From 4b3c3132cbaf6176d4bcc0cbe90db66fe99ad077 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Tue, 4 Apr 2023 14:00:13 -0400 Subject: [PATCH] Update to Chromium version 113.0.5672.0 (#1121455) --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- libcef/browser/alloy/alloy_browser_main.cc | 4 +- .../alloy/alloy_content_browser_client.cc | 7 +- .../alloy/chrome_browser_process_alloy.cc | 17 ++- .../alloy/chrome_browser_process_alloy.h | 5 +- .../browser/extensions/api/tabs/tabs_api.cc | 34 ++--- .../extensions/extension_function_details.cc | 2 +- libcef/browser/main_runner.cc | 6 +- .../browser_platform_delegate_native_mac.mm | 4 +- libcef/browser/prefs/browser_prefs.cc | 12 +- .../alloy/alloy_main_runner_delegate.cc | 3 +- .../common/alloy/alloy_main_runner_delegate.h | 2 +- .../chrome/chrome_main_runner_delegate.cc | 11 ++ .../chrome/chrome_main_runner_delegate.h | 1 + libcef/common/main_runner_delegate.h | 2 +- libcef/renderer/v8_impl.cc | 117 +++++++--------- patch/patch.cfg | 20 +-- patch/patches/base_command_line_1872.patch | 10 +- patch/patches/base_logging_4294575.patch | 20 --- patch/patches/base_sandbox_2743.patch | 17 +-- patch/patches/browser_scheduler.patch | 4 +- .../browser_security_policy_1081397.patch | 8 +- patch/patches/build.patch | 4 +- patch/patches/chrome_browser.patch | 8 +- ...rome_browser_background_mode_1100085.patch | 12 +- patch/patches/chrome_browser_browser.patch | 62 ++++----- .../chrome_browser_context_menus.patch | 18 +-- .../chrome_browser_dialogs_native.patch | 2 +- .../chrome_browser_dialogs_widget.patch | 4 +- patch/patches/chrome_browser_net_proxy.patch | 8 +- .../chrome_browser_permission_prompt.patch | 23 ++-- .../patches/chrome_browser_profile_menu.patch | 2 +- patch/patches/chrome_browser_profiles.patch | 14 +- .../chrome_browser_safe_browsing.patch | 2 +- patch/patches/chrome_browser_themes.patch | 2 +- patch/patches/chrome_plugins.patch | 10 +- patch/patches/chrome_renderer.patch | 2 +- patch/patches/chrome_runtime.patch | 103 ++++++++------ patch/patches/chrome_runtime_views.patch | 127 ++++++++++-------- patch/patches/component_build.patch | 10 +- patch/patches/content_2015.patch | 40 +++--- patch/patches/content_main_654986.patch | 10 +- patch/patches/crashpad_tp_1995.patch | 6 +- patch/patches/embedder_product_override.patch | 2 +- patch/patches/extensions_1947.patch | 4 +- patch/patches/gn_config.patch | 35 ++--- patch/patches/gpu_test_trace_4401670.patch | 23 ++++ patch/patches/gritsettings.patch | 4 +- patch/patches/linux_blink_thread_local.patch | 2 +- patch/patches/linux_bluetooth_1319006.patch | 2 +- patch/patches/linux_printing_context.patch | 16 +-- patch/patches/mac_gpu.patch | 18 --- patch/patches/message_loop.patch | 8 +- patch/patches/metrics_system_profile.patch | 30 +++++ patch/patches/net_cookie_flags.patch | 4 +- patch/patches/osr_fling_2745.patch | 6 +- patch/patches/print_preview_123.patch | 28 +--- patch/patches/printing_context_2196.patch | 4 +- patch/patches/renderer_host_1070713.patch | 2 +- patch/patches/rlz_tracker_4294854.patch | 36 ----- patch/patches/runhooks.patch | 6 +- patch/patches/rwh_background_color_1984.patch | 4 +- patch/patches/services_network_2622.patch | 41 +++--- patch/patches/services_network_2718.patch | 10 +- patch/patches/storage_incognito_2289.patch | 4 +- patch/patches/trace_event.patch | 4 +- patch/patches/views_1749_2102_3330.patch | 82 +++++------ patch/patches/views_widget.patch | 36 ++--- patch/patches/viz_osr_2575.patch | 6 +- patch/patches/web_contents_1257_1565.patch | 30 ++--- patch/patches/webkit_plugin_info_2015.patch | 6 +- patch/patches/webkit_popups.patch | 16 +-- patch/patches/webui_2037.patch | 8 +- patch/patches/win_sandbox_3210.patch | 4 +- tests/ceftests/cors_unittest.cc | 2 +- tools/gn_args.py | 2 - 76 files changed, 617 insertions(+), 645 deletions(-) delete mode 100644 patch/patches/base_logging_4294575.patch create mode 100644 patch/patches/gpu_test_trace_4401670.patch delete mode 100644 patch/patches/mac_gpu.patch create mode 100644 patch/patches/metrics_system_profile.patch delete mode 100644 patch/patches/rlz_tracker_4294854.patch diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index aad121589..90726748c 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/112.0.5615.0' + 'chromium_checkout': 'refs/tags/113.0.5672.0' } diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index ea51ed452..396533df6 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -74,7 +74,7 @@ #endif #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_LINUX) -#include "components/os_crypt/os_crypt.h" +#include "components/os_crypt/sync/os_crypt.h" #endif #if BUILDFLAG(IS_LINUX) @@ -83,7 +83,7 @@ #include "chrome/browser/ui/views/theme_profile_key.h" #include "chrome/common/chrome_paths.h" #include "chrome/grit/chromium_strings.h" -#include "components/os_crypt/key_storage_config_linux.h" +#include "components/os_crypt/sync/key_storage_config_linux.h" #include "libcef/browser/printing/print_dialog_linux.h" #include "ui/base/cursor/cursor_factory.h" #include "ui/base/ime/input_method.h" diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index a5659fc33..b76b91799 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -89,6 +89,7 @@ #include "components/pdf/browser/pdf_url_loader_request_interceptor.h" #include "components/pdf/browser/pdf_web_contents_helper.h" #include "components/pdf/common/internal_plugin_helpers.h" +#include "components/policy/core/common/policy_pref_names.h" #include "components/spellcheck/common/spellcheck.mojom.h" #include "components/version_info/version_info.h" #include "content/browser/plugin_service_impl.h" @@ -923,8 +924,10 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles( Profile* profile = Profile::FromBrowserContext(browser_context); chrome::mojom::DynamicParams dynamic_params = { - profile->GetPrefs()->GetBoolean(prefs::kForceGoogleSafeSearch), - profile->GetPrefs()->GetInteger(prefs::kForceYouTubeRestrict), + profile->GetPrefs()->GetBoolean( + policy::policy_prefs::kForceGoogleSafeSearch), + profile->GetPrefs()->GetInteger( + policy::policy_prefs::kForceYouTubeRestrict), profile->GetPrefs()->GetString(prefs::kAllowedDomainsForApps)}; result.push_back( std::make_unique(std::move(dynamic_params))); diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index ef9d06261..4b72f91c8 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -32,6 +32,7 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/common/content_switches.h" #include "net/log/net_log_capture_mode.h" +#include "services/device/public/cpp/geolocation/geolocation_manager.h" #include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/shared_url_loader_factory.h" @@ -143,6 +144,11 @@ void ChromeBrowserProcessAlloy::FlushLocalStateAndReply( NOTREACHED(); } +device::GeolocationManager* ChromeBrowserProcessAlloy::geolocation_manager() { + NOTREACHED(); + return nullptr; +} + metrics_services_manager::MetricsServicesManager* ChromeBrowserProcessAlloy::GetMetricsServicesManager() { NOTREACHED(); @@ -222,6 +228,11 @@ ChromeBrowserProcessAlloy::notification_platform_bridge() { return nullptr; } +void ChromeBrowserProcessAlloy::SetGeolocationManager( + std::unique_ptr geolocation_manager) { + NOTREACHED(); +} + policy::ChromeBrowserPolicyConnector* ChromeBrowserProcessAlloy::browser_policy_connector() { if (!browser_policy_connector_) { @@ -416,12 +427,6 @@ ChromeBrowserProcessAlloy::hid_policy_allowed_devices() { return nullptr; } -breadcrumbs::BreadcrumbPersistentStorageManager* -ChromeBrowserProcessAlloy::GetBreadcrumbPersistentStorageManager() { - NOTREACHED(); - return nullptr; -} - HidSystemTrayIcon* ChromeBrowserProcessAlloy::hid_system_tray_icon() { NOTREACHED(); return nullptr; diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index 80b3d1068..acd327bd0 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -51,6 +51,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { // BrowserProcess implementation. void EndSession() override; void FlushLocalStateAndReply(base::OnceClosure reply) override; + device::GeolocationManager* geolocation_manager() override; metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() override; metrics::MetricsService* metrics_service() override; @@ -65,6 +66,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { extensions::EventRouterForwarder* extension_event_router_forwarder() override; NotificationUIManager* notification_ui_manager() override; NotificationPlatformBridge* notification_platform_bridge() override; + void SetGeolocationManager( + std::unique_ptr geolocation_manager) override; policy::ChromeBrowserPolicyConnector* browser_policy_connector() override; policy::PolicyService* policy_service() override; IconManager* icon_manager() override; @@ -107,8 +110,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { BuildState* GetBuildState() override; SerialPolicyAllowedPorts* serial_policy_allowed_ports() override; HidPolicyAllowedDevices* hid_policy_allowed_devices() override; - breadcrumbs::BreadcrumbPersistentStorageManager* - GetBreadcrumbPersistentStorageManager() override; HidSystemTrayIcon* hid_system_tray_icon() override; private: diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index 3383ff974..32c028f48 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -69,9 +69,9 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() { TabsCreateFunction::TabsCreateFunction() : cef_details_(this) {} ExtensionFunction::ResponseAction TabsCreateFunction::Run() { - std::unique_ptr params( - tabs::Create::Params::Create(args())); - EXTENSION_FUNCTION_VALIDATE(params.get()); + absl::optional params = + tabs::Create::Params::Create(args()); + EXTENSION_FUNCTION_VALIDATE(params); CefExtensionFunctionDetails::OpenTabParams options; options.window_id = params->create_properties.window_id; @@ -108,9 +108,9 @@ content::WebContents* BaseAPIFunction::GetWebContents(int tab_id) { } ExtensionFunction::ResponseAction TabsUpdateFunction::Run() { - std::unique_ptr params( - tabs::Update::Params::Create(args())); - EXTENSION_FUNCTION_VALIDATE(params.get()); + absl::optional params = + tabs::Update::Params::Create(args()); + EXTENSION_FUNCTION_VALIDATE(params); tab_id_ = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id_); @@ -195,8 +195,8 @@ bool TabsUpdateFunction::UpdateURL(const std::string& url_string, int tab_id, std::string* error) { GURL url; - auto url_expected = - ExtensionTabUtil::PrepareURLForNavigation(url_string, extension()); + auto url_expected = ExtensionTabUtil::PrepareURLForNavigation( + url_string, extension(), browser_context()); if (url_expected.has_value()) { url = *url_expected; } else { @@ -278,7 +278,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { return set_init_result(VALIDATION_FAILURE); } std::unique_ptr details(new InjectDetails()); - if (!InjectDetails::Populate(details_value, details.get())) { + if (!InjectDetails::Populate(details_value.GetDict(), *details)) { return set_init_result(VALIDATION_FAILURE); } @@ -419,8 +419,8 @@ bool TabsRemoveCSSFunction::ShouldRemoveCSS() const { } ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { - std::unique_ptr params( - tabs::SetZoom::Params::Create(args())); + absl::optional params = + tabs::SetZoom::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; @@ -451,8 +451,8 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { } ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { - std::unique_ptr params( - tabs::GetZoom::Params::Create(args())); + absl::optional params = + tabs::GetZoom::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; @@ -471,8 +471,8 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { using api::tabs::ZoomSettings; - std::unique_ptr params( - tabs::SetZoomSettings::Params::Create(args())); + absl::optional params = + tabs::SetZoomSettings::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; @@ -522,8 +522,8 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { } ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() { - std::unique_ptr params( - tabs::GetZoomSettings::Params::Create(args())); + absl::optional params = + tabs::GetZoomSettings::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; diff --git a/libcef/browser/extensions/extension_function_details.cc b/libcef/browser/extensions/extension_function_details.cc index c07082829..efed281fb 100644 --- a/libcef/browser/extensions/extension_function_details.cc +++ b/libcef/browser/extensions/extension_function_details.cc @@ -325,7 +325,7 @@ std::unique_ptr CefExtensionFunctionDetails::OpenTab( GURL url; if (params.url.has_value()) { auto url_expected = ExtensionTabUtil::PrepareURLForNavigation( - *params.url, function()->extension()); + *params.url, function()->extension(), function()->browser_context()); if (url_expected.has_value()) { url = *url_expected; } else { diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 82916923e..2b3485b2e 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -385,9 +385,13 @@ int CefMainRunner::ContentMainInitialize(const CefMainArgs& args, bool CefMainRunner::ContentMainRun(bool* initialized, base::OnceClosure context_initialized) { - main_delegate_->BeforeMainThreadRun(); + main_delegate_->BeforeMainThreadRun(multi_threaded_message_loop_); if (multi_threaded_message_loop_) { + // Detach the CommandLine from the main thread so that it can be + // attached and modified from the UI thread going forward. + base::CommandLine::ForCurrentProcess()->DetachFromCurrentSequence(); + base::WaitableEvent uithread_startup_event( base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED); diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index 92d93c0df..8f1a8ddd3 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -23,7 +23,6 @@ #include "third_party/blink/public/common/input/web_input_event.h" #include "third_party/blink/public/common/input/web_mouse_event.h" #include "third_party/blink/public/common/input/web_mouse_wheel_event.h" -#import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "ui/display/screen.h" #include "ui/events/base_event_utils.h" @@ -439,8 +438,7 @@ gfx::Point CefBrowserPlatformDelegateNativeMac::GetScreenPoint( NSPoint view_pt = {static_cast(view.x()), bounds.size.height - static_cast(view.y())}; NSPoint window_pt = [nsview convertPoint:view_pt toView:nil]; - NSPoint screen_pt = - ui::ConvertPointFromWindowToScreen([nsview window], window_pt); + NSPoint screen_pt = [[nsview window] convertPointToScreen:window_pt]; return gfx::Point(screen_pt.x, screen_pt.y); } return gfx::Point(); diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 627ea0f29..a43767d26 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -35,7 +35,6 @@ #include "chrome/browser/ui/webui/print_preview/policy_settings.h" #include "chrome/common/buildflags.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/safe_search_util.h" #include "chrome/common/pref_names.h" #include "chrome/grit/locale_settings.h" #include "components/certificate_transparency/pref_names.h" @@ -48,6 +47,7 @@ #include "components/language/core/browser/language_prefs.h" #include "components/language/core/browser/pref_names.h" #include "components/permissions/permission_actions_history.h" +#include "components/policy/core/common/policy_pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/json_pref_store.h" #include "components/prefs/pref_filter.h" @@ -57,6 +57,7 @@ #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" #include "components/safe_browsing/core/common/safe_browsing_prefs.h" +#include "components/safe_search_api/safe_search_util.h" #include "components/spellcheck/browser/pref_names.h" #include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable_factory.h" @@ -69,7 +70,7 @@ #include "ui/base/ui_base_switches.h" #if BUILDFLAG(IS_WIN) -#include "components/os_crypt/os_crypt.h" +#include "components/os_crypt/sync/os_crypt.h" #endif #if BUILDFLAG(ENABLE_SUPERVISED_USERS) @@ -281,9 +282,10 @@ std::unique_ptr CreatePrefService(Profile* profile, // Print preferences. // Based on ProfileImpl::RegisterProfilePrefs. - registry->RegisterBooleanPref(prefs::kForceGoogleSafeSearch, false); - registry->RegisterIntegerPref(prefs::kForceYouTubeRestrict, - safe_search_util::YOUTUBE_RESTRICT_OFF); + registry->RegisterBooleanPref(policy::policy_prefs::kForceGoogleSafeSearch, + false); + registry->RegisterIntegerPref(policy::policy_prefs::kForceYouTubeRestrict, + safe_search_api::YOUTUBE_RESTRICT_OFF); registry->RegisterStringPref(prefs::kAllowedDomainsForApps, std::string()); registry->RegisterBooleanPref(prefs::kPrintingEnabled, true); registry->RegisterBooleanPref(prefs::kPrintPreviewDisabled, diff --git a/libcef/common/alloy/alloy_main_runner_delegate.cc b/libcef/common/alloy/alloy_main_runner_delegate.cc index 117c63fcd..883a2eaf3 100644 --- a/libcef/common/alloy/alloy_main_runner_delegate.cc +++ b/libcef/common/alloy/alloy_main_runner_delegate.cc @@ -32,7 +32,8 @@ void AlloyMainRunnerDelegate::BeforeMainThreadInitialize( g_browser_process = new ChromeBrowserProcessAlloy(); } -void AlloyMainRunnerDelegate::BeforeMainThreadRun() { +void AlloyMainRunnerDelegate::BeforeMainThreadRun( + bool multi_threaded_message_loop) { static_cast(g_browser_process)->Initialize(); } diff --git a/libcef/common/alloy/alloy_main_runner_delegate.h b/libcef/common/alloy/alloy_main_runner_delegate.h index 0b774647c..a256f9600 100644 --- a/libcef/common/alloy/alloy_main_runner_delegate.h +++ b/libcef/common/alloy/alloy_main_runner_delegate.h @@ -31,7 +31,7 @@ class AlloyMainRunnerDelegate : public CefMainRunnerDelegate { // CefMainRunnerDelegate overrides. content::ContentMainDelegate* GetContentMainDelegate() override; void BeforeMainThreadInitialize(const CefMainArgs& args) override; - void BeforeMainThreadRun() override; + void BeforeMainThreadRun(bool multi_threaded_message_loop) override; void AfterUIThreadInitialize() override; void AfterUIThreadShutdown() override; void BeforeMainThreadShutdown() override; diff --git a/libcef/common/chrome/chrome_main_runner_delegate.cc b/libcef/common/chrome/chrome_main_runner_delegate.cc index 57a92d931..2413c2276 100644 --- a/libcef/common/chrome/chrome_main_runner_delegate.cc +++ b/libcef/common/chrome/chrome_main_runner_delegate.cc @@ -15,6 +15,7 @@ #include "chrome/common/profiler/main_thread_stack_sampling_profiler.h" #include "components/keep_alive_registry/keep_alive_types.h" #include "components/keep_alive_registry/scoped_keep_alive.h" +#include "components/metrics/persistent_system_profile.h" ChromeMainRunnerDelegate::ChromeMainRunnerDelegate( CefMainRunnerHandler* runner, @@ -42,6 +43,16 @@ void ChromeMainRunnerDelegate::BeforeMainThreadInitialize( #endif } +void ChromeMainRunnerDelegate::BeforeMainThreadRun( + bool multi_threaded_message_loop) { + if (multi_threaded_message_loop) { + // Detach from the main thread so that these objects can be attached and + // modified from the UI thread going forward. + metrics::GlobalPersistentSystemProfile::GetInstance() + ->DetachFromCurrentThread(); + } +} + void ChromeMainRunnerDelegate::BeforeMainMessageLoopRun( base::RunLoop* run_loop) { // The ScopedKeepAlive instance triggers shutdown logic when released on the diff --git a/libcef/common/chrome/chrome_main_runner_delegate.h b/libcef/common/chrome/chrome_main_runner_delegate.h index 970cecd10..13216b207 100644 --- a/libcef/common/chrome/chrome_main_runner_delegate.h +++ b/libcef/common/chrome/chrome_main_runner_delegate.h @@ -33,6 +33,7 @@ class ChromeMainRunnerDelegate : public CefMainRunnerDelegate { // CefMainRunnerDelegate overrides. content::ContentMainDelegate* GetContentMainDelegate() override; void BeforeMainThreadInitialize(const CefMainArgs& args) override; + void BeforeMainThreadRun(bool multi_threaded_message_loop) override; void BeforeMainMessageLoopRun(base::RunLoop* run_loop) override; bool HandleMainMessageLoopQuit() override; void BeforeUIThreadInitialize() override; diff --git a/libcef/common/main_runner_delegate.h b/libcef/common/main_runner_delegate.h index 335ab2b88..daf40807b 100644 --- a/libcef/common/main_runner_delegate.h +++ b/libcef/common/main_runner_delegate.h @@ -21,7 +21,7 @@ class CefMainRunnerDelegate { virtual content::ContentMainDelegate* GetContentMainDelegate() = 0; virtual void BeforeMainThreadInitialize(const CefMainArgs& args) {} - virtual void BeforeMainThreadRun() {} + virtual void BeforeMainThreadRun(bool multi_threaded_message_loop) {} virtual void BeforeMainMessageLoopRun(base::RunLoop* run_loop) {} virtual bool HandleMainMessageLoopQuit() { return false; } virtual void BeforeUIThreadInitialize() {} diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index d8c6534e2..b79839ded 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -34,10 +34,11 @@ #include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/thread_util.h" +#include "base/auto_reset.h" #include "base/functional/bind.h" #include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" -#include "base/threading/thread_local.h" +#include "third_party/abseil-cpp/absl/base/attributes.h" #include "third_party/blink/public/web/blink.h" #include "third_party/blink/public/web/web_frame.h" #include "third_party/blink/public/web/web_local_frame.h" @@ -83,20 +84,34 @@ bool GetPrivate(v8::Local context, .ToLocal(result); } +// Chromium uses the default Isolate for the main render process thread and a +// new Isolate for each WebWorker thread. Continue this pattern by tracking +// Isolate information on a per-thread basis. This implementation will need to +// be re-worked (perhaps using a map keyed on v8::Isolate::GetCurrent()) if +// in the future Chromium begins using the same Isolate across multiple threads. +class CefV8IsolateManager; +ABSL_CONST_INIT thread_local CefV8IsolateManager* g_isolate_manager = nullptr; + // Manages memory and state information associated with a single Isolate. class CefV8IsolateManager { public: CefV8IsolateManager() - : isolate_(v8::Isolate::GetCurrent()), + : resetter_(&g_isolate_manager, this), + isolate_(v8::Isolate::GetCurrent()), task_runner_(CEF_RENDER_TASK_RUNNER()), message_listener_registered_(false), worker_id_(0) { DCHECK(isolate_); DCHECK(task_runner_.get()); } - ~CefV8IsolateManager() { + ~CefV8IsolateManager() = default; + + static CefV8IsolateManager* Get() { return g_isolate_manager; } + + void Destroy() { DCHECK_EQ(isolate_, v8::Isolate::GetCurrent()); DCHECK(context_map_.empty()); + delete this; } scoped_refptr GetContextState( @@ -175,6 +190,8 @@ class CefV8IsolateManager { const GURL& worker_url() const { return worker_url_; } private: + const base::AutoReset resetter_; + v8::Isolate* isolate_; scoped_refptr task_runner_; @@ -193,43 +210,6 @@ class CefV8IsolateManager { GURL worker_url_; }; -// Chromium uses the default Isolate for the main render process thread and a -// new Isolate for each WebWorker thread. Continue this pattern by tracking -// Isolate information on a per-thread basis. This implementation will need to -// be re-worked (perhaps using a map keyed on v8::Isolate::GetCurrent()) if -// in the future Chromium begins using the same Isolate across multiple threads. -class CefV8StateManager { - public: - CefV8StateManager() {} - - void CreateIsolateManager() { - DCHECK(!current_tls_.Get()); - current_tls_.Set(new CefV8IsolateManager()); - } - - void DestroyIsolateManager() { - DCHECK(current_tls_.Get()); - delete current_tls_.Get(); - current_tls_.Set(nullptr); - } - - CefV8IsolateManager* GetIsolateManager() { - CefV8IsolateManager* manager = current_tls_.Get(); - DCHECK(manager); - return manager; - } - - private: - base::ThreadLocalPointer current_tls_; -}; - -base::LazyInstance::Leaky g_v8_state = - LAZY_INSTANCE_INITIALIZER; - -CefV8IsolateManager* GetIsolateManager() { - return g_v8_state.Pointer()->GetIsolateManager(); -} - class V8TrackObject : public CefTrackNode { public: explicit V8TrackObject(v8::Isolate* isolate) @@ -810,7 +790,7 @@ void MessageListenerCallbackImpl(v8::Handle message, return; } - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr context = CefV8Context::GetCurrentContext(); v8::Local v8Stack = message->GetStackTrace(); CefRefPtr stackTrace = @@ -831,23 +811,24 @@ void MessageListenerCallbackImpl(v8::Handle message, // Global functions. void CefV8IsolateCreated() { - g_v8_state.Pointer()->CreateIsolateManager(); + new CefV8IsolateManager(); } void CefV8IsolateDestroyed() { - g_v8_state.Pointer()->DestroyIsolateManager(); + auto* isolate_manager = CefV8IsolateManager::Get(); + isolate_manager->Destroy(); } void CefV8ReleaseContext(v8::Local context) { - GetIsolateManager()->ReleaseContext(context); + CefV8IsolateManager::Get()->ReleaseContext(context); } void CefV8SetUncaughtExceptionStackSize(int stack_size) { - GetIsolateManager()->SetUncaughtExceptionStackSize(stack_size); + CefV8IsolateManager::Get()->SetUncaughtExceptionStackSize(stack_size); } void CefV8SetWorkerAttributes(int worker_id, const GURL& worker_url) { - GetIsolateManager()->SetWorkerAttributes(worker_id, worker_url); + CefV8IsolateManager::Get()->SetWorkerAttributes(worker_id, worker_url); } bool CefRegisterExtension(const CefString& extension_name, @@ -856,7 +837,7 @@ bool CefRegisterExtension(const CefString& extension_name, // Verify that this method was called on the correct thread. CEF_REQUIRE_RT_RETURN(false); - CefV8IsolateManager* isolate_manager = GetIsolateManager(); + auto* isolate_manager = CefV8IsolateManager::Get(); V8TrackString* name = new V8TrackString(extension_name); isolate_manager->AddGlobalTrackObject(name); @@ -879,7 +860,7 @@ bool CefRegisterExtension(const CefString& extension_name, // Helper macros -#define CEF_V8_HAS_ISOLATE() (!!GetIsolateManager()) +#define CEF_V8_HAS_ISOLATE() (!!CefV8IsolateManager::Get()) #define CEF_V8_REQUIRE_ISOLATE_RETURN(var) \ if (!CEF_V8_HAS_ISOLATE()) { \ NOTREACHED() << "V8 isolate is not valid"; \ @@ -929,7 +910,7 @@ CefV8HandleBase::CefV8HandleBase(v8::Isolate* isolate, : isolate_(isolate) { DCHECK(isolate_); - CefV8IsolateManager* manager = GetIsolateManager(); + CefV8IsolateManager* manager = CefV8IsolateManager::Get(); DCHECK(manager); DCHECK_EQ(isolate_, manager->isolate()); @@ -943,7 +924,7 @@ CefV8HandleBase::CefV8HandleBase(v8::Isolate* isolate, CefRefPtr CefV8Context::GetCurrentContext() { CefRefPtr context; CEF_V8_REQUIRE_ISOLATE_RETURN(context); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); if (isolate->InContext()) { v8::HandleScope handle_scope(isolate); context = new CefV8ContextImpl(isolate, isolate->GetCurrentContext()); @@ -955,7 +936,7 @@ CefRefPtr CefV8Context::GetCurrentContext() { CefRefPtr CefV8Context::GetEnteredContext() { CefRefPtr context; CEF_V8_REQUIRE_ISOLATE_RETURN(context); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); if (isolate->InContext()) { v8::HandleScope handle_scope(isolate); context = @@ -967,7 +948,7 @@ CefRefPtr CefV8Context::GetEnteredContext() { // static bool CefV8Context::InContext() { CEF_V8_REQUIRE_ISOLATE_RETURN(false); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); return isolate->InContext(); } @@ -1179,7 +1160,7 @@ CefV8ValueImpl::Handle::~Handle() { context_state_->DeleteTrackObject(tracker_); } } else { - GetIsolateManager()->DeleteGlobalTrackObject(tracker_); + CefV8IsolateManager::Get()->DeleteGlobalTrackObject(tracker_); } } else { delete tracker_; @@ -1235,7 +1216,7 @@ void CefV8ValueImpl::Handle::SetWeakIfNecessary() { // |tracker_| will be deleted when: // A. The process shuts down, or // B. SecondWeakCallback is called for the weak handle. - GetIsolateManager()->AddGlobalTrackObject(tracker_); + CefV8IsolateManager::Get()->AddGlobalTrackObject(tracker_); } } @@ -1268,7 +1249,7 @@ void CefV8ValueImpl::Handle::SecondWeakCallback( // static CefRefPtr CefV8Value::CreateUndefined() { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitUndefined(); return impl.get(); @@ -1277,7 +1258,7 @@ CefRefPtr CefV8Value::CreateUndefined() { // static CefRefPtr CefV8Value::CreateNull() { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitNull(); return impl.get(); @@ -1286,7 +1267,7 @@ CefRefPtr CefV8Value::CreateNull() { // static CefRefPtr CefV8Value::CreateBool(bool value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitBool(value); return impl.get(); @@ -1295,7 +1276,7 @@ CefRefPtr CefV8Value::CreateBool(bool value) { // static CefRefPtr CefV8Value::CreateInt(int32 value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitInt(value); return impl.get(); @@ -1304,7 +1285,7 @@ CefRefPtr CefV8Value::CreateInt(int32 value) { // static CefRefPtr CefV8Value::CreateUInt(uint32 value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitUInt(value); return impl.get(); @@ -1313,7 +1294,7 @@ CefRefPtr CefV8Value::CreateUInt(uint32 value) { // static CefRefPtr CefV8Value::CreateDouble(double value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitDouble(value); return impl.get(); @@ -1322,7 +1303,7 @@ CefRefPtr CefV8Value::CreateDouble(double value) { // static CefRefPtr CefV8Value::CreateDate(CefBaseTime value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); impl->InitDate(value); return impl.get(); @@ -1331,7 +1312,7 @@ CefRefPtr CefV8Value::CreateDate(CefBaseTime value) { // static CefRefPtr CefV8Value::CreateString(const CefString& value) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); CefRefPtr impl = new CefV8ValueImpl(isolate); CefString str(value); impl->InitString(str); @@ -1344,7 +1325,7 @@ CefRefPtr CefV8Value::CreateObject( CefRefPtr interceptor) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); @@ -1395,7 +1376,7 @@ CefRefPtr CefV8Value::CreateObject( CefRefPtr CefV8Value::CreateArray(int length) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); @@ -1426,7 +1407,7 @@ CefRefPtr CefV8Value::CreateArrayBuffer( CefRefPtr release_callback) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); if (context.IsEmpty()) { @@ -1476,7 +1457,7 @@ CefRefPtr CefV8Value::CreateFunction( return nullptr; } - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); @@ -1520,7 +1501,7 @@ CefRefPtr CefV8Value::CreateFunction( // static CefRefPtr CefV8Value::CreatePromise() { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); @@ -2626,7 +2607,7 @@ bool CefV8ValueImpl::HasCaught(v8::Local context, CefRefPtr CefV8StackTrace::GetCurrent(int frame_limit) { CEF_V8_REQUIRE_ISOLATE_RETURN(nullptr); - v8::Isolate* isolate = GetIsolateManager()->isolate(); + v8::Isolate* isolate = CefV8IsolateManager::Get()->isolate(); v8::HandleScope handle_scope(isolate); v8::Local stackTrace = v8::StackTrace::CurrentStackTrace( isolate, frame_limit, v8::StackTrace::kDetailed); diff --git a/patch/patch.cfg b/patch/patch.cfg index 9040ab35f..79f9a70e4 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -390,14 +390,6 @@ patches = [ # when extensions are disabled. 'name': 'extensions_1947', }, - { - # macOS: Fix undesirable switch to discrete GPU during startup. - # https://github.com/chromiumembedded/cef/issues/2398 - # - # macOS: Rely on symlinks to find the Libraries directory. - # https://bugs.chromium.org/p/chromium/issues/detail?id=757974#c23 - 'name': 'mac_gpu', - }, { # macOS: Make the NativeEventProcessor protocol dependency optional. # https://github.com/chromiumembedded/cef/issues/2539 @@ -614,13 +606,13 @@ patches = [ 'name': 'blink_web_element_4200240' }, { - # win: Add missing process_handle.h include for cef_sandbox build. - # https://chromium-review.googlesource.com/c/chromium/src/+/4294575 - 'name': 'base_logging_4294575' + # Fix GN gen unresolved dependencies error with cef_sandbox build. + # https://chromium-review.googlesource.com/c/chromium/src/+/4401670 + 'name': 'gpu_test_trace_4401670' }, { - # Fix Check failed: !*GetSingletonDisallowedTls() on shutdown. - # https://chromium-review.googlesource.com/c/chromium/src/+/4294854 - 'name': 'rlz_tracker_4294854' + # Fix ThreadChecker crash on startup with Chrome runtime + multi-threaded + # message loop. + 'name': 'metrics_system_profile' } ] diff --git a/patch/patches/base_command_line_1872.patch b/patch/patches/base_command_line_1872.patch index 3532b8d1d..75aa35411 100644 --- a/patch/patches/base_command_line_1872.patch +++ b/patch/patches/base_command_line_1872.patch @@ -1,11 +1,11 @@ diff --git base/command_line.cc base/command_line.cc -index ae845dcf3972a..a6fc08d159b74 100644 +index 0ff6e0c111e63..543659c662892 100644 --- base/command_line.cc +++ base/command_line.cc -@@ -339,11 +339,10 @@ void CommandLine::AppendSwitchPath(StringPiece switch_string, - - void CommandLine::AppendSwitchNative(StringPiece switch_string, - CommandLine::StringPieceType value) { +@@ -346,11 +346,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, + #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) + sequence_checker_.Check(); + #endif -#if BUILDFLAG(IS_WIN) const std::string switch_key = ToLowerASCII(switch_string); +#if BUILDFLAG(IS_WIN) diff --git a/patch/patches/base_logging_4294575.patch b/patch/patches/base_logging_4294575.patch deleted file mode 100644 index 77783beea..000000000 --- a/patch/patches/base_logging_4294575.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git base/logging.cc base/logging.cc -index 496e68dfcd33a..b1b0af0710f28 100644 ---- base/logging.cc -+++ base/logging.cc -@@ -20,6 +20,7 @@ - #include "base/debug/crash_logging.h" - #include "base/immediate_crash.h" - #include "base/pending_task.h" -+#include "base/process/process_handle.h" - #include "base/strings/string_piece.h" - #include "base/task/common/task_annotator.h" - #include "base/trace_event/base_tracing.h" -@@ -72,7 +73,6 @@ typedef HANDLE FileHandle; - #include - #include - #include --#include "base/process/process_handle.h" - #define MAX_PATH PATH_MAX - typedef FILE* FileHandle; - #endif diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 28383897a..8c1a6e0bf 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,8 +1,8 @@ diff --git base/BUILD.gn base/BUILD.gn -index 422702cb196c5..7118ae9c9f467 100644 +index 80f6eaf01c022..b1a35ad087a5b 100644 --- base/BUILD.gn +++ base/BUILD.gn -@@ -39,6 +39,7 @@ import("//build/config/ui.gni") +@@ -40,6 +40,7 @@ import("//build/config/ui.gni") import("//build/nocompile.gni") import("//build/timestamp.gni") import("//build_overrides/build.gni") @@ -10,7 +10,7 @@ index 422702cb196c5..7118ae9c9f467 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") -@@ -1509,7 +1510,11 @@ component("base") { +@@ -1535,7 +1536,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 422702cb196c5..7118ae9c9f467 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1909,6 +1914,12 @@ component("base") { +@@ -1935,6 +1940,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -37,7 +37,7 @@ index 422702cb196c5..7118ae9c9f467 100644 "cfgmgr32.lib", "ntdll.lib", diff --git base/allocator/dispatcher/dispatcher.cc base/allocator/dispatcher/dispatcher.cc -index 09ce0dc0c5016..8b847a24918f5 100644 +index 0f044388cefee..49fc4cd20be64 100644 --- base/allocator/dispatcher/dispatcher.cc +++ base/allocator/dispatcher/dispatcher.cc @@ -13,6 +13,7 @@ @@ -185,17 +185,18 @@ index aa7423f88d278..1b2c7d3e3c4a0 100644 return token_ == other.token_; #else diff --git base/win/sid.cc base/win/sid.cc -index 50a120166f08a..dc7da1949b6b1 100644 +index 0f1a2ec79aa4b..7f92778a4a776 100644 --- base/win/sid.cc +++ base/win/sid.cc -@@ -16,14 +16,19 @@ +@@ -15,6 +15,7 @@ #include #include "base/check.h" +#include "base/notreached.h" #include "base/no_destructor.h" #include "base/rand_util.h" - #include "base/strings/string_util_win.h" + #include "base/ranges/algorithm.h" +@@ -22,8 +23,12 @@ #include "base/win/scoped_handle.h" #include "base/win/scoped_localalloc.h" #include "base/win/windows_version.h" diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 9208ee616..685d1cc6f 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,8 +1,8 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index 6006db1791a2a..81e7667183280 100644 +index 33ec36151d7fb..947772e015ad9 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc -@@ -273,7 +273,7 @@ BrowserTaskExecutor::OnUserInputStart() { +@@ -269,7 +269,7 @@ BrowserTaskExecutor::OnUserInputStart() { // static void BrowserTaskExecutor::Shutdown() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 3c36ff638..2d34e4310 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,5 +1,5 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index 4dbf8a2811c9e..917b6a2e7b56f 100644 +index 2cc2e8e2a16da..b9484a5832f74 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc @@ -1800,6 +1800,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( @@ -20,10 +20,10 @@ index 4dbf8a2811c9e..917b6a2e7b56f 100644 // 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 -index a02a6e4a5eb91..bd5ded3609b10 100644 +index 09e2e349e9e29..fdd64503771f9 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -6973,10 +6973,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( +@@ -7139,10 +7139,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -47,7 +47,7 @@ index a02a6e4a5eb91..bd5ded3609b10 100644 } return origin_and_debug_info; -@@ -7006,6 +7018,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7172,6 +7184,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( SandboxFlagsToCommit()); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 52749064e..0f70e4ad9 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 9afb4425840b9..cc12baba6d36e 100644 +index d3adf9735ca95..30aa892822318 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1920,8 +1920,6 @@ config("thin_archive") { +@@ -1916,8 +1916,6 @@ config("thin_archive") { # confuses lldb. if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index ff5184104..36267b76e 100644 --- a/patch/patches/chrome_browser.patch +++ b/patch/patches/chrome_browser.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn -index cc7851e0bbb7e..4502edc5de8e6 100644 +index 4607e1bd4a189..45fcc0aef8720 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,7 +10,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1980,6 +1981,7 @@ static_library("browser") { +@@ -1939,6 +1940,7 @@ static_library("browser") { "//build/config/chromebox_for_meetings:buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2548,6 +2550,10 @@ static_library("browser") { +@@ -2522,6 +2524,10 @@ static_library("browser") { ] } @@ -29,7 +29,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644 if (is_android) { sources += [ "after_startup_task_utils_android.cc", -@@ -6092,8 +6098,6 @@ static_library("browser") { +@@ -6071,8 +6077,6 @@ static_library("browser") { sources += [ "enterprise/chrome_browser_main_extra_parts_enterprise.cc", "enterprise/chrome_browser_main_extra_parts_enterprise.h", diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index e5401222e..9ad636df4 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index fa9472796576e..3e6a71e1e9697 100644 +index 4279a763e28e2..2ec8e4cbfac7d 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h -@@ -199,9 +199,9 @@ class BrowserProcess { +@@ -206,9 +206,9 @@ class BrowserProcess { virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0; @@ -14,10 +14,10 @@ index fa9472796576e..3e6a71e1e9697 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index c559c9dee4da0..facb6dc88e2e1 100644 +index 00043e84a13e0..6c64dd46b47b9 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -1037,18 +1037,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -1069,18 +1069,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -38,10 +38,10 @@ index c559c9dee4da0..facb6dc88e2e1 100644 std::unique_ptr manager) { background_mode_manager_ = std::move(manager); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index c7fab534552b2..075f2e9cfdb66 100644 +index 35ab0ab1cc102..74252dc2b53aa 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -174,8 +174,8 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -176,8 +176,8 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index 9cb9cdabf..28449bec0 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,7 +13,7 @@ index 370d6ab102471..fe1e4111780ed 100644 return false; } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 94f900fb2e05e..2d5719c3bc936 100644 +index 60994f80e8e51..262869e33aa30 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni") @@ -24,7 +24,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -@@ -362,6 +363,10 @@ static_library("ui") { +@@ -364,6 +365,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -35,7 +35,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -386,6 +391,7 @@ static_library("ui") { +@@ -388,6 +393,7 @@ static_library("ui") { "//build:chromeos_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", @@ -43,7 +43,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2543,6 +2549,8 @@ static_library("ui") { +@@ -2574,6 +2580,8 @@ static_library("ui") { "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.h", @@ -52,7 +52,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 "views/apps/app_info_dialog/arc_app_info_links_panel.cc", "views/apps/app_info_dialog/arc_app_info_links_panel.h", "views/apps/chrome_app_window_client_views_chromeos.cc", -@@ -4321,8 +4329,6 @@ static_library("ui") { +@@ -4369,8 +4377,6 @@ static_library("ui") { "views/accessibility/theme_tracking_non_accessible_image_view.h", "views/apps/app_dialog/app_dialog_view.cc", "views/apps/app_dialog/app_dialog_view.h", @@ -61,7 +61,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 "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_views.cc", -@@ -5853,6 +5859,7 @@ static_library("ui") { +@@ -5915,6 +5921,7 @@ static_library("ui") { if (enable_printing) { deps += [ "//components/printing/browser", @@ -70,7 +70,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644 ] } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index f800d1439fd03..0eda6648fa029 100644 +index f1e679d2db0f0..9ad5aaf3a4dfd 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc @@ -263,6 +263,25 @@ @@ -99,7 +99,7 @@ index f800d1439fd03..0eda6648fa029 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -509,6 +528,13 @@ Browser::Browser(const CreateParams& params) +@@ -510,6 +529,13 @@ Browser::Browser(const CreateParams& params) tab_strip_model_->AddObserver(this); @@ -113,7 +113,7 @@ index f800d1439fd03..0eda6648fa029 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -648,6 +674,12 @@ Browser::~Browser() { +@@ -649,6 +675,12 @@ Browser::~Browser() { // away so they don't try and call back to us. if (select_file_dialog_.get()) select_file_dialog_->ListenerDestroyed(); @@ -126,7 +126,7 @@ index f800d1439fd03..0eda6648fa029 100644 } /////////////////////////////////////////////////////////////////////////////// -@@ -1357,6 +1389,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1358,6 +1390,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -141,7 +141,7 @@ index f800d1439fd03..0eda6648fa029 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1364,8 +1404,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1365,8 +1405,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -162,7 +162,7 @@ index f800d1439fd03..0eda6648fa029 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1568,6 +1618,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1569,6 +1619,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -177,7 +177,7 @@ index f800d1439fd03..0eda6648fa029 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1723,6 +1781,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1726,6 +1784,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool should_show_loading_ui) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); @@ -186,7 +186,7 @@ index f800d1439fd03..0eda6648fa029 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1750,6 +1810,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1754,6 +1814,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -195,7 +195,7 @@ index f800d1439fd03..0eda6648fa029 100644 if (!GetStatusBubble()) return; -@@ -1757,6 +1819,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1761,6 +1823,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -213,7 +213,7 @@ index f800d1439fd03..0eda6648fa029 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1781,6 +1854,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { +@@ -1785,6 +1858,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { return false; } @@ -233,7 +233,7 @@ index f800d1439fd03..0eda6648fa029 100644 void Browser::BeforeUnloadFired(WebContents* web_contents, bool proceed, bool* proceed_to_fire_unload) { -@@ -1873,6 +1959,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1877,6 +1963,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -244,7 +244,7 @@ index f800d1439fd03..0eda6648fa029 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1984,11 +2074,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1988,11 +2078,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -260,7 +260,7 @@ index f800d1439fd03..0eda6648fa029 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2188,6 +2282,15 @@ void Browser::RequestMediaAccessPermission( +@@ -2194,6 +2288,15 @@ void Browser::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) { @@ -276,7 +276,7 @@ index f800d1439fd03..0eda6648fa029 100644 const extensions::Extension* extension = GetExtensionForOrigin(profile_, request.security_origin); MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -2728,13 +2831,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { +@@ -2734,13 +2837,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { // Browser, Getters for UI (private): StatusBubble* Browser::GetStatusBubble() { @@ -298,7 +298,7 @@ index f800d1439fd03..0eda6648fa029 100644 return window_ ? window_->GetStatusBubble() : nullptr; } -@@ -2868,6 +2978,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2874,6 +2984,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); web_contents_collection_.StopObserving(web_contents); } @@ -308,7 +308,7 @@ index f800d1439fd03..0eda6648fa029 100644 void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 486cff37b13ac..21a3a39f49247 100644 +index 83b8260beb59d..480bf6df8f2e5 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -22,6 +22,7 @@ @@ -319,7 +319,7 @@ index 486cff37b13ac..21a3a39f49247 100644 #include "chrome/browser/tab_contents/web_contents_collection.h" #include "chrome/browser/themes/theme_service_observer.h" #include "chrome/browser/ui/bookmarks/bookmark_bar.h" -@@ -48,6 +49,10 @@ +@@ -49,6 +50,10 @@ #include "ui/gfx/geometry/rect.h" #include "ui/shell_dialogs/select_file_dialog.h" @@ -330,7 +330,7 @@ index 486cff37b13ac..21a3a39f49247 100644 #if BUILDFLAG(IS_ANDROID) #error This file should only be included on desktop. #endif -@@ -323,6 +328,11 @@ class Browser : public TabStripModelObserver, +@@ -324,6 +329,11 @@ class Browser : public TabStripModelObserver, double initial_aspect_ratio = 1.0; bool lock_aspect_ratio = false; @@ -342,7 +342,7 @@ index 486cff37b13ac..21a3a39f49247 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -398,6 +408,13 @@ class Browser : public TabStripModelObserver, +@@ -399,6 +409,13 @@ class Browser : public TabStripModelObserver, force_skip_warning_user_on_close_ = force_skip_warning_user_on_close; } @@ -356,7 +356,7 @@ index 486cff37b13ac..21a3a39f49247 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -471,6 +488,12 @@ class Browser : public TabStripModelObserver, +@@ -472,6 +489,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); @@ -369,7 +369,7 @@ index 486cff37b13ac..21a3a39f49247 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -847,11 +870,19 @@ class Browser : public TabStripModelObserver, +@@ -848,11 +871,19 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -389,7 +389,7 @@ index 486cff37b13ac..21a3a39f49247 100644 void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; -@@ -1255,6 +1286,8 @@ class Browser : public TabStripModelObserver, +@@ -1256,6 +1287,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -398,7 +398,7 @@ index 486cff37b13ac..21a3a39f49247 100644 CreationSource creation_source_ = CreationSource::kUnknown; UnloadController unload_controller_; -@@ -1319,6 +1352,10 @@ class Browser : public TabStripModelObserver, +@@ -1320,6 +1353,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -410,10 +410,10 @@ index 486cff37b13ac..21a3a39f49247 100644 // The opener browser of the document picture-in-picture browser. Null if the diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index baf326245646a..1b631e80ac3f0 100644 +index c4a4bb8af94b0..37d64039e7eed 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -554,6 +554,13 @@ std::unique_ptr CreateTargetContents( +@@ -553,6 +553,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index 4628e183a..abce33459 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -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 -index e0d7724c3a341..40a25b08152a5 100644 +index 56f143c94da9c..8e6b18a9b92eb 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -315,6 +315,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -316,6 +316,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index e0d7724c3a341..40a25b08152a5 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -561,6 +568,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -562,6 +569,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index e0d7724c3a341..40a25b08152a5 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -774,6 +785,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -775,6 +786,14 @@ RenderViewContextMenu::RenderViewContextMenu( #if BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) pdf_ocr_submenu_model_ = std::make_unique(this); #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) @@ -42,7 +42,7 @@ index e0d7724c3a341..40a25b08152a5 100644 } RenderViewContextMenu::~RenderViewContextMenu() = default; -@@ -1187,6 +1206,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1190,6 +1209,12 @@ void RenderViewContextMenu::InitMenu() { // menu, meaning that each menu item added/removed in this function will cause // it to visibly jump on the screen (see b/173569669). AppendQuickAnswersItems(); @@ -55,7 +55,7 @@ index e0d7724c3a341..40a25b08152a5 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -3130,6 +3155,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( +@@ -3148,6 +3173,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( execute_plugin_action_callback_ = std::move(cb); } @@ -69,10 +69,10 @@ index e0d7724c3a341..40a25b08152a5 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { 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 -index 19678cd892b6e..1e65a38e4cc69 100644 +index 4b6e2d55455c3..e25577396d5c1 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -139,6 +139,12 @@ class RenderViewContextMenu +@@ -142,6 +142,12 @@ class RenderViewContextMenu } #endif @@ -96,7 +96,7 @@ index 19678cd892b6e..1e65a38e4cc69 100644 // "Use enhanced spell check" items. std::unique_ptr spelling_suggestions_menu_observer_; diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -index ab018dd1ce675..1d80631a0c2ec 100644 +index b7522152d2c6d..5201ebe8268f1 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc @@ -149,6 +149,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index d52a0b66e..48facf181 100644 --- a/patch/patches/chrome_browser_dialogs_native.patch +++ b/patch/patches/chrome_browser_dialogs_native.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc -index 3f7a0625e997f..d0e5a1a05af4b 100644 +index 0ff5db3d439bc..586a20ddc8a89 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc @@ -20,6 +20,7 @@ diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index d1f57d829..b5c3d8dfc 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -112,7 +112,7 @@ index 51ed6bcf6b540..9ae4737e0737e 100644 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; // Returns whether a dialog currently about to be shown should be activated. diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc -index dfd41ce139940..b695144ceaf48 100644 +index bfa3af1507a2c..89706052e11d6 100644 --- ui/views/window/dialog_delegate.cc +++ ui/views/window/dialog_delegate.cc @@ -54,10 +54,12 @@ DialogDelegate::DialogDelegate() { @@ -181,7 +181,7 @@ index dfd41ce139940..b695144ceaf48 100644 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child // widgets to prevent top-level window behavior (independent movement, etc). diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index 0b660d38eeb03..4f402ee8ddbd4 100644 +index cb4e19385ffaa..bbe179c4607a8 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h @@ -94,13 +94,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { diff --git a/patch/patches/chrome_browser_net_proxy.patch b/patch/patches/chrome_browser_net_proxy.patch index 599683150..ae69acbd8 100644 --- a/patch/patches/chrome_browser_net_proxy.patch +++ b/patch/patches/chrome_browser_net_proxy.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/net/proxy_config_monitor.cc chrome/browser/net/proxy_config_monitor.cc -index 34584b4400276..809b175ff26de 100644 +index 6dc5622f50847..89d36c8485e7e 100644 --- chrome/browser/net/proxy_config_monitor.cc +++ chrome/browser/net/proxy_config_monitor.cc @@ -9,6 +9,7 @@ @@ -10,7 +10,7 @@ index 34584b4400276..809b175ff26de 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/net/proxy_service_factory.h" #include "chrome/browser/profiles/profile.h" -@@ -21,6 +22,10 @@ +@@ -22,6 +23,10 @@ #include "chrome/browser/ash/profiles/profile_helper.h" #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -21,8 +21,8 @@ index 34584b4400276..809b175ff26de 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/api/proxy/proxy_api.h" #endif -@@ -90,6 +95,9 @@ void ProxyConfigMonitor::AddToNetworkContextParams( - .InitWithNewPipeAndPassReceiver()); +@@ -95,6 +100,9 @@ void ProxyConfigMonitor::AddToNetworkContextParams( + } #if BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_CEF) diff --git a/patch/patches/chrome_browser_permission_prompt.patch b/patch/patches/chrome_browser_permission_prompt.patch index 7d23799f2..911af026c 100644 --- a/patch/patches/chrome_browser_permission_prompt.patch +++ b/patch/patches/chrome_browser_permission_prompt.patch @@ -44,7 +44,7 @@ index 16107572d4d0d..409e9ea870482 100644 base::FeatureList::IsEnabled( features::kPeriodicSyncPermissionForDefaultSearchEngine) && diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc -index d0d4fd4f7925b..0755927b00e2c 100644 +index 1a2fe8936295a..033ecd276cf45 100644 --- chrome/browser/permissions/chrome_permissions_client.cc +++ chrome/browser/permissions/chrome_permissions_client.cc @@ -14,6 +14,7 @@ @@ -77,7 +77,7 @@ index d0d4fd4f7925b..0755927b00e2c 100644 } diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc -index 5e3e2bd6f1e69..4594213db914f 100644 +index a6d47eebe0ba6..111a2e52df96f 100644 --- chrome/browser/permissions/permission_manager_factory.cc +++ chrome/browser/permissions/permission_manager_factory.cc @@ -6,6 +6,7 @@ @@ -88,15 +88,15 @@ index 5e3e2bd6f1e69..4594213db914f 100644 #include "chrome/browser/background_fetch/background_fetch_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" -@@ -60,8 +61,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( +@@ -59,8 +60,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( std::make_unique(profile); #endif // BUILDFLAG(IS_ANDROID) - #if BUILDFLAG(IS_MAC) + #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) + if (!cef::IsAlloyRuntimeEnabled()) { - delegates.geolocation_manager = - g_browser_process->platform_part()->geolocation_manager(); + delegates.geolocation_manager = g_browser_process->geolocation_manager(); + DCHECK(delegates.geolocation_manager); + } - #endif // BUILDFLAG(IS_MAC) + #endif delegates.media_stream_device_enumerator = MediaCaptureDevicesDispatcher::GetInstance(); diff --git chrome/browser/storage/durable_storage_permission_context.cc chrome/browser/storage/durable_storage_permission_context.cc @@ -174,7 +174,7 @@ index 82a50b7e22dfe..c4ba55ec6bd54 100644 if (!browser) { 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 -index c3b99f8e21b1c..8abca05c7c482 100644 +index ff8391841fc28..08562a3a03aef 100644 --- components/embedder_support/permission_context_utils.cc +++ components/embedder_support/permission_context_utils.cc @@ -5,6 +5,7 @@ @@ -185,18 +185,19 @@ index c3b99f8e21b1c..8abca05c7c482 100644 #include "components/background_sync/background_sync_permission_context.h" #include "components/permissions/contexts/accessibility_permission_context.h" #include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h" -@@ -78,11 +79,18 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, +@@ -75,12 +76,19 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, browser_context, std::move(delegates.geolocation_permission_context_delegate)); - #elif BUILDFLAG(IS_MAC) + #elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) + if (cef::IsAlloyRuntimeEnabled()) { + permission_contexts[ContentSettingsType::GEOLOCATION] = + std::make_unique( + browser_context, + std::move(delegates.geolocation_permission_context_delegate)); + } else { + DCHECK(delegates.geolocation_manager); permission_contexts[ContentSettingsType::GEOLOCATION] = - std::make_unique( + std::make_unique( browser_context, std::move(delegates.geolocation_permission_context_delegate), delegates.geolocation_manager); diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 076be9500..f0f728e4d 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -59,7 +59,7 @@ index f5f266328283d..672609d94d1b7 100644 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 -index 41546d7dce559..dce0122a85933 100644 +index a315cdc513f1d..036236798652c 100644 --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc +++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc @@ -45,7 +45,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) { diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 12802788d..1c5e42ab4 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -84,10 +84,10 @@ index 1e6a22d95a53f..6ec4182bfc5e7 100644 // 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 -index 6836199037155..5e0ad06d62fe9 100644 +index 3ee6b902b6bc2..6416146fba8af 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -1018,7 +1018,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1015,7 +1015,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -99,10 +99,10 @@ index 6836199037155..5e0ad06d62fe9 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 145d5d837ae86..6eeb39eddc79b 100644 +index eab4bc302ef7d..9ed7d61345263 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -385,7 +385,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -392,7 +392,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) base::Unretained(this))); #endif @@ -112,7 +112,7 @@ index 145d5d837ae86..6eeb39eddc79b 100644 zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this, diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 54502d1b44a82..8134c87824687 100644 +index c3626f110e6fb..c7d70d32d8f37 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h @@ -130,7 +130,7 @@ class ProfileManager : public Profile::Delegate { @@ -134,7 +134,7 @@ index 54502d1b44a82..8134c87824687 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 43082afabf4bb..fa87aae9cbc93 100644 +index b3cf2ad8d367b..431b44e39de40 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -8,6 +8,7 @@ @@ -145,7 +145,7 @@ index 43082afabf4bb..fa87aae9cbc93 100644 #include "chrome/browser/content_settings/content_settings_manager_delegate.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" -@@ -35,8 +36,10 @@ RendererUpdater::RendererUpdater(Profile* profile) +@@ -36,8 +37,10 @@ RendererUpdater::RendererUpdater(Profile* profile) : profile_(profile), is_off_the_record_(profile_->IsOffTheRecord()), original_profile_(profile->GetOriginalProfile()) { diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index aa540c29f..8af7b9e56 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 038a280213b6a..f823d021afa1e 100644 +index 5e6f67286ba3d..65411bd132294 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -32,6 +32,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index c1551ed96..6562d742c 100644 --- a/patch/patches/chrome_browser_themes.patch +++ b/patch/patches/chrome_browser_themes.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc -index 851cacf36cb21..217c38335903d 100644 +index c9a644a755c12..bf4ea541fb359 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc @@ -30,6 +30,7 @@ diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 746dd9c56..16d2fd955 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -42,10 +42,10 @@ index 8b3f569882aeb..afc8007a6228b 100644 const extensions::Extension* extension = registry->enabled_extensions().GetByID(extension_id); diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index a91227b208c16..d89e3d6ba0ad7 100644 +index 846a2ee1b05d0..b77a01012bbbb 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -983,6 +983,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1009,6 +1009,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -53,7 +53,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1150,7 +1151,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1176,7 +1177,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -63,7 +63,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1159,7 +1161,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1185,7 +1187,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -73,7 +73,7 @@ index a91227b208c16..d89e3d6ba0ad7 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1169,7 +1172,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1195,7 +1198,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 61dcf33be..f7b1ddb76 100644 --- a/patch/patches/chrome_renderer.patch +++ b/patch/patches/chrome_renderer.patch @@ -1,5 +1,5 @@ diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn -index 53733390bf73d..215112f3f5723 100644 +index 0a535c03b96b0..3787cbc8dc8d0 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index 02decb284..5ea89c4fd 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,5 +1,5 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 18b59a7014ea2..82f2fd1b32897 100644 +index d4b31d11a51c4..534973146e405 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -39,6 +39,7 @@ @@ -10,7 +10,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/defaults.h" -@@ -503,6 +504,8 @@ struct MainFunction { +@@ -498,6 +499,8 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -19,18 +19,18 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #if BUILDFLAG(IS_WIN) // Reach out to chrome_elf for the truth on the user data directory. // Note that in tests, this links to chrome_elf_test_stubs. -@@ -652,6 +655,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { +@@ -647,6 +650,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { ChromeMainDelegate::~ChromeMainDelegate() = default; #endif // !BUILDFLAG(IS_ANDROID) +void ChromeMainDelegate::CleanupOnUIThread() { -+ heap_profiler_controller_.reset(); ++ memory_system_.reset(); +} + absl::optional ChromeMainDelegate::PostEarlyInitialization( InvokedIn invoked_in) { DCHECK(base::ThreadPoolInstance::Get()); -@@ -857,7 +864,8 @@ absl::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -855,7 +862,8 @@ absl::optional ChromeMainDelegate::PostEarlyInitialization( if (base::FeatureList::IsEnabled( features::kWriteBasicSystemProfileToPersistentHistogramsFile)) { @@ -40,7 +40,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #if BUILDFLAG(IS_ANDROID) record = base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions); -@@ -1310,6 +1318,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1280,6 +1288,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -48,7 +48,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 crash_reporter::InitializeCrashKeys(); #if BUILDFLAG(IS_POSIX) -@@ -1320,6 +1329,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1290,6 +1299,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -56,7 +56,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #if BUILDFLAG(IS_WIN) child_process_logging::Init(); -@@ -1514,6 +1524,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1484,6 +1494,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } @@ -64,7 +64,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1557,6 +1568,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1527,6 +1538,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -72,7 +72,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 #if BUILDFLAG(ENABLE_PDF) MaybePatchGdiGetFontData(); -@@ -1680,6 +1692,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1650,6 +1662,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -80,7 +80,7 @@ index 18b59a7014ea2..82f2fd1b32897 100644 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. const base::CommandLine* command_line = -@@ -1702,6 +1715,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1672,6 +1685,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -88,11 +88,25 @@ index 18b59a7014ea2..82f2fd1b32897 100644 } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) +@@ -1763,11 +1777,12 @@ void ChromeMainDelegate::InitializeMemorySystem() { + channel == version_info::Channel::DEV); + const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process; + ++ memory_system_ = std::make_unique(); + memory_system::Initializer() + .SetGwpAsanParameters(gwp_asan_boost_sampling, process_type) + .SetProfilingClientParameters(channel, + GetProfileParamsProcess(*command_line)) + .SetDispatcherParameters(memory_system::DispatcherParameters:: + PoissonAllocationSamplerInclusion::kEnforce) +- .Initialize(memory_system_); ++ .Initialize(*memory_system_); + } diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h -index bfafb0a895b0f..f42ebc52d4a1a 100644 +index dad9f981d2e01..29baaf84465a0 100644 --- chrome/app/chrome_main_delegate.h +++ chrome/app/chrome_main_delegate.h -@@ -52,6 +52,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate { +@@ -49,6 +49,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate { ~ChromeMainDelegate() override; @@ -101,8 +115,17 @@ index bfafb0a895b0f..f42ebc52d4a1a 100644 protected: // content::ContentMainDelegate: absl::optional BasicStartupComplete() override; +@@ -98,7 +100,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { + + ChromeContentClient chrome_content_client_; + +- memory_system::MemorySystem memory_system_; ++ std::unique_ptr memory_system_; + + #if BUILDFLAG(IS_CHROMEOS_LACROS) + std::unique_ptr lacros_service_; diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index b05ce3c764ddd..92be5fda315cf 100644 +index b74b87e496946..89cdeef75fea0 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -51,6 +51,7 @@ @@ -113,7 +136,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -1475,7 +1476,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1478,7 +1479,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) @@ -122,7 +145,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 // Handle special early return paths (which couldn't be processed even earlier // as they require the process singleton to be held) first. -@@ -1522,7 +1523,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1525,7 +1526,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { return content::RESULT_CODE_NORMAL_EXIT; #endif // BUILDFLAG(IS_WIN) } @@ -131,7 +154,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 #if BUILDFLAG(IS_WIN) // Check if there is any machine level Chrome installed on the current -@@ -1577,12 +1578,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1580,12 +1581,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->local_state()); } @@ -146,7 +169,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 #if BUILDFLAG(IS_ANDROID) page_info::SetPageInfoClient(new ChromePageInfoClient()); -@@ -1731,6 +1734,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1734,6 +1737,10 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -157,7 +180,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. -@@ -1769,11 +1776,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1772,11 +1779,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -173,7 +196,7 @@ index b05ce3c764ddd..92be5fda315cf 100644 #endif // !BUILDFLAG(IS_ANDROID) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index 194833d0bae43..21564d96466c0 100644 +index d495e1a903fd8..31cf6632e831c 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm @@ -17,6 +17,7 @@ @@ -211,7 +234,7 @@ index 194833d0bae43..21564d96466c0 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 600dd1ab9abc4..b4bc133b4a445 100644 +index cfbed0fd8183a..63529099116e4 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -37,6 +37,7 @@ @@ -222,8 +245,8 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -1527,6 +1528,8 @@ void HandleStringData( - } // namespace +@@ -1523,6 +1524,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { + } ChromeContentBrowserClient::ChromeContentBrowserClient() { + keepalive_timer_.reset(new base::OneShotTimer()); @@ -231,7 +254,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 #if BUILDFLAG(ENABLE_PLUGINS) extra_parts_.push_back(new ChromeContentBrowserClientPluginsPart); #endif -@@ -1552,6 +1555,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { +@@ -1548,6 +1551,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { extra_parts_.clear(); } @@ -243,7 +266,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 // static void ChromeContentBrowserClient::RegisterLocalStatePrefs( PrefRegistrySimple* registry) { -@@ -4313,9 +4321,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -4342,9 +4350,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // BUILDFLAG(IS_ANDROID) @@ -255,8 +278,8 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -@@ -6213,7 +6223,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( - network_service); +@@ -6240,7 +6250,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( + #endif } -void ChromeContentBrowserClient::ConfigureNetworkContextParams( @@ -264,7 +287,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -6231,6 +6241,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( +@@ -6258,6 +6268,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = GetApplicationLocale(); } @@ -273,7 +296,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 } std::vector -@@ -7137,10 +7149,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( +@@ -7194,10 +7206,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( const auto now = base::TimeTicks::Now(); const auto timeout = GetKeepaliveTimerTimeout(context); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); @@ -286,7 +309,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 FROM_HERE, keepalive_deadline_ - now, base::BindOnce( &ChromeContentBrowserClient::OnKeepaliveTimerFired, -@@ -7159,7 +7171,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { +@@ -7216,7 +7228,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { --num_keepalive_requests_; if (num_keepalive_requests_ == 0) { DVLOG(1) << "Stopping the keepalive timer"; @@ -296,7 +319,7 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 // This deletes the keep alive handle attached to the timer function and // unblock the shutdown sequence. } -@@ -7295,7 +7308,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( +@@ -7352,7 +7365,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( const auto now = base::TimeTicks::Now(); const auto then = keepalive_deadline_; if (now < then) { @@ -306,10 +329,10 @@ index 600dd1ab9abc4..b4bc133b4a445 100644 base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, weak_factory_.GetWeakPtr(), diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index 7ecb90a89f1d7..c80ce831382db 100644 +index d2337ac7d7fbf..af49a2589cabf 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -121,6 +121,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -133,6 +133,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { ~ChromeContentBrowserClient() override; @@ -318,7 +341,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644 // TODO(https://crbug.com/787567): This file is about calls from content/ out // to chrome/ to get values or notify about events, but both of these // functions are from chrome/ to chrome/ and don't involve content/ at all. -@@ -602,7 +604,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -616,7 +618,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; @@ -327,7 +350,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -966,7 +968,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -989,7 +991,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if !BUILDFLAG(IS_ANDROID) uint64_t num_keepalive_requests_ = 0; @@ -337,10 +360,10 @@ index 7ecb90a89f1d7..c80ce831382db 100644 #endif diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index ff57c231cc784..59ac71c36caa0 100644 +index bc342655b8367..bc7cbc93dac17 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc -@@ -11,6 +11,7 @@ +@@ -12,6 +12,7 @@ #include "build/build_config.h" #include "build/chromecast_buildflags.h" #include "build/chromeos_buildflags.h" @@ -348,7 +371,7 @@ index ff57c231cc784..59ac71c36caa0 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_ui.h" -@@ -174,6 +175,10 @@ +@@ -177,6 +178,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -359,7 +382,7 @@ index ff57c231cc784..59ac71c36caa0 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1305,6 +1310,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1365,6 +1370,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); @@ -371,7 +394,7 @@ index ff57c231cc784..59ac71c36caa0 100644 } // Register prefs applicable to all profiles. -@@ -1704,6 +1714,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1759,6 +1769,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, const std::string& locale) { RegisterProfilePrefs(registry, locale); diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index a345f5b53..9136073d3 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index f91c359d9792a..9fe7a7faf33bc 100644 +index dc085f13cb279..bad8857a44807 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -389,6 +389,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -24,7 +24,7 @@ index f91c359d9792a..9fe7a7faf33bc 100644 // The order of commands in this switch statement must match the function // declaration order in browser.h! switch (id) { -@@ -1042,11 +1050,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -1050,11 +1058,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( // BrowserCommandController, private: bool BrowserCommandController::IsShowingMainUI() { @@ -41,10 +41,10 @@ index f91c359d9792a..9fe7a7faf33bc 100644 bool BrowserCommandController::IsWebAppOrCustomTab() const { diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc -index 655ce2353f106..e9dd7ed68b9c5 100644 +index f505dbc9aa7b9..de2fa3e6732f5 100644 --- chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc -@@ -151,6 +151,57 @@ absl::optional GetInstallPWAAppMenuItemName(Browser* browser) { +@@ -157,6 +157,57 @@ absl::optional GetInstallPWAAppMenuItemName(Browser* browser) { ui::EscapeMenuLabelAmpersands(app_name)); } @@ -102,7 +102,7 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 } // namespace //////////////////////////////////////////////////////////////////////////////// -@@ -756,7 +807,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { +@@ -811,7 +862,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { return false; } @@ -111,7 +111,7 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 GlobalError* error = GlobalErrorServiceFactory::GetForProfile(browser_->profile()) ->GetGlobalErrorByMenuItemCommandID(command_id); -@@ -771,7 +822,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { +@@ -826,7 +877,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { } } @@ -120,7 +120,7 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 switch (command_id) { case IDC_PIN_TO_START_SCREEN: return false; -@@ -794,6 +845,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const { +@@ -849,6 +900,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const { } } @@ -155,8 +155,8 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 bool AppMenuModel::IsCommandIdAlerted(int command_id) const { if ((command_id == IDC_RECENT_TABS_MENU) || (command_id == AppMenuModel::kMinRecentTabsCommandId)) { -@@ -899,9 +978,13 @@ void AppMenuModel::Build() { - bookmark_sub_menu_model_.get()); +@@ -965,9 +1044,13 @@ void AppMenuModel::Build() { + kExtensionsMenuItem); } - AddSeparator(ui::LOWER_SEPARATOR); @@ -172,7 +172,7 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 AddItemWithStringId(IDC_PRINT, IDS_PRINT); -@@ -965,9 +1048,14 @@ void AppMenuModel::Build() { +@@ -1031,9 +1114,14 @@ void AppMenuModel::Build() { sub_menus_.back().get()); SetElementIdentifierAt(GetIndexOfCommandId(IDC_MORE_TOOLS_MENU).value(), kMoreToolsMenuItem); @@ -190,7 +190,7 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS); // The help submenu is only displayed on official Chrome builds. As the -@@ -1004,6 +1092,11 @@ void AppMenuModel::Build() { +@@ -1070,6 +1158,11 @@ void AppMenuModel::Build() { } #endif // !BUILDFLAG(IS_CHROMEOS_ASH) @@ -203,10 +203,10 @@ index 655ce2353f106..e9dd7ed68b9c5 100644 } diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h -index fa3ceed419c16..522671662cbdf 100644 +index 26545b0cee2c1..118cf0df456d6 100644 --- chrome/browser/ui/toolbar/app_menu_model.h +++ chrome/browser/ui/toolbar/app_menu_model.h -@@ -208,6 +208,9 @@ class AppMenuModel : public ui::SimpleMenuModel, +@@ -230,6 +230,9 @@ class AppMenuModel : public ui::SimpleMenuModel, // Appends a zoom menu (without separators). void CreateZoomMenu(); @@ -217,10 +217,10 @@ index fa3ceed419c16..522671662cbdf 100644 friend class ::MockAppMenuModel; diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index 090ad157308b7..d0534ffb8091c 100644 +index 8da09b8c01c3f..d4f2a855bb8e8 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -67,15 +67,23 @@ bool IsUsingLinuxSystemTheme(Profile* profile) { +@@ -71,15 +71,23 @@ bool IsUsingLinuxSystemTheme(Profile* profile) { //////////////////////////////////////////////////////////////////////////////// // BrowserFrame, public: @@ -246,7 +246,7 @@ index 090ad157308b7..d0534ffb8091c 100644 } BrowserFrame::~BrowserFrame() {} -@@ -166,6 +174,12 @@ void BrowserFrame::LayoutWebAppWindowTitle( +@@ -170,6 +178,12 @@ void BrowserFrame::LayoutWebAppWindowTitle( } int BrowserFrame::GetTopInset() const { @@ -259,7 +259,7 @@ index 090ad157308b7..d0534ffb8091c 100644 return browser_frame_view_->GetTopInset(false); } -@@ -182,6 +196,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const { +@@ -186,6 +200,8 @@ BrowserNonClientFrameView* BrowserFrame::GetFrameView() const { } bool BrowserFrame::UseCustomFrame() const { @@ -268,7 +268,7 @@ index 090ad157308b7..d0534ffb8091c 100644 return native_browser_frame_->UseCustomFrame(); } -@@ -195,20 +211,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const { +@@ -199,20 +215,30 @@ bool BrowserFrame::ShouldDrawFrameHeader() const { void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, ui::WindowShowState* show_state) const { @@ -299,7 +299,7 @@ index 090ad157308b7..d0534ffb8091c 100644 browser_frame_view_->OnBrowserViewInitViewsComplete(); } -@@ -270,7 +296,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { +@@ -274,7 +300,7 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { ui::ColorProviderManager::ThemeInitializerSupplier* BrowserFrame::GetCustomTheme() const { // Do not return any custom theme if the browser has to use the dark theme. @@ -308,7 +308,7 @@ index 090ad157308b7..d0534ffb8091c 100644 return nullptr; Browser* browser = browser_view_->browser(); -@@ -287,6 +313,8 @@ BrowserFrame::GetCustomTheme() const { +@@ -291,6 +317,8 @@ BrowserFrame::GetCustomTheme() const { } void BrowserFrame::OnNativeWidgetWorkspaceChanged() { @@ -317,7 +317,7 @@ index 090ad157308b7..d0534ffb8091c 100644 chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(), IsVisibleOnAllWorkspaces()); -@@ -374,6 +402,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) { +@@ -388,6 +416,8 @@ void BrowserFrame::SetTabDragKind(TabDragKind tab_drag_kind) { ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const { auto key = Widget::GetColorProviderKey(); @@ -326,7 +326,17 @@ index 090ad157308b7..d0534ffb8091c 100644 key.frame_type = UseCustomFrame() ? ui::ColorProviderManager::FrameType::kChromium : ui::ColorProviderManager::FrameType::kNative; -@@ -460,5 +490,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( +@@ -397,6 +427,9 @@ ui::ColorProviderManager::Key BrowserFrame::GetColorProviderKey() const { + } + + absl::optional BrowserFrame::GetUserColor() const { ++ if (!browser_view_) { ++ return absl::nullopt; ++ } + #if BUILDFLAG(IS_CHROMEOS_ASH) + // ChromeOS SystemWebApps use the OS theme all the time. + if (ash::IsSystemWebApp(browser_view_->browser())) { +@@ -489,5 +522,7 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( } bool BrowserFrame::ShouldUseDarkTheme() const { @@ -335,10 +345,10 @@ index 090ad157308b7..d0534ffb8091c 100644 return browser_view_->browser()->profile()->IsIncognitoProfile(); } diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h -index 89262a0c87266..f94cc5faafb90 100644 +index d9fb9af4db3eb..4a809ee9962fd 100644 --- chrome/browser/ui/views/frame/browser_frame.h +++ chrome/browser/ui/views/frame/browser_frame.h -@@ -57,7 +57,9 @@ enum class TabDragKind { +@@ -61,7 +61,9 @@ enum class TabDragKind { // This is a virtual interface that allows system specific browser frames. class BrowserFrame : public views::Widget, public views::ContextMenuController { public: @@ -349,10 +359,10 @@ index 89262a0c87266..f94cc5faafb90 100644 BrowserFrame(const BrowserFrame&) = delete; BrowserFrame& operator=(const BrowserFrame&) = delete; diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index 7f4c8115e35fc..28331cec6c3c7 100644 +index ff1d8ce809a68..a58efb5ca5b72 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -307,11 +307,10 @@ using content::NativeWebKeyboardEvent; +@@ -308,11 +308,10 @@ using content::NativeWebKeyboardEvent; using content::WebContents; using web_modal::WebContentsModalDialogHost; @@ -367,7 +377,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) // UMA histograms that record animation smoothness for tab loading animation. -@@ -863,11 +862,22 @@ class BrowserView::SidePanelVisibilityController : public views::ViewObserver { +@@ -772,11 +771,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -391,7 +401,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 SetShowIcon( ::ShouldShowWindowIcon(browser_.get(), AppUsesWindowControlsOverlay())); -@@ -912,7 +922,6 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -820,7 +830,6 @@ BrowserView::BrowserView(std::unique_ptr browser) } browser_->tab_strip_model()->AddObserver(this); @@ -399,7 +409,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -969,8 +978,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -876,8 +885,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -417,7 +427,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1900,6 +1916,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1788,6 +1804,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -426,7 +436,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2799,7 +2817,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { +@@ -2680,7 +2698,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { } DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() { @@ -436,7 +446,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 if (auto* download_button = toolbar_button_provider_->GetDownloadButton()) return download_button->bubble_controller(); return nullptr; -@@ -3291,7 +3310,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { +@@ -3180,7 +3199,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { if (top_container()->parent() == this) return; @@ -446,7 +456,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -3850,8 +3870,10 @@ void BrowserView::Layout() { +@@ -3733,8 +3753,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -459,7 +469,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -3917,6 +3939,11 @@ void BrowserView::AddedToWidget() { +@@ -3800,6 +3822,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -470,8 +480,8 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 + toolbar_->Init(); - // TODO(pbos): Manage this either inside SidePanel or the corresponding button -@@ -3973,13 +4000,9 @@ void BrowserView::AddedToWidget() { + // TODO(pbos): Investigate whether the side panels should be creatable when +@@ -3846,13 +3873,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -487,7 +497,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 using_native_frame_ = frame_->ShouldUseNativeFrame(); MaybeInitializeWebUITabStrip(); -@@ -4385,7 +4408,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, +@@ -4258,7 +4281,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, // Undo our anti-jankiness hacks and force a re-layout. in_process_fullscreen_ = false; ToolbarSizeChanged(false); @@ -497,7 +507,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 } bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { -@@ -4733,6 +4757,8 @@ Profile* BrowserView::GetProfile() { +@@ -4606,6 +4630,8 @@ Profile* BrowserView::GetProfile() { } void BrowserView::UpdateUIForTabFullscreen() { @@ -506,7 +516,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 frame()->GetFrameView()->UpdateFullscreenTopUI(); } -@@ -4755,6 +4781,8 @@ void BrowserView::HideDownloadShelf() { +@@ -4628,6 +4654,8 @@ void BrowserView::HideDownloadShelf() { } bool BrowserView::CanUserExitFullscreen() const { @@ -516,7 +526,7 @@ index 7f4c8115e35fc..28331cec6c3c7 100644 } diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index d769d3914a123..6a94752bc96ea 100644 +index a2693a336f830..74d7864151d62 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h @@ -124,11 +124,16 @@ class BrowserView : public BrowserWindow, @@ -536,7 +546,7 @@ index d769d3914a123..6a94752bc96ea 100644 void set_frame(BrowserFrame* frame) { frame_ = frame; paint_as_active_subscription_ = -@@ -788,6 +793,12 @@ class BrowserView : public BrowserWindow, +@@ -773,6 +778,12 @@ class BrowserView : public BrowserWindow, return web_app_frame_toolbar(); } @@ -550,10 +560,10 @@ index d769d3914a123..6a94752bc96ea 100644 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc -index c9b4becda8dfa..0284fd5f01bc6 100644 +index cf12bbd30e086..a227f64d8d5e9 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc -@@ -48,6 +48,10 @@ +@@ -47,6 +47,10 @@ #include "ui/views/window/client_view.h" #include "ui/views/window/hit_test_utils.h" @@ -564,7 +574,7 @@ index c9b4becda8dfa..0284fd5f01bc6 100644 using views::View; using web_modal::ModalDialogHostObserver; using web_modal::WebContentsModalDialogHost; -@@ -564,6 +568,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { +@@ -560,6 +564,13 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { int BrowserViewLayout::LayoutToolbar(int top) { TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar"); @@ -595,7 +605,7 @@ index 5e059b9878fc2..c1f6fbcd40ec4 100644 ContentsWebView::~ContentsWebView() { diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc -index c26f017f45682..f9f875292c7d6 100644 +index 0dcdb241b98f7..1117776bbc85c 100644 --- chrome/browser/ui/views/page_action/page_action_icon_controller.cc +++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc @@ -91,6 +91,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, @@ -664,10 +674,10 @@ index f4a5c3ad8cc9c..4f9c1a111e7ce 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 65ba764446ced..140ff05e1b276 100644 +index f2b0bd4099b4f..89b7520e359c3 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -164,12 +164,13 @@ auto& GetViewCommandMap() { +@@ -169,12 +169,13 @@ constexpr int kToolbarDividerCornerRadius = 1; //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: @@ -683,7 +693,7 @@ index 65ba764446ced..140ff05e1b276 100644 SetID(VIEW_ID_TOOLBAR); if (display_mode_ == DisplayMode::NORMAL) { -@@ -200,7 +201,7 @@ void ToolbarView::Init() { +@@ -205,7 +206,7 @@ void ToolbarView::Init() { #endif auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, @@ -692,7 +702,7 @@ index 65ba764446ced..140ff05e1b276 100644 // Make sure the toolbar shows by default. size_animation_.Reset(1); -@@ -224,6 +225,19 @@ void ToolbarView::Init() { +@@ -229,6 +230,19 @@ void ToolbarView::Init() { browser, command, ui::DispositionFromEventFlags(event.flags())); }; @@ -712,8 +722,8 @@ index 65ba764446ced..140ff05e1b276 100644 std::unique_ptr back = std::make_unique( BackForwardButton::Direction::kBack, base::BindRepeating(callback, browser_, IDC_BACK), browser_); -@@ -248,8 +262,10 @@ void ToolbarView::Init() { - std::make_unique(browser_); +@@ -258,8 +272,10 @@ void ToolbarView::Init() { + } } std::unique_ptr cast; - if (media_router::MediaRouterEnabled(browser_->profile())) @@ -724,7 +734,7 @@ index 65ba764446ced..140ff05e1b276 100644 std::unique_ptr media_button; if (base::FeatureList::IsEnabled(media::kGlobalMediaControls)) { -@@ -258,21 +274,23 @@ void ToolbarView::Init() { +@@ -268,14 +284,16 @@ void ToolbarView::Init() { } std::unique_ptr download_button; @@ -743,19 +753,20 @@ index 65ba764446ced..140ff05e1b276 100644 send_tab_to_self_button = std::make_unique( browser_view_); - } +@@ -283,7 +301,7 @@ void ToolbarView::Init() { std::unique_ptr side_panel_button; + std::unique_ptr side_panel_toolbar_container; - if (browser_view_->unified_side_panel()) { + if (browser_view_->unified_side_panel() && BUTTON_VISIBLE(kSidePanel)) { - side_panel_button = std::make_unique(browser_); - } - + if (base::FeatureList::IsEnabled(features::kSidePanelCompanion)) { + side_panel_toolbar_container = + std::make_unique(browser_view_); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 05dfd39061580..29c677a735672 100644 +index b3c20d4eaf0b3..62aef2fbc752d 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -88,7 +88,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -89,7 +89,8 @@ class ToolbarView : public views::AccessiblePaneView, // needs to be displayed. }; diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 9dadee909..760497739 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,5 +1,5 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index ba37a4f5c3604..be5d4c2020660 100644 +index 8ac089ad10e93..7205803b7156c 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h @@ -102,7 +102,7 @@ bool ApplyUserAgentMetadataOverrides( @@ -68,18 +68,18 @@ index 97c7dc7c25000..63c42610bfd9c 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index fcdf677c9772e..b7bfed642fff6 100644 +index 64214a7885df2..0cbc7cfc6fe43 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn -@@ -36,6 +36,7 @@ component("controller") { +@@ -35,6 +35,7 @@ component("controller") { + } configs += [ - "//build/config/compiler:wexit_time_destructors", + "//cef/libcef/features:config", "//third_party/blink/renderer:config", "//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:non_test_config", -@@ -61,6 +62,8 @@ component("controller") { +@@ -60,6 +61,8 @@ component("controller") { "performance_manager/v8_detailed_memory_reporter_impl.h", "performance_manager/v8_worker_memory_reporter.cc", "performance_manager/v8_worker_memory_reporter.h", diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 788e2f0f3..537ae1ee9 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index b91c420730c5e..d69af17943fe7 100644 +index 3083bd8c2a8d6..1966cb5bee7e9 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -589,7 +589,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -588,7 +588,7 @@ void DevToolsHttpHandler::OnJsonRequest( base::Value::Dict version; version.Set("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.Set("WebKit-Version", GetWebKitVersion()); @@ -12,10 +12,10 @@ index b91c420730c5e..d69af17943fe7 100644 version.Set("V8-Version", V8_VERSION_STRING); std::string host = info.GetHeaderValue("host"); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 22fe0e4ff65ce..e38329c932bf2 100644 +index fc00cee495e56..1979a0767edf1 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -721,6 +721,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() { +@@ -741,6 +741,17 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() { resource_request_->has_user_gesture, initiating_origin, initiator_document_.AsRenderFrameHostIfValid(), &loader_factory); @@ -34,10 +34,10 @@ index 22fe0e4ff65ce..e38329c932bf2 100644 factory = base::MakeRefCounted( std::move(loader_factory)); diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 78ae48dcbed95..a5a77e9ad81ce 100644 +index cd77eefb577e6..6cff0a16f2eab 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc -@@ -965,7 +965,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( +@@ -968,7 +968,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( void ContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) {} @@ -46,7 +46,7 @@ index 78ae48dcbed95..a5a77e9ad81ce 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -974,6 +974,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( +@@ -977,6 +977,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = "en-us,en"; @@ -55,7 +55,7 @@ index 78ae48dcbed95..a5a77e9ad81ce 100644 std::vector diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index ceff9665cdb15..657f88d32efd4 100644 +index 5500a0cec01ec..ea2fa77649607 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -35,6 +35,7 @@ @@ -66,7 +66,7 @@ index ceff9665cdb15..657f88d32efd4 100644 #include "content/public/common/alternative_error_page_override_info.mojom-forward.h" #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" -@@ -1776,7 +1777,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1781,7 +1782,7 @@ class CONTENT_EXPORT ContentBrowserClient { // // If |relative_partition_path| is the empty string, it means this needs to // create the default NetworkContext for the BrowserContext. @@ -75,7 +75,7 @@ index ceff9665cdb15..657f88d32efd4 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1979,6 +1980,19 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1984,6 +1985,19 @@ class CONTENT_EXPORT ContentBrowserClient { RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory); @@ -95,7 +95,7 @@ index ceff9665cdb15..657f88d32efd4 100644 // Creates an OverlayWindow to be used for video or Picture-in-Picture. // This window will house the content shown when in Picture-in-Picture mode. // This will return a new OverlayWindow. -@@ -2035,6 +2049,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2040,6 +2054,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -132,10 +132,10 @@ index 77f2c4fbf8c88..ddbacedde912a 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 11759a9fcbe02..87936d85135d9 100644 +index 3d3645fa25131..2b72ced4c62c4 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -628,6 +628,8 @@ void RenderThreadImpl::Init() { +@@ -624,6 +624,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -145,10 +145,10 @@ index 11759a9fcbe02..87936d85135d9 100644 base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index e63b39bbeda10..06bd7d40d0f5c 100644 +index decef7b3d86c0..4efa8338dc3b5 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -976,6 +976,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -969,6 +969,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -165,11 +165,11 @@ index e63b39bbeda10..06bd7d40d0f5c 100644 RendererBlinkPlatformImpl::CreateWebV8ValueConverter() { return std::make_unique(); diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 1c83b5a848a35..909f986cc09df 100644 +index a15ca0214e694..cdc2331096cc5 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -231,6 +231,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - uint64_t private_memory_footprint_bytes) override; +@@ -232,6 +232,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { + base::TimeDelta MinimumIntervalOfUserLevelMemoryPressureSignal() override; #endif + void DevToolsAgentAttached() override; @@ -179,7 +179,7 @@ index 1c83b5a848a35..909f986cc09df 100644 // plus eTLD+1, such as https://google.com), or to a more specific origin. void SetIsLockedToSite(); diff --git headless/lib/browser/headless_content_browser_client.cc headless/lib/browser/headless_content_browser_client.cc -index fab5d1d83f08c..012f4efe4f63e 100644 +index b9f50848e2e75..3ac9b7c3d088a 100644 --- headless/lib/browser/headless_content_browser_client.cc +++ headless/lib/browser/headless_content_browser_client.cc @@ -299,7 +299,7 @@ bool HeadlessContentBrowserClient::IsSharedStorageSelectURLAllowed( @@ -200,7 +200,7 @@ index fab5d1d83f08c..012f4efe4f63e 100644 std::string HeadlessContentBrowserClient::GetProduct() { diff --git headless/lib/browser/headless_content_browser_client.h headless/lib/browser/headless_content_browser_client.h -index 603ebb3aadfec..b189791360362 100644 +index be37373d3d4e8..6741578a5f1b8 100644 --- headless/lib/browser/headless_content_browser_client.h +++ headless/lib/browser/headless_content_browser_client.h @@ -79,7 +79,7 @@ class HeadlessContentBrowserClient : public content::ContentBrowserClient { diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 10624f689..d6fa005a2 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,5 +1,5 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index a3cc7fabebb07..d1e88823f7931 100644 +index 3062f57603321..d8532c9c2eabb 100644 --- content/app/content_main.cc +++ content/app/content_main.cc @@ -173,11 +173,8 @@ ContentMainParams::~ContentMainParams() = default; @@ -39,7 +39,7 @@ index a3cc7fabebb07..d1e88823f7931 100644 InitializeMac(); #endif -@@ -321,16 +309,49 @@ RunContentProcess(ContentMainParams params, +@@ -323,16 +311,49 @@ RunContentProcess(ContentMainParams params, if (IsSubprocess()) CommonSubprocessInit(); @@ -59,7 +59,7 @@ index a3cc7fabebb07..d1e88823f7931 100644 +} + +void ContentMainShutdown(ContentMainRunner* content_main_runner) { - #if !BUILDFLAG(IS_ANDROID) + #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) content_main_runner->Shutdown(); #endif +} @@ -94,7 +94,7 @@ index a3cc7fabebb07..d1e88823f7931 100644 } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 8bfbf0e73fb8d..f80f322b65535 100644 +index 0846656e45ba8..1f34295fb0544 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -46,6 +46,7 @@ @@ -105,7 +105,7 @@ index 8bfbf0e73fb8d..f80f322b65535 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1306,6 +1307,12 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1300,6 +1301,12 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index e06f801b2..f0a81df6d 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -146,7 +146,7 @@ index 39b2de869d225..5a4e621c650ee 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index e5d488e26c170..08d7c35b7cc5c 100644 +index 02bf11a6de045..48d00a9c44123 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -157,7 +157,7 @@ index e5d488e26c170..08d7c35b7cc5c 100644 import("../build/crashpad_buildconfig.gni") static_library("handler") { -@@ -58,6 +59,17 @@ static_library("handler") { +@@ -62,6 +63,17 @@ static_library("handler") { ] } @@ -175,7 +175,7 @@ index e5d488e26c170..08d7c35b7cc5c 100644 public_configs = [ "..:crashpad_config" ] public_deps = [ -@@ -73,6 +85,7 @@ static_library("handler") { +@@ -77,6 +89,7 @@ static_library("handler") { "../snapshot", "../third_party/mini_chromium:chromeos_buildflags", "../tools:tool_support", diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index eede229d8..ce58a4fc9 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,5 +1,5 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index f213668d18044..32a2d4bcfb1b8 100644 +index 9d9a0aac10a35..d1498a8f9df2b 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -17,6 +17,7 @@ diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 2e2a220f6..474ed6250 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -161,7 +161,7 @@ index 9ba85048d1fcf..f3a5b8bc9bda0 100644 // A pointer to the current or speculative main frame in `host_contents_`. We // can't access this frame through the `host_contents_` directly as it does diff --git extensions/browser/extension_registry.cc extensions/browser/extension_registry.cc -index f142a40362c75..ed283ef8f1251 100644 +index c3197eb4790fa..1e7ae767b0582 100644 --- extensions/browser/extension_registry.cc +++ extensions/browser/extension_registry.cc @@ -6,9 +6,14 @@ @@ -250,7 +250,7 @@ index 115f31f9ce46d..914b2564d5a21 100644 base::BindOnce(&ProcessManager::HandleCloseExtensionHost, weak_ptr_factory_.GetWeakPtr())); diff --git extensions/common/extensions_client.cc extensions/common/extensions_client.cc -index 53ad0736cfbdf..c252591fa646d 100644 +index a8108350ddde2..7ae49e78b4327 100644 --- extensions/common/extensions_client.cc +++ extensions/common/extensions_client.cc @@ -23,7 +23,7 @@ ExtensionsClient* g_client = nullptr; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index ba8280cd2..e5a994178 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -12,7 +12,7 @@ index a9b0a5a827fc8..9a0fd388756f3 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 057b4081c95e5..9817b4c62a89e 100644 +index 6b729528b79bd..3b04670a846d6 100644 --- BUILD.gn +++ BUILD.gn @@ -18,6 +18,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,7 +23,7 @@ index 057b4081c95e5..9817b4c62a89e 100644 import("//chrome/browser/buildflags.gni") import("//components/nacl/features.gni") import("//device/vr/buildflags/buildflags.gni") -@@ -279,6 +280,10 @@ group("gn_all") { +@@ -278,6 +279,10 @@ group("gn_all") { deps += root_extra_deps @@ -35,19 +35,18 @@ index 057b4081c95e5..9817b4c62a89e 100644 deps += [ "//printing:printing_unittests" ] } diff --git build/config/win/visual_studio_version.gni build/config/win/visual_studio_version.gni -index 2314ab505bfa2..f10698a79102e 100644 +index 1da479dd5eebc..ff9c7e467997c 100644 --- build/config/win/visual_studio_version.gni +++ build/config/win/visual_studio_version.gni -@@ -5,21 +5,23 @@ +@@ -5,15 +5,14 @@ declare_args() { # Path to Visual Studio. If empty, the default is used which is to use the # automatic toolchain in depot_tools. If set, you must also set the -- # visual_studio_version and wdk_path. -+ # visual_studio_version, wdk_path and windows_sdk_version. +- # visual_studio_version, wdk_path and windows_sdk_version. ++ # visual_studio_version, visual_studio_runtime_dirs and windows_sdk_version. visual_studio_path = "" # Version of Visual Studio pointed to by the visual_studio_path. - # Currently always "2015". visual_studio_version = "" - # Directory of the Windows driver kit. If visual_studio_path is empty, this @@ -58,15 +57,7 @@ index 2314ab505bfa2..f10698a79102e 100644 # Full path to the Windows SDK, not including a backslash at the end. # This value is the default location, override if you have a different - # installation location. - windows_sdk_path = "C:\Program Files (x86)\Windows Kits\10" -+ -+ # Version of the Windows SDK pointed to by the windows_sdk_path. -+ windows_sdk_version = "" - } - - if (visual_studio_path == "") { -@@ -29,12 +31,13 @@ if (visual_studio_path == "") { +@@ -31,14 +30,13 @@ if (visual_studio_path == "") { windows_sdk_version = toolchain_data.sdk_version windows_sdk_path = toolchain_data.sdk_path visual_studio_version = toolchain_data.vs_version @@ -75,14 +66,14 @@ index 2314ab505bfa2..f10698a79102e 100644 } else { assert(visual_studio_version != "", "You must set the visual_studio_version if you set the path") -- assert(wdk_path != "", -- "You must set the wdk_path if you set the visual studio path") -- visual_studio_runtime_dirs = [] -+ assert(windows_sdk_version != "", -+ "You must set the windows_sdk_version if you set the path") + assert(visual_studio_runtime_dirs != "", + "You must set the visual_studio_runtime_dirs if you set the visual " + + "studio path") + assert(windows_sdk_version != "", + "You must set the windows_sdk_version if you set the path") +- assert(wdk_path != "", +- "You must set the wdk_path if you set the visual studio path") +- visual_studio_runtime_dirs = [] } diff --git chrome/app/framework.order chrome/app/framework.order index 60f573a736ba5..90dd6d0b37314 100644 @@ -98,7 +89,7 @@ index 60f573a736ba5..90dd6d0b37314 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index b3f457a9ce656..1af43bc3bb657 100644 +index 84da6451a03ba..ff641f5bdc4c6 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -6,6 +6,7 @@ import("//ash/ambient/resources/resources.gni") diff --git a/patch/patches/gpu_test_trace_4401670.patch b/patch/patches/gpu_test_trace_4401670.patch new file mode 100644 index 000000000..169167872 --- /dev/null +++ b/patch/patches/gpu_test_trace_4401670.patch @@ -0,0 +1,23 @@ +diff --git gpu/BUILD.gn gpu/BUILD.gn +index 671a9e7643de0..498d60c1d35f6 100644 +--- gpu/BUILD.gn ++++ gpu/BUILD.gn +@@ -675,7 +675,6 @@ test("gpu_unittests") { + ":test_support", + "//base", + "//base/test:test_support", +- "//base/test:test_trace_processor", + "//base/third_party/dynamic_annotations", + "//build:chromeos_buildflags", + "//cc:test_support", +@@ -715,6 +714,10 @@ test("gpu_unittests") { + "//url", + ] + ++ if (enable_base_tracing) { ++ deps += [ "//base/test:test_trace_processor" ] ++ } ++ + if (is_android) { + deps += [ + "//ui/android:ui_java", diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 8eec3e93c..49395e673 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec -index d8a54f29cdc9b..127f545f967ee 100644 +index 03c4a6a04c123..92e0ba938198b 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -1121,6 +1121,15 @@ +@@ -1118,6 +1118,15 @@ # END "everything else" section. # Everything but chrome/, components/, content/, and ios/ diff --git a/patch/patches/linux_blink_thread_local.patch b/patch/patches/linux_blink_thread_local.patch index b4134f16f..1516ff0ac 100644 --- a/patch/patches/linux_blink_thread_local.patch +++ b/patch/patches/linux_blink_thread_local.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/renderer/platform/heap/thread_local.h third_party/blink/renderer/platform/heap/thread_local.h -index 6993877c6c3ad..bf4f1626fa332 100644 +index e0519b0982e43..40637ce5952e3 100644 --- third_party/blink/renderer/platform/heap/thread_local.h +++ third_party/blink/renderer/platform/heap/thread_local.h @@ -36,7 +36,7 @@ diff --git a/patch/patches/linux_bluetooth_1319006.patch b/patch/patches/linux_bluetooth_1319006.patch index db5faf81b..e1703a653 100644 --- a/patch/patches/linux_bluetooth_1319006.patch +++ b/patch/patches/linux_bluetooth_1319006.patch @@ -1,5 +1,5 @@ diff --git device/bluetooth/BUILD.gn device/bluetooth/BUILD.gn -index b434121d8f4ea..3c70588acfbec 100644 +index 5e9f447e4d946..64450c1a1f48e 100644 --- device/bluetooth/BUILD.gn +++ device/bluetooth/BUILD.gn @@ -46,10 +46,12 @@ source_set("deprecated_experimental_mojo") { diff --git a/patch/patches/linux_printing_context.patch b/patch/patches/linux_printing_context.patch index 909a36afb..eeb619d05 100644 --- a/patch/patches/linux_printing_context.patch +++ b/patch/patches/linux_printing_context.patch @@ -1,5 +1,5 @@ diff --git printing/printing_context_linux.cc printing/printing_context_linux.cc -index 5520e15c232c8..2648037fcf37e 100644 +index 63af3dd95eada..dc89a9c5c5e47 100644 --- printing/printing_context_linux.cc +++ printing/printing_context_linux.cc @@ -69,11 +69,11 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() { @@ -13,10 +13,10 @@ index 5520e15c232c8..2648037fcf37e 100644 if (!print_dialog_) - print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this); + print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this); - print_dialog_->UseDefaultSettings(); - #endif -@@ -82,8 +82,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() { + if (print_dialog_) { + print_dialog_->UseDefaultSettings(); +@@ -85,8 +85,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() { gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() { #if BUILDFLAG(IS_LINUX) @@ -27,7 +27,7 @@ index 5520e15c232c8..2648037fcf37e 100644 #endif return gfx::Size(); -@@ -95,11 +95,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings( +@@ -98,11 +98,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings( DCHECK(!in_print_job_); #if BUILDFLAG(IS_LINUX) @@ -39,8 +39,8 @@ index 5520e15c232c8..2648037fcf37e 100644 - print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this); + print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this); - // PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will - // remain non-null after this line. + if (print_dialog_) { + // PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will diff --git ui/linux/linux_ui.cc ui/linux/linux_ui.cc index 29db798e8b171..f8b9546b90321 100644 --- ui/linux/linux_ui.cc @@ -76,7 +76,7 @@ index 29db798e8b171..f8b9546b90321 100644 } diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h -index b5fd57741d2f4..eaab5f1bd2b0b 100644 +index 82d40cb5fa1b9..0a08bec8a6e61 100644 --- ui/linux/linux_ui.h +++ ui/linux/linux_ui.h @@ -18,6 +18,10 @@ diff --git a/patch/patches/mac_gpu.patch b/patch/patches/mac_gpu.patch deleted file mode 100644 index 95aa8d37c..000000000 --- a/patch/patches/mac_gpu.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc -index e7bf81292b0f4..e700608f9b9d7 100644 ---- ui/gl/init/gl_initializer_mac.cc -+++ ui/gl/init/gl_initializer_mac.cc -@@ -47,11 +47,8 @@ bool InitializeOneOffForSandbox() { - // GPU-related stuff is very slow without this, probably because - // the sandbox prevents loading graphics drivers or some such. - std::vector attribs; -- if (GLContext::SwitchableGPUsSupported()) { -- // Avoid switching to the discrete GPU just for this pixel -- // format selection. -- attribs.push_back(kCGLPFAAllowOfflineRenderers); -- } -+ // Avoid switching to the discrete GPU just for this pixel format selection. -+ attribs.push_back(kCGLPFAAllowOfflineRenderers); - attribs.push_back(static_cast(0)); - - CGLPixelFormatObj format; diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 4e6ef60e7..cb10b9ee0 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -30,7 +30,7 @@ index 7f5be88878bc6..f72a323b0c8b6 100644 } if (has_msg) diff --git base/task/current_thread.cc base/task/current_thread.cc -index 05daff869644c..ccd19eade21ed 100644 +index b062ee6f827b7..675a604f4b859 100644 --- base/task/current_thread.cc +++ base/task/current_thread.cc @@ -48,6 +48,8 @@ void CurrentThread::AddDestructionObserver( @@ -43,10 +43,10 @@ index 05daff869644c..ccd19eade21ed 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/task/current_thread.h base/task/current_thread.h -index 6e5aea5de684f..22019f157eabd 100644 +index c7e113456e011..041656ff606a8 100644 --- base/task/current_thread.h +++ base/task/current_thread.h -@@ -132,6 +132,12 @@ class BASE_EXPORT CurrentThread { +@@ -133,6 +133,12 @@ class BASE_EXPORT CurrentThread { // with a null callback to clear any potentially pending callbacks. void RegisterOnNextIdleCallback(OnceClosure on_next_idle_callback); @@ -59,7 +59,7 @@ index 6e5aea5de684f..22019f157eabd 100644 // Enables nested task processing in scope of an upcoming native message loop. // Some unwanted message loops may occur when using common controls or printer // functions. Hence, nested task processing is disabled by default to avoid -@@ -196,6 +202,13 @@ class BASE_EXPORT CurrentThread { +@@ -197,6 +203,13 @@ class BASE_EXPORT CurrentThread { friend class web::WebTaskEnvironment; raw_ptr current_; diff --git a/patch/patches/metrics_system_profile.patch b/patch/patches/metrics_system_profile.patch new file mode 100644 index 000000000..d8551b014 --- /dev/null +++ b/patch/patches/metrics_system_profile.patch @@ -0,0 +1,30 @@ +diff --git components/metrics/persistent_system_profile.cc components/metrics/persistent_system_profile.cc +index d0084f3359be2..7acb2178c38f8 100644 +--- components/metrics/persistent_system_profile.cc ++++ components/metrics/persistent_system_profile.cc +@@ -370,6 +370,10 @@ bool PersistentSystemProfile::GetSystemProfile( + return true; + } + ++void PersistentSystemProfile::DetachFromCurrentThread() { ++ DETACH_FROM_THREAD(thread_checker_); ++} ++ + // static + void PersistentSystemProfile::MergeUpdateRecords( + const base::PersistentMemoryAllocator& memory_allocator, +diff --git components/metrics/persistent_system_profile.h components/metrics/persistent_system_profile.h +index 1c5a7491b4f0a..b990176df875f 100644 +--- components/metrics/persistent_system_profile.h ++++ components/metrics/persistent_system_profile.h +@@ -61,6 +61,10 @@ class PersistentSystemProfile { + const base::PersistentMemoryAllocator& memory_allocator, + SystemProfileProto* system_profile); + ++ // Detaches this object from the current thread in preparation for a move to ++ // a different thread. ++ void DetachFromCurrentThread(); ++ + private: + friend class PersistentSystemProfileTest; + diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 7c6b8a68a..f13a9c9e3 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,10 +10,10 @@ index f936d951fe272..90a3165172dce 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 17) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index 48d7ae0d56f20..f8546bd81957c 100644 +index 2ccb6fa76ddc6..f08dd2f2469a6 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -1714,7 +1714,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { +@@ -1709,7 +1709,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index e1dbc4598..e3733d05b 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index afefe3cd83dee..6668463247644 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index 5c162ee2f6edd..c6f31297e33fe 100644 +index 6dab72c3c7471..5578384004d36 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3144,6 +3144,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3140,6 +3140,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,7 +57,7 @@ index 5c162ee2f6edd..c6f31297e33fe 100644 const WebInputEvent& event) { if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index 5b2482ee77ef3..54fa2ea322206 100644 +index f4775ddc34202..e5de7f864ed23 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h @@ -791,6 +791,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 7f8514bdb..c985934e9 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc -index 6fe1ebe84e584..2500dac50ffe3 100644 +index 4b7fcf619a55d..139fd5b4a2bd0 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -24,6 +24,7 @@ @@ -21,7 +21,7 @@ index 6fe1ebe84e584..2500dac50ffe3 100644 using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; -@@ -355,6 +360,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( +@@ -358,6 +363,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( // static DownloadPrefs* DownloadPrefs::FromBrowserContext( content::BrowserContext* context) { @@ -45,26 +45,6 @@ index f2dca42faf347..458703a565501 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/task_manager/web_contents_tags.h" -diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc -index a2adc3c992aba..8cd9aa18e2383 100644 ---- chrome/browser/printing/print_view_manager_base.cc -+++ chrome/browser/printing/print_view_manager_base.cc -@@ -625,13 +625,14 @@ void PrintViewManagerBase::UpdatePrintSettings( - job_settings.Set(kSettingRasterizePdfDpi, value); - } - -+ content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame(); - auto callback_wrapper = - base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply, - weak_ptr_factory_.GetWeakPtr(), std::move(callback)); - std::unique_ptr printer_query = queue_->PopPrinterQuery(cookie); - if (!printer_query) { - printer_query = -- queue_->CreatePrinterQuery(content::GlobalRenderFrameHostId()); -+ queue_->CreatePrinterQuery(render_frame_host->GetGlobalId()); - } - auto* printer_query_ptr = printer_query.get(); - printer_query_ptr->SetSettings( diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html index 5d1658999d5bb..d1b7b7288c946 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html @@ -104,7 +84,7 @@ index d5767fe27db0d..5778847a68208 100644 } diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index e51bf24fcc74f..ed48fb4d6968d 100644 +index fb8f4728eb559..a1a505a31e7af 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -22,6 +22,7 @@ @@ -129,7 +109,7 @@ index e51bf24fcc74f..ed48fb4d6968d 100644 constexpr char kInvalidArgsForDidStartPreview[] = "Invalid arguments for DidStartPreview"; constexpr char kInvalidPageNumberForDidPreviewPage[] = -@@ -328,7 +336,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { +@@ -326,7 +334,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { source->AddLocalizedStrings(kLocalizedStrings); #if !BUILDFLAG(IS_CHROMEOS) diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index f74721c82..e494280f9 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/printing/printer_query.cc chrome/browser/printing/printer_query.cc -index d01d616c3b1ea..580fa043bdc79 100644 +index 7f77a94ddcdbc..149fe2bd90a13 100644 --- chrome/browser/printing/printer_query.cc +++ chrome/browser/printing/printer_query.cc -@@ -115,6 +115,7 @@ PrinterQuery::PrinterQuery(content::GlobalRenderFrameHostId rfh_id) +@@ -116,6 +116,7 @@ PrinterQuery::PrinterQuery(content::GlobalRenderFrameHostId rfh_id) rfh_id_(rfh_id), cookie_(PrintSettings::NewCookie()) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index daee80647..6693df746 100644 --- a/patch/patches/renderer_host_1070713.patch +++ b/patch/patches/renderer_host_1070713.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_view_host_impl.cc content/browser/renderer_host/render_view_host_impl.cc -index 39bd6ef7be6ec..a6ce95a1c8557 100644 +index 172f0b47e2c77..a651cf056c52c 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc @@ -686,6 +686,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { diff --git a/patch/patches/rlz_tracker_4294854.patch b/patch/patches/rlz_tracker_4294854.patch deleted file mode 100644 index 36ac3ad0a..000000000 --- a/patch/patches/rlz_tracker_4294854.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git components/rlz/rlz_tracker.cc components/rlz/rlz_tracker.cc -index b59d3ba6f1aa4..74e488cd4f3c6 100644 ---- components/rlz/rlz_tracker.cc -+++ components/rlz/rlz_tracker.cc -@@ -219,7 +219,8 @@ class RLZTracker::WrapperURLLoaderFactory - - // static - RLZTracker* RLZTracker::GetInstance() { -- return tracker_ ? tracker_ : base::Singleton::get(); -+ static base::NoDestructor instance; -+ return tracker_ ? tracker_ : instance.get(); - } - - RLZTracker::RLZTracker() -diff --git components/rlz/rlz_tracker.h components/rlz/rlz_tracker.h -index 5e30a66838620..bd2166db1f53f 100644 ---- components/rlz/rlz_tracker.h -+++ components/rlz/rlz_tracker.h -@@ -10,7 +10,7 @@ - #include - - #include "base/memory/ref_counted.h" --#include "base/memory/singleton.h" -+#include "base/no_destructor.h" - #include "base/sequence_checker.h" - #include "base/thread_annotations.h" - #include "base/time/time.h" -@@ -128,7 +128,7 @@ class RLZTracker { - void PingNowImpl(); - - private: -- friend struct base::DefaultSingletonTraits; -+ friend class base::NoDestructor; - friend class base::RefCountedThreadSafe; - - // Implementation called from SetRlzDelegate() static method. diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index 0fc4c3ce6..e883ee5ff 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -26,10 +26,10 @@ index d2f5798ce6535..64d6d388c9a27 100644 if (cpu != 'x64'): # x64 is default target CPU thus any other CPU requires a target set diff --git build/vs_toolchain.py build/vs_toolchain.py -index a420dad636df4..f1ef2e914cd5e 100755 +index a9cd6f03d9214..7ae775d6aca6d 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py -@@ -112,9 +112,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): +@@ -114,9 +114,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs) os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH'] elif sys.platform == 'win32' and not depot_tools_win_toolchain: @@ -46,7 +46,7 @@ index a420dad636df4..f1ef2e914cd5e 100755 # When using an installed toolchain these files aren't needed in the output # directory in order to run binaries locally, but they are needed in order # to create isolates or the mini_installer. Copying them to the output -@@ -163,6 +170,10 @@ def _RegistryGetValue(key, value): +@@ -165,6 +172,10 @@ def _RegistryGetValue(key, value): def GetVisualStudioVersion(): """Return best available version of Visual Studio. """ diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 1c633773a..b2cc4210e 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 4cd6bcb8c4ace..6518bf9383621 100644 +index 7098e7e553bcd..b1e4f4c9b9e0b 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -6,6 +6,7 @@ @@ -27,7 +27,7 @@ index 4cd6bcb8c4ace..6518bf9383621 100644 } absl::optional RenderWidgetHostViewAura::GetDisplayFeature() { -@@ -2238,6 +2241,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2247,6 +2250,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // This needs to happen only after |window_| has been initialized using // Init(), because it needs to have the layer. window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index 9a3b0c418..da845fd0e 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc -index 53383355d6646..d7a713017e16d 100644 +index 6162047ffe892..0efb184682a00 100644 --- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc @@ -23,6 +23,7 @@ @@ -10,7 +10,7 @@ index 53383355d6646..d7a713017e16d 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/analysis/analysis_settings.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h" -@@ -232,6 +233,9 @@ bool ContentAnalysisDelegate::IsEnabled( +@@ -243,6 +244,9 @@ bool ContentAnalysisDelegate::IsEnabled( GURL url, Data* data, enterprise_connectors::AnalysisConnector connector) { @@ -21,7 +21,7 @@ index 53383355d6646..d7a713017e16d 100644 enterprise_connectors::ConnectorsServiceFactory::GetForBrowserContext( profile); diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index dd097856a0245..8f07b4b4bdfb2 100644 +index db593e5f07ea8..5e72cd57ee0fa 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -22,6 +22,7 @@ @@ -31,8 +31,8 @@ index dd097856a0245..8f07b4b4bdfb2 100644 +#include "cef/libcef/features/runtime.h" #include "chrome/browser/browser_features.h" #include "chrome/browser/browser_process.h" - #include "chrome/browser/chrome_content_browser_client.h" -@@ -298,8 +299,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) + #include "chrome/browser/content_settings/cookie_settings_factory.h" +@@ -300,8 +301,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) base::Unretained(this))); cookie_settings_ = CookieSettingsFactory::GetForProfile(profile); cookie_settings_observation_.Observe(cookie_settings_.get()); @@ -45,18 +45,7 @@ index dd097856a0245..8f07b4b4bdfb2 100644 DisableQuicIfNotAllowed(); -@@ -339,7 +342,9 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) - base::Unretained(this))); - - #if BUILDFLAG(ENABLE_EXTENSIONS) -- registry_observation_.Observe(extensions::ExtensionRegistry::Get(profile_)); -+ if (auto extension_registry = extensions::ExtensionRegistry::Get(profile_)) { -+ registry_observation_.Observe(extension_registry); -+ } - #endif - } - -@@ -832,7 +837,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -810,7 +813,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( // Configure on-disk storage for non-OTR profiles. OTR profiles just use // default behavior (in memory storage, default sizes). @@ -77,7 +66,7 @@ index dd097856a0245..8f07b4b4bdfb2 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -845,7 +862,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -823,7 +838,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -88,7 +77,7 @@ index dd097856a0245..8f07b4b4bdfb2 100644 ::network::mojom::NetworkContextFilePaths::New(); diff --git chrome/browser/signin/identity_manager_factory.cc chrome/browser/signin/identity_manager_factory.cc -index 0f92e4682eee9..ea6e6ed6f1e05 100644 +index fd58815c03393..c3865639affb1 100644 --- chrome/browser/signin/identity_manager_factory.cc +++ chrome/browser/signin/identity_manager_factory.cc @@ -11,6 +11,7 @@ @@ -99,7 +88,7 @@ index 0f92e4682eee9..ea6e6ed6f1e05 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/image_fetcher/image_decoder_impl.h" #include "chrome/browser/profiles/profile.h" -@@ -82,6 +83,7 @@ IdentityManagerFactory::~IdentityManagerFactory() { +@@ -89,6 +90,7 @@ IdentityManagerFactory::~IdentityManagerFactory() { // static signin::IdentityManager* IdentityManagerFactory::GetForProfile( Profile* profile) { @@ -108,7 +97,7 @@ index 0f92e4682eee9..ea6e6ed6f1e05 100644 GetInstance()->GetServiceForBrowserContext(profile, true)); } diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 44f52e0c14355..6b380a5bfe3c8 100644 +index 6564239ce856a..1754df8ad05a9 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc @@ -554,6 +554,25 @@ void CookieMonster::SetCookieableSchemes( @@ -167,7 +156,7 @@ index 61fd008fc067e..73909be088278 100644 // reset to null. const CookieAccessDelegate* cookie_access_delegate() const { diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc -index 5b4fe64a4374a..780c9726a03d3 100644 +index ba7f48e90026c..a509cc4565e9f 100644 --- services/network/cookie_manager.cc +++ services/network/cookie_manager.cc @@ -283,14 +283,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) { @@ -189,10 +178,10 @@ index 5b4fe64a4374a..780c9726a03d3 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 569b32218cb3c..cf041cc909878 100644 +index 7301ba6c8992e..c34a2919fa9d0 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2257,16 +2257,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2297,16 +2297,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -221,10 +210,10 @@ index 569b32218cb3c..cf041cc909878 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 9433e0e6bbd2c..8f15dca8748a2 100644 +index f32ad0616a72f..c6cc5fcacf34b 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -349,6 +349,9 @@ struct NetworkContextParams { +@@ -346,6 +346,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index 38d0550e5..7379ddebe 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index c0a0fa84be58e..59543775a9c5b 100644 +index e5185febf2cc3..fc296d35427f0 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -494,10 +494,6 @@ class LoginHandlerDelegate { +@@ -496,10 +496,6 @@ class LoginHandlerDelegate { } WebContents* web_contents = web_contents_getter_.Run(); @@ -13,7 +13,7 @@ index c0a0fa84be58e..59543775a9c5b 100644 // WeakPtr is not strictly necessary here due to OnRequestCancelled. creating_login_delegate_ = true; -@@ -549,12 +545,6 @@ void OnAuthRequiredContinuation( +@@ -551,12 +547,6 @@ void OnAuthRequiredContinuation( mojo::PendingRemote auth_challenge_responder, base::RepeatingCallback web_contents_getter) { @@ -26,7 +26,7 @@ index c0a0fa84be58e..59543775a9c5b 100644 new LoginHandlerDelegate( std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_primary_main_frame, process_id, request_id, url, -@@ -2985,8 +2975,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -3050,8 +3040,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index c0a0fa84be58e..59543775a9c5b 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2996,9 +2990,12 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -3061,9 +3055,12 @@ void StoragePartitionImpl::InitNetworkContext() { cert_verifier::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New(); diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 336cdc05c..3833f2aac 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -1,8 +1,8 @@ diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index 3bfd99c004c55..e95bb2a6d78c2 100644 +index 0e1d0b858e9d9..79cc66c6c2e8e 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc -@@ -122,7 +122,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( +@@ -124,7 +124,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( // If we're not incognito mode, schedule all of our file tasks to enable // disk on the storage context. diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index e84ed8275..a02a36637 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,8 +1,8 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index ee17e77330c49..3a4bbed8d4db4 100644 +index 7146ce14ee1a2..acaedc4761331 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h -@@ -64,6 +64,8 @@ +@@ -63,6 +63,8 @@ X("cc") \ X("cc.debug") \ X("cdp.perf") \ diff --git a/patch/patches/views_1749_2102_3330.patch b/patch/patches/views_1749_2102_3330.patch index 0e74fb69a..a43a69a23 100644 --- a/patch/patches/views_1749_2102_3330.patch +++ b/patch/patches/views_1749_2102_3330.patch @@ -1,9 +1,9 @@ diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h -index f1f8f33165a4a..8b07817c654e8 100644 +index 50eeaa9acca98..eb4c7aa70de9c 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h -@@ -15,8 +15,11 @@ - #include "ui/base/models/menu_separator_types.h" +@@ -17,8 +17,11 @@ + #include "ui/color/color_id.h" #include "ui/gfx/native_widget_types.h" +#include "third_party/skia/include/core/SkColor.h" @@ -14,7 +14,7 @@ index f1f8f33165a4a..8b07817c654e8 100644 } namespace ui { -@@ -147,6 +150,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel +@@ -149,6 +152,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel // |event_flags| is a bit mask of ui::EventFlags. virtual void ActivatedAt(size_t index, int event_flags); @@ -106,10 +106,10 @@ index 3c78525361ebf..c922dfe5019a3 100644 } // namespace gfx diff --git ui/views/animation/ink_drop_host.h ui/views/animation/ink_drop_host.h -index a1d08dcdf927a..d2e97e608b357 100644 +index 4512e4e37cb76..ca39d737e9723 100644 --- ui/views/animation/ink_drop_host.h +++ ui/views/animation/ink_drop_host.h -@@ -181,6 +181,8 @@ class VIEWS_EXPORT InkDropHost { +@@ -186,6 +186,8 @@ class VIEWS_EXPORT InkDropHost { View* host_view() { return host_view_; } const View* host_view() const { return host_view_; } @@ -119,10 +119,10 @@ index a1d08dcdf927a..d2e97e608b357 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 55f76e5035abb..4b1cd927c591d 100644 +index ca061545ed8f2..711207914f1fa 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -534,6 +534,12 @@ void LabelButton::OnThemeChanged() { +@@ -552,6 +552,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -136,10 +136,10 @@ index 55f76e5035abb..4b1cd927c591d 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 80e21893c23fb..29b05f765c016 100644 +index e641dc163c5fc..785ccd20e4dd4 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -144,6 +144,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -150,6 +150,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ui::NativeTheme::State GetForegroundThemeState( ui::NativeTheme::ExtraParams* params) const override; @@ -150,7 +150,7 @@ index 80e21893c23fb..29b05f765c016 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index cc9794448399b..22e2abfd34b0f 100644 +index 37c22391d5c94..d96f63ed47ec2 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc @@ -51,12 +51,29 @@ enum LabelPropertyKey { @@ -183,7 +183,7 @@ index cc9794448399b..22e2abfd34b0f 100644 } // namespace namespace views { -@@ -454,6 +471,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -458,6 +475,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged); } @@ -199,7 +199,7 @@ index cc9794448399b..22e2abfd34b0f 100644 std::u16string Label::GetTooltipText() const { return tooltip_text_; } -@@ -759,6 +785,16 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -763,6 +789,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } @@ -217,10 +217,10 @@ index cc9794448399b..22e2abfd34b0f 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index cfcc785aec6e2..1eedb3474e4af 100644 +index 03c33a87c8ee2..3cd41c96ab504 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -241,6 +241,10 @@ class VIEWS_EXPORT Label : public View, +@@ -240,6 +240,10 @@ class VIEWS_EXPORT Label : public View, gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); @@ -231,7 +231,7 @@ index cfcc785aec6e2..1eedb3474e4af 100644 // Gets/Sets the tooltip text. Default behavior for a label (single-line) is // to show the full text if it is wider than its bounds. Calling this // overrides the default behavior and lets you set a custom tooltip. To -@@ -501,6 +505,7 @@ class VIEWS_EXPORT Label : public View, +@@ -500,6 +504,7 @@ class VIEWS_EXPORT Label : public View, int max_width_ = 0; // This is used in single-line mode. int max_width_single_line_ = 0; @@ -240,7 +240,7 @@ index cfcc785aec6e2..1eedb3474e4af 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 2309794bb1692..ad6730b449bf9 100644 +index 9752106bd171b..3a9b02408373d 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc @@ -471,7 +471,8 @@ void MenuController::Run(Widget* parent, @@ -266,10 +266,10 @@ index 2309794bb1692..ad6730b449bf9 100644 params.native_view_for_gestures = native_view_for_gestures_; params.owned_window_anchor = anchor; + params.parent_widget = parent_widget_; - if (item->GetParentMenuItem()) { - params.context = state_.item->GetWidget(); -@@ -2896,8 +2899,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( + params.context = item->GetWidget(); + // (crbug.com/1414232) The item to be open is a submenu. Make sure +@@ -2900,8 +2903,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -281,10 +281,10 @@ index 2309794bb1692..ad6730b449bf9 100644 + base::i18n::IsRTL()); return; + } - MenuItemView* to_select = nullptr; - if (!item->GetSubmenu()->GetMenuItems().empty()) - to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2916,8 +2924,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { + + // Show the sub-menu. + SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); +@@ -2921,8 +2929,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -297,7 +297,7 @@ index 2309794bb1692..ad6730b449bf9 100644 SetSelection(item, SELECTION_UPDATE_IMMEDIATELY); else if (item->GetParentMenuItem()->GetParentMenuItem()) diff --git ui/views/controls/menu/menu_controller.h ui/views/controls/menu/menu_controller.h -index ddc2dc5a381bb..c27f38c5e785e 100644 +index 2dd7c64ce4328..c456df19ddb53 100644 --- ui/views/controls/menu/menu_controller.h +++ ui/views/controls/menu/menu_controller.h @@ -113,7 +113,9 @@ class VIEWS_EXPORT MenuController @@ -311,7 +311,7 @@ index ddc2dc5a381bb..c27f38c5e785e 100644 bool for_drop() const { return for_drop_; } -@@ -730,6 +732,8 @@ class VIEWS_EXPORT MenuController +@@ -724,6 +726,8 @@ class VIEWS_EXPORT MenuController // RunType::SEND_GESTURE_EVENTS_TO_OWNER is set. gfx::NativeView native_view_for_gestures_ = nullptr; @@ -360,7 +360,7 @@ index b8fa1c116ebcd..015f15ed72385 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_host.cc ui/views/controls/menu/menu_host.cc -index 821826daa9e9a..626b8b540fd00 100644 +index d246468d9510b..baf6a250bca8d 100644 --- ui/views/controls/menu/menu_host.cc +++ ui/views/controls/menu/menu_host.cc @@ -143,6 +143,8 @@ void MenuHost::InitMenuHost(const InitParams& init_params) { @@ -396,10 +396,10 @@ index 67cdb883886f8..4ca7d632ad7f9 100644 explicit MenuHost(SubmenuView* submenu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index d49c73d71593e..84bbf9fd78fde 100644 +index 946028ff36e25..7d63a6ba799d5 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1097,6 +1097,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1109,6 +1109,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -415,7 +415,7 @@ index d49c73d71593e..84bbf9fd78fde 100644 } else if (paint_as_selected) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1163,6 +1172,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -1175,6 +1184,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const { @@ -426,11 +426,11 @@ index d49c73d71593e..84bbf9fd78fde 100644 + return text_color; + } + - style::TextContext context = - GetMenuController() && GetMenuController()->use_ash_system_ui_layout() - ? style::CONTEXT_TOUCH_MENU + // Use a custom color if provided by the controller. If the item is selected, + // use the default color. + if (!paint_as_selected && foreground_color_id_.has_value()) { diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index daf9fff97149b..39ba5daae6eb1 100644 +index e826d42492872..2ade4b2f44df5 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc @@ -4,6 +4,7 @@ @@ -441,7 +441,7 @@ index daf9fff97149b..39ba5daae6eb1 100644 #include #include #include -@@ -220,6 +221,76 @@ bool MenuModelAdapter::IsItemChecked(int id) const { +@@ -221,6 +222,76 @@ bool MenuModelAdapter::IsItemChecked(int id) const { return model->IsItemCheckedAt(index); } @@ -651,10 +651,10 @@ index 50291eb07440a..9716791a463aa 100644 void Cancel() override; base::TimeTicks GetClosingEventTime() const override; diff --git ui/views/controls/menu/menu_runner_impl_cocoa.mm ui/views/controls/menu/menu_runner_impl_cocoa.mm -index 5f8fdc6564efd..9dbe6f06764b0 100644 +index 46a50f5a808c3..689c7d3afb21c 100644 --- ui/views/controls/menu/menu_runner_impl_cocoa.mm +++ ui/views/controls/menu/menu_runner_impl_cocoa.mm -@@ -194,6 +194,7 @@ void MenuRunnerImplCocoa::RunMenuAt( +@@ -193,6 +193,7 @@ void MenuRunnerImplCocoa::RunMenuAt( MenuAnchorPosition anchor, int32_t run_types, gfx::NativeView native_view_for_gestures, @@ -676,10 +676,10 @@ index cf696fbcf0714..5c48fd7410b88 100644 // Hides and cancels the menu. diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index e9102acc407c8..46a0cfb8bf436 100644 +index 629877961fe6b..d41bfca45103e 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -263,6 +263,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -260,6 +260,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = background_view_->AddChildView( std::make_unique(content_view, false)); @@ -716,7 +716,7 @@ index 983f9390aa1f6..d6db1ea93e0ef 100644 #if !BUILDFLAG(IS_CHROMEOS_LACROS) if (root_location != root_current_location && diff --git ui/views/view.h ui/views/view.h -index 93a815e296c1c..f2031bb782795 100644 +index d43db49340391..24b68b0d68eed 100644 --- ui/views/view.h +++ ui/views/view.h @@ -21,6 +21,7 @@ @@ -727,7 +727,7 @@ index 93a815e296c1c..f2031bb782795 100644 #include "build/build_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/skia/include/core/SkPath.h" -@@ -285,7 +286,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -286,7 +287,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index d9304d1ce..a22167266 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 0c3953a9e8c68..c3ec0b1b6f79f 100644 +index d770e7b922232..efb97d9a53574 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -656,6 +656,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { +@@ -657,6 +657,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { return scale_override_for_capture_; } @@ -152,10 +152,10 @@ index c4cb1c13fc35c..a9371d66f3f9c 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/ozone/platform/x11/x11_window.cc ui/ozone/platform/x11/x11_window.cc -index cbf300db6ec3a..0e41c846397c7 100644 +index f681a199951f4..365fa8b4c2a46 100644 --- ui/ozone/platform/x11/x11_window.cc +++ ui/ozone/platform/x11/x11_window.cc -@@ -1796,7 +1796,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1801,7 +1801,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(bounds); @@ -243,10 +243,10 @@ index 01d4ffe408a84..fbe41fefbb2bd 100644 base::WeakPtrFactory weak_factory_{this}; }; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -index 1b890d3baef41..c47296b0971a9 100644 +index e24a4268cdfa4..31e97cc4f61c2 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -@@ -273,8 +273,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { +@@ -274,8 +274,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { if (properties.parent_widget) { window_parent_ = DesktopWindowTreeHostPlatform::GetHostForWidget( properties.parent_widget); @@ -258,7 +258,7 @@ index 1b890d3baef41..c47296b0971a9 100644 // Calculate initial bounds. diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 0be1688818063..b627453be9f8b 100644 +index d52fc15106eb3..070800332285c 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -180,16 +180,28 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -325,7 +325,7 @@ index 0be1688818063..b627453be9f8b 100644 SendEventToSink(event); return event->handled(); } -@@ -1215,8 +1237,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { +@@ -1220,8 +1242,16 @@ void DesktopWindowTreeHostWin::SetBoundsInDIP(const gfx::Rect& bounds) { // positions in variable-DPI situations. See https://crbug.com/1224715 for // details. aura::Window* root = nullptr; @@ -344,10 +344,10 @@ index 0be1688818063..b627453be9f8b 100644 } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index b23ba1bf3a49f..f85ff1bef75e4 100644 +index 2b935ac09209c..ef7d7a3675215 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -319,6 +319,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -320,6 +320,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -359,10 +359,10 @@ index b23ba1bf3a49f..f85ff1bef75e4 100644 // the implementation of ::ShowCursor() is based on a counter, so making this // member static ensures that ::ShowCursor() is always called exactly once diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 1e80a2a1d3271..73c5297cba951 100644 +index 3bf08b3dbabd9..81e36e24de16e 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -366,7 +366,8 @@ void Widget::Init(InitParams params) { +@@ -367,7 +367,8 @@ void Widget::Init(InitParams params) { } params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -372,7 +372,7 @@ index 1e80a2a1d3271..73c5297cba951 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -466,13 +467,21 @@ void Widget::Init(InitParams params) { +@@ -467,13 +468,21 @@ void Widget::Init(InitParams params) { if (show_state == ui::SHOW_STATE_MAXIMIZED) { Maximize(); @@ -395,7 +395,7 @@ index 1e80a2a1d3271..73c5297cba951 100644 } if (base::FeatureList::IsEnabled(features::kWidgetLayering)) { -@@ -1592,10 +1601,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { +@@ -1597,10 +1606,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { } gfx::Size Widget::GetMinimumSize() const { @@ -413,7 +413,7 @@ index 1e80a2a1d3271..73c5297cba951 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index c179c718d0255..967a87c07d026 100644 +index e8b02fc9df426..e4ecdd8764244 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h @@ -351,6 +351,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -455,10 +455,10 @@ index 3b9b00b7d79ae..e759e3c1a9f34 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index a73f04ed21dcb..d51a187990319 100644 +index 5de1045439dca..94c6a8b2e914d 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -942,8 +942,12 @@ bool HWNDMessageHandler::IsActive() const { +@@ -939,8 +939,12 @@ bool HWNDMessageHandler::IsActive() const { // In headless mode return expected activation state instead of the // actual one. This ensures that onfocus/onblur notifications work // as expected and no unexpected throttling occurs. @@ -472,7 +472,7 @@ index a73f04ed21dcb..d51a187990319 100644 } bool HWNDMessageHandler::IsMinimized() const { -@@ -3300,10 +3304,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3302,10 +3306,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 14161d0b1..b7b3ffedd 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,7 +80,7 @@ index 8af69cac78b74..9f74e511c263d 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 21a1138ca8df2..283eb9f091583 100644 +index 27c944acb2e84..bc491de193ded 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn @@ -220,6 +220,8 @@ viz_component("service") { @@ -223,7 +223,7 @@ index 2f462f0deb5fc..695869b83cefa 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index e7be43d3f842f..541dc0fde093b 100644 +index 2c587c7d2f7e9..51a4e6fc3f027 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -33,7 +33,9 @@ @@ -261,7 +261,7 @@ index e7be43d3f842f..541dc0fde093b 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -520,6 +533,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -519,6 +532,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index a51ad240c..bff39d999 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index 39e8934e0d54b..bbc9d78392973 100644 +index 79e0289b713ce..abc76cb041465 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -3175,6 +3175,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3189,6 +3189,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -15,7 +15,7 @@ index 39e8934e0d54b..bbc9d78392973 100644 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3185,6 +3191,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3199,6 +3205,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -23,7 +23,7 @@ index 39e8934e0d54b..bbc9d78392973 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3365,6 +3372,9 @@ void WebContentsImpl::RenderWidgetCreated( +@@ -3379,6 +3386,9 @@ void WebContentsImpl::RenderWidgetCreated( OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated", "render_widget_host", render_widget_host); created_widgets_.insert(render_widget_host); @@ -33,7 +33,7 @@ index 39e8934e0d54b..bbc9d78392973 100644 } void WebContentsImpl::RenderWidgetDeleted( -@@ -4096,6 +4106,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4111,6 +4121,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( create_params.picture_in_picture_options = *(params.pip_options); } @@ -49,7 +49,7 @@ index 39e8934e0d54b..bbc9d78392973 100644 // Check whether there is an available prerendered page for this navigation if // this is not for guest. If it exists, take WebContents pre-created for // hosting the prerendered page instead of creating new WebContents. -@@ -7999,6 +8018,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -8035,6 +8054,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // frames). SetFocusedFrameTree(&node->frame_tree()); } @@ -60,10 +60,10 @@ index 39e8934e0d54b..bbc9d78392973 100644 void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 5644b0efa9a3e..da63511c87213 100644 +index f020af02d53a4..e263e4a456905 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -95,10 +95,12 @@ class BrowserContext; +@@ -96,10 +96,12 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -76,7 +76,7 @@ index 5644b0efa9a3e..da63511c87213 100644 class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -241,6 +243,10 @@ class WebContents : public PageNavigator, +@@ -242,6 +244,10 @@ class WebContents : public PageNavigator, network::mojom::WebSandboxFlags starting_sandbox_flags = network::mojom::WebSandboxFlags::kNone; @@ -88,10 +88,10 @@ index 5644b0efa9a3e..da63511c87213 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index b7325f818a264..d37cb4da81eb6 100644 +index 5da6f93293bc5..349ae25c0af08 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -58,9 +58,11 @@ class EyeDropperListener; +@@ -59,9 +59,11 @@ class EyeDropperListener; class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; @@ -103,7 +103,7 @@ index b7325f818a264..d37cb4da81eb6 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -342,6 +344,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -343,6 +345,14 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionConfig& partition_config, SessionStorageNamespace* session_storage_namespace); @@ -119,10 +119,10 @@ index b7325f818a264..d37cb4da81eb6 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index f4c8ee3fe8b16..2d2f90d9f1269 100644 +index 977cd925f574c..43d6c1e953e94 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -219,6 +219,9 @@ class CONTENT_EXPORT WebContentsObserver { +@@ -220,6 +220,9 @@ class CONTENT_EXPORT WebContentsObserver { virtual void OnCaptureHandleConfigUpdate( const blink::mojom::CaptureHandleConfig& config) {} @@ -132,7 +132,7 @@ index f4c8ee3fe8b16..2d2f90d9f1269 100644 // This method is invoked when the `blink::WebView` of the current // RenderViewHost is ready, e.g. because we recreated it after a crash. virtual void RenderViewReady() {} -@@ -798,6 +801,10 @@ class CONTENT_EXPORT WebContentsObserver { +@@ -812,6 +815,10 @@ class CONTENT_EXPORT WebContentsObserver { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 4feb10567..786612b60 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,9 +1,9 @@ diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index e2fb979da659c..b0686d990445e 100644 +index 17e2a2876789c..b708401ec2c0f 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -791,6 +791,11 @@ class BLINK_PLATFORM_EXPORT Platform { - uint64_t private_memory_footprint_bytes) {} +@@ -793,6 +793,11 @@ class BLINK_PLATFORM_EXPORT Platform { + } #endif + // DevTools ------------------------------------------------------------ diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 1addc85b1..befb7cd13 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index c8655d9270b81..d11450d22123a 100644 +index 2c3930e849719..12c81c7c0e7e6 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h -@@ -340,6 +340,7 @@ class BLINK_EXPORT WebView { +@@ -342,6 +342,7 @@ class BLINK_EXPORT WebView { // Sets whether select popup menus should be rendered by the browser. static void SetUseExternalPopupMenus(bool); @@ -11,7 +11,7 @@ index c8655d9270b81..d11450d22123a 100644 // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index 823d6d2ab3772..80310bb1ab1e3 100644 +index bb5b2ecb90889..6a1a7c47e8c86 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -250,8 +250,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { @@ -30,7 +30,7 @@ index 823d6d2ab3772..80310bb1ab1e3 100644 } namespace { -@@ -564,6 +569,7 @@ WebViewImpl::WebViewImpl( +@@ -567,6 +572,7 @@ WebViewImpl::WebViewImpl( chrome_client_(MakeGarbageCollected(this)), minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), @@ -39,10 +39,10 @@ index 823d6d2ab3772..80310bb1ab1e3 100644 fullscreen_controller_(std::make_unique(this)), page_base_background_color_( diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index dcd53ce7503b0..a30c89bf46884 100644 +index 421ca0b15eea5..4802d65c6dc4f 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -134,7 +134,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -135,7 +135,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -52,7 +52,7 @@ index dcd53ce7503b0..a30c89bf46884 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -846,6 +847,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -848,6 +849,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -62,7 +62,7 @@ index dcd53ce7503b0..a30c89bf46884 100644 gfx::Transform device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index c1e0b9eff83cb..333ad8c8e2990 100644 +index 89a9e47e85841..fe8754953c060 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc @@ -916,7 +916,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index e97276d36..e4bf865f1 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index be3a3fe0be6cd..8c1dc6b58850c 100644 +index 0aae647fea27f..295319c17b46f 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -19,10 +19,12 @@ @@ -15,7 +15,7 @@ index be3a3fe0be6cd..8c1dc6b58850c 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h" #include "chrome/browser/google/google_brand.h" -@@ -398,7 +400,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -397,7 +399,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -28,7 +28,7 @@ index be3a3fe0be6cd..8c1dc6b58850c 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); #if BUILDFLAG(IS_WIN) -@@ -472,8 +478,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -471,8 +477,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -41,7 +41,7 @@ index be3a3fe0be6cd..8c1dc6b58850c 100644 std::string extensions_list; for (const scoped_refptr& extension : extension_registry->enabled_extensions()) { -@@ -577,6 +587,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -576,6 +586,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if BUILDFLAG(IS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/win_sandbox_3210.patch b/patch/patches/win_sandbox_3210.patch index 5ff8b41c9..d87717bed 100644 --- a/patch/patches/win_sandbox_3210.patch +++ b/patch/patches/win_sandbox_3210.patch @@ -1,8 +1,8 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index fe0394187eae7..0c7927246a9f9 100644 +index d663390faa8e2..018cd11d9487f 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc -@@ -1006,6 +1006,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -998,6 +998,13 @@ ResultCode SandboxWin::StartSandboxedProcess( const base::HandlesToInheritVector& handles_to_inherit, SandboxDelegate* delegate, base::Process* process) { diff --git a/tests/ceftests/cors_unittest.cc b/tests/ceftests/cors_unittest.cc index a0be81448..ec9778201 100644 --- a/tests/ceftests/cors_unittest.cc +++ b/tests/ceftests/cors_unittest.cc @@ -830,7 +830,7 @@ void SetupIframeRequest(CookieTestSetup* setup, IsStandardType(main_handler)) { setup->AddConsoleMessage( "An iframe which has both allow-scripts and allow-same-origin for " - "its sandbox attribute can remove its sandboxing."); + "its sandbox attribute can escape its sandboxing."); } } else { // Expect JavaScript execution to fail. diff --git a/tools/gn_args.py b/tools/gn_args.py index 026ac2c4e..360405004 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -265,7 +265,6 @@ def GetRecommendedDefaultArgs(): # These require use_partition_alloc_as_malloc=true, so disable them. result['enable_backup_ref_ptr_support'] = False - result['enable_mte_checked_ptr_support'] = False return result @@ -506,7 +505,6 @@ def GetConfigArgsSandbox(platform, args, is_debug, cpu): # These require use_partition_alloc_as_malloc=true, so disable them. 'enable_backup_ref_ptr_support': False, - 'enable_mte_checked_ptr_support': False, # Avoid /LTCG linker warnings and generate smaller lib files. 'is_official_build': False,