Update to Chromium version 124.0.6367.0 (#1274542)

This commit is contained in:
Marshall Greenblatt 2024-03-19 17:11:42 -04:00
parent 526e934a12
commit 52dac91167
147 changed files with 1099 additions and 949 deletions

View File

@ -929,8 +929,8 @@ source_set("libcef_static") {
"libcef/renderer/dom_document_impl.h", "libcef/renderer/dom_document_impl.h",
"libcef/renderer/dom_node_impl.cc", "libcef/renderer/dom_node_impl.cc",
"libcef/renderer/dom_node_impl.h", "libcef/renderer/dom_node_impl.h",
"libcef/renderer/extensions/extensions_dispatcher_delegate.cc", "libcef/renderer/extensions/extensions_renderer_api_provider.cc",
"libcef/renderer/extensions/extensions_dispatcher_delegate.h", "libcef/renderer/extensions/extensions_renderer_api_provider.h",
"libcef/renderer/extensions/extensions_renderer_client.cc", "libcef/renderer/extensions/extensions_renderer_client.cc",
"libcef/renderer/extensions/extensions_renderer_client.h", "libcef/renderer/extensions/extensions_renderer_client.h",
"libcef/renderer/extensions/print_render_frame_helper_delegate.cc", "libcef/renderer/extensions/print_render_frame_helper_delegate.cc",

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': 'refs/tags/123.0.6312.0' 'chromium_checkout': 'refs/tags/124.0.6367.0'
} }

View File

@ -39,6 +39,7 @@
'chrome/renderer/chrome_content_renderer_client.*', 'chrome/renderer/chrome_content_renderer_client.*',
'chrome/renderer/extensions/chrome_extensions_renderer_client.*', 'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
'components/content_settings/core/common/content_settings_types.mojom', 'components/content_settings/core/common/content_settings_types.mojom',
'components/permissions/request_type.h',
'content/browser/renderer_host/render_widget_host_view_base.*', 'content/browser/renderer_host/render_widget_host_view_base.*',
'content/public/browser/content_browser_client.*', 'content/public/browser/content_browser_client.*',
'content/public/browser/render_widget_host_view.h', 'content/public/browser/render_widget_host_view.h',

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal // way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash // hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected. // values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "6c5009ba08bb760e60f7e17845c532b30f19fbae" #define CEF_API_HASH_UNIVERSAL "a419379d63087c1c3fb8a8215c066882fd4fce03"
#if defined(OS_WIN) #if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "09f5a8a3088d2a8384c648be2047e0cb25b1221e" #define CEF_API_HASH_PLATFORM "04f4a1140954f4b11e6fef271d39908ecff07b86"
#elif defined(OS_MAC) #elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "ddee29d0c0de65874ff50f3ff7bc5de51089b9eb" #define CEF_API_HASH_PLATFORM "d0143d677ea9945ed5e0c3624afdb444796661ee"
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "a27764fa2599737204faad84b00c31bb32dba54f" #define CEF_API_HASH_PLATFORM "cac5605286f35bf76576098a0da810a9a34b418a"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -2972,51 +2972,22 @@ typedef enum {
} cef_text_style_t; } cef_text_style_t;
/// ///
/// Specifies where along the main axis the CefBoxLayout child views should be /// Specifies where along the axis the CefBoxLayout child views should be laid
/// laid out. /// out. Should be kept in sync with Chromium's views::LayoutAlignment type.
/// ///
typedef enum { typedef enum {
/// /// Child views will be left/top-aligned.
/// Child views will be left-aligned. CEF_AXIS_ALIGNMENT_START,
///
CEF_MAIN_AXIS_ALIGNMENT_START,
///
/// Child views will be center-aligned. /// Child views will be center-aligned.
/// CEF_AXIS_ALIGNMENT_CENTER,
CEF_MAIN_AXIS_ALIGNMENT_CENTER,
/// /// Child views will be right/bottom-aligned.
/// Child views will be right-aligned. CEF_AXIS_ALIGNMENT_END,
///
CEF_MAIN_AXIS_ALIGNMENT_END,
} cef_main_axis_alignment_t;
///
/// Specifies where along the cross axis the CefBoxLayout child views should be
/// laid out.
///
typedef enum {
///
/// Child views will be stretched to fit. /// Child views will be stretched to fit.
/// CEF_AXIS_ALIGNMENT_STRETCH,
CEF_CROSS_AXIS_ALIGNMENT_STRETCH, } cef_axis_alignment_t;
///
/// Child views will be left-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_START,
///
/// Child views will be center-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_CENTER,
///
/// Child views will be right-aligned.
///
CEF_CROSS_AXIS_ALIGNMENT_END,
} cef_cross_axis_alignment_t;
/// ///
/// Settings used when initializing a CefBoxLayout. /// Settings used when initializing a CefBoxLayout.
@ -3053,12 +3024,12 @@ typedef struct _cef_box_layout_settings_t {
/// ///
/// Specifies where along the main axis the child views should be laid out. /// Specifies where along the main axis the child views should be laid out.
/// ///
cef_main_axis_alignment_t main_axis_alignment; cef_axis_alignment_t main_axis_alignment;
/// ///
/// Specifies where along the cross axis the child views should be laid out. /// Specifies where along the cross axis the child views should be laid out.
/// ///
cef_cross_axis_alignment_t cross_axis_alignment; cef_axis_alignment_t cross_axis_alignment;
/// ///
/// Minimum cross axis size. /// Minimum cross axis size.
@ -3327,64 +3298,65 @@ typedef enum {
/// Front L, Front R, Front C, LFE, Back L, Back R /// Front L, Front R, Front C, LFE, Back L, Back R
CEF_CHANNEL_LAYOUT_5_1_BACK = 12, CEF_CHANNEL_LAYOUT_5_1_BACK = 12,
/// Front L, Front R, Front C, Side L, Side R, Back L, Back R /// Front L, Front R, Front C, Back L, Back R, Side L, Side R
CEF_CHANNEL_LAYOUT_7_0 = 13, CEF_CHANNEL_LAYOUT_7_0 = 13,
/// Front L, Front R, Front C, LFE, Side L, Side R, Back L, Back R /// Front L, Front R, Front C, LFE, Back L, Back R, Side L, Side R
CEF_CHANNEL_LAYOUT_7_1 = 14, CEF_CHANNEL_LAYOUT_7_1 = 14,
/// Front L, Front R, Front C, LFE, Side L, Side R, Front LofC, Front RofC /// Front L, Front R, Front C, LFE, Front LofC, Front RofC, Side L, Side R
CEF_CHANNEL_LAYOUT_7_1_WIDE = 15, CEF_CHANNEL_LAYOUT_7_1_WIDE = 15,
/// Stereo L, Stereo R /// Front L, Front R
CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16, CEF_CHANNEL_LAYOUT_STEREO_DOWNMIX = 16,
/// Stereo L, Stereo R, LFE /// Front L, Front R, LFE
CEF_CHANNEL_LAYOUT_2POINT1 = 17, CEF_CHANNEL_LAYOUT_2POINT1 = 17,
/// Stereo L, Stereo R, Front C, LFE /// Front L, Front R, Front C, LFE
CEF_CHANNEL_LAYOUT_3_1 = 18, CEF_CHANNEL_LAYOUT_3_1 = 18,
/// Stereo L, Stereo R, Front C, Rear C, LFE /// Front L, Front R, Front C, LFE, Back C
CEF_CHANNEL_LAYOUT_4_1 = 19, CEF_CHANNEL_LAYOUT_4_1 = 19,
/// Stereo L, Stereo R, Front C, Side L, Side R, Back C /// Front L, Front R, Front C, Back C, Side L, Side R
CEF_CHANNEL_LAYOUT_6_0 = 20, CEF_CHANNEL_LAYOUT_6_0 = 20,
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC /// Front L, Front R, Front LofC, Front RofC, Side L, Side R
CEF_CHANNEL_LAYOUT_6_0_FRONT = 21, CEF_CHANNEL_LAYOUT_6_0_FRONT = 21,
/// Stereo L, Stereo R, Front C, Rear L, Rear R, Rear C /// Front L, Front R, Front C, Back L, Back R, Back C
CEF_CHANNEL_LAYOUT_HEXAGONAL = 22, CEF_CHANNEL_LAYOUT_HEXAGONAL = 22,
/// Stereo L, Stereo R, Front C, LFE, Side L, Side R, Rear Center /// Front L, Front R, Front C, LFE, Back C, Side L, Side R
CEF_CHANNEL_LAYOUT_6_1 = 23, CEF_CHANNEL_LAYOUT_6_1 = 23,
/// Stereo L, Stereo R, Front C, LFE, Back L, Back R, Rear Center /// Front L, Front R, Front C, LFE, Back L, Back R, Back C
CEF_CHANNEL_LAYOUT_6_1_BACK = 24, CEF_CHANNEL_LAYOUT_6_1_BACK = 24,
/// Stereo L, Stereo R, Side L, Side R, Front LofC, Front RofC, LFE /// Front L, Front R, LFE, Front LofC, Front RofC, Side L, Side R
CEF_CHANNEL_LAYOUT_6_1_FRONT = 25, CEF_CHANNEL_LAYOUT_6_1_FRONT = 25,
/// Front L, Front R, Front C, Side L, Side R, Front LofC, Front RofC /// Front L, Front R, Front C, Front LofC, Front RofC, Side L, Side R
CEF_CHANNEL_LAYOUT_7_0_FRONT = 26, CEF_CHANNEL_LAYOUT_7_0_FRONT = 26,
/// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC /// Front L, Front R, Front C, LFE, Back L, Back R, Front LofC, Front RofC
CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27, CEF_CHANNEL_LAYOUT_7_1_WIDE_BACK = 27,
/// Front L, Front R, Front C, Side L, Side R, Rear L, Back R, Back C. /// Front L, Front R, Front C, Back L, Back R, Back C, Side L, Side R
CEF_CHANNEL_LAYOUT_OCTAGONAL = 28, CEF_CHANNEL_LAYOUT_OCTAGONAL = 28,
/// Channels are not explicitly mapped to speakers. /// Channels are not explicitly mapped to speakers.
CEF_CHANNEL_LAYOUT_DISCRETE = 29, CEF_CHANNEL_LAYOUT_DISCRETE = 29,
/// Deprecated, but keeping the enum value for UMA consistency.
/// Front L, Front R, Front C. Front C contains the keyboard mic audio. This /// Front L, Front R, Front C. Front C contains the keyboard mic audio. This
/// layout is only intended for input for WebRTC. The Front C channel /// layout is only intended for input for WebRTC. The Front C channel
/// is stripped away in the WebRTC audio input pipeline and never seen outside /// is stripped away in the WebRTC audio input pipeline and never seen outside
/// of that. /// of that.
CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30, CEF_CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC = 30,
/// Front L, Front R, Side L, Side R, LFE /// Front L, Front R, LFE, Side L, Side R
CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31, CEF_CHANNEL_LAYOUT_4_1_QUAD_SIDE = 31,
/// Actual channel layout is specified in the bitstream and the actual channel /// Actual channel layout is specified in the bitstream and the actual channel
@ -3398,8 +3370,14 @@ typedef enum {
/// kMaxConcurrentChannels /// kMaxConcurrentChannels
CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33, CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX = 33,
/// Front C, LFE
CEF_CHANNEL_LAYOUT_1_1 = 34,
/// Front L, Front R, LFE, Back C
CEF_CHANNEL_LAYOUT_3_1_BACK = 35,
/// Max value, must always equal the largest entry ever logged. /// Max value, must always equal the largest entry ever logged.
CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_5_1_4_DOWNMIX CEF_CHANNEL_LAYOUT_MAX = CEF_CHANNEL_LAYOUT_3_1_BACK
} cef_channel_layout_t; } cef_channel_layout_t;
/// ///
@ -3671,9 +3649,9 @@ typedef enum {
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7, CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7,
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8, CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8,
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9, CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 10, CEF_PERMISSION_TYPE_IDENTITY_PROVIDER = 1 << 10,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 11, CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 11,
CEF_PERMISSION_TYPE_MIDI = 1 << 12, CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 12,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13, CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14, CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15, CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15,

View File

@ -418,7 +418,16 @@ typedef enum {
/// Whether an application can enumerate audio output device. /// Whether an application can enumerate audio output device.
CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION, CEF_CONTENT_SETTING_TYPE_SPEAKER_SELECTION,
CEF_CONTENT_SETTING_TYPE_NUM_TYPES, /// Content settings for access to the Direct Sockets API.
CEF_CONTENT_SETTING_TYPE_DIRECT_SOCKETS,
/// Keyboard Lock API allows a site to capture keyboard inputs that would
/// otherwise be handled by the OS or the browser.
CEF_CONTENT_SETTING_TYPE_KEYBOARD_LOCK,
/// Pointer Lock API allows a site to hide the cursor and have exclusive
/// access to mouse inputs.
CEF_CONTENT_SETTING_TYPE_POINTER_LOCK,
} cef_content_setting_types_t; } cef_content_setting_types_t;
/// ///

View File

@ -697,7 +697,9 @@ using CefPdfPrintSettings = CefStructBase<CefPdfPrintSettingsTraits>;
/// ///
class CefBoxLayoutSettings : public cef_box_layout_settings_t { class CefBoxLayoutSettings : public cef_box_layout_settings_t {
public: public:
CefBoxLayoutSettings() : cef_box_layout_settings_t{} {} CefBoxLayoutSettings() : cef_box_layout_settings_t{} {
cross_axis_alignment = CEF_AXIS_ALIGNMENT_STRETCH;
}
CefBoxLayoutSettings(const cef_box_layout_settings_t& r) CefBoxLayoutSettings(const cef_box_layout_settings_t& r)
: cef_box_layout_settings_t(r) {} : cef_box_layout_settings_t(r) {}
}; };

View File

@ -145,7 +145,7 @@ ui::LinuxUi* GetLinuxUI() {
#endif // BUILDFLAG(IS_LINUX) #endif // BUILDFLAG(IS_LINUX)
void ProcessSingletonNotificationCallbackImpl( void ProcessSingletonNotificationCallbackImpl(
const base::CommandLine& command_line, base::CommandLine command_line,
const base::FilePath& current_directory) { const base::FilePath& current_directory) {
// Drop the request if the browser process is already shutting down. // Drop the request if the browser process is already shutting down.
if (!CONTEXT_STATE_VALID()) { if (!CONTEXT_STATE_VALID()) {
@ -172,7 +172,7 @@ void ProcessSingletonNotificationCallbackImpl(
// Based on ChromeBrowserMainParts::ProcessSingletonNotificationCallback. // Based on ChromeBrowserMainParts::ProcessSingletonNotificationCallback.
bool ProcessSingletonNotificationCallback( bool ProcessSingletonNotificationCallback(
const base::CommandLine& command_line, base::CommandLine command_line,
const base::FilePath& current_directory) { const base::FilePath& current_directory) {
// Drop the request if the browser process is already shutting down. // Drop the request if the browser process is already shutting down.
// Note that we're going to post an async task below. Even if the browser // Note that we're going to post an async task below. Even if the browser
@ -191,7 +191,7 @@ bool ProcessSingletonNotificationCallback(
// So, we post a task to asynchronously finish the command line processing. // So, we post a task to asynchronously finish the command line processing.
return base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask( return base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
FROM_HERE, base::BindOnce(&ProcessSingletonNotificationCallbackImpl, FROM_HERE, base::BindOnce(&ProcessSingletonNotificationCallbackImpl,
command_line, current_directory)); std::move(command_line), current_directory));
} }
} // namespace } // namespace

View File

@ -980,11 +980,8 @@ AlloyContentBrowserClient::CreateThrottlesForNavigation(
throttles.push_back(std::move(pdf_iframe_throttle)); throttles.push_back(std::move(pdf_iframe_throttle));
} }
auto pdf_throttle = pdf::PdfNavigationThrottle::MaybeCreateThrottleFor( throttles.push_back(std::make_unique<pdf::PdfNavigationThrottle>(
navigation_handle, std::make_unique<ChromePdfStreamDelegate>()); navigation_handle, std::make_unique<ChromePdfStreamDelegate>()));
if (pdf_throttle) {
throttles.push_back(std::move(pdf_throttle));
}
} }
throttle::CreateThrottlesForNavigation(navigation_handle, throttles); throttle::CreateThrottlesForNavigation(navigation_handle, throttles);
@ -999,7 +996,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
const base::RepeatingCallback<content::WebContents*()>& wc_getter, const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data, content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id, int frame_tree_node_id,
absl::optional<int64_t> navigation_id) { std::optional<int64_t> navigation_id) {
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result; std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
// Used to substitute View ID for PDF contents when using the PDF plugin. // Used to substitute View ID for PDF contents when using the PDF plugin.
@ -1100,20 +1097,27 @@ AlloyContentBrowserClient::CreateLoginDelegate(
std::move(auth_required_callback)); std::move(auth_required_callback));
} }
void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( mojo::PendingRemote<network::mojom::URLLoaderFactory>
int frame_tree_node_id, AlloyContentBrowserClient::CreateNonNetworkNavigationURLLoaderFactory(
NonNetworkURLLoaderFactoryMap* factories) { const std::string& scheme,
int frame_tree_node_id) {
if (!extensions::ExtensionsEnabled()) { if (!extensions::ExtensionsEnabled()) {
return; return {};
} }
content::WebContents* web_contents = content::WebContents* web_contents =
content::WebContents::FromFrameTreeNodeId(frame_tree_node_id); content::WebContents::FromFrameTreeNodeId(frame_tree_node_id);
factories->emplace( content::BrowserContext* browser_context = web_contents->GetBrowserContext();
extensions::kExtensionScheme,
extensions::CreateExtensionNavigationURLLoaderFactory( if (scheme == extensions::kExtensionScheme &&
web_contents->GetBrowserContext(), !extensions::ChromeContentBrowserClientExtensionsPart::
!!extensions::WebViewGuest::FromWebContents(web_contents))); AreExtensionsDisabledForProfile(browser_context)) {
return extensions::CreateExtensionNavigationURLLoaderFactory(
browser_context,
!!extensions::WebViewGuest::FromWebContents(web_contents));
}
return {};
} }
void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(

View File

@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
class AlloyBrowserMainParts; class AlloyBrowserMainParts;
@ -137,7 +138,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
const base::RepeatingCallback<content::WebContents*()>& wc_getter, const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data, content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id, int frame_tree_node_id,
absl::optional<int64_t> navigation_id) override; std::optional<int64_t> navigation_id) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
CreateURLLoaderThrottlesForKeepAlive( CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request, const network::ResourceRequest& request,
@ -171,9 +172,9 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
scoped_refptr<net::HttpResponseHeaders> response_headers, scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt, bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback) override; LoginAuthRequiredCallback auth_required_callback) override;
void RegisterNonNetworkNavigationURLLoaderFactories( mojo::PendingRemote<network::mojom::URLLoaderFactory>
int frame_tree_node_id, CreateNonNetworkNavigationURLLoaderFactory(const std::string& scheme,
NonNetworkURLLoaderFactoryMap* factories) override; int frame_tree_node_id) override;
void RegisterNonNetworkSubresourceURLLoaderFactories( void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id, int render_process_id,
int render_frame_id, int render_frame_id,

View File

@ -98,6 +98,7 @@ void CefAudioCapturer::OnCaptureStarted() {
void CefAudioCapturer::Capture(const media::AudioBus* source, void CefAudioCapturer::Capture(const media::AudioBus* source,
base::TimeTicks audio_capture_time, base::TimeTicks audio_capture_time,
const media::AudioGlitchInfo& /*glitch_info*/,
double /*volume*/, double /*volume*/,
bool /*key_pressed*/) { bool /*key_pressed*/) {
const int channels = source->channels(); const int channels = source->channels();

View File

@ -31,6 +31,7 @@ class CefAudioCapturer : public media::AudioCapturerSource::CaptureCallback {
void OnCaptureStarted() override; void OnCaptureStarted() override;
void Capture(const media::AudioBus* audio_source, void Capture(const media::AudioBus* audio_source,
base::TimeTicks audio_capture_time, base::TimeTicks audio_capture_time,
const media::AudioGlitchInfo& glitch_info,
double volume, double volume,
bool key_pressed) override; bool key_pressed) override;
void OnCaptureError(media::AudioCapturerSource::ErrorCode code, void OnCaptureError(media::AudioCapturerSource::ErrorCode code,

View File

@ -48,7 +48,7 @@ class StreamCreatedCallbackAdapter final
client_receiver, client_receiver,
media::mojom::ReadOnlyAudioDataPipePtr data_pipe, media::mojom::ReadOnlyAudioDataPipePtr data_pipe,
bool initially_muted, bool initially_muted,
const absl::optional<base::UnguessableToken>& stream_id) override { const std::optional<base::UnguessableToken>& stream_id) override {
DCHECK(!initially_muted); // Loopback streams shouldn't be started muted. DCHECK(!initially_muted); // Loopback streams shouldn't be started muted.
callback_.Run(std::move(stream), std::move(client_receiver), callback_.Run(std::move(stream), std::move(client_receiver),
std::move(data_pipe)); std::move(data_pipe));

View File

@ -158,7 +158,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes(
bool include_defaults) { bool include_defaults) {
if (schemes_list.empty() && include_defaults) { if (schemes_list.empty() && include_defaults) {
// No explicit registration of schemes. // No explicit registration of schemes.
return absl::nullopt; return std::nullopt;
} }
std::vector<std::string> all_schemes; std::vector<std::string> all_schemes;
@ -177,7 +177,7 @@ CefBrowserContext::CookieableSchemes MakeSupportedSchemes(
all_schemes.push_back("wss"); all_schemes.push_back("wss");
} }
return absl::make_optional(all_schemes); return std::make_optional(all_schemes);
} }
template <typename T> template <typename T>

View File

@ -6,6 +6,7 @@
#define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_ #define CEF_LIBCEF_BROWSER_BROWSER_CONTEXT_IMPL_H_
#pragma once #pragma once
#include <optional>
#include <set> #include <set>
#include <vector> #include <vector>
@ -19,7 +20,6 @@
#include "base/task/sequenced_task_runner_helpers.h" #include "base/task/sequenced_task_runner_helpers.h"
#include "chrome/common/plugin.mojom.h" #include "chrome/common/plugin.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_context.mojom.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/origin.h" #include "url/origin.h"
/* /*
@ -187,7 +187,7 @@ class CefBrowserContext {
CefRefPtr<CefRequestContextImpl> GetAnyRequestContext( CefRefPtr<CefRequestContextImpl> GetAnyRequestContext(
bool prefer_no_handler) const; bool prefer_no_handler) const;
using CookieableSchemes = absl::optional<std::vector<std::string>>; using CookieableSchemes = std::optional<std::vector<std::string>>;
// Returns the schemes associated with this context specifically, or the // Returns the schemes associated with this context specifically, or the
// global configuration if unset. // global configuration if unset.

View File

@ -63,7 +63,7 @@ void CefBrowserFrame::FrameAttached(
} }
void CefBrowserFrame::UpdateDraggableRegions( void CefBrowserFrame::UpdateDraggableRegions(
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) { std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) {
if (auto host = GetFrameHost()) { if (auto host = GetFrameHost()) {
host->UpdateDraggableRegions(std::move(regions)); host->UpdateDraggableRegions(std::move(regions));
} }

View File

@ -42,7 +42,7 @@ class CefBrowserFrame
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame, void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override; bool reattached) override;
void UpdateDraggableRegions( void UpdateDraggableRegions(
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
override; override;
// FrameServiceBase methods: // FrameServiceBase methods:

View File

@ -55,8 +55,7 @@ ChromeBrowserContext* ChromeBrowserContext::GetOrCreateForProfile(
auto* new_context = new ChromeBrowserContext(settings); auto* new_context = new ChromeBrowserContext(settings);
new_context->Initialize(); new_context->Initialize();
new_context->ProfileCreated(Profile::CreateStatus::CREATE_STATUS_INITIALIZED, new_context->ProfileCreated(CreateStatus::kInitialized, profile);
profile);
return new_context; return new_context;
} }
@ -98,7 +97,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) {
if (cache_path_ == user_data_dir) { if (cache_path_ == user_data_dir) {
// Use the default disk-based profile. // Use the default disk-based profile.
auto profile = GetPrimaryUserProfile(); auto profile = GetPrimaryUserProfile();
ProfileCreated(Profile::CreateStatus::CREATE_STATUS_INITIALIZED, profile); ProfileCreated(CreateStatus::kInitialized, profile);
return; return;
} else if (cache_path_.DirName() == user_data_dir) { } else if (cache_path_.DirName() == user_data_dir) {
// Create or load a specific disk-based profile. May continue // Create or load a specific disk-based profile. May continue
@ -107,10 +106,10 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) {
cache_path_, cache_path_,
base::BindOnce(&ChromeBrowserContext::ProfileCreated, base::BindOnce(&ChromeBrowserContext::ProfileCreated,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
Profile::CreateStatus::CREATE_STATUS_INITIALIZED), CreateStatus::kInitialized),
base::BindOnce(&ChromeBrowserContext::ProfileCreated, base::BindOnce(&ChromeBrowserContext::ProfileCreated,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
Profile::CreateStatus::CREATE_STATUS_CREATED)); CreateStatus::kCreated));
return; return;
} else { } else {
// All profile directories must be relative to |user_data_dir|. // All profile directories must be relative to |user_data_dir|.
@ -120,7 +119,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) {
} }
// Default to creating a new/unique OffTheRecord profile. // Default to creating a new/unique OffTheRecord profile.
ProfileCreated(Profile::CreateStatus::CREATE_STATUS_LOCAL_FAIL, nullptr); ProfileCreated(CreateStatus::kDefault, nullptr);
} }
void ChromeBrowserContext::Shutdown() { void ChromeBrowserContext::Shutdown() {
@ -140,13 +139,13 @@ void ChromeBrowserContext::Shutdown() {
} }
} }
void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status, void ChromeBrowserContext::ProfileCreated(CreateStatus status,
Profile* profile) { Profile* profile) {
Profile* parent_profile = nullptr; Profile* parent_profile = nullptr;
OffTheRecordProfileImpl* otr_profile = nullptr; OffTheRecordProfileImpl* otr_profile = nullptr;
if (status != Profile::CreateStatus::CREATE_STATUS_CREATED && if (status != CreateStatus::kCreated &&
status != Profile::CreateStatus::CREATE_STATUS_INITIALIZED) { status != CreateStatus::kInitialized) {
CHECK(!profile); CHECK(!profile);
CHECK(!profile_); CHECK(!profile_);
@ -160,7 +159,7 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status,
profile_ = parent_profile->GetOffTheRecordProfile( profile_ = parent_profile->GetOffTheRecordProfile(
profile_id, /*create_if_needed=*/true); profile_id, /*create_if_needed=*/true);
otr_profile = static_cast<OffTheRecordProfileImpl*>(profile_); otr_profile = static_cast<OffTheRecordProfileImpl*>(profile_);
status = Profile::CreateStatus::CREATE_STATUS_INITIALIZED; status = CreateStatus::kInitialized;
should_destroy_ = true; should_destroy_ = true;
} else if (profile && !profile_) { } else if (profile && !profile_) {
// May be CREATE_STATUS_CREATED or CREATE_STATUS_INITIALIZED since // May be CREATE_STATUS_CREATED or CREATE_STATUS_INITIALIZED since
@ -174,7 +173,7 @@ void ChromeBrowserContext::ProfileCreated(Profile::CreateStatus status,
} }
} }
if (status == Profile::CreateStatus::CREATE_STATUS_INITIALIZED) { if (status == CreateStatus::kInitialized) {
CHECK(profile_); CHECK(profile_);
// Must set |profile_| before Init() calls // Must set |profile_| before Init() calls

View File

@ -41,7 +41,16 @@ class ChromeBrowserContext : public CefBrowserContext, public ProfileObserver {
private: private:
~ChromeBrowserContext() override; ~ChromeBrowserContext() override;
void ProfileCreated(Profile::CreateStatus status, Profile* profile); enum class CreateStatus {
// Default to creating a new/unique OffTheRecord profile.
kDefault,
// Profile created but before initializing extensions and promo resources.
kCreated,
// Profile is created, extensions and promo resources are initialized.
kInitialized,
};
void ProfileCreated(CreateStatus status, Profile* profile);
base::OnceClosure initialized_cb_; base::OnceClosure initialized_cb_;
Profile* profile_ = nullptr; Profile* profile_ = nullptr;

View File

@ -7,13 +7,12 @@
#pragma once #pragma once
#include <memory> #include <memory>
#include <optional>
#include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_host_base.h"
#include "libcef/browser/browser_info.h" #include "libcef/browser/browser_info.h"
#include "libcef/browser/chrome/browser_delegate.h" #include "libcef/browser/chrome/browser_delegate.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
class CefBrowserContentsDelegate; class CefBrowserContentsDelegate;
class CefRequestContextImpl; class CefRequestContextImpl;
class CefWindowImpl; class CefWindowImpl;

View File

@ -117,7 +117,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver,
} }
void SetAccelerator(int command_id, void SetAccelerator(int command_id,
absl::optional<ui::Accelerator> accel) override { std::optional<ui::Accelerator> accel) override {
// No-op if already at the default state. // No-op if already at the default state.
if (!accel && !GetItemInfo(command_id)) { if (!accel && !GetItemInfo(command_id)) {
return; return;
@ -135,7 +135,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver,
ItemInfo() = default; ItemInfo() = default;
bool checked = false; bool checked = false;
absl::optional<ui::Accelerator> accel; std::optional<ui::Accelerator> accel;
}; };
ItemInfo* GetItemInfo(int command_id) { ItemInfo* GetItemInfo(int command_id) {

View File

@ -71,7 +71,7 @@ void ChromeBrowserView::OnGestureEvent(ui::GestureEvent* event) {
ToolbarView* ChromeBrowserView::OverrideCreateToolbar() { ToolbarView* ChromeBrowserView::OverrideCreateToolbar() {
if (cef_delegate()) { if (cef_delegate()) {
auto toolbar_type = cef_delegate()->GetChromeToolbarType(cef_browser_view_); auto toolbar_type = cef_delegate()->GetChromeToolbarType(cef_browser_view_);
absl::optional<ToolbarView::DisplayMode> display_mode; std::optional<ToolbarView::DisplayMode> display_mode;
switch (toolbar_type) { switch (toolbar_type) {
case CEF_CTT_NORMAL: case CEF_CTT_NORMAL:
display_mode = ToolbarView::DisplayMode::NORMAL; display_mode = ToolbarView::DisplayMode::NORMAL;

View File

@ -9,7 +9,7 @@ CefRefPtr<CefToolbarViewImpl> CefToolbarViewImpl::Create(
CefRefPtr<CefViewDelegate> delegate, CefRefPtr<CefViewDelegate> delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<ToolbarView::DisplayMode> display_mode) { std::optional<ToolbarView::DisplayMode> display_mode) {
CEF_REQUIRE_UIT_RETURN(nullptr); CEF_REQUIRE_UIT_RETURN(nullptr);
CefRefPtr<CefToolbarViewImpl> view = CefRefPtr<CefToolbarViewImpl> view =
new CefToolbarViewImpl(delegate, browser, browser_view, display_mode); new CefToolbarViewImpl(delegate, browser, browser_view, display_mode);
@ -24,7 +24,7 @@ CefToolbarViewImpl::CefToolbarViewImpl(
CefRefPtr<CefViewDelegate> delegate, CefRefPtr<CefViewDelegate> delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<ToolbarView::DisplayMode> display_mode) std::optional<ToolbarView::DisplayMode> display_mode)
: ParentClass(delegate), : ParentClass(delegate),
browser_(browser), browser_(browser),
browser_view_(browser_view), browser_view_(browser_view),

View File

@ -27,7 +27,7 @@ class CefToolbarViewImpl
CefRefPtr<CefViewDelegate> delegate, CefRefPtr<CefViewDelegate> delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<ToolbarView::DisplayMode> display_mode); std::optional<ToolbarView::DisplayMode> display_mode);
static const char* const kTypeString; static const char* const kTypeString;
@ -41,7 +41,7 @@ class CefToolbarViewImpl
CefToolbarViewImpl(CefRefPtr<CefViewDelegate> delegate, CefToolbarViewImpl(CefRefPtr<CefViewDelegate> delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<ToolbarView::DisplayMode> display_mode); std::optional<ToolbarView::DisplayMode> display_mode);
// CefViewImpl methods: // CefViewImpl methods:
CefToolbarViewView* CreateRootView() override; CefToolbarViewView* CreateRootView() override;
@ -49,7 +49,7 @@ class CefToolbarViewImpl
Browser* const browser_; Browser* const browser_;
BrowserView* const browser_view_; BrowserView* const browser_view_;
absl::optional<ToolbarView::DisplayMode> const display_mode_; std::optional<ToolbarView::DisplayMode> const display_mode_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl);
}; };

View File

@ -7,5 +7,5 @@
CefToolbarViewView::CefToolbarViewView(CefViewDelegate* cef_delegate, CefToolbarViewView::CefToolbarViewView(CefViewDelegate* cef_delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<DisplayMode> display_mode) std::optional<DisplayMode> display_mode)
: ParentClass(cef_delegate, browser, browser_view, display_mode) {} : ParentClass(cef_delegate, browser, browser_view, display_mode) {}

View File

@ -18,7 +18,7 @@ class CefToolbarViewView : public CefViewView<ToolbarView, CefViewDelegate> {
explicit CefToolbarViewView(CefViewDelegate* cef_delegate, explicit CefToolbarViewView(CefViewDelegate* cef_delegate,
Browser* browser, Browser* browser,
BrowserView* browser_view, BrowserView* browser_view,
absl::optional<DisplayMode> display_mode); std::optional<DisplayMode> display_mode);
CefToolbarViewView(const CefToolbarViewView&) = delete; CefToolbarViewView(const CefToolbarViewView&) = delete;
CefToolbarViewView& operator=(const CefToolbarViewView&) = delete; CefToolbarViewView& operator=(const CefToolbarViewView&) = delete;

View File

@ -82,7 +82,7 @@ void CefDevToolsFileManager::Save(const std::string& url,
base::FilePath initial_path; base::FilePath initial_path;
if (const base::Value* path_value = file_map.Find(base::MD5String(url))) { if (const base::Value* path_value = file_map.Find(base::MD5String(url))) {
absl::optional<base::FilePath> path = base::ValueToFilePath(*path_value); std::optional<base::FilePath> path = base::ValueToFilePath(*path_value);
if (path) { if (path) {
initial_path = std::move(*path); initial_path = std::move(*path);
} }

View File

@ -414,7 +414,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
// TODO(pfeldman): handle some of the embedder messages in content. // TODO(pfeldman): handle some of the embedder messages in content.
const std::string* url = params[0].GetIfString(); const std::string* url = params[0].GetIfString();
const std::string* headers = params[1].GetIfString(); const std::string* headers = params[1].GetIfString();
absl::optional<const int> stream_id = params[2].GetIfInt(); std::optional<const int> stream_id = params[2].GetIfInt();
if (!url || !headers || !stream_id.has_value()) { if (!url || !headers || !stream_id.has_value()) {
return; return;
} }
@ -540,7 +540,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
} }
const std::string* url = params[0].GetIfString(); const std::string* url = params[0].GetIfString();
const std::string* content = params[1].GetIfString(); const std::string* content = params[1].GetIfString();
absl::optional<bool> save_as = params[2].GetIfBool(); std::optional<bool> save_as = params[2].GetIfBool();
if (!url || !content || !save_as.has_value()) { if (!url || !content || !save_as.has_value()) {
return; return;
} }

View File

@ -68,7 +68,7 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() {
TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {} TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {}
ExtensionFunction::ResponseAction TabsCreateFunction::Run() { ExtensionFunction::ResponseAction TabsCreateFunction::Run() {
absl::optional<tabs::Create::Params> params = std::optional<tabs::Create::Params> params =
tabs::Create::Params::Create(args()); tabs::Create::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
@ -108,7 +108,7 @@ content::WebContents* BaseAPIFunction::GetWebContents(int tab_id) {
} }
ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
absl::optional<tabs::Update::Params> params = std::optional<tabs::Update::Params> params =
tabs::Update::Params::Create(args()); tabs::Update::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
@ -391,7 +391,7 @@ void ExecuteCodeInTabFunction::LoadFileComplete(
const std::string& file, const std::string& file,
std::unique_ptr<std::string> data) { std::unique_ptr<std::string> data) {
std::vector<std::unique_ptr<std::string>> data_list; std::vector<std::unique_ptr<std::string>> data_list;
absl::optional<std::string> error; std::optional<std::string> error;
const bool success = !!data.get(); const bool success = !!data.get();
if (success) { if (success) {
DCHECK(data); DCHECK(data);
@ -411,7 +411,7 @@ bool TabsRemoveCSSFunction::ShouldRemoveCSS() const {
} }
ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
absl::optional<tabs::SetZoom::Params> params = std::optional<tabs::SetZoom::Params> params =
tabs::SetZoom::Params::Create(args()); tabs::SetZoom::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
@ -443,7 +443,7 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
} }
ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
absl::optional<tabs::GetZoom::Params> params = std::optional<tabs::GetZoom::Params> params =
tabs::GetZoom::Params::Create(args()); tabs::GetZoom::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
@ -463,7 +463,7 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
using tabs::ZoomSettings; using tabs::ZoomSettings;
absl::optional<tabs::SetZoomSettings::Params> params = std::optional<tabs::SetZoomSettings::Params> params =
tabs::SetZoomSettings::Params::Create(args()); tabs::SetZoomSettings::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);
@ -514,7 +514,7 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
} }
ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() { ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() {
absl::optional<tabs::GetZoomSettings::Params> params = std::optional<tabs::GetZoomSettings::Params> params =
tabs::GetZoomSettings::Params::Create(args()); tabs::GetZoomSettings::Params::Create(args());
EXTENSION_FUNCTION_VALIDATE(params); EXTENSION_FUNCTION_VALIDATE(params);

View File

@ -99,13 +99,13 @@ class CefExtensionFunctionDetails {
~OpenTabParams(); ~OpenTabParams();
bool create_browser_if_needed = false; bool create_browser_if_needed = false;
absl::optional<int> window_id; std::optional<int> window_id;
absl::optional<int> opener_tab_id; std::optional<int> opener_tab_id;
absl::optional<std::string> url; std::optional<std::string> url;
absl::optional<bool> active; std::optional<bool> active;
absl::optional<bool> pinned; std::optional<bool> pinned;
absl::optional<int> index; std::optional<int> index;
absl::optional<int> bookmark_id; std::optional<int> bookmark_id;
}; };
// Opens a new tab given creation parameters |params|. Returns a Tab object // Opens a new tab given creation parameters |params|. Returns a Tab object

View File

@ -58,7 +58,7 @@ namespace extensions {
namespace { namespace {
// Implementation based on ComponentLoader::ParseManifest. // Implementation based on ComponentLoader::ParseManifest.
absl::optional<base::Value::Dict> ParseManifest( std::optional<base::Value::Dict> ParseManifest(
base::StringPiece manifest_contents) { base::StringPiece manifest_contents) {
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest = std::unique_ptr<base::Value> manifest =
@ -66,7 +66,7 @@ absl::optional<base::Value::Dict> ParseManifest(
if (!manifest.get() || !manifest->is_dict()) { if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest."; LOG(ERROR) << "Failed to parse extension manifest.";
return absl::nullopt; return std::nullopt;
} }
return std::move(*manifest).TakeDict(); return std::move(*manifest).TakeDict();

View File

@ -100,8 +100,8 @@ ValueStore::WriteResult CefValueStore::Set(WriteOptions options,
if (!old_value || *old_value != value) { if (!old_value || *old_value != value) {
changes.emplace_back(key, changes.emplace_back(key,
old_value old_value
? absl::optional<base::Value>(old_value->Clone()) ? std::optional<base::Value>(old_value->Clone())
: absl::nullopt, : std::nullopt,
value.Clone()); value.Clone());
storage_.Set(key, value.Clone()); storage_.Set(key, value.Clone());
} }
@ -122,9 +122,9 @@ ValueStore::WriteResult CefValueStore::Remove(
ValueStoreChangeList changes; ValueStoreChangeList changes;
for (auto const& key : keys) { for (auto const& key : keys) {
absl::optional<base::Value> old_value = storage_.Extract(key); std::optional<base::Value> old_value = storage_.Extract(key);
if (old_value.has_value()) { if (old_value.has_value()) {
changes.emplace_back(key, std::move(*old_value), absl::nullopt); changes.emplace_back(key, std::move(*old_value), std::nullopt);
} }
} }
return WriteResult(std::move(changes), CreateStatusCopy(status_)); return WriteResult(std::move(changes), CreateStatusCopy(status_));

View File

@ -118,7 +118,7 @@ FileChooserParams SelectFileToFileChooserParams(
const ui::SelectFileDialog::FileTypeInfo* file_types) { const ui::SelectFileDialog::FileTypeInfo* file_types) {
FileChooserParams params; FileChooserParams params;
absl::optional<FileChooserParams::Mode> mode; std::optional<FileChooserParams::Mode> mode;
switch (type) { switch (type) {
case ui::SelectFileDialog::Type::SELECT_UPLOAD_FOLDER: case ui::SelectFileDialog::Type::SELECT_UPLOAD_FOLDER:
mode = FileChooserParams::Mode::kUploadFolder; mode = FileChooserParams::Mode::kUploadFolder;

View File

@ -692,7 +692,7 @@ void CefFrameHostImpl::FrameAttached(
} }
void CefFrameHostImpl::UpdateDraggableRegions( void CefFrameHostImpl::UpdateDraggableRegions(
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) { std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) {
auto browser = GetBrowserHostBase(); auto browser = GetBrowserHostBase();
if (!browser) { if (!browser) {
return; return;

View File

@ -154,7 +154,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame, void FrameAttached(mojo::PendingRemote<cef::mojom::RenderFrame> render_frame,
bool reattached) override; bool reattached) override;
void UpdateDraggableRegions( void UpdateDraggableRegions(
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions) std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
override; override;
bool is_temporary() const { return !frame_token_.has_value(); } bool is_temporary() const { return !frame_token_.has_value(); }

View File

@ -45,9 +45,9 @@ CefMediaCaptureDevicesDispatcher::~CefMediaCaptureDevicesDispatcher() = default;
void CefMediaCaptureDevicesDispatcher::RegisterPrefs( void CefMediaCaptureDevicesDispatcher::RegisterPrefs(
PrefRegistrySimple* registry) { PrefRegistrySimple* registry) {
registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice, registry->RegisterStringPref(prefs::kDefaultAudioCaptureDeviceDeprecated,
std::string()); std::string());
registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice, registry->RegisterStringPref(prefs::kDefaultVideoCaptureDeviceDeprecated,
std::string()); std::string());
} }
@ -61,12 +61,14 @@ void CefMediaCaptureDevicesDispatcher::GetDefaultDevices(
std::string default_device; std::string default_device;
if (audio) { if (audio) {
default_device = prefs->GetString(prefs::kDefaultAudioCaptureDevice); default_device =
prefs->GetString(prefs::kDefaultAudioCaptureDeviceDeprecated);
GetRequestedDevice(default_device, true, false, devices); GetRequestedDevice(default_device, true, false, devices);
} }
if (video) { if (video) {
default_device = prefs->GetString(prefs::kDefaultVideoCaptureDevice); default_device =
prefs->GetString(prefs::kDefaultVideoCaptureDeviceDeprecated);
GetRequestedDevice(default_device, false, true, devices); GetRequestedDevice(default_device, false, true, devices);
} }
} }

View File

@ -88,9 +88,9 @@ class RequestManager {
map_.erase(it); map_.erase(it);
} }
absl::optional<CefBrowserURLRequest::RequestInfo> Get(int32_t request_id) { std::optional<CefBrowserURLRequest::RequestInfo> Get(int32_t request_id) {
if (request_id > kInitialRequestID) { if (request_id > kInitialRequestID) {
return absl::nullopt; return std::nullopt;
} }
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
@ -98,7 +98,7 @@ class RequestManager {
if (it != map_.end()) { if (it != map_.end()) {
return it->second; return it->second;
} }
return absl::nullopt; return std::nullopt;
} }
private: private:
@ -608,16 +608,16 @@ class CefBrowserURLRequest::Context
// CefBrowserURLRequest ------------------------------------------------------- // CefBrowserURLRequest -------------------------------------------------------
// static // static
absl::optional<CefBrowserURLRequest::RequestInfo> std::optional<CefBrowserURLRequest::RequestInfo>
CefBrowserURLRequest::FromRequestID(int32_t request_id) { CefBrowserURLRequest::FromRequestID(int32_t request_id) {
if (IsValidRequestID(request_id)) { if (IsValidRequestID(request_id)) {
return g_manager.Get().Get(request_id); return g_manager.Get().Get(request_id);
} }
return absl::nullopt; return std::nullopt;
} }
// static // static
absl::optional<CefBrowserURLRequest::RequestInfo> std::optional<CefBrowserURLRequest::RequestInfo>
CefBrowserURLRequest::FromRequestID( CefBrowserURLRequest::FromRequestID(
const content::GlobalRequestID& request_id) { const content::GlobalRequestID& request_id) {
return FromRequestID(request_id.request_id); return FromRequestID(request_id.request_id);

View File

@ -6,11 +6,10 @@
#define CEF_LIBCEF_BROWSER_NET_SERVICE_BROWSER_URLREQUEST_IMPL_H_ #define CEF_LIBCEF_BROWSER_NET_SERVICE_BROWSER_URLREQUEST_IMPL_H_
#include <memory> #include <memory>
#include <optional>
#include "include/cef_urlrequest.h" #include "include/cef_urlrequest.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace content { namespace content {
struct GlobalRequestID; struct GlobalRequestID;
} }
@ -27,8 +26,8 @@ class CefBrowserURLRequest : public CefURLRequest {
CefRefPtr<CefURLRequestClient>>; CefRefPtr<CefURLRequestClient>>;
// Retrieve the request objects, if any, associated with |request_id|. // Retrieve the request objects, if any, associated with |request_id|.
static absl::optional<RequestInfo> FromRequestID(int32_t request_id); static std::optional<RequestInfo> FromRequestID(int32_t request_id);
static absl::optional<RequestInfo> FromRequestID( static std::optional<RequestInfo> FromRequestID(
const content::GlobalRequestID& request_id); const content::GlobalRequestID& request_id);
// If |frame| is nullptr requests can still be intercepted but no // If |frame| is nullptr requests can still be intercepted but no

View File

@ -212,7 +212,7 @@ void SaveCookiesOnUIThread(
bool IsCookieableScheme( bool IsCookieableScheme(
const GURL& url, const GURL& url,
const absl::optional<std::vector<std::string>>& cookieable_schemes) { const std::optional<std::vector<std::string>>& cookieable_schemes) {
if (!url.has_scheme()) { if (!url.has_scheme()) {
return false; return false;
} }
@ -298,8 +298,8 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter,
net::CookieInclusionStatus returned_status; net::CookieInclusionStatus returned_status;
std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create( std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create(
request.url, cookie_string, base::Time::Now(), request.url, cookie_string, base::Time::Now(),
absl::make_optional(response_date), std::make_optional(response_date),
/*cookie_partition_key=*/absl::nullopt, /*cookie_partition_key=*/std::nullopt,
/*block_truncated=*/true, &returned_status); /*block_truncated=*/true, &returned_status);
if (!returned_status.IsInclude()) { if (!returned_status.IsInclude()) {
continue; continue;

View File

@ -25,7 +25,7 @@ namespace net_service::cookie_helper {
// cookieable, which may intentionally exclude standard schemes. // cookieable, which may intentionally exclude standard schemes.
bool IsCookieableScheme( bool IsCookieableScheme(
const GURL& url, const GURL& url,
const absl::optional<std::vector<std::string>>& cookieable_schemes); const std::optional<std::vector<std::string>>& cookieable_schemes);
using AllowCookieCallback = using AllowCookieCallback =
base::RepeatingCallback<void(const net::CanonicalCookie&, base::RepeatingCallback<void(const net::CanonicalCookie&,

View File

@ -303,7 +303,7 @@ bool CefCookieManagerImpl::SetCookieInternal(
/*creation_time=*/base::Time(), expiration_time, /*creation_time=*/base::Time(), expiration_time,
/*last_access_time=*/base::Time(), cookie.secure ? true : false, /*last_access_time=*/base::Time(), cookie.secure ? true : false,
cookie.httponly ? true : false, same_site, priority, cookie.httponly ? true : false, same_site, priority,
/*partition_key=*/absl::nullopt); /*partition_key=*/std::nullopt);
if (!canonical_cookie) { if (!canonical_cookie) {
SetCookieCallbackImpl( SetCookieCallbackImpl(

View File

@ -70,7 +70,7 @@ class AuthCallbackImpl : public CefAuthCallback {
void RunCallbackOnIOThread( void RunCallbackOnIOThread(
CefRefPtr<CefBrowserHostBase> browser, CefRefPtr<CefBrowserHostBase> browser,
absl::optional<CefBrowserURLRequest::RequestInfo> url_request_info, std::optional<CefBrowserURLRequest::RequestInfo> url_request_info,
const net::AuthChallengeInfo& auth_info, const net::AuthChallengeInfo& auth_info,
const GURL& origin_url, const GURL& origin_url,
CefRefPtr<AuthCallbackImpl> callback_impl) { CefRefPtr<AuthCallbackImpl> callback_impl) {
@ -144,7 +144,7 @@ void LoginDelegate::Continue(const CefString& username,
void LoginDelegate::Cancel() { void LoginDelegate::Cancel() {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
if (!callback_.is_null()) { if (!callback_.is_null()) {
std::move(callback_).Run(absl::nullopt); std::move(callback_).Run(std::nullopt);
} }
} }

View File

@ -40,12 +40,12 @@ namespace {
// User data key for ResourceContextData. // User data key for ResourceContextData.
const void* const kResourceContextUserDataKey = &kResourceContextUserDataKey; const void* const kResourceContextUserDataKey = &kResourceContextUserDataKey;
absl::optional<std::string> GetHeaderString( std::optional<std::string> GetHeaderString(
const net::HttpResponseHeaders* headers, const net::HttpResponseHeaders* headers,
const std::string& header_name) { const std::string& header_name) {
std::string header_value; std::string header_value;
if (!headers || !headers->GetNormalizedHeader(header_name, &header_value)) { if (!headers || !headers->GetNormalizedHeader(header_name, &header_value)) {
return absl::nullopt; return std::nullopt;
} }
return header_value; return header_value;
} }
@ -247,7 +247,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
void OnReceiveResponse( void OnReceiveResponse(
network::mojom::URLResponseHeadPtr head, network::mojom::URLResponseHeadPtr head,
mojo::ScopedDataPipeConsumerHandle body, mojo::ScopedDataPipeConsumerHandle body,
absl::optional<mojo_base::BigBuffer> cached_metadata) override; std::optional<mojo_base::BigBuffer> cached_metadata) override;
void OnReceiveRedirect(const net::RedirectInfo& redirect_info, void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr head) override; network::mojom::URLResponseHeadPtr head) override;
void OnUploadProgress(int64_t current_position, void OnUploadProgress(int64_t current_position,
@ -261,7 +261,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
const std::vector<std::string>& removed_headers, const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) override; const std::optional<GURL>& new_url) override;
void SetPriority(net::RequestPriority priority, void SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) override; int32_t intra_priority_value) override;
void PauseReadingBodyFromNet() override; void PauseReadingBodyFromNet() override;
@ -282,7 +282,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
// Helpers for optionally overriding headers. // Helpers for optionally overriding headers.
void HandleResponseOrRedirectHeaders( void HandleResponseOrRedirectHeaders(
absl::optional<net::RedirectInfo> redirect_info, std::optional<net::RedirectInfo> redirect_info,
net::CompletionOnceCallback continuation); net::CompletionOnceCallback continuation);
void ContinueResponseOrRedirect( void ContinueResponseOrRedirect(
net::CompletionOnceCallback continuation, net::CompletionOnceCallback continuation,
@ -352,7 +352,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
network::ResourceRequest request_; network::ResourceRequest request_;
network::mojom::URLResponseHeadPtr current_response_; network::mojom::URLResponseHeadPtr current_response_;
mojo::ScopedDataPipeConsumerHandle current_body_; mojo::ScopedDataPipeConsumerHandle current_body_;
absl::optional<mojo_base::BigBuffer> current_cached_metadata_; std::optional<mojo_base::BigBuffer> current_cached_metadata_;
scoped_refptr<net::HttpResponseHeaders> current_headers_; scoped_refptr<net::HttpResponseHeaders> current_headers_;
scoped_refptr<net::HttpResponseHeaders> override_headers_; scoped_refptr<net::HttpResponseHeaders> override_headers_;
GURL original_url_; GURL original_url_;
@ -450,7 +450,7 @@ InterceptedRequest::~InterceptedRequest() {
} }
if (on_headers_received_callback_) { if (on_headers_received_callback_) {
std::move(on_headers_received_callback_) std::move(on_headers_received_callback_)
.Run(net::ERR_ABORTED, absl::nullopt, GURL()); .Run(net::ERR_ABORTED, std::nullopt, GURL());
} }
} }
@ -579,12 +579,12 @@ void InterceptedRequest::OnBeforeSendHeaders(
const net::HttpRequestHeaders& headers, const net::HttpRequestHeaders& headers,
OnBeforeSendHeadersCallback callback) { OnBeforeSendHeadersCallback callback) {
if (!current_request_uses_header_client_) { if (!current_request_uses_header_client_) {
std::move(callback).Run(net::OK, absl::nullopt); std::move(callback).Run(net::OK, std::nullopt);
return; return;
} }
request_.headers = headers; request_.headers = headers;
std::move(callback).Run(net::OK, absl::nullopt); std::move(callback).Run(net::OK, std::nullopt);
// Resume handling of client messages after continuing from an async callback. // Resume handling of client messages after continuing from an async callback.
if (proxied_client_receiver_.is_bound()) { if (proxied_client_receiver_.is_bound()) {
@ -597,14 +597,14 @@ void InterceptedRequest::OnHeadersReceived(
const net::IPEndPoint& remote_endpoint, const net::IPEndPoint& remote_endpoint,
OnHeadersReceivedCallback callback) { OnHeadersReceivedCallback callback) {
if (!current_request_uses_header_client_) { if (!current_request_uses_header_client_) {
std::move(callback).Run(net::OK, absl::nullopt, GURL()); std::move(callback).Run(net::OK, std::nullopt, GURL());
return; return;
} }
current_headers_ = base::MakeRefCounted<net::HttpResponseHeaders>(headers); current_headers_ = base::MakeRefCounted<net::HttpResponseHeaders>(headers);
on_headers_received_callback_ = std::move(callback); on_headers_received_callback_ = std::move(callback);
absl::optional<net::RedirectInfo> redirect_info; std::optional<net::RedirectInfo> redirect_info;
std::string location; std::string location;
if (current_headers_->IsRedirect(&location)) { if (current_headers_->IsRedirect(&location)) {
const GURL new_url = request_.url.Resolve(location); const GURL new_url = request_.url.Resolve(location);
@ -628,7 +628,7 @@ void InterceptedRequest::OnReceiveEarlyHints(
void InterceptedRequest::OnReceiveResponse( void InterceptedRequest::OnReceiveResponse(
network::mojom::URLResponseHeadPtr head, network::mojom::URLResponseHeadPtr head,
mojo::ScopedDataPipeConsumerHandle body, mojo::ScopedDataPipeConsumerHandle body,
absl::optional<mojo_base::BigBuffer> cached_metadata) { std::optional<mojo_base::BigBuffer> cached_metadata) {
current_response_ = std::move(head); current_response_ = std::move(head);
current_body_ = std::move(body); current_body_ = std::move(body);
current_cached_metadata_ = std::move(cached_metadata); current_cached_metadata_ = std::move(cached_metadata);
@ -643,7 +643,7 @@ void InterceptedRequest::OnReceiveResponse(
ContinueToResponseStarted(net::OK); ContinueToResponseStarted(net::OK);
} else { } else {
HandleResponseOrRedirectHeaders( HandleResponseOrRedirectHeaders(
absl::nullopt, std::nullopt,
base::BindOnce(&InterceptedRequest::ContinueToResponseStarted, base::BindOnce(&InterceptedRequest::ContinueToResponseStarted,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} }
@ -743,7 +743,7 @@ void InterceptedRequest::FollowRedirect(
const std::vector<std::string>& removed_headers_ext, const std::vector<std::string>& removed_headers_ext,
const net::HttpRequestHeaders& modified_headers_ext, const net::HttpRequestHeaders& modified_headers_ext,
const net::HttpRequestHeaders& modified_cors_exempt_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) { const std::optional<GURL>& new_url) {
std::vector<std::string> removed_headers = removed_headers_ext; std::vector<std::string> removed_headers = removed_headers_ext;
net::HttpRequestHeaders modified_headers = modified_headers_ext; net::HttpRequestHeaders modified_headers = modified_headers_ext;
OnProcessRequestHeaders(new_url.value_or(GURL()), &modified_headers, OnProcessRequestHeaders(new_url.value_or(GURL()), &modified_headers,
@ -894,7 +894,7 @@ void InterceptedRequest::ContinueAfterInterceptWithOverride(
} }
void InterceptedRequest::HandleResponseOrRedirectHeaders( void InterceptedRequest::HandleResponseOrRedirectHeaders(
absl::optional<net::RedirectInfo> redirect_info, std::optional<net::RedirectInfo> redirect_info,
net::CompletionOnceCallback continuation) { net::CompletionOnceCallback continuation) {
override_headers_ = nullptr; override_headers_ = nullptr;
redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL(); redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL();
@ -957,7 +957,7 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) {
} }
DCHECK(on_headers_received_callback_); DCHECK(on_headers_received_callback_);
absl::optional<std::string> headers; std::optional<std::string> headers;
if (override_headers_) { if (override_headers_) {
headers = override_headers_->raw_headers(); headers = override_headers_->raw_headers();
} }
@ -1056,8 +1056,8 @@ void InterceptedRequest::ContinueToBeforeRedirect(
bool should_clear_upload; bool should_clear_upload;
net::RedirectUtil::UpdateHttpRequest(original_url, original_method, net::RedirectUtil::UpdateHttpRequest(original_url, original_method,
new_redirect_info, new_redirect_info,
absl::make_optional(remove_headers), std::make_optional(remove_headers),
/*modified_headers=*/absl::nullopt, /*modified_headers=*/std::nullopt,
&request_.headers, &should_clear_upload); &request_.headers, &should_clear_upload);
if (should_clear_upload) { if (should_clear_upload) {
@ -1275,7 +1275,7 @@ void InterceptedRequestHandler::OnRequestResponse(
int32_t request_id, int32_t request_id,
network::ResourceRequest* request, network::ResourceRequest* request,
net::HttpResponseHeaders* headers, net::HttpResponseHeaders* headers,
absl::optional<net::RedirectInfo> redirect_info, std::optional<net::RedirectInfo> redirect_info,
OnRequestResponseResultCallback callback) { OnRequestResponseResultCallback callback) {
std::move(callback).Run( std::move(callback).Run(
ResponseMode::CONTINUE, nullptr, ResponseMode::CONTINUE, nullptr,

View File

@ -8,6 +8,8 @@
#include "libcef/browser/net_service/stream_reader_url_loader.h" #include "libcef/browser/net_service/stream_reader_url_loader.h"
#include <optional>
#include "base/containers/unique_ptr_adapters.h" #include "base/containers/unique_ptr_adapters.h"
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "base/hash/hash.h" #include "base/hash/hash.h"
@ -19,7 +21,6 @@
#include "services/network/public/cpp/url_loader_factory_builder.h" #include "services/network/public/cpp/url_loader_factory_builder.h"
#include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace content { namespace content {
class ResourceContext; class ResourceContext;
@ -105,12 +106,11 @@ class InterceptedRequestHandler {
ResponseMode /* response_mode */, ResponseMode /* response_mode */,
scoped_refptr<net::HttpResponseHeaders> /* override_headers */, scoped_refptr<net::HttpResponseHeaders> /* override_headers */,
const GURL& /* redirect_url */)>; const GURL& /* redirect_url */)>;
virtual void OnRequestResponse( virtual void OnRequestResponse(int32_t request_id,
int32_t request_id, network::ResourceRequest* request,
network::ResourceRequest* request, net::HttpResponseHeaders* headers,
net::HttpResponseHeaders* headers, std::optional<net::RedirectInfo> redirect_info,
absl::optional<net::RedirectInfo> redirect_info, OnRequestResponseResultCallback callback);
OnRequestResponseResultCallback callback);
// Called to optionally filter the response body. // Called to optionally filter the response body.
virtual mojo::ScopedDataPipeConsumerHandle OnFilterResponseBody( virtual mojo::ScopedDataPipeConsumerHandle OnFilterResponseBody(

View File

@ -841,7 +841,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
void OnRequestResponse(int32_t request_id, void OnRequestResponse(int32_t request_id,
network::ResourceRequest* request, network::ResourceRequest* request,
net::HttpResponseHeaders* headers, net::HttpResponseHeaders* headers,
absl::optional<net::RedirectInfo> redirect_info, std::optional<net::RedirectInfo> redirect_info,
OnRequestResponseResultCallback callback) override { OnRequestResponseResultCallback callback) override {
CEF_REQUIRE_IOT(); CEF_REQUIRE_IOT();

View File

@ -475,7 +475,7 @@ StreamReaderURLLoader::StreamReaderURLLoader(
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client, mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
absl::optional<mojo_base::BigBuffer> cached_metadata, std::optional<mojo_base::BigBuffer> cached_metadata,
std::unique_ptr<Delegate> response_delegate) std::unique_ptr<Delegate> response_delegate)
: request_id_(request_id), : request_id_(request_id),
request_(request), request_(request),
@ -520,13 +520,13 @@ void StreamReaderURLLoader::Start() {
base::BindOnce(&StreamReaderURLLoader::ContinueWithRequestHeaders, base::BindOnce(&StreamReaderURLLoader::ContinueWithRequestHeaders,
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
} else { } else {
ContinueWithRequestHeaders(net::OK, absl::nullopt); ContinueWithRequestHeaders(net::OK, std::nullopt);
} }
} }
void StreamReaderURLLoader::ContinueWithRequestHeaders( void StreamReaderURLLoader::ContinueWithRequestHeaders(
int32_t result, int32_t result,
const absl::optional<net::HttpRequestHeaders>& headers) { const std::optional<net::HttpRequestHeaders>& headers) {
if (result != net::OK) { if (result != net::OK) {
RequestComplete(result); RequestComplete(result);
return; return;
@ -552,7 +552,7 @@ void StreamReaderURLLoader::FollowRedirect(
const std::vector<std::string>& removed_headers, const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) { const std::optional<GURL>& new_url) {
DCHECK(false); DCHECK(false);
} }
@ -665,15 +665,15 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code,
std::move(pending_response))); std::move(pending_response)));
} else { } else {
ContinueWithResponseHeaders(std::move(pending_response), net::OK, ContinueWithResponseHeaders(std::move(pending_response), net::OK,
absl::nullopt, absl::nullopt); std::nullopt, std::nullopt);
} }
} }
void StreamReaderURLLoader::ContinueWithResponseHeaders( void StreamReaderURLLoader::ContinueWithResponseHeaders(
network::mojom::URLResponseHeadPtr pending_response, network::mojom::URLResponseHeadPtr pending_response,
int32_t result, int32_t result,
const absl::optional<std::string>& headers, const std::optional<std::string>& headers,
const absl::optional<GURL>& redirect_url) { const std::optional<GURL>& redirect_url) {
if (result != net::OK) { if (result != net::OK) {
RequestComplete(result); RequestComplete(result);
return; return;

View File

@ -117,7 +117,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
mojo::PendingRemote<network::mojom::URLLoaderClient> client, mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client, mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
absl::optional<mojo_base::BigBuffer> cached_metadata, std::optional<mojo_base::BigBuffer> cached_metadata,
std::unique_ptr<Delegate> response_delegate); std::unique_ptr<Delegate> response_delegate);
StreamReaderURLLoader(const StreamReaderURLLoader&) = delete; StreamReaderURLLoader(const StreamReaderURLLoader&) = delete;
@ -132,7 +132,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
const std::vector<std::string>& removed_headers, const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) override; const std::optional<GURL>& new_url) override;
void SetPriority(net::RequestPriority priority, void SetPriority(net::RequestPriority priority,
int intra_priority_value) override; int intra_priority_value) override;
void PauseReadingBodyFromNet() override; void PauseReadingBodyFromNet() override;
@ -141,7 +141,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
private: private:
void ContinueWithRequestHeaders( void ContinueWithRequestHeaders(
int32_t result, int32_t result,
const absl::optional<net::HttpRequestHeaders>& headers); const std::optional<net::HttpRequestHeaders>& headers);
void OnInputStreamOpened(std::unique_ptr<Delegate> returned_delegate, void OnInputStreamOpened(std::unique_ptr<Delegate> returned_delegate,
std::unique_ptr<InputStream> input_stream); std::unique_ptr<InputStream> input_stream);
@ -150,8 +150,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
void ContinueWithResponseHeaders( void ContinueWithResponseHeaders(
network::mojom::URLResponseHeadPtr pending_response, network::mojom::URLResponseHeadPtr pending_response,
int32_t result, int32_t result,
const absl::optional<std::string>& headers, const std::optional<std::string>& headers,
const absl::optional<GURL>& redirect_url); const std::optional<GURL>& redirect_url);
void ReadMore(); void ReadMore();
void OnDataPipeWritable(MojoResult result); void OnDataPipeWritable(MojoResult result);
@ -173,7 +173,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
mojo::Remote<network::mojom::URLLoaderClient> client_; mojo::Remote<network::mojom::URLLoaderClient> client_;
mojo::Remote<network::mojom::TrustedHeaderClient> header_client_; mojo::Remote<network::mojom::TrustedHeaderClient> header_client_;
const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
absl::optional<mojo_base::BigBuffer> cached_metadata_; std::optional<mojo_base::BigBuffer> cached_metadata_;
std::unique_ptr<Delegate> response_delegate_; std::unique_ptr<Delegate> response_delegate_;
scoped_refptr<InputStreamReader> input_stream_reader_; scoped_refptr<InputStreamReader> input_stream_reader_;

View File

@ -55,7 +55,7 @@ scoped_refptr<URLLoaderFactoryGetter> URLLoaderFactoryGetter::Create(
browser_client->WillCreateURLLoaderFactory( browser_client->WillCreateURLLoaderFactory(
browser_context, render_frame_host, render_process_id, browser_context, render_frame_host, render_process_id,
content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource,
url::Origin(), absl::nullopt /* navigation_id */, ukm::SourceIdObj(), url::Origin(), std::nullopt /* navigation_id */, ukm::SourceIdObj(),
factory_builder, nullptr /* header_client */, factory_builder, nullptr /* header_client */,
nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */,
nullptr /* factory_override */, nullptr /* factory_override */,

View File

@ -107,7 +107,7 @@ class CefOriginWhitelistManager {
} }
void GetCrossOriginWhitelistEntries( void GetCrossOriginWhitelistEntries(
absl::optional<CrossOriginWhiteList>* entries) const { std::optional<CrossOriginWhiteList>* entries) const {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
if (!origin_list_.empty()) { if (!origin_list_.empty()) {
@ -289,7 +289,7 @@ bool CefClearCrossOriginWhitelist() {
} }
void GetCrossOriginWhitelistEntries( void GetCrossOriginWhitelistEntries(
absl::optional<CrossOriginWhiteList>* entries) { std::optional<CrossOriginWhiteList>* entries) {
CefOriginWhitelistManager::GetInstance()->GetCrossOriginWhitelistEntries( CefOriginWhitelistManager::GetInstance()->GetCrossOriginWhitelistEntries(
entries); entries);
} }

View File

@ -5,10 +5,9 @@
#ifndef CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_ #ifndef CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_
#define CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_ #define CEF_LIBCEF_BROWSER_ORIGIN_WHITELIST_IMPL_H_
#include <optional>
#include <vector> #include <vector>
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "cef/libcef/common/mojom/cef.mojom-forward.h" #include "cef/libcef/common/mojom/cef.mojom-forward.h"
namespace content { namespace content {
@ -25,7 +24,7 @@ using CrossOriginWhiteList =
// Called to retrieve the current list of cross-origin white list entries. This // Called to retrieve the current list of cross-origin white list entries. This
// method is thread safe. // method is thread safe.
void GetCrossOriginWhitelistEntries( void GetCrossOriginWhitelistEntries(
absl::optional<CrossOriginWhiteList>* entries); std::optional<CrossOriginWhiteList>* entries);
// Returns true if |source| can access |target| based on the cross-origin white // Returns true if |source| can access |target| based on the cross-origin white
// list settings. // list settings.

View File

@ -184,6 +184,20 @@ struct PopulateAxNodeAttributes {
attributes->SetString(ToString(attr.first), ToString(state)); attributes->SetString(ToString(attr.first), ToString(state));
} }
} break; } break;
case ax::mojom::IntAttribute::kAriaNotificationInterruptDeprecated: {
auto state =
static_cast<ax::mojom::AriaNotificationInterrupt>(attr.second);
if (ax::mojom::AriaNotificationInterrupt::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
} break;
case ax::mojom::IntAttribute::kAriaNotificationPriorityDeprecated: {
auto state =
static_cast<ax::mojom::AriaNotificationPriority>(attr.second);
if (ax::mojom::AriaNotificationPriority::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
} break;
case ax::mojom::IntAttribute::kTextDirection: { case ax::mojom::IntAttribute::kTextDirection: {
auto state = static_cast<ax::mojom::WritingDirection>(attr.second); auto state = static_cast<ax::mojom::WritingDirection>(attr.second);
if (ax::mojom::WritingDirection::kNone != state) { if (ax::mojom::WritingDirection::kNone != state) {

View File

@ -28,7 +28,6 @@
#include "content/browser/renderer_host/text_input_manager.h" #include "content/browser/renderer_host/text_input_manager.h"
#include "content/public/browser/render_frame_metadata_provider.h" #include "content/public/browser/render_frame_metadata_provider.h"
#include "content/public/common/widget_type.h" #include "content/public/common/widget_type.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/mojom/widget/record_content_to_visible_time_request.mojom-forward.h" #include "third_party/blink/public/mojom/widget/record_content_to_visible_time_request.mojom-forward.h"
#include "ui/base/cursor/cursor.h" #include "ui/base/cursor/cursor.h"
#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h"

View File

@ -67,7 +67,7 @@ void CefVideoConsumerOSR::SizeChanged(const gfx::Size& size_in_pixels) {
} }
void CefVideoConsumerOSR::RequestRefreshFrame( void CefVideoConsumerOSR::RequestRefreshFrame(
const absl::optional<gfx::Rect>& bounds_in_pixels) { const std::optional<gfx::Rect>& bounds_in_pixels) {
bounds_in_pixels_ = bounds_in_pixels; bounds_in_pixels_ = bounds_in_pixels;
video_capturer_->RequestRefreshFrame(); video_capturer_->RequestRefreshFrame();
} }
@ -126,7 +126,7 @@ void CefVideoConsumerOSR::OnFrameCaptured(
// Use the bounds passed to RequestRefreshFrame(). // Use the bounds passed to RequestRefreshFrame().
damage_rect = gfx::Rect(info->coded_size); damage_rect = gfx::Rect(info->coded_size);
damage_rect.Intersect(*bounds_in_pixels_); damage_rect.Intersect(*bounds_in_pixels_);
bounds_in_pixels_ = absl::nullopt; bounds_in_pixels_ = std::nullopt;
} else { } else {
// Retrieve the rectangular region of the frame that has changed since the // Retrieve the rectangular region of the frame that has changed since the
// frame with the directly preceding CAPTURE_COUNTER. If that frame was not // frame with the directly preceding CAPTURE_COUNTER. If that frame was not

View File

@ -1,10 +1,11 @@
#ifndef LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ #ifndef LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_
#define LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ #define LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_
#include <optional>
#include "base/functional/callback.h" #include "base/functional/callback.h"
#include "components/viz/host/client_frame_sink_video_capturer.h" #include "components/viz/host/client_frame_sink_video_capturer.h"
#include "media/capture/mojom/video_capture_types.mojom.h" #include "media/capture/mojom/video_capture_types.mojom.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
class CefRenderWidgetHostViewOSR; class CefRenderWidgetHostViewOSR;
@ -20,7 +21,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer {
void SetActive(bool active); void SetActive(bool active);
void SetFrameRate(base::TimeDelta frame_rate); void SetFrameRate(base::TimeDelta frame_rate);
void SizeChanged(const gfx::Size& size_in_pixels); void SizeChanged(const gfx::Size& size_in_pixels);
void RequestRefreshFrame(const absl::optional<gfx::Rect>& bounds_in_pixels); void RequestRefreshFrame(const std::optional<gfx::Rect>& bounds_in_pixels);
private: private:
// viz::mojom::FrameSinkVideoConsumer implementation. // viz::mojom::FrameSinkVideoConsumer implementation.
@ -40,7 +41,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer {
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_; std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
gfx::Size size_in_pixels_; gfx::Size size_in_pixels_;
absl::optional<gfx::Rect> bounds_in_pixels_; std::optional<gfx::Rect> bounds_in_pixels_;
}; };
#endif // LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ #endif // LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_

View File

@ -125,8 +125,8 @@ class CefPermissionPrompt : public permissions::PermissionPrompt {
const override { const override {
return permissions::PermissionPromptDisposition::CUSTOM_MODAL_DIALOG; return permissions::PermissionPromptDisposition::CUSTOM_MODAL_DIALOG;
} }
absl::optional<gfx::Rect> GetViewBoundsInScreen() const override { std::optional<gfx::Rect> GetViewBoundsInScreen() const override {
return absl::nullopt; return std::nullopt;
} }
bool ShouldFinalizeRequestAfterDecided() const override { return true; } bool ShouldFinalizeRequestAfterDecided() const override { return true; }
@ -201,12 +201,12 @@ cef_permission_request_types_t GetCefRequestType(
return CEF_PERMISSION_TYPE_LOCAL_FONTS; return CEF_PERMISSION_TYPE_LOCAL_FONTS;
case permissions::RequestType::kGeolocation: case permissions::RequestType::kGeolocation:
return CEF_PERMISSION_TYPE_GEOLOCATION; return CEF_PERMISSION_TYPE_GEOLOCATION;
case permissions::RequestType::kIdentityProvider:
return CEF_PERMISSION_TYPE_IDENTITY_PROVIDER;
case permissions::RequestType::kIdleDetection: case permissions::RequestType::kIdleDetection:
return CEF_PERMISSION_TYPE_IDLE_DETECTION; return CEF_PERMISSION_TYPE_IDLE_DETECTION;
case permissions::RequestType::kMicStream: case permissions::RequestType::kMicStream:
return CEF_PERMISSION_TYPE_MIC_STREAM; return CEF_PERMISSION_TYPE_MIC_STREAM;
case permissions::RequestType::kMidi:
return CEF_PERMISSION_TYPE_MIDI;
case permissions::RequestType::kMidiSysex: case permissions::RequestType::kMidiSysex:
return CEF_PERMISSION_TYPE_MIDI_SYSEX; return CEF_PERMISSION_TYPE_MIDI_SYSEX;
case permissions::RequestType::kMultipleDownloads: case permissions::RequestType::kMultipleDownloads:

View File

@ -65,7 +65,7 @@ void PrintToPDF(content::WebContents* web_contents,
const bool display_header_footer = !!settings.display_header_footer; const bool display_header_footer = !!settings.display_header_footer;
// Defaults to no header/footer. // Defaults to no header/footer.
absl::optional<std::string> header_template, footer_template; std::optional<std::string> header_template, footer_template;
if (display_header_footer) { if (display_header_footer) {
if (settings.header_template.length > 0) { if (settings.header_template.length > 0) {
header_template = CefString(&settings.header_template); header_template = CefString(&settings.header_template);
@ -76,20 +76,20 @@ void PrintToPDF(content::WebContents* web_contents,
} }
// Defaults to 1.0. // Defaults to 1.0.
absl::optional<double> scale; std::optional<double> scale;
if (settings.scale > 0) { if (settings.scale > 0) {
scale = settings.scale; scale = settings.scale;
} }
// Defaults to letter size. // Defaults to letter size.
absl::optional<double> paper_width, paper_height; std::optional<double> paper_width, paper_height;
if (settings.paper_width > 0 && settings.paper_height > 0) { if (settings.paper_width > 0 && settings.paper_height > 0) {
paper_width = settings.paper_width; paper_width = settings.paper_width;
paper_height = settings.paper_height; paper_height = settings.paper_height;
} }
// Defaults to kDefaultMarginInInches. // Defaults to kDefaultMarginInInches.
absl::optional<double> margin_top, margin_bottom, margin_left, margin_right; std::optional<double> margin_top, margin_bottom, margin_left, margin_right;
if (settings.margin_type == PDF_PRINT_MARGIN_NONE) { if (settings.margin_type == PDF_PRINT_MARGIN_NONE) {
margin_top = 0; margin_top = 0;
margin_bottom = 0; margin_bottom = 0;

View File

@ -50,7 +50,7 @@ class ResolveHostHelper : public network::ResolveHostClientBase {
host_resolver_.set_disconnect_handler(base::BindOnce( host_resolver_.set_disconnect_handler(base::BindOnce(
&ResolveHostHelper::OnComplete, base::Unretained(this), net::ERR_FAILED, &ResolveHostHelper::OnComplete, base::Unretained(this), net::ERR_FAILED,
net::ResolveErrorInfo(net::ERR_FAILED), absl::nullopt, absl::nullopt)); net::ResolveErrorInfo(net::ERR_FAILED), std::nullopt, std::nullopt));
host_resolver_->ResolveHost( host_resolver_->ResolveHost(
network::mojom::HostResolverHost::NewHostPortPair( network::mojom::HostResolverHost::NewHostPortPair(
@ -62,8 +62,8 @@ class ResolveHostHelper : public network::ResolveHostClientBase {
private: private:
void OnComplete(int result, void OnComplete(int result,
const net::ResolveErrorInfo& resolve_error_info, const net::ResolveErrorInfo& resolve_error_info,
const absl::optional<net::AddressList>& resolved_addresses, const std::optional<net::AddressList>& resolved_addresses,
const absl::optional<net::HostResolverEndpointResults>& const std::optional<net::HostResolverEndpointResults>&
endpoint_results_with_metadat) override { endpoint_results_with_metadat) override {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
@ -586,9 +586,6 @@ cef_content_setting_values_t CefRequestContextImpl::GetContentSetting(
const CefString& top_level_url, const CefString& top_level_url,
cef_content_setting_types_t content_type) { cef_content_setting_types_t content_type) {
// Verify that our enums match Chromium's values. // Verify that our enums match Chromium's values.
static_assert(static_cast<int>(CEF_CONTENT_SETTING_TYPE_NUM_TYPES) ==
static_cast<int>(ContentSettingsType::NUM_TYPES),
"Mismatched enum found for CEF_CONTENT_SETTING_TYPE_NUM_TYPES");
static_assert( static_assert(
static_cast<int>(CEF_CONTENT_SETTING_VALUE_NUM_VALUES) == static_cast<int>(CEF_CONTENT_SETTING_VALUE_NUM_VALUES) ==
static_cast<int>(CONTENT_SETTING_NUM_SETTINGS), static_cast<int>(CONTENT_SETTING_NUM_SETTINGS),

View File

@ -460,7 +460,7 @@ bool CefSimpleMenuModelImpl::RemoveAccelerator(int command_id) {
if (!VerifyContext() || command_id == kInvalidIndex) { if (!VerifyContext() || command_id == kInvalidIndex) {
return false; return false;
} }
state_delegate_->SetAccelerator(command_id, absl::nullopt); state_delegate_->SetAccelerator(command_id, std::nullopt);
return true; return true;
} }

View File

@ -7,12 +7,12 @@
#define CEF_LIBCEF_BROWSER_SIMPLE_MENU_MODEL_IMPL_H_ #define CEF_LIBCEF_BROWSER_SIMPLE_MENU_MODEL_IMPL_H_
#pragma once #pragma once
#include <optional>
#include <vector> #include <vector>
#include "include/cef_menu_model.h" #include "include/cef_menu_model.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/models/simple_menu_model.h" #include "ui/base/models/simple_menu_model.h"
// Implementation of CefMenuModel that wraps an existing ui::SimpleMenuModel. // Implementation of CefMenuModel that wraps an existing ui::SimpleMenuModel.
@ -24,7 +24,7 @@ class CefSimpleMenuModelImpl : public CefMenuModel {
public: public:
virtual void SetChecked(int command_id, bool checked) = 0; virtual void SetChecked(int command_id, bool checked) = 0;
virtual void SetAccelerator(int command_id, virtual void SetAccelerator(int command_id,
absl::optional<ui::Accelerator> accel) = 0; std::optional<ui::Accelerator> accel) = 0;
protected: protected:
virtual ~StateDelegate() = default; virtual ~StateDelegate() = default;

View File

@ -5,6 +5,7 @@
#include "libcef/browser/views/browser_view_impl.h" #include "libcef/browser/views/browser_view_impl.h"
#include <memory> #include <memory>
#include <optional>
#include "libcef/browser/browser_host_base.h" #include "libcef/browser/browser_host_base.h"
#include "libcef/browser/browser_util.h" #include "libcef/browser/browser_util.h"
@ -15,12 +16,11 @@
#include "libcef/browser/views/window_impl.h" #include "libcef/browser/views/window_impl.h"
#include "content/public/common/input/native_web_keyboard_event.h" #include "content/public/common/input/native_web_keyboard_event.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/content_accelerators/accelerator_util.h" #include "ui/content_accelerators/accelerator_util.h"
namespace { namespace {
absl::optional<cef_gesture_command_t> GetGestureCommand( std::optional<cef_gesture_command_t> GetGestureCommand(
ui::GestureEvent* event) { ui::GestureEvent* event) {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
if (event->details().type() == ui::ET_GESTURE_SWIPE) { if (event->details().type() == ui::ET_GESTURE_SWIPE) {
@ -31,7 +31,7 @@ absl::optional<cef_gesture_command_t> GetGestureCommand(
} }
} }
#endif #endif
return absl::nullopt; return std::nullopt;
} }
} // namespace } // namespace

View File

@ -67,6 +67,8 @@
#endif #endif
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
#include "base/win/scoped_handle.h"
#include "base/win/win_util.h"
#include "ui/base/resource/resource_bundle_win.h" #include "ui/base/resource/resource_bundle_win.h"
#endif #endif
@ -420,10 +422,60 @@ std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
// Initialize logging. // Initialize logging.
logging::LoggingSettings log_settings; logging::LoggingSettings log_settings;
const base::FilePath& log_file = enum class LoggingDest {
command_line->GetSwitchValuePath(switches::kLogFile); kFile,
DCHECK(!log_file.empty()); kStderr,
log_settings.log_file_path = log_file.value().c_str(); #if BUILDFLAG(IS_WIN)
kHandle,
#endif
};
LoggingDest dest = LoggingDest::kFile;
if (command_line->GetSwitchValueASCII(switches::kEnableLogging) == "stderr") {
dest = LoggingDest::kStderr;
}
#if BUILDFLAG(IS_WIN)
// On Windows child process may be given a handle in the --log-file switch.
base::win::ScopedHandle log_handle;
if (command_line->GetSwitchValueASCII(switches::kEnableLogging) == "handle") {
auto handle_str = command_line->GetSwitchValueNative(switches::kLogFile);
uint32_t handle_value = 0;
if (base::StringToUint(handle_str, &handle_value)) {
// This handle is owned by the logging framework and is closed when the
// process exits.
HANDLE duplicate = nullptr;
if (::DuplicateHandle(GetCurrentProcess(),
base::win::Uint32ToHandle(handle_value),
GetCurrentProcess(), &duplicate, 0, FALSE,
DUPLICATE_SAME_ACCESS)) {
log_handle.Set(duplicate);
dest = LoggingDest::kHandle;
}
}
}
#endif // BUILDFLAG(IS_WIN)
base::FilePath log_file;
if (dest == LoggingDest::kFile) {
log_file = command_line->GetSwitchValuePath(switches::kLogFile);
DCHECK(!log_file.empty());
}
#if BUILDFLAG(IS_WIN)
if (dest == LoggingDest::kHandle) {
// TODO(crbug.com/328285906) Use a ScopedHandle in logging settings.
log_settings.log_file = log_handle.release();
} else {
log_settings.log_file = nullptr;
}
#endif // BUILDFLAG(IS_WIN)
if (dest == LoggingDest::kFile) {
log_settings.log_file_path = log_file.value().c_str();
} else {
log_settings.log_file_path = nullptr;
}
log_settings.lock_log = logging::DONT_LOCK_LOG_FILE; log_settings.lock_log = logging::DONT_LOCK_LOG_FILE;
log_settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE; log_settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE;
@ -458,7 +510,13 @@ std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
// level here so that only FATAL messages are output. // level here so that only FATAL messages are output.
logging::SetMinLogLevel(logging::LOGGING_FATAL); logging::SetMinLogLevel(logging::LOGGING_FATAL);
} else { } else {
log_settings.logging_dest = logging::LOG_TO_ALL; if (dest == LoggingDest::kStderr) {
log_settings.logging_dest =
logging::LOG_TO_STDERR | logging::LOG_TO_SYSTEM_DEBUG_LOG;
} else {
// Includes both handle or provided filename on Windows.
log_settings.logging_dest = logging::LOG_TO_ALL;
}
logging::SetMinLogLevel(log_severity); logging::SetMinLogLevel(log_severity);
} }

View File

@ -47,7 +47,7 @@ CefRefPtr<CefValue> CefParseJSON(const void* json,
if (!json || json_size == 0) { if (!json || json_size == 0) {
return nullptr; return nullptr;
} }
absl::optional<base::Value> parse_result = base::JSONReader::Read( std::optional<base::Value> parse_result = base::JSONReader::Read(
base::StringPiece(static_cast<const char*>(json), json_size), base::StringPiece(static_cast<const char*>(json), json_size),
GetJSONReaderOptions(options)); GetJSONReaderOptions(options));
if (parse_result) { if (parse_result) {

View File

@ -35,9 +35,9 @@ base::RefCountedMemory* CefResourceBundleDelegate::LoadDataResourceBytes(
return nullptr; return nullptr;
} }
absl::optional<std::string> CefResourceBundleDelegate::LoadDataResourceString( std::optional<std::string> CefResourceBundleDelegate::LoadDataResourceString(
int resource_id) { int resource_id) {
return absl::nullopt; return std::nullopt;
} }
bool CefResourceBundleDelegate::GetRawDataResource( bool CefResourceBundleDelegate::GetRawDataResource(

View File

@ -32,7 +32,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate {
base::RefCountedMemory* LoadDataResourceBytes( base::RefCountedMemory* LoadDataResourceBytes(
int resource_id, int resource_id,
ui::ResourceScaleFactor scale_factor) override; ui::ResourceScaleFactor scale_factor) override;
absl::optional<std::string> LoadDataResourceString(int resource_id) override; std::optional<std::string> LoadDataResourceString(int resource_id) override;
bool GetRawDataResource(int resource_id, bool GetRawDataResource(int resource_id,
ui::ResourceScaleFactor scale_factor, ui::ResourceScaleFactor scale_factor,
base::StringPiece* value) const override; base::StringPiece* value) const override;

View File

@ -85,7 +85,7 @@ CefValueImpl::~CefValueImpl() = default;
void CefValueImpl::SetValue(base::Value value) { void CefValueImpl::SetValue(base::Value value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(absl::make_optional(std::move(value))); SetValueInternal(std::make_optional(std::move(value)));
} }
base::Value CefValueImpl::CopyValue() { base::Value CefValueImpl::CopyValue() {
@ -386,26 +386,26 @@ bool CefValueImpl::SetString(const CefString& value) {
bool CefValueImpl::SetBinary(CefRefPtr<CefBinaryValue> value) { bool CefValueImpl::SetBinary(CefRefPtr<CefBinaryValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(absl::nullopt); SetValueInternal(std::nullopt);
binary_value_ = value; binary_value_ = value;
return true; return true;
} }
bool CefValueImpl::SetDictionary(CefRefPtr<CefDictionaryValue> value) { bool CefValueImpl::SetDictionary(CefRefPtr<CefDictionaryValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(absl::nullopt); SetValueInternal(std::nullopt);
dictionary_value_ = value; dictionary_value_ = value;
return true; return true;
} }
bool CefValueImpl::SetList(CefRefPtr<CefListValue> value) { bool CefValueImpl::SetList(CefRefPtr<CefListValue> value) {
base::AutoLock lock_scope(lock_); base::AutoLock lock_scope(lock_);
SetValueInternal(absl::nullopt); SetValueInternal(std::nullopt);
list_value_ = value; list_value_ = value;
return true; return true;
} }
void CefValueImpl::SetValueInternal(absl::optional<base::Value> value) { void CefValueImpl::SetValueInternal(std::optional<base::Value> value) {
lock_.AssertAcquired(); lock_.AssertAcquired();
value_.reset(nullptr); value_.reset(nullptr);
@ -1048,7 +1048,7 @@ bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) {
} }
// |actual_value| is no longer valid after this call. // |actual_value| is no longer valid after this call.
absl::optional<base::Value> out_value = std::optional<base::Value> out_value =
mutable_value()->GetDict().Extract(base::StringPiece(key.ToString())); mutable_value()->GetDict().Extract(base::StringPiece(key.ToString()));
if (!out_value.has_value()) { if (!out_value.has_value()) {
return false; return false;

View File

@ -106,7 +106,7 @@ class CefValueImpl : public CefValue {
}; };
private: private:
void SetValueInternal(absl::optional<base::Value> value); void SetValueInternal(std::optional<base::Value> value);
// Returns the controller for the current value, if any. // Returns the controller for the current value, if any.
CefValueController* GetValueController() const; CefValueController* GetValueController() const;

View File

@ -294,7 +294,7 @@ void AlloyContentRendererClient::RenderFrameCreated(
} }
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; std::optional<bool> is_windowless;
render_manager_->RenderFrameCreated(render_frame, render_frame_observer, render_manager_->RenderFrameCreated(render_frame, render_frame_observer,
browser_created, is_windowless); browser_created, is_windowless);
if (browser_created) { if (browser_created) {
@ -314,7 +314,7 @@ void AlloyContentRendererClient::WebViewCreated(
bool was_created_by_renderer, bool was_created_by_renderer,
const url::Origin* outermost_origin) { const url::Origin* outermost_origin) {
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; std::optional<bool> is_windowless;
render_manager_->WebViewCreated(web_view, browser_created, is_windowless); render_manager_->WebViewCreated(web_view, browser_created, is_windowless);
if (browser_created) { if (browser_created) {
OnBrowserCreated(web_view, is_windowless); OnBrowserCreated(web_view, is_windowless);
@ -427,9 +427,10 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin(
return true; return true;
} }
void AlloyContentRendererClient::GetSupportedKeySystems( std::unique_ptr<media::KeySystemSupportObserver>
AlloyContentRendererClient::GetSupportedKeySystems(
media::GetSupportedKeySystemsCB cb) { media::GetSupportedKeySystemsCB cb) {
GetChromeKeySystems(std::move(cb)); return GetChromeKeySystems(std::move(cb));
} }
void AlloyContentRendererClient::RunScriptsAtDocumentStart( void AlloyContentRendererClient::RunScriptsAtDocumentStart(
@ -542,7 +543,7 @@ void AlloyContentRendererClient::WillDestroyCurrentMessageLoop() {
void AlloyContentRendererClient::OnBrowserCreated( void AlloyContentRendererClient::OnBrowserCreated(
blink::WebView* web_view, blink::WebView* web_view,
absl::optional<bool> is_windowless) { std::optional<bool> is_windowless) {
#if BUILDFLAG(IS_MAC) #if BUILDFLAG(IS_MAC)
const bool windowless = is_windowless.has_value() && *is_windowless; const bool windowless = is_windowless.has_value() && *is_windowless;

View File

@ -20,13 +20,13 @@
#include "chrome/common/plugin.mojom.h" #include "chrome/common/plugin.mojom.h"
#include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_thread.h"
#include "media/base/key_systems_support_observer.h"
#include "mojo/public/cpp/bindings/generic_pending_receiver.h" #include "mojo/public/cpp/bindings/generic_pending_receiver.h"
#include "services/service_manager/public/cpp/local_interface_provider.h" #include "services/service_manager/public/cpp/local_interface_provider.h"
namespace extensions { namespace extensions {
class CefExtensionsRendererClient; class CefExtensionsRendererClient;
class Dispatcher; class Dispatcher;
class DispatcherDelegate;
class ExtensionsClient; class ExtensionsClient;
class ExtensionsRendererClient; class ExtensionsRendererClient;
class ResourceRequestPolicy; class ResourceRequestPolicy;
@ -100,7 +100,8 @@ class AlloyContentRendererClient
uint64_t VisitedLinkHash(std::string_view canonical_url) override; uint64_t VisitedLinkHash(std::string_view canonical_url) override;
bool IsLinkVisited(uint64_t link_hash) override; bool IsLinkVisited(uint64_t link_hash) override;
bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override;
void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override; std::unique_ptr<media::KeySystemSupportObserver> GetSupportedKeySystems(
media::GetSupportedKeySystemsCB cb) override;
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override;
@ -126,7 +127,7 @@ class AlloyContentRendererClient
private: private:
void OnBrowserCreated(blink::WebView* web_view, void OnBrowserCreated(blink::WebView* web_view,
absl::optional<bool> is_windowless); std::optional<bool> is_windowless);
// Perform cleanup work for single-process mode. // Perform cleanup work for single-process mode.
void RunSingleProcessCleanupOnUIThread(); void RunSingleProcessCleanupOnUIThread();

View File

@ -24,23 +24,23 @@ CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
AlloyContentRendererClient* alloy_content_renderer_client) AlloyContentRendererClient* alloy_content_renderer_client)
: type_(type), : type_(type),
alloy_content_renderer_client_(alloy_content_renderer_client) { alloy_content_renderer_client_(alloy_content_renderer_client) {
DETACH_FROM_THREAD(thread_checker_); DETACH_FROM_SEQUENCE(sequence_checker_);
} }
CefURLLoaderThrottleProviderImpl::~CefURLLoaderThrottleProviderImpl() { CefURLLoaderThrottleProviderImpl::~CefURLLoaderThrottleProviderImpl() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
} }
CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl( CefURLLoaderThrottleProviderImpl::CefURLLoaderThrottleProviderImpl(
const CefURLLoaderThrottleProviderImpl& other) const CefURLLoaderThrottleProviderImpl& other)
: type_(other.type_), : type_(other.type_),
alloy_content_renderer_client_(other.alloy_content_renderer_client_) { alloy_content_renderer_client_(other.alloy_content_renderer_client_) {
DETACH_FROM_THREAD(thread_checker_); DETACH_FROM_SEQUENCE(sequence_checker_);
} }
std::unique_ptr<blink::URLLoaderThrottleProvider> std::unique_ptr<blink::URLLoaderThrottleProvider>
CefURLLoaderThrottleProviderImpl::Clone() { CefURLLoaderThrottleProviderImpl::Clone() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return base::WrapUnique(new CefURLLoaderThrottleProviderImpl(*this)); return base::WrapUnique(new CefURLLoaderThrottleProviderImpl(*this));
} }
@ -48,7 +48,7 @@ blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>>
CefURLLoaderThrottleProviderImpl::CreateThrottles( CefURLLoaderThrottleProviderImpl::CreateThrottles(
base::optional_ref<const blink::LocalFrameToken> local_frame_token, base::optional_ref<const blink::LocalFrameToken> local_frame_token,
const network::ResourceRequest& request) { const network::ResourceRequest& request) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> throttles; blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> throttles;

View File

@ -8,7 +8,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "base/threading/thread_checker.h" #include "base/sequence_checker.h"
#include "third_party/blink/public/platform/url_loader_throttle_provider.h" #include "third_party/blink/public/platform/url_loader_throttle_provider.h"
class AlloyContentRendererClient; class AlloyContentRendererClient;
@ -43,7 +43,7 @@ class CefURLLoaderThrottleProviderImpl
blink::URLLoaderThrottleProviderType type_; blink::URLLoaderThrottleProviderType type_;
AlloyContentRendererClient* const alloy_content_renderer_client_; AlloyContentRendererClient* const alloy_content_renderer_client_;
THREAD_CHECKER(thread_checker_); SEQUENCE_CHECKER(sequence_checker_);
}; };
#endif // CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_ #endif // CEF_LIBCEF_RENDERER_ALLOY_URL_LOADER_THROTTLE_PROVIDER_IMPL_H_

View File

@ -81,7 +81,7 @@ void GoBack(blink::WebView* view) {
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame);
blink::To<blink::LocalFrame>(core_frame) blink::To<blink::LocalFrame>(core_frame)
->GetLocalFrameHostRemote() ->GetLocalFrameHostRemote()
.GoToEntryAtOffset(-1, /*has_user_gesture=*/true, absl::nullopt); .GoToEntryAtOffset(-1, /*has_user_gesture=*/true, std::nullopt);
} }
} }
} }
@ -97,7 +97,7 @@ void GoForward(blink::WebView* view) {
blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame);
blink::To<blink::LocalFrame>(core_frame) blink::To<blink::LocalFrame>(core_frame)
->GetLocalFrameHostRemote() ->GetLocalFrameHostRemote()
.GoToEntryAtOffset(1, /*has_user_gesture=*/true, absl::nullopt); .GoToEntryAtOffset(1, /*has_user_gesture=*/true, std::nullopt);
} }
} }
} }

View File

@ -46,7 +46,7 @@ void ChromeContentRendererClientCef::RenderFrameCreated(
new CefRenderFrameObserver(render_frame); new CefRenderFrameObserver(render_frame);
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; std::optional<bool> is_windowless;
render_manager_->RenderFrameCreated(render_frame, render_frame_observer, render_manager_->RenderFrameCreated(render_frame, render_frame_observer,
browser_created, is_windowless); browser_created, is_windowless);
if (is_windowless.has_value() && *is_windowless) { if (is_windowless.has_value() && *is_windowless) {
@ -62,7 +62,7 @@ void ChromeContentRendererClientCef::WebViewCreated(
outermost_origin); outermost_origin);
bool browser_created; bool browser_created;
absl::optional<bool> is_windowless; std::optional<bool> is_windowless;
render_manager_->WebViewCreated(web_view, browser_created, is_windowless); render_manager_->WebViewCreated(web_view, browser_created, is_windowless);
if (is_windowless.has_value() && *is_windowless) { if (is_windowless.has_value() && *is_windowless) {
LOG(ERROR) << "The chrome runtime does not support windowless browsers"; LOG(ERROR) << "The chrome runtime does not support windowless browsers";

View File

@ -1,21 +0,0 @@
// Copyright 2015 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h"
#include "base/feature_list.h"
#include "chrome/grit/renderer_resources.h"
#include "extensions/common/extension_features.h"
#include "extensions/renderer/resource_bundle_source_map.h"
namespace extensions {
CefExtensionsDispatcherDelegate::CefExtensionsDispatcherDelegate() = default;
CefExtensionsDispatcherDelegate::~CefExtensionsDispatcherDelegate() = default;
void CefExtensionsDispatcherDelegate::PopulateSourceMap(
extensions::ResourceBundleSourceMap* source_map) {}
} // namespace extensions

View File

@ -1,29 +0,0 @@
// Copyright 2015 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_
#define CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_
#include "extensions/renderer/dispatcher_delegate.h"
namespace extensions {
class CefExtensionsDispatcherDelegate : public DispatcherDelegate {
public:
CefExtensionsDispatcherDelegate();
CefExtensionsDispatcherDelegate(const CefExtensionsDispatcherDelegate&) =
delete;
CefExtensionsDispatcherDelegate& operator=(
const CefExtensionsDispatcherDelegate&) = delete;
~CefExtensionsDispatcherDelegate() override;
void PopulateSourceMap(
extensions::ResourceBundleSourceMap* source_map) override;
};
} // namespace extensions
#endif // CEF_LIBCEF_RENDERER_EXTENSIONS_EXTENSIONS_DISPATCHER_DELEGATE_H_

View File

@ -0,0 +1,32 @@
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/renderer/extensions/extensions_renderer_api_provider.h"
#include "extensions/renderer/module_system.h"
#include "extensions/renderer/script_context.h"
namespace extensions {
void CefExtensionsRendererAPIProvider::RegisterNativeHandlers(
ModuleSystem* module_system,
NativeExtensionBindingsSystem* bindings_system,
V8SchemaRegistry* v8_schema_registry,
ScriptContext* context) const {}
void CefExtensionsRendererAPIProvider::AddBindingsSystemHooks(
Dispatcher* dispatcher,
NativeExtensionBindingsSystem* bindings_system) const {}
void CefExtensionsRendererAPIProvider::PopulateSourceMap(
ResourceBundleSourceMap* source_map) const {}
void CefExtensionsRendererAPIProvider::EnableCustomElementAllowlist() const {}
void CefExtensionsRendererAPIProvider::RequireWebViewModules(
ScriptContext* context) const {
context->module_system()->Require("extensionsWebViewElement");
}
} // namespace extensions

View File

@ -0,0 +1,38 @@
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_
#define CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_
#include "extensions/renderer/extensions_renderer_api_provider.h"
namespace extensions {
// Provides capabilities for the set of extension APIs defined for the
// extensions shell.
class CefExtensionsRendererAPIProvider
: public ExtensionsRendererAPIProvider {
public:
CefExtensionsRendererAPIProvider() = default;
CefExtensionsRendererAPIProvider(
const CefExtensionsRendererAPIProvider&) = delete;
CefExtensionsRendererAPIProvider& operator=(
const CefExtensionsRendererAPIProvider&) = delete;
~CefExtensionsRendererAPIProvider() override = default;
void RegisterNativeHandlers(ModuleSystem* module_system,
NativeExtensionBindingsSystem* bindings_system,
V8SchemaRegistry* v8_schema_registry,
ScriptContext* context) const override;
void AddBindingsSystemHooks(
Dispatcher* dispatcher,
NativeExtensionBindingsSystem* bindings_system) const override;
void PopulateSourceMap(ResourceBundleSourceMap* source_map) const override;
void EnableCustomElementAllowlist() const override;
void RequireWebViewModules(ScriptContext* context) const override;
};
} // namespace extensions
#endif // CEF_LIBCEF_BROWSER_EXTENSIONS_EXTENSIONS_RENDERER_API_PROVIDER_H_

View File

@ -6,7 +6,7 @@
#include "libcef/renderer/alloy/alloy_content_renderer_client.h" #include "libcef/renderer/alloy/alloy_content_renderer_client.h"
#include "libcef/renderer/alloy/alloy_render_thread_observer.h" #include "libcef/renderer/alloy/alloy_render_thread_observer.h"
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h" #include "libcef/renderer/extensions/extensions_renderer_api_provider.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
@ -16,7 +16,9 @@
#include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_thread.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "extensions/common/permissions/permissions_data.h" #include "extensions/common/permissions/permissions_data.h"
#include "extensions/renderer/api/core_extensions_renderer_api_provider.h"
#include "extensions/renderer/dispatcher.h" #include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/dispatcher_delegate.h"
#include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extension_frame_helper.h"
#include "extensions/renderer/extensions_render_frame_observer.h" #include "extensions/renderer/extensions_render_frame_observer.h"
#include "extensions/renderer/extensions_renderer_api_provider.h" #include "extensions/renderer/extensions_renderer_api_provider.h"
@ -42,7 +44,10 @@ void IsGuestViewApiAvailableToScriptContext(
CefExtensionsRendererClient::CefExtensionsRendererClient( CefExtensionsRendererClient::CefExtensionsRendererClient(
AlloyContentRendererClient* alloy_content_renderer_client) AlloyContentRendererClient* alloy_content_renderer_client)
: alloy_content_renderer_client_(alloy_content_renderer_client) {} : alloy_content_renderer_client_(alloy_content_renderer_client) {
AddAPIProvider(std::make_unique<CoreExtensionsRendererAPIProvider>());
AddAPIProvider(std::make_unique<CefExtensionsRendererAPIProvider>());
}
CefExtensionsRendererClient::~CefExtensionsRendererClient() = default; CefExtensionsRendererClient::~CefExtensionsRendererClient() = default;
@ -83,9 +88,8 @@ void CefExtensionsRendererClient::RenderThreadStarted() {
content::RenderThread* thread = content::RenderThread::Get(); content::RenderThread* thread = content::RenderThread::Get();
extension_dispatcher_ = std::make_unique<extensions::Dispatcher>( extension_dispatcher_ = std::make_unique<extensions::Dispatcher>(
std::make_unique<extensions::CefExtensionsDispatcherDelegate>(), std::make_unique<extensions::DispatcherDelegate>(),
std::vector< std::move(api_providers_));
std::unique_ptr<extensions::ExtensionsRendererAPIProvider>>());
extension_dispatcher_->OnRenderThreadStarted(thread); extension_dispatcher_->OnRenderThreadStarted(thread);
resource_request_policy_ = resource_request_policy_ =
std::make_unique<extensions::ResourceRequestPolicy>( std::make_unique<extensions::ResourceRequestPolicy>(

View File

@ -39,7 +39,6 @@ class Origin;
namespace extensions { namespace extensions {
class Dispatcher; class Dispatcher;
class DispatcherDelegate;
class ResourceRequestPolicy; class ResourceRequestPolicy;
class CefExtensionsRendererClient : public ExtensionsRendererClient { class CefExtensionsRendererClient : public ExtensionsRendererClient {
@ -54,6 +53,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
~CefExtensionsRendererClient() override; ~CefExtensionsRendererClient() override;
// ExtensionsRendererClient implementation. // ExtensionsRendererClient implementation.
void RenderThreadStarted() override;
bool IsIncognitoProcess() const override; bool IsIncognitoProcess() const override;
int GetLowestIsolatedWorldId() const override; int GetLowestIsolatedWorldId() const override;
extensions::Dispatcher* GetDispatcher() override; extensions::Dispatcher* GetDispatcher() override;
@ -65,7 +65,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
const GURL& script_url) const override; const GURL& script_url) const override;
// See AlloyContentRendererClient methods with the same names. // See AlloyContentRendererClient methods with the same names.
void RenderThreadStarted();
void RenderFrameCreated(content::RenderFrame* render_frame, void RenderFrameCreated(content::RenderFrame* render_frame,
service_manager::BinderRegistry* registry); service_manager::BinderRegistry* registry);
bool OverrideCreatePlugin(content::RenderFrame* render_frame, bool OverrideCreatePlugin(content::RenderFrame* render_frame,

View File

@ -381,9 +381,9 @@ void CefFrameImpl::OnDraggableRegionsChanged() {
} }
using RegionsArg = using RegionsArg =
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>>; std::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>>;
RegionsArg regions_arg = RegionsArg regions_arg =
regions.empty() ? absl::nullopt : absl::make_optional(std::move(regions)); regions.empty() ? std::nullopt : std::make_optional(std::move(regions));
SendToBrowserFrame( SendToBrowserFrame(
__FUNCTION__, __FUNCTION__,
@ -613,8 +613,8 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason,
const auto connection_state = browser_connection_state_; const auto connection_state = browser_connection_state_;
const bool frame_is_valid = !!frame_; const bool frame_is_valid = !!frame_;
VLOG(1) << frame_debug_str_ << " disconnected " VLOG(1) << frame_debug_str_ << " disconnected "
<< GetDisconnectDebugString(connection_state, frame_is_valid, << GetDisconnectDebugString(connection_state, frame_is_valid, reason,
reason, description); description);
browser_frame_.reset(); browser_frame_.reset();
receiver_.reset(); receiver_.reset();

View File

@ -105,7 +105,7 @@ void CefRenderManager::RenderFrameCreated(
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
CefRenderFrameObserver* render_frame_observer, CefRenderFrameObserver* render_frame_observer,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless) { std::optional<bool>& is_windowless) {
auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame, auto browser = MaybeCreateBrowser(render_frame->GetWebView(), render_frame,
&browser_created, &is_windowless); &browser_created, &is_windowless);
if (browser) { if (browser) {
@ -122,7 +122,7 @@ void CefRenderManager::RenderFrameCreated(
void CefRenderManager::WebViewCreated(blink::WebView* web_view, void CefRenderManager::WebViewCreated(blink::WebView* web_view,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless) { std::optional<bool>& is_windowless) {
content::RenderFrame* render_frame = nullptr; content::RenderFrame* render_frame = nullptr;
if (web_view->MainFrame()->IsWebLocalFrame()) { if (web_view->MainFrame()->IsWebLocalFrame()) {
render_frame = content::RenderFrame::FromWebFrame( render_frame = content::RenderFrame::FromWebFrame(
@ -291,7 +291,7 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
blink::WebView* web_view, blink::WebView* web_view,
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
bool* browser_created, bool* browser_created,
absl::optional<bool>* is_windowless) { std::optional<bool>* is_windowless) {
if (browser_created) { if (browser_created) {
*browser_created = false; *browser_created = false;
} }

View File

@ -8,6 +8,7 @@
#include <map> #include <map>
#include <memory> #include <memory>
#include <optional>
#include "include/internal/cef_ptr.h" #include "include/internal/cef_ptr.h"
@ -15,7 +16,6 @@
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace blink { namespace blink {
class WebFrame; class WebFrame;
@ -53,10 +53,10 @@ class CefRenderManager : public cef::mojom::RenderManager {
void RenderFrameCreated(content::RenderFrame* render_frame, void RenderFrameCreated(content::RenderFrame* render_frame,
CefRenderFrameObserver* render_frame_observer, CefRenderFrameObserver* render_frame_observer,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless); std::optional<bool>& is_windowless);
void WebViewCreated(blink::WebView* web_view, void WebViewCreated(blink::WebView* web_view,
bool& browser_created, bool& browser_created,
absl::optional<bool>& is_windowless); std::optional<bool>& is_windowless);
void DevToolsAgentAttached(); void DevToolsAgentAttached();
void DevToolsAgentDetached(); void DevToolsAgentDetached();
void ExposeInterfacesToBrowser(mojo::BinderMap* binders); void ExposeInterfacesToBrowser(mojo::BinderMap* binders);
@ -97,7 +97,7 @@ class CefRenderManager : public cef::mojom::RenderManager {
blink::WebView* web_view, blink::WebView* web_view,
content::RenderFrame* render_frame, content::RenderFrame* render_frame,
bool* browser_created, bool* browser_created,
absl::optional<bool>* is_windowless); std::optional<bool>* is_windowless);
// Called from CefBrowserImpl::OnDestruct(). // Called from CefBrowserImpl::OnDestruct().
void OnBrowserDestroyed(CefBrowserImpl* browser); void OnBrowserDestroyed(CefBrowserImpl* browser);

View File

@ -165,6 +165,9 @@ patches = [
# Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded # Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded
# message loop. # message loop.
# https://github.com/chromiumembedded/cef/issues/2798 # https://github.com/chromiumembedded/cef/issues/2798
#
# win: Don't create console window for `--enable-logging=handle`
# https://chromium-review.googlesource.com/c/chromium/src/+/5381045
'name': 'content_main_654986', 'name': 'content_main_654986',
}, },
{ {
@ -555,12 +558,6 @@ patches = [
# Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h. # Avoid usage of PartitionAlloc assertions (PA_BASE_CHECK) in raw_ptr.h.
'name': 'base_sandbox_2743', 'name': 'base_sandbox_2743',
}, },
{
# Windows: Fix MSVC compile errors using base::MakeFixedFlatMapSorted
# in registry.cc when building cef_sandbox.
# https://github.com/chromiumembedded/cef/issues/3519
'name': 'base_sandbox_3519',
},
{ {
# Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling # Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling
# scrolling in OSR mode. # scrolling in OSR mode.
@ -730,4 +727,10 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/3645 # https://github.com/chromiumembedded/cef/issues/3645
'name': 'win_taskbar_decorator_3645' 'name': 'win_taskbar_decorator_3645'
}, },
{
# chrome: Fix crash on static FontList destruction with
# multi-threaded-message-loop.
# https://chromium-review.googlesource.com/c/chromium/src/+/5388128
'name': 'chrome_watermark_5388128'
},
] ]

View File

@ -1,8 +1,8 @@
diff --git base/command_line.cc base/command_line.cc diff --git base/command_line.cc base/command_line.cc
index 69e4303165259..682e8d2bfa6ce 100644 index 15d57c1c78956..2241eb0c32572 100644
--- base/command_line.cc --- base/command_line.cc
+++ base/command_line.cc +++ base/command_line.cc
@@ -355,11 +355,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, @@ -383,11 +383,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string,
#if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
sequence_checker_.Check(); sequence_checker_.Check();
#endif #endif

View File

@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn diff --git base/BUILD.gn base/BUILD.gn
index a989a351a8765..3f7af447dd187 100644 index 25356ec40cdbf..250bac82d893a 100644
--- base/BUILD.gn --- base/BUILD.gn
+++ base/BUILD.gn +++ base/BUILD.gn
@@ -41,6 +41,7 @@ import("//build/nocompile.gni") @@ -41,6 +41,7 @@ import("//build/nocompile.gni")
@ -10,7 +10,7 @@ index a989a351a8765..3f7af447dd187 100644
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni") import("//testing/test.gni")
@@ -1507,7 +1508,11 @@ component("base") { @@ -1515,7 +1516,11 @@ component("base") {
"hash/md5_constexpr_internal.h", "hash/md5_constexpr_internal.h",
"hash/sha1.h", "hash/sha1.h",
] ]
@ -23,7 +23,7 @@ index a989a351a8765..3f7af447dd187 100644
sources += [ sources += [
"hash/md5_nacl.cc", "hash/md5_nacl.cc",
"hash/md5_nacl.h", "hash/md5_nacl.h",
@@ -1936,6 +1941,12 @@ component("base") { @@ -1944,6 +1949,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
} }
@ -37,17 +37,17 @@ index a989a351a8765..3f7af447dd187 100644
"cfgmgr32.lib", "cfgmgr32.lib",
"ntdll.lib", "ntdll.lib",
diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc
index 4595034abae30..da29453cf7d71 100644 index 78f706cd6bef8..87eafa7a762f6 100644
--- base/allocator/dispatcher/dispatcher.cc --- base/allocator/dispatcher/dispatcher.cc
+++ base/allocator/dispatcher/dispatcher.cc +++ base/allocator/dispatcher/dispatcher.cc
@@ -10,6 +10,7 @@ @@ -8,6 +8,7 @@
#include "base/check.h" #include "base/check.h"
#include "base/dcheck_is_on.h" #include "base/dcheck_is_on.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
+#include "cef/libcef/features/features.h" +#include "cef/libcef/features/features.h"
#include "partition_alloc/partition_alloc_buildflags.h"
#include "partition_alloc/shim/allocator_shim.h"
#if DCHECK_IS_ON()
#include <atomic>
@@ -33,7 +34,7 @@ struct Dispatcher::Impl { @@ -33,7 +34,7 @@ struct Dispatcher::Impl {
} }
@ -58,7 +58,7 @@ index 4595034abae30..da29453cf7d71 100644
auto const was_set = is_initialized_check_flag_.test_and_set(); auto const was_set = is_initialized_check_flag_.test_and_set();
is_initialized_check_flag_.clear(); is_initialized_check_flag_.clear();
diff --git base/hash/md5.h base/hash/md5.h diff --git base/hash/md5.h base/hash/md5.h
index b49701893a182..acefcbc5bc439 100644 index 215d636fec275..922e88f31b999 100644
--- base/hash/md5.h --- base/hash/md5.h
+++ base/hash/md5.h +++ base/hash/md5.h
@@ -11,8 +11,9 @@ @@ -11,8 +11,9 @@
@ -164,7 +164,7 @@ index 299e54300a09d..cdc43cc48dce6 100644
static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng(); static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng();
BOOL success = BOOL success =
diff --git base/unguessable_token.cc base/unguessable_token.cc diff --git base/unguessable_token.cc base/unguessable_token.cc
index da65502f75c3a..8b9d6eec4a1e2 100644 index 1f91a938caf55..e7b383ebe3986 100644
--- base/unguessable_token.cc --- base/unguessable_token.cc
+++ base/unguessable_token.cc +++ base/unguessable_token.cc
@@ -10,8 +10,9 @@ @@ -10,8 +10,9 @@
@ -178,7 +178,7 @@ index da65502f75c3a..8b9d6eec4a1e2 100644
#include "third_party/boringssl/src/include/openssl/mem.h" #include "third_party/boringssl/src/include/openssl/mem.h"
#endif #endif
@@ -57,7 +58,7 @@ absl::optional<UnguessableToken> UnguessableToken::DeserializeFromString( @@ -57,7 +58,7 @@ std::optional<UnguessableToken> UnguessableToken::DeserializeFromString(
} }
bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) { bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) {
@ -188,7 +188,7 @@ index da65502f75c3a..8b9d6eec4a1e2 100644
return lhs.token_ == rhs.token_; return lhs.token_ == rhs.token_;
#else #else
diff --git base/win/sid.cc base/win/sid.cc diff --git base/win/sid.cc base/win/sid.cc
index 3323cc7cbfee1..778b86dcd4154 100644 index ccaf03323d60f..3d7a7513d1843 100644
--- base/win/sid.cc --- base/win/sid.cc
+++ base/win/sid.cc +++ base/win/sid.cc
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@

View File

@ -1,53 +0,0 @@
diff --git base/ranges/ranges.h base/ranges/ranges.h
index 27eac4f3a4c39..2cb63bec79e63 100644
--- base/ranges/ranges.h
+++ base/ranges/ranges.h
@@ -30,12 +30,14 @@ constexpr T* begin(std::array<T, N>& array, priority_tag<2> tag) {
return const_cast<T*>(begin(const_cast<const std::array<T, N>&>(array), tag));
}
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
// Overload for const std::array. Required since std::array::begin is not
// constexpr prior to C++17.
template <typename T, size_t N>
constexpr const T* begin(const std::array<T, N>& array, priority_tag<2>) {
return N != 0 ? &array[0] : nullptr;
}
+#endif
// Generic container overload.
template <typename Range>
@@ -65,12 +67,14 @@ constexpr T* end(std::array<T, N>& array, priority_tag<2> tag) {
return const_cast<T*>(end(const_cast<const std::array<T, N>&>(array), tag));
}
+#if !defined(CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS)
// Overload for const std::array. Required since std::array::end is not
// constexpr prior to C++17.
template <typename T, size_t N>
constexpr const T* end(const std::array<T, N>& array, priority_tag<2>) {
return N != 0 ? (&array[0]) + N : nullptr;
}
+#endif
// Generic container overload.
template <typename Range>
diff --git base/win/registry.cc base/win/registry.cc
index 7b9dcb90e627e..275b60e6c2a28 100644
--- base/win/registry.cc
+++ base/win/registry.cc
@@ -14,6 +14,14 @@
#include <utility>
#include <vector>
+#include "cef/libcef/features/features.h"
+
+#if BUILDFLAG(IS_CEF_SANDBOX_BUILD)
+// Avoid overloads for const std::array in base/ranges/ranges.h that don't
+// compile with MSVC. See issue #3519.
+#define CEF_EXCLUDE_PROBLEMATIC_CONST_ARRAY_OVERLOADS 1
+#endif
+
#include "base/check_op.h"
#include "base/functional/callback.h"
#include "base/notreached.h"

View File

@ -1,8 +1,8 @@
diff --git base/test/BUILD.gn base/test/BUILD.gn diff --git base/test/BUILD.gn base/test/BUILD.gn
index 9cd7f3eaa502f..ed34018fdba6a 100644 index 4c0357370dffc..cdb90b96e1a4a 100644
--- base/test/BUILD.gn --- base/test/BUILD.gn
+++ base/test/BUILD.gn +++ base/test/BUILD.gn
@@ -191,11 +191,6 @@ static_library("test_support") { @@ -190,11 +190,6 @@ static_library("test_support") {
if (enable_base_tracing) { if (enable_base_tracing) {
public_deps += [ "//third_party/perfetto:perfetto_test_support" ] public_deps += [ "//third_party/perfetto:perfetto_test_support" ]
@ -14,7 +14,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644
deps += [ deps += [
":amalgamated_perfetto_sql_stdlib", ":amalgamated_perfetto_sql_stdlib",
":gen_cc_chrome_track_event_descriptor", ":gen_cc_chrome_track_event_descriptor",
@@ -562,7 +557,7 @@ if (enable_base_tracing) { @@ -560,7 +555,7 @@ if (enable_base_tracing) {
# processor depends on dev_sqlite. The two share the same symbols but have # processor depends on dev_sqlite. The two share the same symbols but have
# different implementations, so we need to hide dev_sqlite in this shared # different implementations, so we need to hide dev_sqlite in this shared
# library even in non-component builds to prevent duplicate symbols. # library even in non-component builds to prevent duplicate symbols.
@ -23,7 +23,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644
if (is_ios) { if (is_ios) {
_target_type = "ios_framework_bundle" _target_type = "ios_framework_bundle"
} }
@@ -571,6 +566,8 @@ if (enable_base_tracing) { @@ -569,6 +564,8 @@ if (enable_base_tracing) {
defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] defines = [ "TEST_TRACE_PROCESSOR_IMPL" ]
testonly = true testonly = true
sources = [ sources = [
@ -32,7 +32,7 @@ index 9cd7f3eaa502f..ed34018fdba6a 100644
"test_trace_processor_export.h", "test_trace_processor_export.h",
"test_trace_processor_impl.cc", "test_trace_processor_impl.cc",
"test_trace_processor_impl.h", "test_trace_processor_impl.h",
@@ -588,33 +585,6 @@ if (enable_base_tracing) { @@ -586,33 +583,6 @@ if (enable_base_tracing) {
output_name = "TestTraceProcessor" output_name = "TestTraceProcessor"
bundle_deps_filter = [ "//third_party/icu:icudata" ] bundle_deps_filter = [ "//third_party/icu:icudata" ]
} }
@ -88,10 +88,10 @@ index f5191b804bc07..aadb7d66ba4c3 100644
+ +
#endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_ #endif // BASE_TEST_TEST_TRACE_PROCESSOR_EXPORT_H_
diff --git content/shell/BUILD.gn content/shell/BUILD.gn diff --git content/shell/BUILD.gn content/shell/BUILD.gn
index 7579ffdd7302e..0dc2e70f79284 100644 index d04abf8d841cc..61caa4266685b 100644
--- content/shell/BUILD.gn --- content/shell/BUILD.gn
+++ content/shell/BUILD.gn +++ content/shell/BUILD.gn
@@ -841,7 +841,6 @@ if (is_mac) { @@ -878,7 +878,6 @@ if (is_mac) {
# Specify a sensible install_name for static builds. The library is # Specify a sensible install_name for static builds. The library is
# dlopen()ed so this is not used to resolve the module. # dlopen()ed so this is not used to resolve the module.
ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ] ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name" ]

View File

@ -1,5 +1,5 @@
diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h
index 9cd08e8b26410..d2dca33bdc62e 100644 index 103cbab74b515..3b763e5100340 100644
--- third_party/blink/public/web/web_element.h --- third_party/blink/public/web/web_element.h
+++ third_party/blink/public/web/web_element.h +++ third_party/blink/public/web/web_element.h
@@ -82,6 +82,9 @@ class BLINK_EXPORT WebElement : public WebNode { @@ -82,6 +82,9 @@ class BLINK_EXPORT WebElement : public WebNode {
@ -13,7 +13,7 @@ index 9cd08e8b26410..d2dca33bdc62e 100644
// Returns true if the element's contenteditable attribute is in the true // Returns true if the element's contenteditable attribute is in the true
// state or in the plaintext-only state: // state or in the plaintext-only state:
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index 5cc36b7dccab4..05c9a46e3db69 100644 index 3c71a93d1a6ea..df2c5cd35b846 100644
--- third_party/blink/renderer/core/exported/web_element.cc --- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc +++ third_party/blink/renderer/core/exported/web_element.cc
@@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name, @@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name,

View File

@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index 7517bd98e4f7c..6a49e25d63436 100644 index 5daf5aba13046..f0922951ee2b3 100644
--- content/browser/child_process_security_policy_impl.cc --- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc
@@ -1900,6 +1900,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( @@ -1904,6 +1904,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin(
// DeclarativeApiTest.PersistRules. // DeclarativeApiTest.PersistRules.
if (actual_process_lock.matches_scheme(url::kDataScheme)) if (actual_process_lock.matches_scheme(url::kDataScheme))
return true; return true;
@ -20,10 +20,10 @@ index 7517bd98e4f7c..6a49e25d63436 100644
// Make an exception to allow most visited tiles to commit in // Make an exception to allow most visited tiles to commit in
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index b303b8bd70624..d696b002f3179 100644 index 52cdd617511bd..1d52c8473304c 100644
--- content/browser/renderer_host/navigation_request.cc --- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc
@@ -7777,10 +7777,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( @@ -7966,10 +7966,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin = bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin; network::mojom::WebSandboxFlags::kOrigin;
@ -47,7 +47,7 @@ index b303b8bd70624..d696b002f3179 100644
} }
return origin_and_debug_info; return origin_and_debug_info;
@@ -7888,6 +7900,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { @@ -8077,6 +8089,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
DetermineInitiatorRelationship(initiator_rfh, DetermineInitiatorRelationship(initiator_rfh,
frame_tree_node_->current_frame_host())); frame_tree_node_->current_frame_host()));

View File

@ -1,10 +1,10 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 3c7b4d82d0b46..7f890ab3aa546 100644 index bd7dd25175f1e..34f5263fee4fa 100644
--- build/config/compiler/BUILD.gn --- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn
@@ -2195,8 +2195,6 @@ config("thin_archive") { @@ -2182,8 +2182,6 @@ config("thin_archive") {
# confuses lldb. # archives.
if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) {
arflags = [ "-T" ] arflags = [ "-T" ]
- } else if (is_win && use_lld) { - } else if (is_win && use_lld) {
- arflags = [ "/llvmlibthin" ] - arflags = [ "/llvmlibthin" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index e9c28ab05bd01..9e10f7f5d0d0f 100644 index 5d698b969a134..ffddbc4db780b 100644
--- chrome/browser/BUILD.gn --- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@ -10,7 +10,7 @@ index e9c28ab05bd01..9e10f7f5d0d0f 100644
import("//chrome/browser/buildflags.gni") import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
@@ -2042,6 +2043,7 @@ static_library("browser") { @@ -2050,6 +2051,7 @@ static_library("browser") {
"//build/config/chromebox_for_meetings:buildflags", "//build/config/chromebox_for_meetings:buildflags",
"//build/config/compiler:compiler_buildflags", "//build/config/compiler:compiler_buildflags",
"//cc", "//cc",
@ -18,7 +18,7 @@ index e9c28ab05bd01..9e10f7f5d0d0f 100644
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
@@ -2698,6 +2700,10 @@ static_library("browser") { @@ -2707,6 +2709,10 @@ static_library("browser") {
] ]
} }

View File

@ -14,7 +14,7 @@ index 3e7de43022a41..21354d14d11c3 100644
std::unique_ptr<BackgroundModeManager> manager) = 0; std::unique_ptr<BackgroundModeManager> manager) = 0;
#endif #endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 4645aebcfcb1e..3c07c056d7f1f 100644 index 0290ba1dbcbba..d96217c2bb869 100644
--- chrome/browser/browser_process_impl.cc --- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc
@@ -1093,18 +1093,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { @@ -1093,18 +1093,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
@ -38,7 +38,7 @@ index 4645aebcfcb1e..3c07c056d7f1f 100644
std::unique_ptr<BackgroundModeManager> manager) { std::unique_ptr<BackgroundModeManager> manager) {
background_mode_manager_ = std::move(manager); background_mode_manager_ = std::move(manager);
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
index e569e2d1a0dd0..fc5703af98b58 100644 index b303ad32bec66..e85dd8134147e 100644
--- chrome/browser/browser_process_impl.h --- chrome/browser/browser_process_impl.h
+++ chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h
@@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess, @@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess,

View File

@ -13,18 +13,18 @@ index 2480282a19d12..dbd1fbf8a15b5 100644
return false; return false;
} }
diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc
index 8aa2877ee6352..2e015069f0083 100644 index c5eea1036e1eb..d102fff3e9de8 100644
--- chrome/browser/devtools/devtools_window.cc --- chrome/browser/devtools/devtools_window.cc
+++ chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc
@@ -31,6 +31,7 @@ @@ -35,6 +35,7 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/task_manager/web_contents_tags.h" #include "chrome/browser/task_manager/web_contents_tags.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h" +#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
@@ -1193,6 +1194,13 @@ DevToolsWindow* DevToolsWindow::Create( @@ -1223,6 +1224,13 @@ DevToolsWindow* DevToolsWindow::Create(
!browser->is_type_normal()) { !browser->is_type_normal()) {
can_dock = false; can_dock = false;
} }
@ -38,7 +38,7 @@ index 8aa2877ee6352..2e015069f0083 100644
} }
// Create WebContents with devtools. // Create WebContents with devtools.
@@ -1800,12 +1808,29 @@ void DevToolsWindow::CreateDevToolsBrowser() { @@ -1845,12 +1853,29 @@ void DevToolsWindow::CreateDevToolsBrowser() {
Browser::CreationStatus::kOk) { Browser::CreationStatus::kOk) {
return; return;
} }
@ -75,7 +75,7 @@ index 8aa2877ee6352..2e015069f0083 100644
} }
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 768e11b9e5648..b4ba1800def14 100644 index 3fe3d6eddbf01..b1549c86523be 100644
--- chrome/browser/ui/BUILD.gn --- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") @@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni")
@ -86,7 +86,7 @@ index 768e11b9e5648..b4ba1800def14 100644
import("//chrome/browser/buildflags.gni") import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni") import("//chromeos/ash/components/assistant/assistant.gni")
@@ -386,6 +387,10 @@ static_library("ui") { @@ -393,6 +394,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wexit_time_destructors",
] ]
@ -97,7 +97,7 @@ index 768e11b9e5648..b4ba1800def14 100644
# Since browser and browser_ui actually depend on each other, # Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser. # we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less # However, this means browser_ui and browser should more or less
@@ -411,6 +416,7 @@ static_library("ui") { @@ -418,6 +423,7 @@ static_library("ui") {
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//build/config/chromebox_for_meetings:buildflags", "//build/config/chromebox_for_meetings:buildflags",
"//cc/paint", "//cc/paint",
@ -105,7 +105,7 @@ index 768e11b9e5648..b4ba1800def14 100644
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
"//chrome/app:chrome_dll_resources", "//chrome/app:chrome_dll_resources",
@@ -2901,6 +2907,8 @@ static_library("ui") { @@ -2936,6 +2942,8 @@ static_library("ui") {
"views/apps/app_dialog/app_block_dialog_view.h", "views/apps/app_dialog/app_block_dialog_view.h",
"views/apps/app_dialog/app_pause_dialog_view.cc", "views/apps/app_dialog/app_pause_dialog_view.cc",
"views/apps/app_dialog/app_pause_dialog_view.h", "views/apps/app_dialog/app_pause_dialog_view.h",
@ -114,7 +114,7 @@ index 768e11b9e5648..b4ba1800def14 100644
"views/apps/app_info_dialog/arc_app_info_links_panel.cc", "views/apps/app_info_dialog/arc_app_info_links_panel.cc",
"views/apps/app_info_dialog/arc_app_info_links_panel.h", "views/apps/app_info_dialog/arc_app_info_links_panel.h",
"views/apps/chrome_app_window_client_views_chromeos.cc", "views/apps/chrome_app_window_client_views_chromeos.cc",
@@ -4941,8 +4949,6 @@ static_library("ui") { @@ -4996,8 +5004,6 @@ static_library("ui") {
"views/accessibility/theme_tracking_non_accessible_image_view.h", "views/accessibility/theme_tracking_non_accessible_image_view.h",
"views/apps/app_dialog/app_dialog_view.cc", "views/apps/app_dialog/app_dialog_view.cc",
"views/apps/app_dialog/app_dialog_view.h", "views/apps/app_dialog/app_dialog_view.h",
@ -123,7 +123,7 @@ index 768e11b9e5648..b4ba1800def14 100644
"views/apps/app_info_dialog/app_info_dialog_container.cc", "views/apps/app_info_dialog/app_info_dialog_container.cc",
"views/apps/app_info_dialog/app_info_dialog_container.h", "views/apps/app_info_dialog/app_info_dialog_container.h",
"views/apps/app_info_dialog/app_info_dialog_views.cc", "views/apps/app_info_dialog/app_info_dialog_views.cc",
@@ -6740,6 +6746,7 @@ static_library("ui") { @@ -6813,6 +6819,7 @@ static_library("ui") {
if (enable_printing) { if (enable_printing) {
deps += [ deps += [
"//components/printing/browser", "//components/printing/browser",
@ -132,7 +132,7 @@ index 768e11b9e5648..b4ba1800def14 100644
] ]
} }
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index 0791cc8f55a92..df3fb31c5c787 100644 index 3d985470f60d1..762f0e827d53e 100644
--- chrome/browser/ui/browser.cc --- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc
@@ -264,6 +264,25 @@ @@ -264,6 +264,25 @@
@ -194,7 +194,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
void Browser::FullscreenTopUIStateChanged() { void Browser::FullscreenTopUIStateChanged() {
@@ -1449,6 +1480,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( @@ -1451,6 +1482,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event)) if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED; return content::KeyboardEventProcessingResult::HANDLED;
@ -209,7 +209,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
return window()->PreHandleKeyboardEvent(event); return window()->PreHandleKeyboardEvent(event);
} }
@@ -1456,8 +1495,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, @@ -1458,8 +1497,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) { const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window = DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source); DevToolsWindow::GetInstanceForInspectedWebContents(source);
@ -230,7 +230,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
bool Browser::TabsNeedBeforeUnloadFired() const { bool Browser::TabsNeedBeforeUnloadFired() const {
@@ -1660,6 +1709,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, @@ -1658,6 +1707,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
} }
#endif // BUILDFLAG(IS_CHROMEOS_ASH) #endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -245,7 +245,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
NavigateParams nav_params(this, params.url, params.transition); NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source; nav_params.source_contents = source;
@@ -1817,6 +1874,8 @@ void Browser::LoadingStateChanged(WebContents* source, @@ -1815,6 +1872,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) { bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@ -254,7 +254,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
void Browser::CloseContents(WebContents* source) { void Browser::CloseContents(WebContents* source) {
@@ -1845,6 +1904,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { @@ -1843,6 +1902,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
} }
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@ -263,7 +263,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
if (!GetStatusBubble()) if (!GetStatusBubble())
return; return;
@@ -1852,6 +1913,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -1850,6 +1911,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url); GetStatusBubble()->SetURL(url);
} }
@ -281,7 +281,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
void Browser::ContentsMouseEvent(WebContents* source, void Browser::ContentsMouseEvent(WebContents* source,
bool motion, bool motion,
bool exited) { bool exited) {
@@ -1876,6 +1948,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { @@ -1874,6 +1946,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
return false; return false;
} }
@ -301,7 +301,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
void Browser::BeforeUnloadFired(WebContents* web_contents, void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed, bool proceed,
bool* proceed_to_fire_unload) { bool* proceed_to_fire_unload) {
@@ -1975,12 +2060,24 @@ void Browser::WebContentsCreated(WebContents* source_contents, @@ -1973,12 +2058,24 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager. // Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents); task_manager::WebContentsTags::CreateForTabContents(new_contents);
@ -326,7 +326,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
// Don't show the page hung dialog when a HTML popup hangs because // Don't show the page hung dialog when a HTML popup hangs because
// the dialog will take the focus and immediately close the popup. // the dialog will take the focus and immediately close the popup.
RenderWidgetHostView* view = render_widget_host->GetView(); RenderWidgetHostView* view = render_widget_host->GetView();
@@ -1993,6 +2090,13 @@ void Browser::RendererUnresponsive( @@ -1991,6 +2088,13 @@ void Browser::RendererUnresponsive(
void Browser::RendererResponsive( void Browser::RendererResponsive(
WebContents* source, WebContents* source,
content::RenderWidgetHost* render_widget_host) { content::RenderWidgetHost* render_widget_host) {
@ -340,7 +340,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
RenderWidgetHostView* view = render_widget_host->GetView(); RenderWidgetHostView* view = render_widget_host->GetView();
if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) { if (view && !render_widget_host->GetView()->IsHTMLFormPopup()) {
TabDialogs::FromWebContents(source)->HideHungRendererDialog( TabDialogs::FromWebContents(source)->HideHungRendererDialog(
@@ -2119,11 +2223,15 @@ void Browser::EnterFullscreenModeForTab( @@ -2117,11 +2221,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) { const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id); requesting_frame, options.display_id);
@ -356,7 +356,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2322,6 +2430,15 @@ void Browser::RequestMediaAccessPermission( @@ -2321,6 +2429,15 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents, content::WebContents* web_contents,
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) { content::MediaResponseCallback callback) {
@ -372,7 +372,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
const extensions::Extension* extension = const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin); GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -2858,9 +2975,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { @@ -2864,9 +2981,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private): // Browser, Getters for UI (private):
StatusBubble* Browser::GetStatusBubble() { StatusBubble* Browser::GetStatusBubble() {
@ -385,7 +385,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
// We hide the status bar for web apps windows as this matches native // We hide the status bar for web apps windows as this matches native
@@ -2868,6 +2987,12 @@ StatusBubble* Browser::GetStatusBubble() { @@ -2874,6 +2993,12 @@ StatusBubble* Browser::GetStatusBubble() {
// mode, as the minimal browser UI includes the status bar. // mode, as the minimal browser UI includes the status bar.
if (web_app::AppBrowserController::IsWebApp(this) && if (web_app::AppBrowserController::IsWebApp(this) &&
!app_controller()->HasMinimalUiButtons()) { !app_controller()->HasMinimalUiButtons()) {
@ -398,7 +398,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
return nullptr; return nullptr;
} }
@@ -3004,6 +3129,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { @@ -3010,6 +3135,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents); web_contents_collection_.StopObserving(web_contents);
} }
@ -407,7 +407,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
} }
void Browser::TabDetachedAtImpl(content::WebContents* contents, void Browser::TabDetachedAtImpl(content::WebContents* contents,
@@ -3158,6 +3285,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( @@ -3164,6 +3291,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
bool check_can_support) const { bool check_can_support) const {
@ -423,7 +423,7 @@ index 0791cc8f55a92..df3fb31c5c787 100644
case TYPE_NORMAL: case TYPE_NORMAL:
return NormalBrowserSupportsWindowFeature(feature, check_can_support); return NormalBrowserSupportsWindowFeature(feature, check_can_support);
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 36ae82017f790..b0a4be7c1ab32 100644 index 4f393fa78e991..a486d6f7f1571 100644
--- chrome/browser/ui/browser.h --- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
@ -488,7 +488,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644
// Get the FindBarController for this browser, creating it if it does not // Get the FindBarController for this browser, creating it if it does not
// yet exist. // yet exist.
FindBarController* GetFindBarController(); FindBarController* GetFindBarController();
@@ -909,11 +936,19 @@ class Browser : public TabStripModelObserver, @@ -908,11 +935,19 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source, void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override; const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@ -508,7 +508,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644
void BeforeUnloadFired(content::WebContents* source, void BeforeUnloadFired(content::WebContents* source,
bool proceed, bool proceed,
bool* proceed_to_fire_unload) override; bool* proceed_to_fire_unload) override;
@@ -1253,6 +1288,10 @@ class Browser : public TabStripModelObserver, @@ -1252,6 +1287,10 @@ class Browser : public TabStripModelObserver,
// This Browser's window. // This Browser's window.
raw_ptr<BrowserWindow, DanglingUntriaged> window_; raw_ptr<BrowserWindow, DanglingUntriaged> window_;
@ -519,7 +519,7 @@ index 36ae82017f790..b0a4be7c1ab32 100644
std::unique_ptr<TabStripModelDelegate> const tab_strip_model_delegate_; std::unique_ptr<TabStripModelDelegate> const tab_strip_model_delegate_;
std::unique_ptr<TabStripModel> const tab_strip_model_; std::unique_ptr<TabStripModel> const tab_strip_model_;
@@ -1319,6 +1358,8 @@ class Browser : public TabStripModelObserver, @@ -1318,6 +1357,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_; const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_; bool initial_visible_on_all_workspaces_state_;

View File

@ -56,10 +56,10 @@ index 36335ba63ee83..e14005d6a4e86 100644
#if BUILDFLAG(ENABLE_SUPERVISED_USERS) #if BUILDFLAG(ENABLE_SUPERVISED_USERS)
supervised_user::SupervisedUserSettingsService* supervised_service = supervised_user::SupervisedUserSettingsService* supervised_service =
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index 34871864cf8d7..8404bcc4e50dd 100644 index 0ff900e700ba8..ca5b899bece6d 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc --- components/content_settings/renderer/content_settings_agent_impl.cc
+++ components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc
@@ -143,7 +143,7 @@ ContentSetting GetContentSettingFromRules( @@ -148,7 +148,7 @@ ContentSetting GetContentSettingFromRules(
return rule.GetContentSetting(); return rule.GetContentSetting();
} }
} }

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 25f2e8f6c4f09..25c21e4552f8a 100644 index d182bc1b7bff2..e4f54b6d2be24 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc --- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -360,6 +360,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() { @@ -361,6 +361,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get(); return callback.get();
} }
@ -16,7 +16,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644
enum class UmaEnumIdLookupType { enum class UmaEnumIdLookupType {
GeneralEnumId, GeneralEnumId,
ContextSpecificEnumId, ContextSpecificEnumId,
@@ -616,6 +623,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { @@ -618,6 +625,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
return 1; return 1;
@ -27,7 +27,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644
id = CollapseCommandsForUMA(id); id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type); const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id); auto it = map.find(id);
@@ -863,6 +874,14 @@ RenderViewContextMenu::RenderViewContextMenu( @@ -867,6 +878,14 @@ RenderViewContextMenu::RenderViewContextMenu(
pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this); pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@ -42,7 +42,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644
observers_.AddObserver(&autofill_context_menu_manager_); observers_.AddObserver(&autofill_context_menu_manager_);
} }
@@ -1337,6 +1356,12 @@ void RenderViewContextMenu::InitMenu() { @@ -1341,6 +1360,12 @@ void RenderViewContextMenu::InitMenu() {
autofill::PopupHidingReason::kContextMenuOpened); autofill::PopupHidingReason::kContextMenuOpened);
} }
} }
@ -55,7 +55,7 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644
} }
Profile* RenderViewContextMenu::GetProfile() const { Profile* RenderViewContextMenu::GetProfile() const {
@@ -3556,6 +3581,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( @@ -3564,6 +3589,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
execute_plugin_action_callback_ = std::move(cb); execute_plugin_action_callback_ = std::move(cb);
} }
@ -69,10 +69,10 @@ index 25f2e8f6c4f09..25c21e4552f8a 100644
RenderViewContextMenu::GetHandlersForLinkUrl() { RenderViewContextMenu::GetHandlersForLinkUrl() {
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers = custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index e4041eee0e29e..7d5e3aa1d8cfb 100644 index 9634f1d7f3442..1187aec354b15 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h --- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -159,6 +159,12 @@ class RenderViewContextMenu @@ -158,6 +158,12 @@ class RenderViewContextMenu
} }
#endif #endif
@ -85,7 +85,7 @@ index e4041eee0e29e..7d5e3aa1d8cfb 100644
protected: protected:
Profile* GetProfile() const; Profile* GetProfile() const;
@@ -471,6 +477,9 @@ class RenderViewContextMenu @@ -470,6 +476,9 @@ class RenderViewContextMenu
// built. // built.
bool is_protocol_submenu_valid_ = false; bool is_protocol_submenu_valid_ = false;
@ -132,7 +132,7 @@ index c49b49d76d7cc..842a6fae5d8e4 100644
command_executed_ = true; command_executed_ = true;
RecordUsedItem(id); RecordUsedItem(id);
diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h
index 33de73c75ef8c..c0ef8b7f8ba07 100644 index e3e8617aa03b6..9bb486d691582 100644
--- components/renderer_context_menu/render_view_context_menu_base.h --- components/renderer_context_menu/render_view_context_menu_base.h
+++ components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h
@@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, @@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index 25ccc6c633df5..7d439c4d9cc3c 100644 index 4d5299dc12b76..a74d0212d2eb1 100644
--- chrome/browser/file_select_helper.cc --- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@ @@ -20,6 +20,7 @@
@ -10,7 +10,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h" #include "chrome/browser/platform_util.h"
@@ -242,6 +243,13 @@ void FileSelectHelper::OnListFile( @@ -246,6 +247,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog( void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path, const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) { std::vector<ui::SelectedFileInfo> selected_files) {
@ -24,7 +24,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
ShowFolderUploadConfirmationDialog( ShowFolderUploadConfirmationDialog(
path, path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this), base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -326,6 +334,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( @@ -330,6 +338,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
if (AbortIfWebContentsDestroyed()) if (AbortIfWebContentsDestroyed())
return; return;
@ -37,7 +37,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
#if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) #if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS)
enterprise_connectors::ContentAnalysisDelegate::Data data; enterprise_connectors::ContentAnalysisDelegate::Data data;
if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled( if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
@@ -456,7 +470,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { @@ -460,7 +474,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() {
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo> std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
FileSelectHelper::GetFileTypesFromAcceptType( FileSelectHelper::GetFileTypesFromAcceptType(
@ -47,7 +47,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>(); auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>();
if (accept_types.empty()) if (accept_types.empty())
return base_file_type; return base_file_type;
@@ -469,17 +484,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( @@ -473,17 +488,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions = std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back(); &file_type->extensions.back();
@ -73,7 +73,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
} else { } else {
if (!base::IsStringASCII(accept_type)) if (!base::IsStringASCII(accept_type))
continue; continue;
@@ -490,10 +512,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( @@ -494,10 +516,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
description_id = IDS_AUDIO_FILES; description_id = IDS_AUDIO_FILES;
else if (ascii_type == "video/*") else if (ascii_type == "video/*")
description_id = IDS_VIDEO_FILES; description_id = IDS_VIDEO_FILES;
@ -94,7 +94,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
if (extensions->size() > old_extension_size) if (extensions->size() > old_extension_size)
valid_type_count++; valid_type_count++;
} }
@@ -518,6 +548,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( @@ -522,6 +552,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
l10n_util::GetStringUTF16(description_id)); l10n_util::GetStringUTF16(description_id));
} }
@ -110,7 +110,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
return file_type; return file_type;
} }
@@ -525,7 +564,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( @@ -529,7 +568,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser( void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host, content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener, scoped_refptr<content::FileSelectListener> listener,
@ -120,7 +120,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
Profile* profile = Profile::FromBrowserContext( Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext()); render_frame_host->GetProcess()->GetBrowserContext());
@@ -544,6 +584,7 @@ void FileSelectHelper::RunFileChooser( @@ -548,6 +588,7 @@ void FileSelectHelper::RunFileChooser(
// message. // message.
scoped_refptr<FileSelectHelper> file_select_helper( scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile)); new FileSelectHelper(profile));
@ -128,7 +128,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
file_select_helper->RunFileChooser(render_frame_host, std::move(listener), file_select_helper->RunFileChooser(render_frame_host, std::move(listener),
params.Clone()); params.Clone());
} }
@@ -595,7 +636,8 @@ void FileSelectHelper::RunFileChooser( @@ -599,7 +640,8 @@ void FileSelectHelper::RunFileChooser(
} }
void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) { void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) {
@ -139,7 +139,7 @@ index 25ccc6c633df5..7d439c4d9cc3c 100644
params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH
: ui::SelectFileDialog::FileTypeInfo::ANY_PATH; : ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h
index bd975f96585b8..abf0a24222ded 100644 index 7194323c36956..903cdf0c294fc 100644
--- chrome/browser/file_select_helper.h --- chrome/browser/file_select_helper.h
+++ chrome/browser/file_select_helper.h +++ chrome/browser/file_select_helper.h
@@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< @@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@ -152,7 +152,7 @@ index bd975f96585b8..abf0a24222ded 100644
// Enumerates all the files in directory. // Enumerates all the files in directory.
static void EnumerateDirectory( static void EnumerateDirectory(
@@ -262,7 +263,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< @@ -264,7 +265,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// |accept_types| contains only valid lowercased MIME types or file extensions // |accept_types| contains only valid lowercased MIME types or file extensions
// beginning with a period (.). // beginning with a period (.).
static std::unique_ptr<ui::SelectFileDialog::FileTypeInfo> static std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
@ -162,7 +162,7 @@ index bd975f96585b8..abf0a24222ded 100644
// Check the accept type is valid. It is expected to be all lower case with // Check the accept type is valid. It is expected to be all lower case with
// no whitespace. // no whitespace.
@@ -323,6 +325,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< @@ -325,6 +327,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// Set to false in unit tests since there is no WebContents. // Set to false in unit tests since there is no WebContents.
bool abort_on_missing_web_contents_in_tests_ = true; bool abort_on_missing_web_contents_in_tests_ = true;

View File

@ -247,7 +247,7 @@ index 992dbc606ab78..2361727757696 100644
// Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child
// widgets to prevent top-level window behavior (independent movement, etc). // widgets to prevent top-level window behavior (independent movement, etc).
diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h
index 6a2aace29d60d..d6d6292c10487 100644 index bfeb88bc9b666..6dd74a72e20cc 100644
--- ui/views/window/dialog_delegate.h --- ui/views/window/dialog_delegate.h
+++ ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h
@@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { @@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {

View File

@ -77,7 +77,7 @@ index b6afdced9d0af..e189d08ecdd46 100644
} }
diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc
index d6485540139e0..a77c888b2e147 100644 index c75f396997e17..b219e122ffb5c 100644
--- chrome/browser/permissions/permission_manager_factory.cc --- chrome/browser/permissions/permission_manager_factory.cc
+++ chrome/browser/permissions/permission_manager_factory.cc +++ chrome/browser/permissions/permission_manager_factory.cc
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
@ -88,13 +88,14 @@ index d6485540139e0..a77c888b2e147 100644
#include "chrome/browser/background_fetch/background_fetch_permission_context.h" #include "chrome/browser/background_fetch/background_fetch_permission_context.h"
#include "chrome/browser/background_sync/periodic_background_sync_permission_context.h" #include "chrome/browser/background_sync/periodic_background_sync_permission_context.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -62,8 +63,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( @@ -62,9 +63,11 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
std::make_unique<GeolocationPermissionContextDelegate>(profile); std::make_unique<GeolocationPermissionContextDelegate>(profile);
#endif // BUILDFLAG(IS_ANDROID) #endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
+ if (!cef::IsAlloyRuntimeEnabled()) { + if (!cef::IsAlloyRuntimeEnabled()) {
delegates.geolocation_manager = device::GeolocationManager::GetInstance(); delegates.geolocation_system_permission_manager =
DCHECK(delegates.geolocation_manager); device::GeolocationSystemPermissionManager::GetInstance();
DCHECK(delegates.geolocation_system_permission_manager);
+ } + }
#endif #endif
delegates.media_stream_device_enumerator = delegates.media_stream_device_enumerator =
@ -175,7 +176,7 @@ index 07720bc3faccb..546325f2b5558 100644
if (!browser) { if (!browser) {
DLOG(WARNING) << "Permission prompt suppressed because the WebContents is " DLOG(WARNING) << "Permission prompt suppressed because the WebContents is "
diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc
index 402fe1588c459..091625f54b340 100644 index 9c0ec651d494f..e5c6126adeea7 100644
--- components/embedder_support/permission_context_utils.cc --- components/embedder_support/permission_context_utils.cc
+++ components/embedder_support/permission_context_utils.cc +++ components/embedder_support/permission_context_utils.cc
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
@ -186,7 +187,7 @@ index 402fe1588c459..091625f54b340 100644
#include "components/background_sync/background_sync_permission_context.h" #include "components/background_sync/background_sync_permission_context.h"
#include "components/permissions/contexts/accessibility_permission_context.h" #include "components/permissions/contexts/accessibility_permission_context.h"
#include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h" #include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h"
@@ -77,10 +78,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, @@ -79,10 +80,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
std::move(delegates.geolocation_permission_context_delegate), std::move(delegates.geolocation_permission_context_delegate),
is_regular_profile); is_regular_profile);
#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) #elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/policy/browser_dm_token_storage_linux.cc chrome/browser/policy/browser_dm_token_storage_linux.cc diff --git chrome/browser/policy/browser_dm_token_storage_linux.cc chrome/browser/policy/browser_dm_token_storage_linux.cc
index 10085136f52ce..ec1be9babecc2 100644 index 9fef3079833f4..43576d91d53f1 100644
--- chrome/browser/policy/browser_dm_token_storage_linux.cc --- chrome/browser/policy/browser_dm_token_storage_linux.cc
+++ chrome/browser/policy/browser_dm_token_storage_linux.cc +++ chrome/browser/policy/browser_dm_token_storage_linux.cc
@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
@ -33,7 +33,7 @@ index 10085136f52ce..ec1be9babecc2 100644
} }
diff --git chrome/browser/policy/browser_dm_token_storage_mac.mm chrome/browser/policy/browser_dm_token_storage_mac.mm diff --git chrome/browser/policy/browser_dm_token_storage_mac.mm chrome/browser/policy/browser_dm_token_storage_mac.mm
index 27af6ec08f593..6dfab7c74e8da 100644 index 27af6ec08f593..156689eec644d 100644
--- chrome/browser/policy/browser_dm_token_storage_mac.mm --- chrome/browser/policy/browser_dm_token_storage_mac.mm
+++ chrome/browser/policy/browser_dm_token_storage_mac.mm +++ chrome/browser/policy/browser_dm_token_storage_mac.mm
@@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
@ -44,7 +44,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
namespace policy { namespace policy {
@@ -47,11 +48,6 @@ const char kEnrollmentOptionsFilePath[] = FILE_PATH_LITERAL( @@ -47,11 +48,6 @@
"/Library/Google/Chrome/CloudManagementEnrollmentOptions"); "/Library/Google/Chrome/CloudManagementEnrollmentOptions");
const char kEnrollmentMandatoryOption[] = "Mandatory"; const char kEnrollmentMandatoryOption[] = "Mandatory";
@ -90,7 +90,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644
+ ChromeBrowserPolicyConnector::GetBundleId()); + ChromeBrowserPolicyConnector::GetBundleId());
+ CFStringRef bundle_id = bundle_id_scoper.get(); + CFStringRef bundle_id = bundle_id_scoper.get();
+ if (!bundle_id) { + if (!bundle_id) {
+ return absl::nullopt; + return std::optional<bool>();
+ } + }
+ +
base::apple::ScopedCFTypeRef<CFPropertyListRef> value( base::apple::ScopedCFTypeRef<CFPropertyListRef> value(
@ -105,7 +105,7 @@ index 27af6ec08f593..6dfab7c74e8da 100644
} }
diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc
index 8824abb401188..687e667e4b942 100644 index 50f1b5313ce45..687e667e4b942 100644
--- chrome/browser/policy/chrome_browser_policy_connector.cc --- chrome/browser/policy/chrome_browser_policy_connector.cc
+++ chrome/browser/policy/chrome_browser_policy_connector.cc +++ chrome/browser/policy/chrome_browser_policy_connector.cc
@@ -13,11 +13,14 @@ @@ -13,11 +13,14 @@
@ -209,7 +209,7 @@ index 8824abb401188..687e667e4b942 100644
base::flat_set<std::string> base::flat_set<std::string>
ChromeBrowserPolicyConnector::device_affiliation_ids() const { ChromeBrowserPolicyConnector::device_affiliation_ids() const {
#if BUILDFLAG(IS_CHROMEOS_LACROS) #if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -349,23 +424,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { @@ -349,25 +424,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() {
std::unique_ptr<ConfigurationPolicyProvider> std::unique_ptr<ConfigurationPolicyProvider>
ChromeBrowserPolicyConnector::CreatePlatformProvider() { ChromeBrowserPolicyConnector::CreatePlatformProvider() {
#if BUILDFLAG(IS_WIN) #if BUILDFLAG(IS_WIN)
@ -230,6 +230,8 @@ index 8824abb401188..687e667e4b942 100644
- // app's bundle ID actually is. All channels of Chrome should obey the same - // app's bundle ID actually is. All channels of Chrome should obey the same
- // policies. - // policies.
- CFStringRef bundle_id = CFSTR("com.google.Chrome"); - CFStringRef bundle_id = CFSTR("com.google.Chrome");
-#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)
- CFStringRef bundle_id = CFSTR("com.google.ChromeForTesting");
-#else -#else
- base::apple::ScopedCFTypeRef<CFStringRef> bundle_id_scoper = - base::apple::ScopedCFTypeRef<CFStringRef> bundle_id_scoper =
- base::SysUTF8ToCFStringRef(base::apple::BaseBundleID()); - base::SysUTF8ToCFStringRef(base::apple::BaseBundleID());
@ -242,7 +244,7 @@ index 8824abb401188..687e667e4b942 100644
auto loader = std::make_unique<PolicyLoaderMac>( auto loader = std::make_unique<PolicyLoaderMac>(
base::ThreadPool::CreateSequencedTaskRunner( base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT}), {base::MayBlock(), base::TaskPriority::BEST_EFFORT}),
@@ -375,7 +449,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { @@ -377,7 +449,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() {
std::move(loader)); std::move(loader));
#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
base::FilePath config_dir_path; base::FilePath config_dir_path;
@ -304,7 +306,7 @@ index 1a2e78c3472ec..5d1bd95a15113 100644
#include "components/policy/policy_constants.h" #include "components/policy/policy_constants.h"
namespace policy::path_parser { namespace policy::path_parser {
@@ -97,16 +98,12 @@ base::FilePath::StringType ExpandPathVariables( @@ -97,16 +98,12 @@
void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { void CheckUserDataDirPolicy(base::FilePath* user_data_dir) {
// Since the configuration management infrastructure is not initialized when // Since the configuration management infrastructure is not initialized when
// this code runs, read the policy preference directly. // this code runs, read the policy preference directly.
@ -390,10 +392,10 @@ index 4cde94111918e..aaf8245abd9a6 100644
// policy files that allow sys-admins // policy files that allow sys-admins
// to set policies for chrome. This directory // to set policies for chrome. This directory
diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py
index d225da88a04fb..191bb6b56df40 100755 index e5efa52a8467f..37253ef517bfa 100755
--- components/policy/tools/generate_policy_source.py --- components/policy/tools/generate_policy_source.py
+++ components/policy/tools/generate_policy_source.py +++ components/policy/tools/generate_policy_source.py
@@ -448,6 +448,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, @@ -449,6 +449,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups,
#include <cstdint> #include <cstdint>
#include <string> #include <string>
@ -401,7 +403,7 @@ index d225da88a04fb..191bb6b56df40 100755
#include "components/policy/core/common/policy_details.h" #include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_map.h"
@@ -470,9 +471,11 @@ struct SchemaData; @@ -471,9 +472,11 @@ struct SchemaData;
''') ''')
if target_platform == 'win': if target_platform == 'win':
@ -415,7 +417,7 @@ index d225da88a04fb..191bb6b56df40 100755
f.write('''#if BUILDFLAG(IS_CHROMEOS) f.write('''#if BUILDFLAG(IS_CHROMEOS)
// Sets default profile policies values for enterprise users. // Sets default profile policies values for enterprise users.
@@ -1115,12 +1118,14 @@ namespace policy { @@ -1116,7 +1119,8 @@ namespace policy {
f.write('} // namespace\n\n') f.write('} // namespace\n\n')
if target_platform == 'win': if target_platform == 'win':
@ -424,6 +426,8 @@ index d225da88a04fb..191bb6b56df40 100755
+ '#if BUILDFLAG(GOOGLE_CHROME_BRANDING)\n' + '#if BUILDFLAG(GOOGLE_CHROME_BRANDING)\n'
'const wchar_t kRegistryChromePolicyKey[] = ' 'const wchar_t kRegistryChromePolicyKey[] = '
'L"' + CHROME_POLICY_KEY + '";\n' 'L"' + CHROME_POLICY_KEY + '";\n'
'#elif BUILDFLAG(GOOGLE_CHROME_FOR_TESTING_BRANDING)\n'
@@ -1125,6 +1129,7 @@ namespace policy {
'#else\n' '#else\n'
'const wchar_t kRegistryChromePolicyKey[] = ' 'const wchar_t kRegistryChromePolicyKey[] = '
'L"' + CHROMIUM_POLICY_KEY + '";\n' 'L"' + CHROMIUM_POLICY_KEY + '";\n'

View File

@ -44,7 +44,7 @@ index caa20ec03434a..2a3ca921445c1 100644
avatar_toolbar_button, GetBrowser().profile(), type); avatar_toolbar_button, GetBrowser().profile(), type);
DCHECK_EQ(nullptr, bubble_tracker_.view()); DCHECK_EQ(nullptr, bubble_tracker_.view());
diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
index e2dc163557bca..3c56bbc2881cc 100644 index 791ab794c8750..ca9e0851e2689 100644
--- chrome/browser/ui/views/profiles/incognito_menu_view.cc --- chrome/browser/ui/views/profiles/incognito_menu_view.cc
+++ chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc
@@ -36,7 +36,9 @@ @@ -36,7 +36,9 @@
@ -55,9 +55,9 @@ index e2dc163557bca..3c56bbc2881cc 100644
+ DCHECK(browser->profile()->IsIncognitoProfile() || + DCHECK(browser->profile()->IsIncognitoProfile() ||
+ (browser->profile()->IsOffTheRecord() && + (browser->profile()->IsOffTheRecord() &&
+ browser->profile()->GetOTRProfileID().IsUniqueForCEF())); + browser->profile()->GetOTRProfileID().IsUniqueForCEF()));
GetViewAccessibility().OverrideName(GetAccessibleWindowTitle()); GetViewAccessibility().SetName(GetAccessibleWindowTitle(),
ax::mojom::NameFrom::kAttribute);
base::RecordAction(base::UserMetricsAction("IncognitoMenu_Show"));
diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
index 38e38d6eabc85..0856ae8d5f5ff 100644 index 38e38d6eabc85..0856ae8d5f5ff 100644
--- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc

View File

@ -52,10 +52,10 @@ index 2ec2a791c4943..8573cac4111d6 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix); return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 4bf4b36f01890..b8a966db377db 100644 index 3d5b457eeca11..c7d37503a0fef 100644
--- chrome/browser/profiles/profile.h --- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h
@@ -103,6 +103,10 @@ class Profile : public content::BrowserContext { @@ -94,6 +94,10 @@ class Profile : public content::BrowserContext {
// be applicable to run. Please see crbug.com/1098697#c3 for more details. // be applicable to run. Please see crbug.com/1098697#c3 for more details.
static OTRProfileID CreateUnique(const std::string& profile_id_prefix); static OTRProfileID CreateUnique(const std::string& profile_id_prefix);
@ -66,7 +66,7 @@ index 4bf4b36f01890..b8a966db377db 100644
// Creates a unique OTR profile id to be used for DevTools browser contexts. // Creates a unique OTR profile id to be used for DevTools browser contexts.
static OTRProfileID CreateUniqueForDevTools(); static OTRProfileID CreateUniqueForDevTools();
@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext { @@ -511,6 +515,8 @@ class Profile : public content::BrowserContext {
return instant_service_; return instant_service_;
} }
@ -75,7 +75,7 @@ index 4bf4b36f01890..b8a966db377db 100644
protected: protected:
// Creates an OffTheRecordProfile which points to this Profile. // Creates an OffTheRecordProfile which points to this Profile.
static std::unique_ptr<Profile> CreateOffTheRecordProfile( static std::unique_ptr<Profile> CreateOffTheRecordProfile(
@@ -533,7 +539,6 @@ class Profile : public content::BrowserContext { @@ -522,7 +528,6 @@ class Profile : public content::BrowserContext {
static PrefStore* CreateExtensionPrefStore(Profile*, static PrefStore* CreateExtensionPrefStore(Profile*,
bool incognito_pref_store); bool incognito_pref_store);
@ -84,10 +84,10 @@ index 4bf4b36f01890..b8a966db377db 100644
// Returns whether the user has signed in this profile to an account. // Returns whether the user has signed in this profile to an account.
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 669c8ab31a549..eff71491eacfd 100644 index 98bfbc0f96140..de7919947e356 100644
--- chrome/browser/profiles/profile_impl.cc --- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc
@@ -1036,7 +1036,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, @@ -1043,7 +1043,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile); otr_profiles_[otr_profile_id] = std::move(otr_profile);
@ -99,10 +99,10 @@ index 669c8ab31a549..eff71491eacfd 100644
return raw_otr_profile; return raw_otr_profile;
} }
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index d6c0c3c9d5ad9..22bc9a7cf65f7 100644 index 3db592470f262..75bfc32b6511b 100644
--- chrome/browser/profiles/profile_manager.cc --- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc
@@ -438,7 +438,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) @@ -437,7 +437,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
profile_manager_android_ = std::make_unique<ProfileManagerAndroid>(this); profile_manager_android_ = std::make_unique<ProfileManagerAndroid>(this);
#endif #endif
@ -134,7 +134,7 @@ index 3d5fd0d5ca858..965ab69b3fe8f 100644
// Returns the directory where the first created profile is stored, // Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use. // relative to the user data directory currently in use.
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
index 7b1fb9863deb6..d2821d03c4238 100644 index 0d1d2e3661ff1..a97322b1d991d 100644
--- chrome/browser/profiles/renderer_updater.cc --- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
@ -145,7 +145,7 @@ index 7b1fb9863deb6..d2821d03c4238 100644
#include "chrome/browser/content_settings/content_settings_manager_delegate.h" #include "chrome/browser/content_settings/content_settings_manager_delegate.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
@@ -46,11 +47,14 @@ RendererUpdater::RendererUpdater(Profile* profile) @@ -45,6 +46,7 @@ RendererUpdater::RendererUpdater(Profile* profile)
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS) #if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
, ,
bound_session_cookie_refresh_service_( bound_session_cookie_refresh_service_(
@ -153,13 +153,6 @@ index 7b1fb9863deb6..d2821d03c4238 100644
BoundSessionCookieRefreshServiceFactory::GetForProfile(profile)) BoundSessionCookieRefreshServiceFactory::GetForProfile(profile))
#endif #endif
{ {
+ if (!cef::IsAlloyRuntimeEnabled()) {
identity_manager_observation_.Observe(
IdentityManagerFactory::GetForProfile(original_profile_));
+ }
#if BUILDFLAG(IS_CHROMEOS_ASH)
oauth2_login_manager_ =
diff --git chrome/browser/profiles/renderer_updater_factory.cc chrome/browser/profiles/renderer_updater_factory.cc diff --git chrome/browser/profiles/renderer_updater_factory.cc chrome/browser/profiles/renderer_updater_factory.cc
index ed5b366aa47ab..58ebe795e4636 100644 index ed5b366aa47ab..58ebe795e4636 100644
--- chrome/browser/profiles/renderer_updater_factory.cc --- chrome/browser/profiles/renderer_updater_factory.cc

Some files were not shown because too many files have changed in this diff Show More