From 00dca9601e793b683df888e93551a4a346970679 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 3 Jun 2021 21:34:56 -0400 Subject: [PATCH] Update to Chromium version 92.0.4515.0 (#885287) --- BUILD.gn | 7 ++ CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- libcef/browser/alloy/alloy_browser_context.cc | 16 +-- libcef/browser/alloy/alloy_browser_context.h | 1 - .../browser/alloy/alloy_browser_host_impl.cc | 18 +-- libcef/browser/alloy/alloy_browser_main.cc | 7 +- libcef/browser/alloy/alloy_browser_main.h | 8 +- .../alloy/alloy_content_browser_client.cc | 23 ++-- .../alloy/alloy_content_browser_client.h | 6 +- .../alloy/browser_platform_delegate_alloy.cc | 6 +- libcef/browser/alloy/chrome_profile_alloy.cc | 15 +-- libcef/browser/alloy/chrome_profile_alloy.h | 1 - .../alloy/chrome_profile_manager_alloy.cc | 7 -- .../alloy/chrome_profile_manager_alloy.h | 1 - .../browser/audio_loopback_stream_creator.cc | 2 +- libcef/browser/browser_contents_delegate.cc | 37 ++---- libcef/browser/browser_contents_delegate.h | 3 +- libcef/browser/browser_context.cc | 28 ++--- libcef/browser/browser_context.h | 4 +- libcef/browser/browser_frame.cc | 2 +- libcef/browser/browser_frame.h | 2 +- libcef/browser/browser_host_base.cc | 3 +- .../browser/chrome/chrome_browser_context.cc | 8 +- .../browser/chrome/chrome_browser_delegate.h | 2 +- .../chrome_content_browser_client_cef.cc | 10 +- .../chrome_content_browser_client_cef.h | 4 +- .../chrome/chrome_context_menu_handler.cc | 4 +- .../chrome/views/chrome_browser_view.cc | 2 +- .../browser/chrome/views/toolbar_view_impl.cc | 4 +- .../browser/chrome/views/toolbar_view_impl.h | 6 +- .../browser/chrome/views/toolbar_view_view.cc | 2 +- .../browser/chrome/views/toolbar_view_view.h | 2 +- libcef/browser/context.cc | 10 +- .../browser/devtools/devtools_file_manager.cc | 45 +++---- .../browser/devtools/devtools_file_manager.h | 18 +-- libcef/browser/devtools/devtools_frontend.cc | 22 ++-- libcef/browser/devtools/devtools_frontend.h | 2 +- libcef/browser/devtools/devtools_manager.cc | 2 +- .../devtools/devtools_util_unittest.cc | 18 +-- libcef/browser/download_manager_delegate.cc | 12 +- .../browser/extensions/api/tabs/tabs_api.cc | 105 ++++++---------- libcef/browser/extensions/api/tabs/tabs_api.h | 22 +--- .../extensions/browser_extensions_util.cc | 4 +- .../browser_platform_delegate_background.cc | 4 +- libcef/browser/extensions/extension_system.cc | 19 +-- .../extension_web_contents_observer.cc | 3 +- .../extensions/value_store/cef_value_store.cc | 6 +- libcef/browser/file_dialog_manager.cc | 2 +- libcef/browser/frame_host_impl.cc | 2 +- libcef/browser/frame_host_impl.h | 2 +- libcef/browser/image_impl.cc | 8 +- libcef/browser/image_impl.h | 6 +- libcef/browser/iothread_state.cc | 4 +- libcef/browser/main_runner.cc | 4 +- libcef/browser/main_runner.h | 2 +- .../browser/media_router/media_router_impl.cc | 4 +- libcef/browser/menu_manager.cc | 30 ++--- libcef/browser/menu_model_impl.cc | 10 +- .../browser_platform_delegate_native_win.cc | 4 +- libcef/browser/native/cursor_util.cc | 6 +- libcef/browser/native/cursor_util.h | 6 +- libcef/browser/native/cursor_util_linux.cc | 11 +- libcef/browser/native/cursor_util_win.cc | 4 +- libcef/browser/native/native_menu_win.cc | 4 +- libcef/browser/native/window_delegate_view.cc | 2 +- libcef/browser/native/window_x11.cc | 5 +- libcef/browser/net/chrome_scheme_handler.cc | 14 ++- libcef/browser/net/throttle_handler.cc | 5 +- .../net_service/browser_urlrequest_impl.cc | 31 +++-- .../net_service/browser_urlrequest_impl.h | 6 +- libcef/browser/net_service/cookie_helper.cc | 4 +- libcef/browser/net_service/cookie_helper.h | 5 +- .../net_service/cookie_manager_impl.cc | 35 +++--- libcef/browser/net_service/login_delegate.cc | 4 +- .../net_service/proxy_url_loader_factory.cc | 34 +++--- .../net_service/proxy_url_loader_factory.h | 4 +- .../resource_request_handler_wrapper.cc | 13 +- .../resource_request_handler_wrapper.h | 2 +- .../net_service/stream_reader_url_loader.cc | 12 +- .../net_service/stream_reader_url_loader.h | 8 +- .../net_service/url_loader_factory_getter.cc | 7 +- libcef/browser/origin_whitelist_impl.cc | 19 +-- libcef/browser/origin_whitelist_impl.h | 4 +- .../osr/render_widget_host_view_osr.cc | 59 +++++---- .../browser/osr/render_widget_host_view_osr.h | 13 +- libcef/browser/osr/video_consumer_osr.cc | 4 +- libcef/browser/osr/video_consumer_osr.h | 6 +- libcef/browser/prefs/browser_prefs.cc | 8 +- .../constrained_window_views_client.cc | 1 + libcef/browser/printing/print_dialog_linux.cc | 14 ++- libcef/browser/printing/print_view_manager.cc | 19 +-- libcef/browser/printing/print_view_manager.h | 5 +- libcef/browser/request_context_impl.cc | 22 ++-- libcef/browser/simple_menu_model_impl.cc | 2 +- libcef/browser/simple_menu_model_impl.h | 2 +- libcef/browser/trace_subscriber.cc | 22 ++-- libcef/browser/views/button_impl.h | 14 +-- libcef/browser/views/button_view.h | 7 +- libcef/browser/views/window_impl.cc | 11 +- libcef/browser/views/window_view.cc | 3 +- libcef/browser/views/window_view.h | 3 +- libcef/browser/web_plugin_impl.cc | 15 +-- libcef/common/alloy/alloy_main_delegate.cc | 19 +-- libcef/common/alloy/alloy_main_delegate.h | 2 +- .../common/chrome/chrome_main_delegate_cef.cc | 18 +-- .../common/chrome/chrome_main_delegate_cef.h | 2 +- libcef/common/command_line_impl.cc | 18 ++- libcef/common/crash_reporter_client.cc | 2 +- libcef/common/json_impl.cc | 2 +- libcef/common/main_runner_handler.h | 2 +- libcef/common/resource_bundle_delegate.cc | 4 +- libcef/common/resource_bundle_delegate.h | 2 +- libcef/common/task_impl.cc | 4 +- libcef/common/task_runner_impl.cc | 4 +- libcef/common/thread_impl.cc | 2 +- libcef/common/values_impl.cc | 4 - libcef/common/widevine_loader.cc | 11 +- .../alloy/alloy_content_renderer_client.cc | 8 +- .../alloy/alloy_content_renderer_client.h | 2 +- .../alloy/alloy_render_thread_observer.cc | 2 +- .../chrome_content_renderer_client_cef.cc | 4 +- .../extensions/extensions_renderer_client.cc | 4 +- libcef/renderer/frame_impl.cc | 2 +- libcef/renderer/render_manager.cc | 6 +- libcef/renderer/render_manager.h | 8 +- libcef/renderer/render_urlrequest_impl.cc | 1 - libcef/renderer/v8_impl.cc | 2 +- patch/patch.cfg | 6 + patch/patches/base_sandbox_2743.patch | 6 +- patch/patches/base_string_piece_1049498.patch | 6 +- patch/patches/browser_scheduler.patch | 2 +- .../browser_security_policy_1081397.patch | 8 +- patch/patches/build.patch | 4 +- patch/patches/chrome_browser.patch | 6 +- ...rome_browser_background_mode_1100085.patch | 59 ++------- patch/patches/chrome_browser_browser.patch | 54 ++++----- .../chrome_browser_content_settings.patch | 4 +- .../chrome_browser_context_menus.patch | 34 +++--- patch/patches/chrome_browser_net_export.patch | 34 +++--- .../patches/chrome_browser_profile_menu.patch | 12 +- patch/patches/chrome_browser_profiles.patch | 59 ++++----- .../chrome_browser_safe_browsing.patch | 2 +- .../chrome_browser_sharesheet_1123388.patch | 48 +++----- patch/patches/chrome_browser_themes.patch | 12 +- patch/patches/chrome_plugins.patch | 20 ++-- patch/patches/chrome_renderer.patch | 6 +- patch/patches/chrome_runtime.patch | 46 +++---- patch/patches/chrome_runtime_views.patch | 80 ++++++------- patch/patches/chrome_widevine.patch | 2 +- patch/patches/component_build.patch | 16 +-- patch/patches/content_2015.patch | 86 ++++++------- patch/patches/content_main_654986.patch | 18 +-- patch/patches/crashpad_1995.patch | 13 +- patch/patches/crashpad_tp_1995.patch | 8 +- patch/patches/embedder_product_override.patch | 8 +- patch/patches/extensions_1947.patch | 8 +- patch/patches/gn_config.patch | 18 +-- patch/patches/gritsettings.patch | 4 +- .../linux_allocator_uffd_1206047.patch | 17 +++ patch/patches/linux_assets_path_1936.patch | 4 +- patch/patches/message_loop.patch | 4 +- patch/patches/message_pump_mac_2495.patch | 6 +- .../mime_handler_view_guest_1565_2727.patch | 2 +- patch/patches/net_cookie_flags.patch | 6 +- patch/patches/osr_fling_2745.patch | 8 +- patch/patches/print_preview_123.patch | 113 +++++++----------- patch/patches/printing_context_2196.patch | 10 +- patch/patches/renderer_host_1070713.patch | 4 +- .../renderer_preferences_util_545103.patch | 6 +- patch/patches/resource_bundle_2512.patch | 8 +- patch/patches/runhooks.patch | 2 +- patch/patches/rwh_background_color_1984.patch | 8 +- patch/patches/services_network_2622.patch | 28 ++--- patch/patches/services_network_2718.patch | 14 +-- .../patches/set_resize_background_color.patch | 6 +- patch/patches/storage_incognito_2289.patch | 20 ++-- patch/patches/trace_event.patch | 4 +- patch/patches/views_1749_2102.patch | 88 +++++++------- patch/patches/views_widget.patch | 82 ++++++------- patch/patches/viz_osr_2575.patch | 36 +++--- patch/patches/web_contents_1257_1565.patch | 26 ++-- .../web_url_loader_cancel_1617042.patch | 6 +- patch/patches/webkit_plugin_info_2015.patch | 32 ++--- .../webkit_popups_and_background.patch | 34 +++--- patch/patches/webui_2037.patch | 6 +- patch/patches/webview_plugin_2020.patch | 4 +- tests/ceftests/cors_unittest.cc | 35 +++--- tests/ceftests/scheme_handler_unittest.cc | 4 +- tests/ceftests/views/scroll_view_unittest.cc | 4 +- tools/compile_ib_files.py | 4 +- 190 files changed, 1234 insertions(+), 1309 deletions(-) create mode 100644 patch/patches/linux_allocator_uffd_1206047.patch diff --git a/BUILD.gn b/BUILD.gn index 85b6e4948..5b7e647c8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -363,6 +363,9 @@ if (is_win) { # Required by content_switches.cc "//media:media_buildflags", + + # Required by crash_keys.cc (from base/stl_util.h) + "//third_party/abseil-cpp:absl", ] } } @@ -796,6 +799,10 @@ static_library("libcef_static") { # For Chrome runtime support. "//chrome/app/chrome_main_delegate.cc", "//chrome/app/chrome_main_delegate.h", + + # Part of //content//test::test_support which is testingonly. + "//content/public/test/scoped_web_ui_controller_factory_registration.cc", + "//content/public/test/scoped_web_ui_controller_factory_registration.h", ] configs += [ diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 55daf5b57..287593fb6 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/91.0.4472.0' + 'chromium_checkout': 'refs/tags/92.0.4515.0' } diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index 96516f4d5..d34c5db1f 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -311,13 +311,12 @@ AlloyBrowserContext::GetClientHintsControllerDelegate() { ChromeZoomLevelPrefs* AlloyBrowserContext::GetZoomLevelPrefs() { return static_cast( - GetStoragePartition(this, nullptr)->GetZoomLevelDelegate()); + GetStoragePartition(nullptr)->GetZoomLevelDelegate()); } scoped_refptr AlloyBrowserContext::GetURLLoaderFactory() { - return GetDefaultStoragePartition(this) - ->GetURLLoaderFactoryForBrowserProcess(); + return GetDefaultStoragePartition()->GetURLLoaderFactoryForBrowserProcess(); } base::FilePath AlloyBrowserContext::GetPath() { @@ -339,18 +338,11 @@ AlloyBrowserContext::CreateZoomLevelDelegate( zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); } -bool AlloyBrowserContext::IsOffTheRecord() const { - // Alloy contexts are never flagged as off-the-record. It causes problems - // for the extension system. - return false; -} - content::DownloadManagerDelegate* AlloyBrowserContext::GetDownloadManagerDelegate() { if (!download_manager_delegate_) { - content::DownloadManager* manager = - BrowserContext::GetDownloadManager(this); - download_manager_delegate_.reset(new CefDownloadManagerDelegate(manager)); + download_manager_delegate_.reset( + new CefDownloadManagerDelegate(GetDownloadManager())); } return download_manager_delegate_.get(); } diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index 72c458196..0b584f315 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -64,7 +64,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy, base::FilePath GetPath() const override; std::unique_ptr CreateZoomLevelDelegate( const base::FilePath& partition_path) override; - bool IsOffTheRecord() const override; content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; content::BrowserPluginGuestManager* GetGuestManager() override; storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 1af79386c..574486a76 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -639,7 +639,7 @@ void AlloyBrowserHostImpl::SendExternalBeginFrame() { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK( CEF_UIT, - base::Bind(&AlloyBrowserHostImpl::SendExternalBeginFrame, this)); + base::BindOnce(&AlloyBrowserHostImpl::SendExternalBeginFrame, this)); return; } @@ -654,8 +654,8 @@ void AlloyBrowserHostImpl::SendTouchEvent(const CefTouchEvent& event) { } if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, base::Bind(&AlloyBrowserHostImpl::SendTouchEvent, - this, event)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::SendTouchEvent, + this, event)); return; } @@ -800,10 +800,10 @@ bool AlloyBrowserHostImpl::MaybeAllowNavigation( // The PDF viewer will load the PDF extension in the guest view, and print // preview will load chrome://print in the guest view. All other navigations // are passed to the owner browser. - CEF_POST_TASK( - CEF_UIT, - base::Bind(base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab), - this, nullptr, params)); + CEF_POST_TASK(CEF_UIT, + base::BindOnce( + base::IgnoreResult(&AlloyBrowserHostImpl::OpenURLFromTab), + this, nullptr, params)); return false; } @@ -1077,8 +1077,8 @@ void AlloyBrowserHostImpl::DragSourceEndedAt( void AlloyBrowserHostImpl::SetAudioMuted(bool mute) { if (!CEF_CURRENTLY_ON_UIT()) { - CEF_POST_TASK(CEF_UIT, - base::Bind(&AlloyBrowserHostImpl::SetAudioMuted, this, mute)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::SetAudioMuted, + this, mute)); return; } if (!web_contents()) diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index ffcde4281..020a895d3 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -109,7 +109,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() { #endif // defined(TOOLKIT_VIEWS) } -void AlloyBrowserMainParts::PreMainMessageLoopStart() { +void AlloyBrowserMainParts::PreCreateMainMessageLoop() { #if defined(USE_AURA) && defined(USE_X11) ui::TouchFactory::SetTouchDeviceListFromCommandLine(); #endif @@ -129,7 +129,7 @@ void AlloyBrowserMainParts::PreMainMessageLoopStart() { media_router::ChromeMediaRouterFactory::DoPlatformInit(); } -void AlloyBrowserMainParts::PostMainMessageLoopStart() { +void AlloyBrowserMainParts::PostCreateMainMessageLoop() { #if defined(OS_LINUX) printing::PrintingContextLinux::SetCreatePrintDialogFunction( &CefPrintDialogLinux::CreatePrintDialog); @@ -155,7 +155,8 @@ int AlloyBrowserMainParts::PreCreateThreads() { int AlloyBrowserMainParts::PreMainMessageLoopRun() { #if defined(USE_AURA) - display::Screen::SetScreenInstance(views::CreateDesktopScreen()); + screen_ = views::CreateDesktopScreen(); + display::Screen::SetScreenInstance(screen_.get()); #endif if (extensions::ExtensionsEnabled()) { diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 609b60c2f..5e338a176 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -24,6 +24,9 @@ class ExtensionsClient; } // namespace extensions #if defined(USE_AURA) +namespace display { +class Screen; +} namespace wm { class WMState; } @@ -47,8 +50,8 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { int PreEarlyInitialization() override; void ToolkitInitialized() override; - void PreMainMessageLoopStart() override; - void PostMainMessageLoopStart() override; + void PreCreateMainMessageLoop() override; + void PostCreateMainMessageLoop() override; int PreCreateThreads() override; int PreMainMessageLoopRun() override; void PostMainMessageLoopRun() override; @@ -91,6 +94,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { scoped_refptr user_blocking_task_runner_; #if defined(USE_AURA) + std::unique_ptr screen_; std::unique_ptr wm_state_; #endif diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index abb3f084d..2debc97df 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -98,6 +98,7 @@ #include "content/public/common/storage_quota_params.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" +#include "extensions/browser/event_router.h" #include "extensions/browser/extension_message_filter.h" #include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_registry.h" @@ -238,9 +239,10 @@ class CefAllowCertificateErrorCallbackImpl : public CefRequestCallback { RunNow(std::move(callback_), allow); } } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefAllowCertificateErrorCallbackImpl::Continue, - this, allow)); + CEF_POST_TASK( + CEF_UIT, + base::BindOnce(&CefAllowCertificateErrorCallbackImpl::Continue, this, + allow)); } } @@ -1043,6 +1045,11 @@ void AlloyContentBrowserClient::ExposeInterfacesToRenderer( associated_registry->AddInterface( base::BindRepeating(&BindPluginInfoHost, host->GetID())); + if (extensions::ExtensionsEnabled()) { + associated_registry->AddInterface(base::BindRepeating( + &extensions::EventRouter::BindForRenderer, host->GetID())); + } + CefBrowserManager::ExposeInterfacesToRenderer(registry, associated_registry, host); } @@ -1152,7 +1159,7 @@ bool AlloyContentBrowserClient::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -1250,7 +1257,7 @@ bool AlloyContentBrowserClient::HandleExternalProtocol( bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) { // Call the other HandleExternalProtocol variant. return false; @@ -1269,8 +1276,8 @@ bool AlloyContentBrowserClient::HandleExternalProtocol( // nothing handles the request. auto request_handler = net_service::CreateInterceptedRequestHandler( web_contents_getter, frame_tree_node_id, resource_request, - base::Bind(CefBrowserPlatformDelegate::HandleExternalProtocol, - resource_request.url)); + base::BindRepeating(CefBrowserPlatformDelegate::HandleExternalProtocol, + resource_request.url)); net_service::ProxyURLLoaderFactory::CreateProxy( web_contents_getter, std::move(receiver), std::move(request_handler)); @@ -1366,7 +1373,7 @@ bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed( content::BrowserContext* browser_context, const GURL& url, const GURL& site_for_cookies, - const base::Optional& top_frame_origin) { + const absl::optional& top_frame_origin) { // Persistent MediaDevice IDs are allowed if cookies are allowed. return CookieSettingsFactory::GetForProfile( Profile::FromBrowserContext(browser_context)) diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 194401b53..95ac3e038 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -158,7 +158,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -185,7 +185,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) override; bool HandleExternalProtocol( @@ -211,7 +211,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { content::BrowserContext* browser_context, const GURL& scope, const GURL& site_for_cookies, - const base::Optional& top_frame_origin) override; + const absl::optional& top_frame_origin) override; bool ShouldAllowPluginCreation( const url::Origin& embedder_origin, const content::PepperPluginInfo& plugin_info) override; diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 18aad738c..08fe7dc2e 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -379,12 +379,12 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF( return; printing::CefPrintViewManager::PdfPrintCallback pdf_callback; if (callback.get()) { - pdf_callback = base::Bind(&CefPdfPrintCallback::OnPdfPrintFinished, - callback.get(), path); + pdf_callback = base::BindOnce(&CefPdfPrintCallback::OnPdfPrintFinished, + callback.get(), path); } GetPrintViewManager(actionable_contents) ->PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path), - settings, pdf_callback); + settings, std::move(pdf_callback)); } void CefBrowserPlatformDelegateAlloy::Find(int identifier, diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index be54b205c..2aa14f818 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -6,6 +6,7 @@ #include "libcef/browser/alloy/chrome_profile_alloy.h" #include "base/no_destructor.h" +#include "components/profile_metrics/browser_profile_type.h" #include "components/variations/variations_client.h" #include "components/variations/variations_ids_provider.h" #include "net/url_request/url_request_context.h" @@ -35,7 +36,10 @@ class CefVariationsClient : public variations::VariationsClient { } // namespace -ChromeProfileAlloy::ChromeProfileAlloy() {} +ChromeProfileAlloy::ChromeProfileAlloy() { + profile_metrics::SetBrowserProfileType( + this, profile_metrics::BrowserProfileType::kRegular); +} ChromeProfileAlloy::~ChromeProfileAlloy() {} @@ -44,13 +48,15 @@ bool ChromeProfileAlloy::IsOffTheRecord() { } bool ChromeProfileAlloy::IsOffTheRecord() const { + // Alloy contexts are never flagged as off-the-record. It causes problems + // for the extension system. return false; } const Profile::OTRProfileID& ChromeProfileAlloy::GetOTRProfileID() const { NOTREACHED(); static base::NoDestructor otr_profile_id( - "ProfileImp::NoOTRProfileID"); + Profile::OTRProfileID::PrimaryID()); return *otr_profile_id; } @@ -116,11 +122,6 @@ ChromeProfileAlloy::GetExtensionSpecialStoragePolicy() { return nullptr; } -PrefService* ChromeProfileAlloy::GetOffTheRecordPrefs() { - NOTREACHED(); - return nullptr; -} - bool ChromeProfileAlloy::IsSameOrParent(Profile* profile) { NOTREACHED(); return false; diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index 20083610b..bf5e1fc49 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -38,7 +38,6 @@ class ChromeProfileAlloy : public Profile { bool IsSupervised() const override; bool IsChild() const override; ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; - PrefService* GetOffTheRecordPrefs() override; bool IsSameOrParent(Profile* profile) override; base::Time GetStartTime() const override; base::FilePath last_selected_directory() override; diff --git a/libcef/browser/alloy/chrome_profile_manager_alloy.cc b/libcef/browser/alloy/chrome_profile_manager_alloy.cc index 860604709..a2a757b69 100644 --- a/libcef/browser/alloy/chrome_profile_manager_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_manager_alloy.cc @@ -56,10 +56,3 @@ bool ChromeProfileManagerAlloy::IsValidProfile(const void* profile) { return !!CefBrowserContext::FromBrowserContext( static_cast(profile)); } - -Profile* ChromeProfileManagerAlloy::GetLastUsedProfile( - const base::FilePath& user_data_dir) { - // Override this method to avoid having to register prefs::kProfileLastUsed, - // usage of which doesn't make sense for CEF. - return GetActiveBrowserContext()->AsProfile(); -} diff --git a/libcef/browser/alloy/chrome_profile_manager_alloy.h b/libcef/browser/alloy/chrome_profile_manager_alloy.h index aa5332997..6936b5a10 100644 --- a/libcef/browser/alloy/chrome_profile_manager_alloy.h +++ b/libcef/browser/alloy/chrome_profile_manager_alloy.h @@ -18,7 +18,6 @@ class ChromeProfileManagerAlloy : public ProfileManager { Profile* GetProfile(const base::FilePath& profile_dir) override; bool IsValidProfile(const void* profile) override; - Profile* GetLastUsedProfile(const base::FilePath& user_data_dir) override; private: DISALLOW_COPY_AND_ASSIGN(ChromeProfileManagerAlloy); diff --git a/libcef/browser/audio_loopback_stream_creator.cc b/libcef/browser/audio_loopback_stream_creator.cc index 1ecbee44d..d6dd3a723 100644 --- a/libcef/browser/audio_loopback_stream_creator.cc +++ b/libcef/browser/audio_loopback_stream_creator.cc @@ -44,7 +44,7 @@ class StreamCreatedCallbackAdapter final client_receiver, media::mojom::ReadOnlyAudioDataPipePtr data_pipe, bool initially_muted, - const base::Optional& stream_id) override { + const absl::optional& stream_id) override { DCHECK(!initially_muted); // Loopback streams shouldn't be started muted. callback_.Run(std::move(stream), std::move(client_receiver), std::move(data_pipe)); diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index 87848a5cf..cc579d3ee 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -8,6 +8,7 @@ #include "libcef/browser/browser_platform_delegate.h" #include "libcef/browser/browser_util.h" +#include "content/public/browser/focused_node_details.h" #include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/navigation_entry.h" @@ -17,6 +18,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" #include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h" +#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h" using content::KeyboardEventProcessingResult; @@ -232,18 +234,6 @@ bool CefBrowserContentsDelegate::HandleKeyboardEvent( void CefBrowserContentsDelegate::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { browser_info_->MaybeCreateFrame(render_frame_host, false /* is_guest_view */); - - if (render_frame_host->GetParent() == nullptr) { - // May be already registered if the renderer crashed previously. - auto render_view_host = render_frame_host->GetRenderViewHost(); - if (!registrar_->IsRegistered( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host))) { - registrar_->Add( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host)); - } - } } void CefBrowserContentsDelegate::RenderFrameHostChanged( @@ -264,17 +254,6 @@ void CefBrowserContentsDelegate::RenderFrameDeleted( } } -void CefBrowserContentsDelegate::RenderViewDeleted( - content::RenderViewHost* render_view_host) { - if (registrar_->IsRegistered( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host))) { - registrar_->Remove( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host)); - } -} - void CefBrowserContentsDelegate::RenderViewReady() { if (auto c = client()) { if (auto handler = c->GetRequestHandler()) { @@ -472,6 +451,13 @@ void CefBrowserContentsDelegate::OnWebContentsFocused( } } +void CefBrowserContentsDelegate::OnFocusChangedInPage( + content::FocusedNodeDetails* details) { + focus_on_editable_field_ = + details->focus_type != blink::mojom::blink::FocusType::kNone && + details->is_editable_node; +} + void CefBrowserContentsDelegate::WebContentsDestroyed() { auto wc = web_contents(); ObserveWebContents(nullptr); @@ -484,15 +470,12 @@ void CefBrowserContentsDelegate::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - DCHECK(type == content::NOTIFICATION_LOAD_STOP || - type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE); + DCHECK_EQ(type, content::NOTIFICATION_LOAD_STOP); if (type == content::NOTIFICATION_LOAD_STOP) { content::NavigationController* controller = content::Source(source).ptr(); OnTitleChange(controller->GetWebContents()->GetTitle()); - } else if (type == content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE) { - focus_on_editable_field_ = *content::Details(details).ptr(); } } diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index ac30f5f92..4d6abd48c 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -10,6 +10,7 @@ #include "libcef/browser/frame_host_impl.h" +#include "base/callback_list.h" #include "base/observer_list.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" @@ -108,7 +109,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void RenderFrameHostChanged(content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) override; void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; - void RenderViewDeleted(content::RenderViewHost* render_view_host) override; void RenderViewReady() override; void RenderProcessGone(base::TerminationStatus status) override; void OnFrameFocused(content::RenderFrameHost* render_frame_host) override; @@ -129,6 +129,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, const std::vector& candidates) override; void OnWebContentsFocused( content::RenderWidgetHost* render_widget_host) override; + void OnFocusChangedInPage(content::FocusedNodeDetails* details) override; void WebContentsDestroyed() override; // NotificationObserver methods. diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index 2d3ad2e27..a95745ab1 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -300,9 +300,9 @@ void CefBrowserContext::OnRenderFrameCreated( frame_tree_node_id, handler); CEF_POST_TASK(CEF_IOT, - base::Bind(&CefIOThreadState::AddHandler, iothread_state_, - render_process_id, render_frame_id, - frame_tree_node_id, handler)); + base::BindOnce(&CefIOThreadState::AddHandler, iothread_state_, + render_process_id, render_frame_id, + frame_tree_node_id, handler)); } } @@ -332,9 +332,9 @@ void CefBrowserContext::OnRenderFrameDeleted( handler_map_.RemoveHandler(render_process_id, render_frame_id, frame_tree_node_id); - CEF_POST_TASK(CEF_IOT, base::Bind(&CefIOThreadState::RemoveHandler, - iothread_state_, render_process_id, - render_frame_id, frame_tree_node_id)); + CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefIOThreadState::RemoveHandler, + iothread_state_, render_process_id, + render_frame_id, frame_tree_node_id)); } if (is_main_frame) { @@ -438,15 +438,16 @@ void CefBrowserContext::RegisterSchemeHandlerFactory( const CefString& scheme_name, const CefString& domain_name, CefRefPtr factory) { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefIOThreadState::RegisterSchemeHandlerFactory, - iothread_state_, scheme_name, domain_name, factory)); + CEF_POST_TASK( + CEF_IOT, + base::BindOnce(&CefIOThreadState::RegisterSchemeHandlerFactory, + iothread_state_, scheme_name, domain_name, factory)); } void CefBrowserContext::ClearSchemeHandlerFactories() { CEF_POST_TASK(CEF_IOT, - base::Bind(&CefIOThreadState::ClearSchemeHandlerFactories, - iothread_state_)); + base::BindOnce(&CefIOThreadState::ClearSchemeHandlerFactories, + iothread_state_)); } void CefBrowserContext::LoadExtension( @@ -482,8 +483,7 @@ bool CefBrowserContext::IsPrintPreviewSupported() const { network::mojom::NetworkContext* CefBrowserContext::GetNetworkContext() { CEF_REQUIRE_UIT(); auto browser_context = AsBrowserContext(); - return browser_context->GetDefaultStoragePartition(browser_context) - ->GetNetworkContext(); + return browser_context->GetDefaultStoragePartition()->GetNetworkContext(); } CefMediaRouterManager* CefBrowserContext::GetMediaRouterManager() { @@ -517,7 +517,7 @@ CefBrowserContext::GetGlobalCookieableSchemes() { CefString(&settings.cookieable_schemes_list), !settings.cookieable_schemes_exclude_defaults); } - return base::nullopt; + return absl::nullopt; }()); return *schemes; } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index dce938812..682e00851 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -16,9 +16,9 @@ #include "base/callback.h" #include "base/files/file_path.h" #include "base/memory/weak_ptr.h" -#include "base/optional.h" #include "chrome/common/plugin.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "url/origin.h" /* @@ -200,7 +200,7 @@ class CefBrowserContext { CefMediaRouterManager* GetMediaRouterManager(); - using CookieableSchemes = base::Optional>; + using CookieableSchemes = absl::optional>; // Returns the schemes associated with this context specifically, or the // global configuration if unset. diff --git a/libcef/browser/browser_frame.cc b/libcef/browser/browser_frame.cc index 558634cfc..96c7a9dd2 100644 --- a/libcef/browser/browser_frame.cc +++ b/libcef/browser/browser_frame.cc @@ -58,7 +58,7 @@ void CefBrowserFrame::DidFinishFrameLoad(const GURL& validated_url, } void CefBrowserFrame::UpdateDraggableRegions( - base::Optional> regions) { + absl::optional> regions) { if (auto host = GetFrameHost()) { host->UpdateDraggableRegions(std::move(regions)); } diff --git a/libcef/browser/browser_frame.h b/libcef/browser/browser_frame.h index d164b2b0b..ec0bb6010 100644 --- a/libcef/browser/browser_frame.h +++ b/libcef/browser/browser_frame.h @@ -36,7 +36,7 @@ class CefBrowserFrame void DidFinishFrameLoad(const GURL& validated_url, int32_t http_status_code) override; void UpdateDraggableRegions( - base::Optional> regions) + absl::optional> regions) override; // FrameServiceBase methods: diff --git a/libcef/browser/browser_host_base.cc b/libcef/browser/browser_host_base.cc index c846d294e..f7d54e3de 100644 --- a/libcef/browser/browser_host_base.cc +++ b/libcef/browser/browser_host_base.cc @@ -232,8 +232,7 @@ void CefBrowserHostBase::StartDownload(const CefString& url) { if (!browser_context) return; - content::DownloadManager* manager = - content::BrowserContext::GetDownloadManager(browser_context); + content::DownloadManager* manager = browser_context->GetDownloadManager(); if (!manager) return; diff --git a/libcef/browser/chrome/chrome_browser_context.cc b/libcef/browser/chrome/chrome_browser_context.cc index edc61213d..e16851b77 100644 --- a/libcef/browser/chrome/chrome_browser_context.cc +++ b/libcef/browser/chrome/chrome_browser_context.cc @@ -56,8 +56,9 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { // Create or load a specific disk-based profile. May continue // synchronously or asynchronously. profile_manager->CreateProfileAsync( - cache_path_, base::Bind(&ChromeBrowserContext::ProfileCreated, - weak_ptr_factory_.GetWeakPtr())); + cache_path_, + base::BindRepeating(&ChromeBrowserContext::ProfileCreated, + weak_ptr_factory_.GetWeakPtr())); return; } else { // All profile directories must be relative to |user_data_dir|. @@ -96,7 +97,8 @@ void ChromeBrowserContext::ProfileCreated(Profile* profile, const auto& profile_id = Profile::OTRProfileID::CreateUniqueForCEF(); parent_profile = g_browser_process->profile_manager()->GetPrimaryUserProfile(); - profile_ = parent_profile->GetOffTheRecordProfile(profile_id); + profile_ = parent_profile->GetOffTheRecordProfile( + profile_id, /*create_if_needed=*/true); otr_profile = static_cast(profile_); status = Profile::CreateStatus::CREATE_STATUS_INITIALIZED; should_destroy_ = true; diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index b7de41664..65e5e78b8 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -12,7 +12,7 @@ #include "libcef/browser/browser_info.h" #include "libcef/browser/chrome/browser_delegate.h" -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" class CefBrowserContentsDelegate; class CefRequestContextImpl; diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index e18c43c1a..f8f92fd6a 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -199,7 +199,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -243,7 +243,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) { // |out_factory| will be non-nullptr when this method is initially called // from NavigationURLLoaderImpl::PrepareForNonInterceptedRequest. @@ -273,9 +273,9 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( // HandleExternalProtocolHelper may be called if nothing handles the request. auto request_handler = net_service::CreateInterceptedRequestHandler( web_contents_getter, frame_tree_node_id, resource_request, - base::Bind(HandleExternalProtocolHelper, base::Unretained(this), - web_contents_getter, frame_tree_node_id, navigation_data, - resource_request)); + base::BindRepeating(HandleExternalProtocolHelper, base::Unretained(this), + web_contents_getter, frame_tree_node_id, + navigation_data, resource_request)); net_service::ProxyURLLoaderFactory::CreateProxy( web_contents_getter, std::move(receiver), std::move(request_handler)); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index dcbaaf164..60bf7e021 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -48,7 +48,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - base::Optional navigation_id, + absl::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -65,7 +65,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - const base::Optional& initiating_origin, + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory) override; bool HandleExternalProtocol( diff --git a/libcef/browser/chrome/chrome_context_menu_handler.cc b/libcef/browser/chrome/chrome_context_menu_handler.cc index 557ebadc1..c474cb5ee 100644 --- a/libcef/browser/chrome/chrome_context_menu_handler.cc +++ b/libcef/browser/chrome/chrome_context_menu_handler.cc @@ -111,7 +111,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, } void SetAccelerator(int command_id, - base::Optional accel) override { + absl::optional accel) override { // No-op if already at the default state. if (!accel && !GetItemInfo(command_id)) return; @@ -127,7 +127,7 @@ class CefContextMenuObserver : public RenderViewContextMenuObserver, ItemInfo() {} bool checked = false; - base::Optional accel; + absl::optional accel; }; ItemInfo* GetItemInfo(int command_id) { diff --git a/libcef/browser/chrome/views/chrome_browser_view.cc b/libcef/browser/chrome/views/chrome_browser_view.cc index 07d21a6d4..d85ebdbb6 100644 --- a/libcef/browser/chrome/views/chrome_browser_view.cc +++ b/libcef/browser/chrome/views/chrome_browser_view.cc @@ -74,7 +74,7 @@ ToolbarView* ChromeBrowserView::OverrideCreateToolbar( BrowserView* browser_view) { if (cef_delegate()) { auto toolbar_type = cef_delegate()->GetChromeToolbarType(); - base::Optional display_mode; + absl::optional display_mode; switch (toolbar_type) { case CEF_CTT_NORMAL: display_mode = ToolbarView::DisplayMode::NORMAL; diff --git a/libcef/browser/chrome/views/toolbar_view_impl.cc b/libcef/browser/chrome/views/toolbar_view_impl.cc index de010b80e..fcc175523 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.cc +++ b/libcef/browser/chrome/views/toolbar_view_impl.cc @@ -9,7 +9,7 @@ CefRefPtr CefToolbarViewImpl::Create( CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode) { + absl::optional display_mode) { CEF_REQUIRE_UIT_RETURN(nullptr); CefRefPtr view = new CefToolbarViewImpl(delegate, browser, browser_view, display_mode); @@ -24,7 +24,7 @@ CefToolbarViewImpl::CefToolbarViewImpl( CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode) + absl::optional display_mode) : ParentClass(delegate), browser_(browser), browser_view_(browser_view), diff --git a/libcef/browser/chrome/views/toolbar_view_impl.h b/libcef/browser/chrome/views/toolbar_view_impl.h index 848ab0d39..5c483a673 100644 --- a/libcef/browser/chrome/views/toolbar_view_impl.h +++ b/libcef/browser/chrome/views/toolbar_view_impl.h @@ -24,7 +24,7 @@ class CefToolbarViewImpl CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode); + absl::optional display_mode); static const char* const kTypeString; @@ -38,7 +38,7 @@ class CefToolbarViewImpl CefToolbarViewImpl(CefRefPtr delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode); + absl::optional display_mode); // CefViewImpl methods: CefToolbarViewView* CreateRootView() override; @@ -46,7 +46,7 @@ class CefToolbarViewImpl Browser* const browser_; BrowserView* const browser_view_; - base::Optional const display_mode_; + absl::optional const display_mode_; IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefToolbarViewImpl); DISALLOW_COPY_AND_ASSIGN(CefToolbarViewImpl); diff --git a/libcef/browser/chrome/views/toolbar_view_view.cc b/libcef/browser/chrome/views/toolbar_view_view.cc index aeb20b307..ad986bd5e 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.cc +++ b/libcef/browser/chrome/views/toolbar_view_view.cc @@ -7,5 +7,5 @@ CefToolbarViewView::CefToolbarViewView(CefViewDelegate* cef_delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode) + absl::optional display_mode) : ParentClass(cef_delegate, browser, browser_view, display_mode) {} diff --git a/libcef/browser/chrome/views/toolbar_view_view.h b/libcef/browser/chrome/views/toolbar_view_view.h index 8eed6c037..030c97df7 100644 --- a/libcef/browser/chrome/views/toolbar_view_view.h +++ b/libcef/browser/chrome/views/toolbar_view_view.h @@ -18,7 +18,7 @@ class CefToolbarViewView : public CefViewView { explicit CefToolbarViewView(CefViewDelegate* cef_delegate, Browser* browser, BrowserView* browser_view, - base::Optional display_mode); + absl::optional display_mode); private: DISALLOW_COPY_AND_ASSIGN(CefToolbarViewView); diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index 687e4b8df..d896fe13e 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -294,10 +294,12 @@ void CefSetOSModalLoop(bool osModalLoop) { return; } - if (CEF_CURRENTLY_ON_UIT()) - base::CurrentThread::Get()->set_os_modal_loop(osModalLoop); - else - CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop)); + if (!CEF_CURRENTLY_ON_UIT()) { + CEF_POST_TASK(CEF_UIT, base::BindOnce(CefSetOSModalLoop, osModalLoop)); + return; + } + + base::CurrentThread::Get()->set_os_modal_loop(osModalLoop); #endif // defined(OS_WIN) } diff --git a/libcef/browser/devtools/devtools_file_manager.cc b/libcef/browser/devtools/devtools_file_manager.cc index adea22abb..c68fb5b98 100644 --- a/libcef/browser/devtools/devtools_file_manager.cc +++ b/libcef/browser/devtools/devtools_file_manager.cc @@ -35,7 +35,7 @@ void WriteToFile(const base::FilePath& path, const std::string& content) { void AppendToFile(const base::FilePath& path, const std::string& content) { DCHECK(!path.empty()); - base::AppendToFile(path, content.c_str(), content.size()); + base::AppendToFile(path, base::StringPiece(content)); } } // namespace @@ -53,27 +53,27 @@ void CefDevToolsFileManager::SaveToFile(const std::string& url, const std::string& content, bool save_as) { Save(url, content, save_as, - base::Bind(&CefDevToolsFileManager::FileSavedAs, - weak_factory_.GetWeakPtr(), url), - base::Bind(&CefDevToolsFileManager::CanceledFileSaveAs, - weak_factory_.GetWeakPtr(), url)); + base::BindOnce(&CefDevToolsFileManager::FileSavedAs, + weak_factory_.GetWeakPtr(), url), + base::BindOnce(&CefDevToolsFileManager::CanceledFileSaveAs, + weak_factory_.GetWeakPtr(), url)); } void CefDevToolsFileManager::AppendToFile(const std::string& url, const std::string& content) { Append(url, content, - base::Bind(&CefDevToolsFileManager::AppendedTo, - weak_factory_.GetWeakPtr(), url)); + base::BindOnce(&CefDevToolsFileManager::AppendedTo, + weak_factory_.GetWeakPtr(), url)); } void CefDevToolsFileManager::Save(const std::string& url, const std::string& content, bool save_as, - const SaveCallback& saveCallback, - const CancelCallback& cancelCallback) { + SaveCallback saveCallback, + CancelCallback cancelCallback) { auto it = saved_files_.find(url); if (it != saved_files_.end() && !save_as) { - SaveAsFileSelected(url, content, saveCallback, it->second); + SaveAsFileSelected(url, content, std::move(saveCallback), it->second); return; } @@ -83,7 +83,7 @@ void CefDevToolsFileManager::Save(const std::string& url, const base::Value* path_value; if (file_map->Get(base::MD5String(url), &path_value)) { - base::Optional path = util::ValueToFilePath(*path_value); + absl::optional path = util::ValueToFilePath(*path_value); if (path) initial_path = std::move(*path); } @@ -116,28 +116,29 @@ void CefDevToolsFileManager::Save(const std::string& url, } browser_impl_->RunFileChooser( - params, base::Bind(&CefDevToolsFileManager::SaveAsDialogDismissed, - weak_factory_.GetWeakPtr(), url, content, saveCallback, - cancelCallback)); + params, + base::BindOnce(&CefDevToolsFileManager::SaveAsDialogDismissed, + weak_factory_.GetWeakPtr(), url, content, + std::move(saveCallback), std::move(cancelCallback))); } void CefDevToolsFileManager::SaveAsDialogDismissed( const std::string& url, const std::string& content, - const SaveCallback& saveCallback, - const CancelCallback& cancelCallback, + SaveCallback saveCallback, + CancelCallback cancelCallback, int selected_accept_filter, const std::vector& file_paths) { if (file_paths.size() == 1) { - SaveAsFileSelected(url, content, saveCallback, file_paths[0]); + SaveAsFileSelected(url, content, std::move(saveCallback), file_paths[0]); } else { - cancelCallback.Run(); + std::move(cancelCallback).Run(); } } void CefDevToolsFileManager::SaveAsFileSelected(const std::string& url, const std::string& content, - const SaveCallback& callback, + SaveCallback callback, const base::FilePath& path) { *g_last_save_path.Pointer() = path; saved_files_[url] = path; @@ -146,7 +147,7 @@ void CefDevToolsFileManager::SaveAsFileSelected(const std::string& url, base::DictionaryValue* files_map = update.Get(); files_map->SetKey(base::MD5String(url), util::FilePathToValue(path)); std::string file_system_path = path.AsUTF8Unsafe(); - callback.Run(file_system_path); + std::move(callback).Run(file_system_path); file_task_runner_->PostTask(FROM_HERE, base::BindOnce(&::WriteToFile, path, content)); } @@ -167,11 +168,11 @@ void CefDevToolsFileManager::CanceledFileSaveAs(const std::string& url) { void CefDevToolsFileManager::Append(const std::string& url, const std::string& content, - const AppendCallback& callback) { + AppendCallback callback) { auto it = saved_files_.find(url); if (it == saved_files_.end()) return; - callback.Run(); + std::move(callback).Run(); file_task_runner_->PostTask( FROM_HERE, base::BindOnce(&::AppendToFile, it->second, content)); } diff --git a/libcef/browser/devtools/devtools_file_manager.h b/libcef/browser/devtools/devtools_file_manager.h index 979a4edcb..8a37677b6 100644 --- a/libcef/browser/devtools/devtools_file_manager.h +++ b/libcef/browser/devtools/devtools_file_manager.h @@ -36,31 +36,31 @@ class CefDevToolsFileManager { private: // SaveToFile implementation: - typedef base::Callback SaveCallback; - typedef base::Callback CancelCallback; + typedef base::OnceCallback SaveCallback; + typedef base::OnceCallback CancelCallback; void Save(const std::string& url, const std::string& content, bool save_as, - const SaveCallback& saveCallback, - const CancelCallback& cancelCallback); + SaveCallback saveCallback, + CancelCallback cancelCallback); void SaveAsDialogDismissed(const std::string& url, const std::string& content, - const SaveCallback& saveCallback, - const CancelCallback& cancelCallback, + SaveCallback saveCallback, + CancelCallback cancelCallback, int selected_accept_filter, const std::vector& file_paths); void SaveAsFileSelected(const std::string& url, const std::string& content, - const SaveCallback& callback, + SaveCallback callback, const base::FilePath& path); void FileSavedAs(const std::string& url, const std::string& file_system_path); void CanceledFileSaveAs(const std::string& url); // AppendToFile implementation: - typedef base::Callback AppendCallback; + typedef base::OnceCallback AppendCallback; void Append(const std::string& url, const std::string& content, - const AppendCallback& callback); + AppendCallback callback); void AppendedTo(const std::string& url); void CallClientFunction(const std::string& function_name, diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index 9a94ec99b..61b798031 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -160,7 +160,7 @@ void LogProtocolMessage(const base::FilePath& log_file, WriteTimestamp(stream); stream << ": " << type_label << ": " << to_log << "\n"; const std::string& str = stream.str(); - if (!base::AppendToFile(log_file, str.c_str(), str.size())) { + if (!base::AppendToFile(log_file, base::StringPiece(str))) { LOG(ERROR) << "Failed to write file " << log_file.value(); log_error = true; } @@ -294,8 +294,8 @@ void CefDevToolsFrontend::InspectElementAt(int x, int y) { void CefDevToolsFrontend::Close() { base::PostTask(FROM_HERE, {content::BrowserThread::UI}, - base::Bind(&AlloyBrowserHostImpl::CloseBrowser, - frontend_browser_.get(), true)); + base::BindOnce(&AlloyBrowserHostImpl::CloseBrowser, + frontend_browser_.get(), true)); } CefDevToolsFrontend::CefDevToolsFrontend( @@ -323,8 +323,8 @@ void CefDevToolsFrontend::ReadyToCommitNavigation( content::RenderFrameHost* frame = navigation_handle->GetRenderFrameHost(); if (navigation_handle->IsInMainFrame()) { frontend_host_ = content::DevToolsFrontendHost::Create( - frame, - base::Bind(&CefDevToolsFrontend::HandleMessageFromDevToolsFrontend, + frame, base::BindRepeating( + &CefDevToolsFrontend::HandleMessageFromDevToolsFrontend, base::Unretained(this))); return; } @@ -367,13 +367,11 @@ void CefDevToolsFrontend::WebContentsDestroyed() { } void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( - const std::string& message) { + base::Value message) { std::string method; base::ListValue* params = nullptr; base::DictionaryValue* dict = nullptr; - base::Optional parsed_message = base::JSONReader::Read(message); - if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || - !dict->GetString("method", &method)) { + if (!message.GetAsDictionary(&dict) || !dict->GetString("method", &method)) { return; } int request_id = 0; @@ -461,8 +459,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( SendMessageAck(request_id, &response); return; } else { - auto* partition = content::BrowserContext::GetStoragePartitionForUrl( - web_contents()->GetBrowserContext(), gurl); + auto* partition = + web_contents()->GetBrowserContext()->GetStoragePartitionForUrl(gurl); url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess(); } @@ -608,7 +606,7 @@ void CefDevToolsFrontend::LogProtocolMessage(ProtocolMessageType type, const base::StringPiece& message) { DCHECK(ProtocolLoggingEnabled()); - std::string to_log = message.substr(0, kMaxLogLineLength).as_string(); + std::string to_log(message.substr(0, kMaxLogLineLength)); // Execute in an ordered context that allows blocking. auto task_runner = CefTaskRunnerManager::Get()->GetBackgroundTaskRunner(); diff --git a/libcef/browser/devtools/devtools_frontend.h b/libcef/browser/devtools/devtools_frontend.h index 1214cc56b..1cc83a643 100644 --- a/libcef/browser/devtools/devtools_frontend.h +++ b/libcef/browser/devtools/devtools_frontend.h @@ -70,7 +70,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, void AgentHostClosed(content::DevToolsAgentHost* agent_host) override; void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, base::span message) override; - void HandleMessageFromDevToolsFrontend(const std::string& message); + void HandleMessageFromDevToolsFrontend(base::Value message); private: // WebContentsObserver overrides diff --git a/libcef/browser/devtools/devtools_manager.cc b/libcef/browser/devtools/devtools_manager.cc index 171ec6597..46438ea50 100644 --- a/libcef/browser/devtools/devtools_manager.cc +++ b/libcef/browser/devtools/devtools_manager.cc @@ -62,7 +62,7 @@ class CefDevToolsRegistrationImpl : public CefRegistration, void OnDevToolsEvent(const base::StringPiece& method, const base::StringPiece& params) override { CEF_REQUIRE_UIT(); - observer_->OnDevToolsEvent(browser_, method.as_string(), params.data(), + observer_->OnDevToolsEvent(browser_, std::string(method), params.data(), params.size()); } diff --git a/libcef/browser/devtools/devtools_util_unittest.cc b/libcef/browser/devtools/devtools_util_unittest.cc index 0175aa040..9617f9445 100644 --- a/libcef/browser/devtools/devtools_util_unittest.cc +++ b/libcef/browser/devtools/devtools_util_unittest.cc @@ -83,7 +83,7 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsEvent) { EXPECT_TRUE(parser.Initialize(message)); EXPECT_TRUE(parser.IsInitialized()); EXPECT_TRUE(parser.IsEvent()); - EXPECT_STREQ("Test.myMethod", parser.method_.as_string().data()); + EXPECT_STREQ("Test.myMethod", parser.method_.data()); EXPECT_TRUE(parser.params_.empty()); parser.Reset(); @@ -94,8 +94,8 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsEvent) { EXPECT_TRUE(parser.Initialize(message)); EXPECT_TRUE(parser.IsInitialized()); EXPECT_TRUE(parser.IsEvent()); - EXPECT_STREQ("Test.myMethod2", parser.method_.as_string().data()); - EXPECT_STREQ("{}", parser.params_.as_string().data()); + EXPECT_STREQ("Test.myMethod2", parser.method_.data()); + EXPECT_STREQ("{}", parser.params_.data()); parser.Reset(); EXPECT_FALSE(parser.IsInitialized()); @@ -105,8 +105,8 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsEvent) { EXPECT_TRUE(parser.Initialize(message)); EXPECT_TRUE(parser.IsInitialized()); EXPECT_TRUE(parser.IsEvent()); - EXPECT_STREQ("Test.myMethod3", parser.method_.as_string().data()); - EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.as_string().data()); + EXPECT_STREQ("Test.myMethod3", parser.method_.data()); + EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.data()); } TEST(DevToolsUtil, ProtocolParser_Initialize_IsFailure_ResultMalformed) { @@ -162,7 +162,7 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsResult_Result) { EXPECT_TRUE(parser.IsResult()); EXPECT_EQ(1, parser.message_id_); EXPECT_TRUE(parser.success_); - EXPECT_STREQ("{}", parser.params_.as_string().data()); + EXPECT_STREQ("{}", parser.params_.data()); parser.Reset(); EXPECT_FALSE(parser.IsInitialized()); @@ -174,7 +174,7 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsResult_Result) { EXPECT_TRUE(parser.IsResult()); EXPECT_EQ(2, parser.message_id_); EXPECT_TRUE(parser.success_); - EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.as_string().data()); + EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.data()); } TEST(DevToolsUtil, ProtocolParser_Initialize_IsResult_Error) { @@ -188,7 +188,7 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsResult_Error) { EXPECT_TRUE(parser.IsResult()); EXPECT_EQ(1, parser.message_id_); EXPECT_FALSE(parser.success_); - EXPECT_STREQ("{}", parser.params_.as_string().data()); + EXPECT_STREQ("{}", parser.params_.data()); parser.Reset(); EXPECT_FALSE(parser.IsInitialized()); @@ -200,5 +200,5 @@ TEST(DevToolsUtil, ProtocolParser_Initialize_IsResult_Error) { EXPECT_TRUE(parser.IsResult()); EXPECT_EQ(2, parser.message_id_); EXPECT_FALSE(parser.success_); - EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.as_string().data()); + EXPECT_STREQ("{\"foo\":\"bar\"}", parser.params_.data()); } diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 437794bfe..d1b4a4b8b 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -153,7 +153,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DownloadItem::MixedContentStatus::UNKNOWN, suggested_path, - base::nullopt /*download_schedule*/, + absl::nullopt /*download_schedule*/, download::DOWNLOAD_INTERRUPT_REASON_NONE); } } @@ -172,7 +172,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { std::move(callback).Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DownloadItem::MixedContentStatus::UNKNOWN, - path, base::nullopt /*download_schedule*/, + path, absl::nullopt /*download_schedule*/, download::DOWNLOAD_INTERRUPT_REASON_NONE); } @@ -195,17 +195,17 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback { void Cancel() override { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoCancel, this)); + base::BindOnce(&CefDownloadItemCallbackImpl::DoCancel, this)); } void Pause() override { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoPause, this)); + base::BindOnce(&CefDownloadItemCallbackImpl::DoPause, this)); } void Resume() override { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefDownloadItemCallbackImpl::DoResume, this)); + base::BindOnce(&CefDownloadItemCallbackImpl::DoResume, this)); } private: @@ -358,7 +358,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, download::DownloadItem::MixedContentStatus::UNKNOWN, - item->GetForcedFilePath(), base::nullopt /*download_schedule*/, + item->GetForcedFilePath(), absl::nullopt /*download_schedule*/, download::DOWNLOAD_INTERRUPT_REASON_NONE); return true; } diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index f5c779ee9..db10572ee 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -17,6 +17,8 @@ #include "extensions/common/permissions/permissions_data.h" #include "third_party/blink/public/common/page/page_zoom.h" +using zoom::ZoomController; + namespace extensions { namespace cef { @@ -256,153 +258,124 @@ content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) { return browser->web_contents(); } -void ZoomAPIFunction::SendResponse(bool success) { - ResponseValue response; - if (success) { - response = ArgumentList(std::move(results_)); - } else { - response = results_ ? ErrorWithArguments(std::move(results_), error_) - : Error(error_); - } - Respond(std::move(response)); -} - -ExtensionFunction::ResponseAction ZoomAPIFunction::Run() { - if (RunAsync()) - return RespondLater(); - // TODO(devlin): Track these down and eliminate them if possible. We - // shouldn't return results and an error. - if (results_) - return RespondNow(ErrorWithArguments(std::move(results_), error_)); - return RespondNow(Error(error_)); -} - -bool TabsSetZoomFunction::RunAsync() { +ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() { std::unique_ptr params( tabs::SetZoom::Params::Create(*args_)); - EXTENSION_FUNCTION_PRERUN_VALIDATE(params); + EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); if (!web_contents) - return false; + return RespondNow(Error(std::move(error_))); GURL url(web_contents->GetVisibleURL()); if (extension()->permissions_data()->IsRestrictedUrl(url, &error_)) - return false; + return RespondNow(Error(std::move(error_))); - zoom::ZoomController* zoom_controller = - zoom::ZoomController::FromWebContents(web_contents); + ZoomController* zoom_controller = + ZoomController::FromWebContents(web_contents); double zoom_level = params->zoom_factor > 0 ? blink::PageZoomFactorToZoomLevel(params->zoom_factor) : zoom_controller->GetDefaultZoomLevel(); - scoped_refptr client( - new extensions::ExtensionZoomRequestClient(extension())); + auto client = base::MakeRefCounted(extension()); if (!zoom_controller->SetZoomLevelByClient(zoom_level, client)) { // Tried to zoom a tab in disabled mode. - error_ = keys::kCannotZoomDisabledTabError; - return false; + return RespondNow(Error(tabs_constants::kCannotZoomDisabledTabError)); } - SendResponse(true); - return true; + return RespondNow(NoArguments()); } -bool TabsGetZoomFunction::RunAsync() { +ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() { std::unique_ptr params( tabs::GetZoom::Params::Create(*args_)); - EXTENSION_FUNCTION_PRERUN_VALIDATE(params); + EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); if (!web_contents) - return false; + return RespondNow(Error(std::move(error_))); double zoom_level = zoom::ZoomController::FromWebContents(web_contents)->GetZoomLevel(); double zoom_factor = blink::PageZoomLevelToZoomFactor(zoom_level); - results_ = tabs::GetZoom::Results::Create(zoom_factor); - SendResponse(true); - return true; + + return RespondNow(ArgumentList(tabs::GetZoom::Results::Create(zoom_factor))); } -bool TabsSetZoomSettingsFunction::RunAsync() { +ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { using api::tabs::ZoomSettings; std::unique_ptr params( tabs::SetZoomSettings::Params::Create(*args_)); - EXTENSION_FUNCTION_PRERUN_VALIDATE(params); + EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); if (!web_contents) - return false; + return RespondNow(Error(std::move(error_))); GURL url(web_contents->GetVisibleURL()); + std::string error; if (extension()->permissions_data()->IsRestrictedUrl(url, &error_)) - return false; + return RespondNow(Error(std::move(error_))); // "per-origin" scope is only available in "automatic" mode. if (params->zoom_settings.scope == tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN && params->zoom_settings.mode != tabs::ZOOM_SETTINGS_MODE_AUTOMATIC && params->zoom_settings.mode != tabs::ZOOM_SETTINGS_MODE_NONE) { - error_ = keys::kPerOriginOnlyInAutomaticError; - return false; + return RespondNow(Error(tabs_constants::kPerOriginOnlyInAutomaticError)); } // Determine the correct internal zoom mode to set |web_contents| to from the // user-specified |zoom_settings|. - zoom::ZoomController::ZoomMode zoom_mode = - zoom::ZoomController::ZOOM_MODE_DEFAULT; + ZoomController::ZoomMode zoom_mode = ZoomController::ZOOM_MODE_DEFAULT; switch (params->zoom_settings.mode) { case tabs::ZOOM_SETTINGS_MODE_NONE: case tabs::ZOOM_SETTINGS_MODE_AUTOMATIC: switch (params->zoom_settings.scope) { case tabs::ZOOM_SETTINGS_SCOPE_NONE: case tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN: - zoom_mode = zoom::ZoomController::ZOOM_MODE_DEFAULT; + zoom_mode = ZoomController::ZOOM_MODE_DEFAULT; break; case tabs::ZOOM_SETTINGS_SCOPE_PER_TAB: - zoom_mode = zoom::ZoomController::ZOOM_MODE_ISOLATED; + zoom_mode = ZoomController::ZOOM_MODE_ISOLATED; } break; case tabs::ZOOM_SETTINGS_MODE_MANUAL: - zoom_mode = zoom::ZoomController::ZOOM_MODE_MANUAL; + zoom_mode = ZoomController::ZOOM_MODE_MANUAL; break; case tabs::ZOOM_SETTINGS_MODE_DISABLED: - zoom_mode = zoom::ZoomController::ZOOM_MODE_DISABLED; + zoom_mode = ZoomController::ZOOM_MODE_DISABLED; } - zoom::ZoomController::FromWebContents(web_contents)->SetZoomMode(zoom_mode); + ZoomController::FromWebContents(web_contents)->SetZoomMode(zoom_mode); - SendResponse(true); - return true; + return RespondNow(NoArguments()); } -bool TabsGetZoomSettingsFunction::RunAsync() { +ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() { std::unique_ptr params( tabs::GetZoomSettings::Params::Create(*args_)); - EXTENSION_FUNCTION_PRERUN_VALIDATE(params); + EXTENSION_FUNCTION_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); if (!web_contents) - return false; - zoom::ZoomController* zoom_controller = - zoom::ZoomController::FromWebContents(web_contents); + return RespondNow(Error(std::move(error_))); + ZoomController* zoom_controller = + ZoomController::FromWebContents(web_contents); - zoom::ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); + ZoomController::ZoomMode zoom_mode = zoom_controller->zoom_mode(); api::tabs::ZoomSettings zoom_settings; ZoomModeToZoomSettings(zoom_mode, &zoom_settings); - zoom_settings.default_zoom_factor.reset( - new double(blink::PageZoomLevelToZoomFactor( - zoom_controller->GetDefaultZoomLevel()))); + zoom_settings.default_zoom_factor = std::make_unique( + blink::PageZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel())); - results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings); - SendResponse(true); - return true; + return RespondNow( + ArgumentList(api::tabs::GetZoomSettings::Results::Create(zoom_settings))); } } // namespace cef diff --git a/libcef/browser/extensions/api/tabs/tabs_api.h b/libcef/browser/extensions/api/tabs/tabs_api.h index 45bd70449..fc03adc1c 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.h +++ b/libcef/browser/extensions/api/tabs/tabs_api.h @@ -108,23 +108,9 @@ class ZoomAPIFunction : public ExtensionFunction { // may set |error_|. content::WebContents* GetWebContents(int tab_id); - virtual bool RunAsync() = 0; - - // Responds with success/failure. |results_| or |error_| should be set - // accordingly. - void SendResponse(bool success); - - // Exposed versions of ExtensionFunction::results_ and - // ExtensionFunction::error_ that are curried into the response. - // These need to keep the same name to avoid breaking existing - // implementations, but this should be temporary with crbug.com/648275 - // and crbug.com/634140. - std::unique_ptr results_; std::string error_; private: - ResponseAction Run() final; - const CefExtensionFunctionDetails cef_details_; }; @@ -132,7 +118,7 @@ class TabsSetZoomFunction : public ZoomAPIFunction { private: ~TabsSetZoomFunction() override {} - bool RunAsync() override; + ResponseAction Run() override; DECLARE_EXTENSION_FUNCTION("tabs.setZoom", TABS_SETZOOM) }; @@ -141,7 +127,7 @@ class TabsGetZoomFunction : public ZoomAPIFunction { private: ~TabsGetZoomFunction() override {} - bool RunAsync() override; + ResponseAction Run() override; DECLARE_EXTENSION_FUNCTION("tabs.getZoom", TABS_GETZOOM) }; @@ -150,7 +136,7 @@ class TabsSetZoomSettingsFunction : public ZoomAPIFunction { private: ~TabsSetZoomSettingsFunction() override {} - bool RunAsync() override; + ResponseAction Run() override; DECLARE_EXTENSION_FUNCTION("tabs.setZoomSettings", TABS_SETZOOMSETTINGS) }; @@ -159,7 +145,7 @@ class TabsGetZoomSettingsFunction : public ZoomAPIFunction { private: ~TabsGetZoomSettingsFunction() override {} - bool RunAsync() override; + ResponseAction Run() override; DECLARE_EXTENSION_FUNCTION("tabs.getZoomSettings", TABS_GETZOOMSETTINGS) }; diff --git a/libcef/browser/extensions/browser_extensions_util.cc b/libcef/browser/extensions/browser_extensions_util.cc index 48e83e6e3..bc6ef0be7 100644 --- a/libcef/browser/extensions/browser_extensions_util.cc +++ b/libcef/browser/extensions/browser_extensions_util.cc @@ -54,8 +54,8 @@ void GetAllGuestsForOwnerContents(content::WebContents* owner, std::vector* guests) { content::BrowserPluginGuestManager* plugin_guest_manager = owner->GetBrowserContext()->GetGuestManager(); - plugin_guest_manager->ForEachGuest(owner, - base::Bind(InsertWebContents, guests)); + plugin_guest_manager->ForEachGuest( + owner, base::BindRepeating(InsertWebContents, guests)); } content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) { diff --git a/libcef/browser/extensions/browser_platform_delegate_background.cc b/libcef/browser/extensions/browser_platform_delegate_background.cc index 4b1252906..5e640bfe8 100644 --- a/libcef/browser/extensions/browser_platform_delegate_background.cc +++ b/libcef/browser/extensions/browser_platform_delegate_background.cc @@ -29,8 +29,8 @@ void CefBrowserPlatformDelegateBackground::CloseHostWindow() { // No host window, so continue browser destruction now. Do it asynchronously // so the call stack has a chance to unwind. CEF_POST_TASK(CEF_UIT, - base::Bind(&AlloyBrowserHostImpl::WindowDestroyed, - static_cast(browser_))); + base::BindOnce(&AlloyBrowserHostImpl::WindowDestroyed, + static_cast(browser_))); } CefWindowHandle CefBrowserPlatformDelegateBackground::GetHostWindowHandle() diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 22da03fea..8739763a8 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -13,6 +13,7 @@ #include "libcef/browser/thread_util.h" #include "libcef/common/extensions/extensions_util.h" +#include "base/bind.h" #include "base/command_line.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -446,10 +447,10 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts( // manifest settings. content::GetIOThreadTaskRunner({})->PostTaskAndReply( FROM_HERE, - base::Bind(&InfoMap::AddExtension, info_map(), - base::RetainedRef(extension), base::Time::Now(), - true, // incognito_enabled - false), // notifications_disabled + base::BindOnce(&InfoMap::AddExtension, info_map(), + base::RetainedRef(extension), base::Time::Now(), + true, // incognito_enabled + false), // notifications_disabled std::move(callback)); } @@ -459,8 +460,8 @@ void CefExtensionSystem::UnregisterExtensionWithRequestContexts( const std::string& extension_id, const UnloadedExtensionReason reason) { content::GetIOThreadTaskRunner({})->PostTask( - FROM_HERE, - base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason)); + FROM_HERE, base::BindOnce(&InfoMap::RemoveExtension, info_map(), + extension_id, reason)); } const base::OneShotEvent& CefExtensionSystem::ready() const { @@ -634,9 +635,9 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) { // extension. RegisterExtensionWithRequestContexts( extension, - base::Bind(&CefExtensionSystem::OnExtensionRegisteredWithRequestContexts, - weak_ptr_factory_.GetWeakPtr(), - base::WrapRefCounted(extension))); + base::BindOnce( + &CefExtensionSystem::OnExtensionRegisteredWithRequestContexts, + weak_ptr_factory_.GetWeakPtr(), base::WrapRefCounted(extension))); // Tell renderers about the loaded extension. renderer_helper_->OnExtensionLoaded(*extension); diff --git a/libcef/browser/extensions/extension_web_contents_observer.cc b/libcef/browser/extensions/extension_web_contents_observer.cc index 1f825d058..d266e8cc4 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.cc +++ b/libcef/browser/extensions/extension_web_contents_observer.cc @@ -9,6 +9,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/url_constants.h" +#include "third_party/blink/public/common/chrome_debug_urls.h" namespace extensions { @@ -45,7 +46,7 @@ void CefExtensionWebContentsObserver::RenderFrameCreated( if ((extension->is_extension() || extension->is_platform_app()) && Manifest::IsComponentLocation(extension->location())) { policy->GrantRequestOrigin( - process_id, url::Origin::Create(GURL(content::kChromeUIResourcesURL))); + process_id, url::Origin::Create(GURL(blink::kChromeUIResourcesURL))); policy->GrantRequestOrigin( process_id, url::Origin::Create(GURL(chrome::kChromeUIThemeURL))); } diff --git a/libcef/browser/extensions/value_store/cef_value_store.cc b/libcef/browser/extensions/value_store/cef_value_store.cc index 730b0722f..1d23b6520 100644 --- a/libcef/browser/extensions/value_store/cef_value_store.cc +++ b/libcef/browser/extensions/value_store/cef_value_store.cc @@ -100,8 +100,8 @@ ValueStore::WriteResult CefValueStore::Set( !old_value->Equals(&it.value())) { changes.emplace_back(it.key(), old_value - ? base::Optional(old_value->Clone()) - : base::nullopt, + ? absl::optional(old_value->Clone()) + : absl::nullopt, it.value().Clone()); storage_.SetWithoutPathExpansion(it.key(), it.value().CreateDeepCopy()); } @@ -123,7 +123,7 @@ ValueStore::WriteResult CefValueStore::Remove( for (auto it = keys.cbegin(); it != keys.cend(); ++it) { std::unique_ptr old_value; if (storage_.RemoveWithoutPathExpansion(*it, &old_value)) { - changes.emplace_back(*it, std::move(*old_value), base::nullopt); + changes.emplace_back(*it, std::move(*old_value), absl::nullopt); } } return WriteResult(std::move(changes), CreateStatusCopy(status_)); diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index 4d139eb51..d73471cdc 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -197,7 +197,7 @@ void CefFileDialogManager::RunFileDialog( params.accept_types.push_back(*it); } - RunFileChooser(params, base::Bind(RunFileDialogDismissed, callback)); + RunFileChooser(params, base::BindOnce(RunFileDialogDismissed, callback)); } void CefFileDialogManager::RunFileChooser( diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index e06da3e7d..dfad616ea 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -590,7 +590,7 @@ void CefFrameHostImpl::DidFinishFrameLoad(const GURL& validated_url, } void CefFrameHostImpl::UpdateDraggableRegions( - base::Optional> regions) { + absl::optional> regions) { auto browser = GetBrowserHostBase(); if (!browser) return; diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index 233479932..ef126d2e4 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -124,7 +124,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { void DidFinishFrameLoad(const GURL& validated_url, int32_t http_status_code) override; void UpdateDraggableRegions( - base::Optional> regions) + absl::optional> regions) override; static int64_t MakeFrameId(const content::RenderFrameHost* host); diff --git a/libcef/browser/image_impl.cc b/libcef/browser/image_impl.cc index ff8b489af..d249ffb7f 100644 --- a/libcef/browser/image_impl.cc +++ b/libcef/browser/image_impl.cc @@ -366,7 +366,7 @@ bool CefImageImpl::ConvertBitmap(const SkBitmap& src_bitmap, // static bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap, std::vector* compressed, - const CompressionMethod& method) { + CompressionMethod method) { const SkBitmap* bitmap_ptr = nullptr; SkBitmap bitmap_postalpha; if (bitmap.alphaType() == kPremul_SkAlphaType) { @@ -386,7 +386,7 @@ bool CefImageImpl::WriteCompressedFormat(const SkBitmap& bitmap, DCHECK(bitmap_ptr->alphaType() == kOpaque_SkAlphaType || bitmap_ptr->alphaType() == kUnpremul_SkAlphaType); - return method.Run(*bitmap_ptr, compressed); + return std::move(method).Run(*bitmap_ptr, compressed); } // static @@ -394,7 +394,7 @@ bool CefImageImpl::WritePNG(const SkBitmap& bitmap, std::vector* compressed, bool with_transparency) { return WriteCompressedFormat(bitmap, compressed, - base::Bind(PNGMethod, with_transparency)); + base::BindOnce(PNGMethod, with_transparency)); } // static @@ -402,5 +402,5 @@ bool CefImageImpl::WriteJPEG(const SkBitmap& bitmap, std::vector* compressed, int quality) { return WriteCompressedFormat(bitmap, compressed, - base::Bind(JPEGMethod, quality)); + base::BindOnce(JPEGMethod, quality)); } diff --git a/libcef/browser/image_impl.h b/libcef/browser/image_impl.h index 9859f37d7..1458f2765 100644 --- a/libcef/browser/image_impl.h +++ b/libcef/browser/image_impl.h @@ -95,14 +95,14 @@ class CefImageImpl : public CefImage { // The |bitmap| argument will be RGBA or BGRA and either opaque or transparent // with post-multiplied alpha. Writes the compressed output into |compressed|. - typedef base::Callback* /*compressed*/)> + typedef base::OnceCallback* /*compressed*/)> CompressionMethod; // Write |bitmap| into |compressed| using |method|. static bool WriteCompressedFormat(const SkBitmap& bitmap, std::vector* compressed, - const CompressionMethod& method); + CompressionMethod method); // Write |bitmap| into |compressed| using PNG encoding. static bool WritePNG(const SkBitmap& bitmap, diff --git a/libcef/browser/iothread_state.cc b/libcef/browser/iothread_state.cc index 0ecec6491..7a8a82935 100644 --- a/libcef/browser/iothread_state.cc +++ b/libcef/browser/iothread_state.cc @@ -19,8 +19,8 @@ CefIOThreadState::CefIOThreadState() { // Using base::Unretained() is safe because both this callback and possible // deletion of |this| will execute on the IO thread, and this callback will // be executed first. - CEF_POST_TASK(CEF_IOT, base::Bind(&CefIOThreadState::InitOnIOThread, - base::Unretained(this))); + CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefIOThreadState::InitOnIOThread, + base::Unretained(this))); } CefIOThreadState::~CefIOThreadState() { diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 5741def94..9e0045daf 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -426,7 +426,7 @@ bool CefMainRunner::ContentMainRun(bool* initialized, return true; } -void CefMainRunner::PreCreateMainMessageLoop() { +void CefMainRunner::PreBrowserMain() { if (external_message_pump_) { InitExternalMessagePumpFactoryForUI(); } @@ -439,7 +439,7 @@ int CefMainRunner::RunMainProcess( browser_runner_ = content::BrowserMainRunner::Create(); // Initialize browser process state. Results in a call to - // AlloyBrowserMain::PreMainMessageLoopStart() which creates the UI message + // AlloyBrowserMain::PreBrowserMain() which creates the UI message // loop. int exit_code = browser_runner_->Initialize(main_function_params); if (exit_code >= 0) diff --git a/libcef/browser/main_runner.h b/libcef/browser/main_runner.h index 503e6765b..ca8a56191 100644 --- a/libcef/browser/main_runner.h +++ b/libcef/browser/main_runner.h @@ -60,7 +60,7 @@ class CefMainRunner : public CefMainRunnerHandler { bool ContentMainRun(bool* initialized, base::OnceClosure context_initialized); // CefMainRunnerHandler methods: - void PreCreateMainMessageLoop() override; + void PreBrowserMain() override; int RunMainProcess( const content::MainFunctionParams& main_function_params) override; diff --git a/libcef/browser/media_router/media_router_impl.cc b/libcef/browser/media_router/media_router_impl.cc index 68673d792..dd884a7b7 100644 --- a/libcef/browser/media_router/media_router_impl.cc +++ b/libcef/browser/media_router/media_router_impl.cc @@ -162,8 +162,8 @@ void CefMediaRouterImpl::Initialize( if (callback) { // Execute client callback asynchronously for consistency. - CEF_POST_TASK(CEF_UIT, base::Bind(&CefCompletionCallback::OnComplete, - callback.get())); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefCompletionCallback::OnComplete, + callback.get())); } } diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index 3bb0a3c72..4b020fe10 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -35,21 +35,21 @@ const cef_event_flags_t kEmptyEventFlags = static_cast(0); class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { public: - typedef base::Callback Callback; + typedef base::OnceCallback Callback; - explicit CefRunContextMenuCallbackImpl(const Callback& callback) - : callback_(callback) {} + explicit CefRunContextMenuCallbackImpl(Callback callback) + : callback_(std::move(callback)) {} ~CefRunContextMenuCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. if (CEF_CURRENTLY_ON_UIT()) { - RunNow(callback_, kInvalidCommandId, kEmptyEventFlags); + RunNow(std::move(callback_), kInvalidCommandId, kEmptyEventFlags); } else { - CEF_POST_TASK( - CEF_UIT, - base::Bind(&CefRunContextMenuCallbackImpl::RunNow, callback_, - kInvalidCommandId, kEmptyEventFlags)); + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&CefRunContextMenuCallbackImpl::RunNow, + std::move(callback_), kInvalidCommandId, + kEmptyEventFlags)); } } } @@ -57,13 +57,13 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { void Continue(int command_id, cef_event_flags_t event_flags) override { if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { - RunNow(callback_, command_id, event_flags); + RunNow(std::move(callback_), command_id, event_flags); callback_.Reset(); } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefRunContextMenuCallbackImpl::Continue, this, - command_id, event_flags)); + base::BindOnce(&CefRunContextMenuCallbackImpl::Continue, + this, command_id, event_flags)); } } @@ -72,11 +72,11 @@ class CefRunContextMenuCallbackImpl : public CefRunContextMenuCallback { void Disconnect() { callback_.Reset(); } private: - static void RunNow(const Callback& callback, + static void RunNow(Callback callback, int command_id, cef_event_flags_t event_flags) { CEF_REQUIRE_UIT(); - callback.Run(command_id, event_flags); + std::move(callback).Run(command_id, event_flags); } Callback callback_; @@ -154,8 +154,8 @@ bool CefMenuManager::CreateContextMenu( if (model_->GetCount() > 0) { CefRefPtr callbackImpl( new CefRunContextMenuCallbackImpl( - base::Bind(&CefMenuManager::ExecuteCommandCallback, - weak_ptr_factory_.GetWeakPtr()))); + base::BindOnce(&CefMenuManager::ExecuteCommandCallback, + weak_ptr_factory_.GetWeakPtr()))); // This reference will be cleared when the callback is executed or // the callback object is deleted. diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index a4359af1f..929b21701 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -785,8 +785,8 @@ void CefMenuModelImpl::MouseOutsideMenu(const gfx::Point& screen_point) { // Allow the callstack to unwind before notifying the delegate since it may // result in the menu being destroyed. CefTaskRunnerImpl::GetCurrentTaskRunner()->PostTask( - FROM_HERE, - base::Bind(&CefMenuModelImpl::OnMouseOutsideMenu, this, screen_point)); + FROM_HERE, base::BindOnce(&CefMenuModelImpl::OnMouseOutsideMenu, this, + screen_point)); } void CefMenuModelImpl::UnhandledOpenSubmenu(bool is_rtl) { @@ -797,7 +797,7 @@ void CefMenuModelImpl::UnhandledOpenSubmenu(bool is_rtl) { // result in the menu being destroyed. CefTaskRunnerImpl::GetCurrentTaskRunner()->PostTask( FROM_HERE, - base::Bind(&CefMenuModelImpl::OnUnhandledOpenSubmenu, this, is_rtl)); + base::BindOnce(&CefMenuModelImpl::OnUnhandledOpenSubmenu, this, is_rtl)); } void CefMenuModelImpl::UnhandledCloseSubmenu(bool is_rtl) { @@ -808,7 +808,7 @@ void CefMenuModelImpl::UnhandledCloseSubmenu(bool is_rtl) { // result in the menu being destroyed. CefTaskRunnerImpl::GetCurrentTaskRunner()->PostTask( FROM_HERE, - base::Bind(&CefMenuModelImpl::OnUnhandledCloseSubmenu, this, is_rtl)); + base::BindOnce(&CefMenuModelImpl::OnUnhandledCloseSubmenu, this, is_rtl)); } bool CefMenuModelImpl::GetTextColor(int index, @@ -883,7 +883,7 @@ void CefMenuModelImpl::MenuWillClose() { // called after this. It's more convenient for the delegate to be called // afterwards, though, so post a task. CefTaskRunnerImpl::GetCurrentTaskRunner()->PostTask( - FROM_HERE, base::Bind(&CefMenuModelImpl::OnMenuClosed, this)); + FROM_HERE, base::BindOnce(&CefMenuModelImpl::OnMenuClosed, this)); } std::u16string CefMenuModelImpl::GetFormattedLabelAt(int index) { diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 86d311414..65fc0ef6d 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -349,7 +349,7 @@ void CefBrowserPlatformDelegateNativeWin::ViewText(const std::string& text) { std::string str = text; scoped_refptr str_ref = base::RefCountedString::TakeString(&str); - CEF_POST_USER_VISIBLE_TASK(base::Bind(WriteTempFileAndView, str_ref)); + CEF_POST_USER_VISIBLE_TASK(base::BindOnce(WriteTempFileAndView, str_ref)); } bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent( @@ -395,7 +395,7 @@ bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent( // static void CefBrowserPlatformDelegate::HandleExternalProtocol(const GURL& url) { - CEF_POST_USER_VISIBLE_TASK(base::Bind(ExecuteExternalProtocol, url)); + CEF_POST_USER_VISIBLE_TASK(base::BindOnce(ExecuteExternalProtocol, url)); } CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle( diff --git a/libcef/browser/native/cursor_util.cc b/libcef/browser/native/cursor_util.cc index 64deff52d..35a2f3701 100644 --- a/libcef/browser/native/cursor_util.cc +++ b/libcef/browser/native/cursor_util.cc @@ -36,7 +36,7 @@ bool OnCursorChange(CefBrowserHostBase* browser, const ui::Cursor& ui_cursor) { #if defined(USE_AURA) CefCursorHandle platform_cursor; - ui::PlatformCursor image_cursor = nullptr; + scoped_refptr image_cursor; if (ui_cursor.type() == ui::mojom::CursorType::kCustom) { image_cursor = ui::CursorFactory::GetInstance()->CreateImageCursor( @@ -49,10 +49,6 @@ bool OnCursorChange(CefBrowserHostBase* browser, const ui::Cursor& ui_cursor) { handled = handler->OnCursorChange(browser, platform_cursor, cursor_type, custom_cursor_info); - - if (image_cursor) { - ui::CursorFactory::GetInstance()->UnrefImageCursor(image_cursor); - } #elif defined(OS_MAC) // |web_cursor| owns the resulting |native_cursor|. content::WebCursor web_cursor(ui_cursor); diff --git a/libcef/browser/native/cursor_util.h b/libcef/browser/native/cursor_util.h index a3a1e0a98..9e677ef6f 100644 --- a/libcef/browser/native/cursor_util.h +++ b/libcef/browser/native/cursor_util.h @@ -10,13 +10,17 @@ #include "ui/base/cursor/cursor.h" #include "ui/base/cursor/mojom/cursor_type.mojom-forward.h" +#if defined(USE_AURA) +#include "ui/base/cursor/platform_cursor.h" +#endif + class CefBrowserHostBase; namespace cursor_util { #if defined(USE_AURA) cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type); -cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor); +cef_cursor_handle_t ToCursorHandle(scoped_refptr cursor); #endif // defined(USE_AURA) // Returns true if the client handled the cursor change. diff --git a/libcef/browser/native/cursor_util_linux.cc b/libcef/browser/native/cursor_util_linux.cc index f5d256845..b61f82495 100644 --- a/libcef/browser/native/cursor_util_linux.cc +++ b/libcef/browser/native/cursor_util_linux.cc @@ -8,6 +8,8 @@ #if defined(USE_X11) #include "ui/base/x/x11_cursor.h" +#elif defined(USE_OZONE) +#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" #endif namespace cursor_util { @@ -20,13 +22,16 @@ cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) { return 0; } -cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor) { +cef_cursor_handle_t ToCursorHandle(scoped_refptr cursor) { #if defined(USE_X11) // See https://crbug.com/1029142 for background. return static_cast( - static_cast(cursor)->xcursor()); + ui::X11Cursor::FromPlatformCursor(cursor)->xcursor()); +#elif defined(USE_OZONE) + return static_cast( + ui::BitmapCursorOzone::FromPlatformCursor(cursor)->platform_data()); #else - return cursor; + return 0; #endif } diff --git a/libcef/browser/native/cursor_util_win.cc b/libcef/browser/native/cursor_util_win.cc index 842a54671..00cb5cfb2 100644 --- a/libcef/browser/native/cursor_util_win.cc +++ b/libcef/browser/native/cursor_util_win.cc @@ -156,8 +156,8 @@ cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) { return LoadCursor(module_handle, cursor_id); } -cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor) { - return static_cast(cursor)->hcursor(); +cef_cursor_handle_t ToCursorHandle(scoped_refptr cursor) { + return ui::WinCursor::FromPlatformCursor(cursor)->hcursor(); } } // namespace cursor_util diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 27dae2da5..4d3b029b2 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -487,8 +487,8 @@ void CefNativeMenuWin::RunMenuAt(const gfx::Point& point, int alignment) { // does. menu_to_select_factory_.InvalidateWeakPtrs(); base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&CefNativeMenuWin::DelayedSelect, - menu_to_select_factory_.GetWeakPtr())); + FROM_HERE, base::BindOnce(&CefNativeMenuWin::DelayedSelect, + menu_to_select_factory_.GetWeakPtr())); menu_action_ = MENU_ACTION_SELECTED; } // Send MenuWillClose after we schedule the select, otherwise MenuWillClose is diff --git a/libcef/browser/native/window_delegate_view.cc b/libcef/browser/native/window_delegate_view.cc index a591577ee..90c57a105 100644 --- a/libcef/browser/native/window_delegate_view.cc +++ b/libcef/browser/native/window_delegate_view.cc @@ -48,7 +48,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget, params.remove_standard_frame = true; // Cause WidgetDelegate::CanActivate to return true. See comments in // AlloyBrowserHostImpl::PlatformSetFocus. - params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; + params.activatable = views::Widget::InitParams::Activatable::kYes; params.z_order = always_on_top_ ? ui::ZOrderLevel::kFloatingWindow : ui::ZOrderLevel::kNormal; diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index aeac4713f..615f44a75 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -9,6 +9,7 @@ #include "libcef/browser/browser_host_base.h" #include "libcef/browser/thread_util.h" +#include "net/base/network_interfaces.h" #include "ui/base/x/x11_util.h" #include "ui/events/platform/platform_event_source.h" #include "ui/events/platform/x11/x11_event_source.h" @@ -391,8 +392,8 @@ void CefWindowX11::ProcessXEvent(const x11::Event& event) { if (!focus_pending_) { focus_pending_ = true; CEF_POST_DELAYED_TASK(CEF_UIT, - base::Bind(&CefWindowX11::ContinueFocus, - weak_ptr_factory_.GetWeakPtr()), + base::BindOnce(&CefWindowX11::ContinueFocus, + weak_ptr_factory_.GetWeakPtr()), 100); } } else { diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 2239f3c12..7507aa4a2 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -44,7 +44,9 @@ #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" #include "content/public/common/user_agent.h" +#include "content/public/test/scoped_web_ui_controller_factory_registration.h" #include "ipc/ipc_channel.h" +#include "third_party/blink/public/common/chrome_debug_urls.h" #include "ui/base/resource/resource_bundle.h" #include "v8/include/v8.h" @@ -182,7 +184,7 @@ bool IsAllowedWebUIHost(const std::string& host) { // Additional debug URLs that are not included in chrome::kChromeDebugURLs. const char* kAllowedDebugURLs[] = { - content::kChromeUIBrowserCrashURL, + blink::kChromeUIBrowserCrashURL, }; void GetDebugURLs(std::vector* urls) { @@ -639,7 +641,9 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { static CefWebUIControllerFactory* GetInstance(); protected: - CefWebUIControllerFactory() {} + CefWebUIControllerFactory() + : remove_content_registration_( + content::ContentWebUIControllerFactory::GetInstance()) {} ~CefWebUIControllerFactory() override {} private: @@ -662,6 +666,9 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { return false; } + content::ScopedWebUIControllerFactoryRegistration + remove_content_registration_; + DISALLOW_COPY_AND_ASSIGN(CefWebUIControllerFactory); }; @@ -677,9 +684,6 @@ CefWebUIControllerFactory* CefWebUIControllerFactory::GetInstance() { void RegisterWebUIControllerFactory() { // Channel all WebUI handling through CefWebUIControllerFactory. - content::WebUIControllerFactory::UnregisterFactoryForTesting( - content::ContentWebUIControllerFactory::GetInstance()); - content::WebUIControllerFactory::RegisterFactory( CefWebUIControllerFactory::GetInstance()); } diff --git a/libcef/browser/net/throttle_handler.cc b/libcef/browser/net/throttle_handler.cc index c9f3091de..82d305860 100644 --- a/libcef/browser/net/throttle_handler.cc +++ b/libcef/browser/net/throttle_handler.cc @@ -107,8 +107,9 @@ void CreateThrottlesForNavigation(content::NavigationHandle* navigation_handle, std::unique_ptr throttle = std::make_unique( navigation_handle, - base::Bind(&NavigationOnUIThread, is_main_frame, frame_id, - parent_frame_id, navigation_handle->GetFrameTreeNodeId()), + base::BindRepeating(&NavigationOnUIThread, is_main_frame, frame_id, + parent_frame_id, + navigation_handle->GetFrameTreeNodeId()), navigation_interception::SynchronyMode::kSync); throttles.push_back(std::move(throttle)); } diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 0c82fa41b..b769b1a1c 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -82,16 +82,16 @@ class RequestManager { map_.erase(it); } - base::Optional Get(int32_t request_id) { + absl::optional Get(int32_t request_id) { if (request_id > kInitialRequestID) - return base::nullopt; + return absl::nullopt; base::AutoLock lock_scope(lock_); RequestMap::const_iterator it = map_.find(request_id); if (it != map_.end()) { return it->second; } - return base::nullopt; + return absl::nullopt; } private: @@ -230,8 +230,7 @@ class CefBrowserURLRequest::Context net_service::URLLoaderFactoryGetter::Create(nullptr, browser_context); url_loader_network_observer = static_cast( - content::BrowserContext::GetDefaultStoragePartition( - browser_context)) + browser_context->GetDefaultStoragePartition()) ->CreateAuthCertObserverForServiceWorker(); } @@ -346,7 +345,7 @@ class CefBrowserURLRequest::Context content_type = net_service::kContentTypeApplicationFormURLEncoded; } loader_->AttachStringForUpload( - bytes_element.AsStringPiece().as_string(), content_type); + std::string(bytes_element.AsStringPiece()), content_type); if (request_flags & UR_FLAG_REPORT_UPLOAD_PROGRESS) { // Report the expected upload data size. @@ -376,14 +375,14 @@ class CefBrowserURLRequest::Context if (request_flags & UR_FLAG_STOP_ON_REDIRECT) { // The request will be canceled in OnRedirect. loader_->SetOnRedirectCallback( - base::Bind(&CefBrowserURLRequest::Context::OnRedirect, - weak_ptr_factory_.GetWeakPtr())); + base::BindRepeating(&CefBrowserURLRequest::Context::OnRedirect, + weak_ptr_factory_.GetWeakPtr())); } if (request_flags & UR_FLAG_REPORT_UPLOAD_PROGRESS) { loader_->SetOnUploadProgressCallback( - base::Bind(&CefBrowserURLRequest::Context::OnUploadProgress, - weak_ptr_factory_.GetWeakPtr())); + base::BindRepeating(&CefBrowserURLRequest::Context::OnUploadProgress, + weak_ptr_factory_.GetWeakPtr())); } if ((request_flags & UR_FLAG_NO_DOWNLOAD_DATA) || method == "HEAD") { @@ -395,9 +394,9 @@ class CefBrowserURLRequest::Context loader_->SetOnResponseStartedCallback( base::BindOnce(&CefBrowserURLRequest::Context::OnResponseStarted, weak_ptr_factory_.GetWeakPtr())); - loader_->SetOnDownloadProgressCallback( - base::Bind(&CefBrowserURLRequest::Context::OnDownloadProgress, - weak_ptr_factory_.GetWeakPtr())); + loader_->SetOnDownloadProgressCallback(base::BindRepeating( + &CefBrowserURLRequest::Context::OnDownloadProgress, + weak_ptr_factory_.GetWeakPtr())); loader_->DownloadAsStream(loader_factory.get(), this); } @@ -597,16 +596,16 @@ class CefBrowserURLRequest::Context // CefBrowserURLRequest ------------------------------------------------------- // static -base::Optional +absl::optional CefBrowserURLRequest::FromRequestID(int32_t request_id) { if (IsValidRequestID(request_id)) { return g_manager.Get().Get(request_id); } - return base::nullopt; + return absl::nullopt; } // static -base::Optional +absl::optional CefBrowserURLRequest::FromRequestID( const content::GlobalRequestID& request_id) { return FromRequestID(request_id.request_id); diff --git a/libcef/browser/net_service/browser_urlrequest_impl.h b/libcef/browser/net_service/browser_urlrequest_impl.h index 45f5a673c..21843b9b5 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.h +++ b/libcef/browser/net_service/browser_urlrequest_impl.h @@ -9,7 +9,7 @@ #include "include/cef_urlrequest.h" -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace content { struct GlobalRequestID; @@ -27,8 +27,8 @@ class CefBrowserURLRequest : public CefURLRequest { CefRefPtr>; // Retrieve the request objects, if any, associated with |request_id|. - static base::Optional FromRequestID(int32_t request_id); - static base::Optional FromRequestID( + static absl::optional FromRequestID(int32_t request_id); + static absl::optional FromRequestID( const content::GlobalRequestID& request_id); // If |frame| is nullptr requests can still be intercepted but no diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index 6b2adf40c..f342ea491 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -26,7 +26,7 @@ namespace { network::mojom::CookieManager* GetCookieManager( content::BrowserContext* browser_context) { CEF_REQUIRE_UIT(); - return content::BrowserContext::GetDefaultStoragePartition(browser_context) + return browser_context->GetDefaultStoragePartition() ->GetCookieManagerForBrowserProcess(); } @@ -164,7 +164,7 @@ void SaveCookiesOnUIThread(content::BrowserContext* browser_context, bool IsCookieableScheme( const GURL& url, - const base::Optional>& cookieable_schemes) { + const absl::optional>& cookieable_schemes) { if (!url.has_scheme()) return false; diff --git a/libcef/browser/net_service/cookie_helper.h b/libcef/browser/net_service/cookie_helper.h index 2e0cbe1e5..06459a5a9 100644 --- a/libcef/browser/net_service/cookie_helper.h +++ b/libcef/browser/net_service/cookie_helper.h @@ -28,10 +28,11 @@ namespace cookie_helper { // cookieable, which may intentionally exclude standard schemes. bool IsCookieableScheme( const GURL& url, - const base::Optional>& cookieable_schemes); + const absl::optional>& cookieable_schemes); using AllowCookieCallback = - base::Callback; + base::RepeatingCallback; using DoneCookieCallback = base::OnceCallback; diff --git a/libcef/browser/net_service/cookie_manager_impl.cc b/libcef/browser/net_service/cookie_manager_impl.cc index 935cad6c3..3d10142a9 100644 --- a/libcef/browser/net_service/cookie_manager_impl.cc +++ b/libcef/browser/net_service/cookie_manager_impl.cc @@ -30,8 +30,8 @@ CefBrowserContext* GetBrowserContext(const CefBrowserContext::Getter& getter) { // Do not keep a reference to the object returned by this method. CookieManager* GetCookieManager(CefBrowserContext* browser_context) { CEF_REQUIRE_UIT(); - return content::BrowserContext::GetDefaultStoragePartition( - browser_context->AsBrowserContext()) + return browser_context->AsBrowserContext() + ->GetDefaultStoragePartition() ->GetCookieManagerForBrowserProcess(); } @@ -39,8 +39,8 @@ CookieManager* GetCookieManager(CefBrowserContext* browser_context) { void RunAsyncCompletionOnUIThread(CefRefPtr callback) { if (!callback.get()) return; - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefCompletionCallback::OnComplete, callback.get())); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefCompletionCallback::OnComplete, + callback.get())); } // Always execute the callback asynchronously. @@ -53,8 +53,8 @@ void SetCookieCallbackImpl(CefRefPtr callback, LOG(WARNING) << "SetCookie failed with reason: " << access_result.status.GetDebugString(); } - CEF_POST_TASK(CEF_UIT, base::Bind(&CefSetCookieCallback::OnComplete, - callback.get(), is_include)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefSetCookieCallback::OnComplete, + callback.get(), is_include)); } // Always execute the callback asynchronously. @@ -62,8 +62,8 @@ void DeleteCookiesCallbackImpl(CefRefPtr callback, uint32_t num_deleted) { if (!callback.get()) return; - CEF_POST_TASK(CEF_UIT, base::Bind(&CefDeleteCookiesCallback::OnComplete, - callback.get(), num_deleted)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefDeleteCookiesCallback::OnComplete, + callback.get(), num_deleted)); } void ExecuteVisitor(CefRefPtr visitor, @@ -99,8 +99,8 @@ void GetAllCookiesCallbackImpl( CefRefPtr visitor, const CefBrowserContext::Getter& browser_context_getter, const net::CookieList& cookies) { - CEF_POST_TASK(CEF_UIT, base::Bind(&ExecuteVisitor, visitor, - browser_context_getter, cookies)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&ExecuteVisitor, visitor, + browser_context_getter, cookies)); } void GetCookiesCallbackImpl( @@ -233,8 +233,8 @@ bool CefCookieManagerImpl::VisitAllCookiesInternal( return false; GetCookieManager(browser_context) - ->GetAllCookies(base::Bind(&GetAllCookiesCallbackImpl, visitor, - browser_context_getter_)); + ->GetAllCookies(base::BindOnce(&GetAllCookiesCallbackImpl, visitor, + browser_context_getter_)); return true; } @@ -258,8 +258,8 @@ bool CefCookieManagerImpl::VisitUrlCookiesInternal( GetCookieManager(browser_context) ->GetCookieList(url, options, - base::Bind(&GetCookiesCallbackImpl, visitor, - browser_context_getter_)); + base::BindOnce(&GetCookiesCallbackImpl, visitor, + browser_context_getter_)); return true; } @@ -311,7 +311,7 @@ bool CefCookieManagerImpl::SetCookieInternal( GetCookieManager(browser_context) ->SetCanonicalCookie(*canonical_cookie, url, options, - base::Bind(SetCookieCallbackImpl, callback)); + base::BindOnce(SetCookieCallbackImpl, callback)); return true; } @@ -342,7 +342,7 @@ bool CefCookieManagerImpl::DeleteCookiesInternal( GetCookieManager(browser_context) ->DeleteCookies(std::move(deletion_filter), - base::Bind(DeleteCookiesCallbackImpl, callback)); + base::BindOnce(DeleteCookiesCallbackImpl, callback)); return true; } @@ -355,7 +355,8 @@ bool CefCookieManagerImpl::FlushStoreInternal( return false; GetCookieManager(browser_context) - ->FlushCookieStore(base::Bind(RunAsyncCompletionOnUIThread, callback)); + ->FlushCookieStore( + base::BindOnce(RunAsyncCompletionOnUIThread, callback)); return true; } diff --git a/libcef/browser/net_service/login_delegate.cc b/libcef/browser/net_service/login_delegate.cc index 3aeeb380f..ff30d0de3 100644 --- a/libcef/browser/net_service/login_delegate.cc +++ b/libcef/browser/net_service/login_delegate.cc @@ -68,7 +68,7 @@ class AuthCallbackImpl : public CefAuthCallback { void RunCallbackOnIOThread( CefRefPtr browser, - base::Optional url_request_info, + absl::optional url_request_info, const net::AuthChallengeInfo& auth_info, const GURL& origin_url, CefRefPtr callback_impl) { @@ -142,7 +142,7 @@ void LoginDelegate::Continue(const CefString& username, void LoginDelegate::Cancel() { CEF_REQUIRE_UIT(); if (!callback_.is_null()) { - std::move(callback_).Run(base::nullopt); + std::move(callback_).Run(absl::nullopt); } } diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index 16d762689..e6a3ff545 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -33,12 +33,12 @@ namespace { // User data key for ResourceContextData. const void* const kResourceContextUserDataKey = &kResourceContextUserDataKey; -base::Optional GetHeaderString( +absl::optional GetHeaderString( const net::HttpResponseHeaders* headers, const std::string& header_name) { std::string header_value; if (!headers || !headers->GetNormalizedHeader(header_name, &header_value)) { - return base::nullopt; + return absl::nullopt; } return header_value; } @@ -147,13 +147,13 @@ class CorsPreflightRequest : public network::mojom::TrustedHeaderClient { // mojom::TrustedHeaderClient methods: void OnBeforeSendHeaders(const net::HttpRequestHeaders& headers, OnBeforeSendHeadersCallback callback) override { - std::move(callback).Run(net::OK, base::nullopt); + std::move(callback).Run(net::OK, absl::nullopt); } void OnHeadersReceived(const std::string& headers, const net::IPEndPoint& remote_endpoint, OnHeadersReceivedCallback callback) override { - std::move(callback).Run(net::OK, base::nullopt, GURL()); + std::move(callback).Run(net::OK, absl::nullopt, GURL()); OnDestroy(); } @@ -225,7 +225,7 @@ class InterceptedRequest : public network::mojom::URLLoader, const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override; + const absl::optional& new_url) override; void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override; void PauseReadingBodyFromNet() override; @@ -246,7 +246,7 @@ class InterceptedRequest : public network::mojom::URLLoader, // Helpers for optionally overriding headers. void HandleResponseOrRedirectHeaders( - base::Optional redirect_info, + absl::optional redirect_info, net::CompletionOnceCallback continuation); void ContinueResponseOrRedirect( net::CompletionOnceCallback continuation, @@ -412,7 +412,7 @@ InterceptedRequest::~InterceptedRequest() { SendErrorCallback(status_.error_code, false); if (on_headers_received_callback_) { std::move(on_headers_received_callback_) - .Run(net::ERR_ABORTED, base::nullopt, GURL()); + .Run(net::ERR_ABORTED, absl::nullopt, GURL()); } } @@ -493,12 +493,12 @@ void InterceptedRequest::OnBeforeSendHeaders( const net::HttpRequestHeaders& headers, OnBeforeSendHeadersCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, base::nullopt); + std::move(callback).Run(net::OK, absl::nullopt); return; } request_.headers = headers; - std::move(callback).Run(net::OK, base::nullopt); + std::move(callback).Run(net::OK, absl::nullopt); // Resume handling of client messages after continuing from an async callback. if (proxied_client_receiver_.is_bound()) @@ -510,14 +510,14 @@ void InterceptedRequest::OnHeadersReceived( const net::IPEndPoint& remote_endpoint, OnHeadersReceivedCallback callback) { if (!current_request_uses_header_client_) { - std::move(callback).Run(net::OK, base::nullopt, GURL()); + std::move(callback).Run(net::OK, absl::nullopt, GURL()); return; } current_headers_ = base::MakeRefCounted(headers); on_headers_received_callback_ = std::move(callback); - base::Optional redirect_info; + absl::optional redirect_info; std::string location; if (current_headers_->IsRedirect(&location)) { const GURL new_url = request_.url.Resolve(location); @@ -551,7 +551,7 @@ void InterceptedRequest::OnReceiveResponse( ContinueToResponseStarted(net::OK); } else { HandleResponseOrRedirectHeaders( - base::nullopt, + absl::nullopt, base::BindOnce(&InterceptedRequest::ContinueToResponseStarted, weak_factory_.GetWeakPtr())); } @@ -659,7 +659,7 @@ void InterceptedRequest::FollowRedirect( const std::vector& removed_headers_ext, const net::HttpRequestHeaders& modified_headers_ext, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) { + const absl::optional& new_url) { std::vector removed_headers = removed_headers_ext; net::HttpRequestHeaders modified_headers = modified_headers_ext; OnProcessRequestHeaders(new_url.value_or(GURL()), &modified_headers, @@ -802,7 +802,7 @@ void InterceptedRequest::ContinueAfterInterceptWithOverride( } void InterceptedRequest::HandleResponseOrRedirectHeaders( - base::Optional redirect_info, + absl::optional redirect_info, net::CompletionOnceCallback continuation) { override_headers_ = nullptr; redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL(); @@ -860,7 +860,7 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) { } DCHECK(on_headers_received_callback_); - base::Optional headers; + absl::optional headers; if (override_headers_) headers = override_headers_->raw_headers(); header_client_redirect_url_ = redirect_url_; @@ -954,7 +954,7 @@ void InterceptedRequest::ContinueToBeforeRedirect( net::RedirectUtil::UpdateHttpRequest(original_url, original_method, new_redirect_info, base::make_optional(remove_headers), - /*modified_headers=*/base::nullopt, + /*modified_headers=*/absl::nullopt, &request_.headers, &should_clear_upload); if (should_clear_upload) { @@ -1164,7 +1164,7 @@ void InterceptedRequestHandler::OnRequestResponse( int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, - base::Optional redirect_info, + absl::optional redirect_info, OnRequestResponseResultCallback callback) { std::move(callback).Run( ResponseMode::CONTINUE, nullptr, diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 16bde5018..04d3bd59b 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -12,7 +12,6 @@ #include "base/containers/unique_ptr_adapters.h" #include "base/hash/hash.h" #include "base/macros.h" -#include "base/optional.h" #include "base/strings/string_piece.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" @@ -20,6 +19,7 @@ #include "mojo/public/cpp/bindings/receiver_set.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace content { class ResourceContext; @@ -104,7 +104,7 @@ class InterceptedRequestHandler { int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, - base::Optional redirect_info, + absl::optional redirect_info, OnRequestResponseResultCallback callback); // Called to optionally filter the response body. diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 1e57bef43..047ce14a4 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -233,7 +233,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { bool is_navigation, bool is_download, const url::Origin& request_initiator, - const base::Closure& unhandled_request_callback) { + const base::RepeatingClosure& unhandled_request_callback) { CEF_REQUIRE_UIT(); browser_context_ = browser_context; @@ -297,7 +297,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { bool is_navigation_ = true; bool is_download_ = false; CefString request_initiator_; - base::Closure unhandled_request_callback_; + base::RepeatingClosure unhandled_request_callback_; // Default values for standard headers. std::string accept_language_; @@ -705,7 +705,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { void OnRequestResponse(int32_t request_id, network::ResourceRequest* request, net::HttpResponseHeaders* headers, - base::Optional redirect_info, + absl::optional redirect_info, OnRequestResponseResultCallback callback) override { CEF_REQUIRE_IOT(); @@ -1179,7 +1179,7 @@ void InitOnUIThread( content::WebContents::Getter web_contents_getter, int frame_tree_node_id, const network::ResourceRequest& request, - const base::Closure& unhandled_request_callback) { + const base::RepeatingClosure& unhandled_request_callback) { CEF_REQUIRE_UIT(); // May return nullptr if the WebContents was destroyed while this callback was @@ -1278,7 +1278,8 @@ std::unique_ptr CreateInterceptedRequestHandler( std::make_unique(); init_state->Initialize(browser_context, browserPtr, framePtr, render_process_id, frame_tree_node_id, is_navigation, - is_download, request_initiator, base::Closure()); + is_download, request_initiator, + base::RepeatingClosure()); auto wrapper = std::make_unique(); wrapper->init_helper()->MaybeSetInitialized(std::move(init_state)); @@ -1290,7 +1291,7 @@ std::unique_ptr CreateInterceptedRequestHandler( content::WebContents::Getter web_contents_getter, int frame_tree_node_id, const network::ResourceRequest& request, - const base::Closure& unhandled_request_callback) { + const base::RepeatingClosure& unhandled_request_callback) { auto wrapper = std::make_unique(); CEF_POST_TASK(CEF_UIT, base::BindOnce(InitOnUIThread, wrapper->init_helper(), web_contents_getter, frame_tree_node_id, diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.h b/libcef/browser/net_service/resource_request_handler_wrapper.h index 52d2b2792..104682eab 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.h +++ b/libcef/browser/net_service/resource_request_handler_wrapper.h @@ -43,7 +43,7 @@ std::unique_ptr CreateInterceptedRequestHandler( content::WebContents::Getter web_contents_getter, int frame_tree_node_id, const network::ResourceRequest& request, - const base::Closure& unhandled_request_callback); + const base::RepeatingClosure& unhandled_request_callback); } // namespace net_service diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index d7690baed..baf31c5e2 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -508,13 +508,13 @@ void StreamReaderURLLoader::Start() { base::BindOnce(&StreamReaderURLLoader::ContinueWithRequestHeaders, weak_factory_.GetWeakPtr())); } else { - ContinueWithRequestHeaders(net::OK, base::nullopt); + ContinueWithRequestHeaders(net::OK, absl::nullopt); } } void StreamReaderURLLoader::ContinueWithRequestHeaders( int32_t result, - const base::Optional& headers) { + const absl::optional& headers) { if (result != net::OK) { RequestComplete(result); return; @@ -540,7 +540,7 @@ void StreamReaderURLLoader::FollowRedirect( const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) { + const absl::optional& new_url) { NOTREACHED(); } @@ -651,15 +651,15 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code, std::move(pending_response))); } else { ContinueWithResponseHeaders(std::move(pending_response), net::OK, - base::nullopt, base::nullopt); + absl::nullopt, absl::nullopt); } } void StreamReaderURLLoader::ContinueWithResponseHeaders( network::mojom::URLResponseHeadPtr pending_response, int32_t result, - const base::Optional& headers, - const base::Optional& redirect_url) { + const absl::optional& headers, + const absl::optional& redirect_url) { if (result != net::OK) { RequestComplete(result); return; diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 55c0a4166..4e76010dd 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -127,7 +127,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { const std::vector& removed_headers, const net::HttpRequestHeaders& modified_headers, const net::HttpRequestHeaders& modified_cors_exempt_headers, - const base::Optional& new_url) override; + const absl::optional& new_url) override; void SetPriority(net::RequestPriority priority, int intra_priority_value) override; void PauseReadingBodyFromNet() override; @@ -136,7 +136,7 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { private: void ContinueWithRequestHeaders( int32_t result, - const base::Optional& headers); + const absl::optional& headers); void OnInputStreamOpened(std::unique_ptr returned_delegate, std::unique_ptr input_stream); @@ -145,8 +145,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { void ContinueWithResponseHeaders( network::mojom::URLResponseHeadPtr pending_response, int32_t result, - const base::Optional& headers, - const base::Optional& redirect_url); + const absl::optional& headers, + const absl::optional& redirect_url); void SendBody(); void ReadMore(); diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index 9384d75bd..1ff5e75bd 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -32,9 +32,8 @@ scoped_refptr URLLoaderFactoryGetter::Create( // initialize additional state, and that should be done on the UI thread // instead of potentially racing with the WillCreateURLLoaderFactory // implementation. - auto loader_factory = - content::BrowserContext::GetDefaultStoragePartition(browser_context) - ->GetURLLoaderFactoryForBrowserProcess(); + auto loader_factory = browser_context->GetDefaultStoragePartition() + ->GetURLLoaderFactoryForBrowserProcess(); network::mojom::URLLoaderFactoryPtrInfo proxy_factory_ptr_info; network::mojom::URLLoaderFactoryRequest proxy_factory_request; @@ -65,7 +64,7 @@ scoped_refptr URLLoaderFactoryGetter::Create( should_proxy |= browser_client->WillCreateURLLoaderFactory( browser_context, render_frame_host, render_process_id, content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, - url::Origin(), base::nullopt /* navigation_id */, ukm::SourceIdObj(), + url::Origin(), absl::nullopt /* navigation_id */, ukm::SourceIdObj(), &maybe_proxy_factory_request, nullptr /* header_client */, nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, nullptr /* factory_override */); diff --git a/libcef/browser/origin_whitelist_impl.cc b/libcef/browser/origin_whitelist_impl.cc index 02c0dd2e5..88e1ac8fb 100644 --- a/libcef/browser/origin_whitelist_impl.cc +++ b/libcef/browser/origin_whitelist_impl.cc @@ -101,7 +101,7 @@ class CefOriginWhitelistManager { } void GetCrossOriginWhitelistEntries( - base::Optional* entries) const { + absl::optional* entries) const { base::AutoLock lock_scope(lock_); if (!origin_list_.empty()) { @@ -226,9 +226,9 @@ bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, } else { CEF_POST_TASK( CEF_UIT, - base::Bind(base::IgnoreResult(&CefAddCrossOriginWhitelistEntry), - source_origin, target_protocol, target_domain, - allow_target_subdomains)); + base::BindOnce(base::IgnoreResult(&CefAddCrossOriginWhitelistEntry), + source_origin, target_protocol, target_domain, + allow_target_subdomains)); } return true; @@ -257,9 +257,9 @@ bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, } else { CEF_POST_TASK( CEF_UIT, - base::Bind(base::IgnoreResult(&CefRemoveCrossOriginWhitelistEntry), - source_origin, target_protocol, target_domain, - allow_target_subdomains)); + base::BindOnce(base::IgnoreResult(&CefRemoveCrossOriginWhitelistEntry), + source_origin, target_protocol, target_domain, + allow_target_subdomains)); } return true; @@ -276,14 +276,15 @@ bool CefClearCrossOriginWhitelist() { CefOriginWhitelistManager::GetInstance()->ClearOrigins(); } else { CEF_POST_TASK( - CEF_UIT, base::Bind(base::IgnoreResult(&CefClearCrossOriginWhitelist))); + CEF_UIT, + base::BindOnce(base::IgnoreResult(&CefClearCrossOriginWhitelist))); } return true; } void GetCrossOriginWhitelistEntries( - base::Optional* entries) { + absl::optional* entries) { CefOriginWhitelistManager::GetInstance()->GetCrossOriginWhitelistEntries( entries); } diff --git a/libcef/browser/origin_whitelist_impl.h b/libcef/browser/origin_whitelist_impl.h index fbc9d0d61..c5f8236dc 100644 --- a/libcef/browser/origin_whitelist_impl.h +++ b/libcef/browser/origin_whitelist_impl.h @@ -7,7 +7,7 @@ #include -#include "base/optional.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "cef/libcef/common/mojom/cef.mojom-forward.h" @@ -25,7 +25,7 @@ using CrossOriginWhiteList = // Called to retrieve the current list of cross-origin white list entries. This // method is thread safe. void GetCrossOriginWhitelistEntries( - base::Optional* entries); + absl::optional* entries); // Returns true if |source| can access |target| based on the cross-origin white // list settings. diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 49c156828..e367eea03 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -207,7 +207,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( DCHECK(render_widget_host_); DCHECK(!render_widget_host_->GetView()); - set_current_device_scale_factor(kDefaultScaleFactor); + SetCurrentDeviceScaleFactor(kDefaultScaleFactor); if (parent_host_view_) { browser_impl_ = parent_host_view_->browser_impl(); @@ -432,7 +432,7 @@ bool CefRenderWidgetHostViewOSR::IsShowing() { void CefRenderWidgetHostViewOSR::EnsureSurfaceSynchronizedForWebTest() { ++latest_capture_sequence_number_; SynchronizeVisualProperties(cc::DeadlinePolicy::UseInfiniteDeadline(), - base::nullopt); + absl::nullopt); } gfx::Rect CefRenderWidgetHostViewOSR::GetViewBounds() { @@ -452,15 +452,15 @@ void CefRenderWidgetHostViewOSR::SetBackgroundColor(SkColor color) { content::RenderWidgetHostViewBase::SetBackgroundColor(color); } -base::Optional CefRenderWidgetHostViewOSR::GetBackgroundColor() { +absl::optional CefRenderWidgetHostViewOSR::GetBackgroundColor() { return background_color_; } void CefRenderWidgetHostViewOSR::UpdateBackgroundColor() {} -base::Optional +absl::optional CefRenderWidgetHostViewOSR::GetDisplayFeature() { - return base::nullopt; + return absl::nullopt; } void CefRenderWidgetHostViewOSR::SetDisplayFeatureForTesting( @@ -524,7 +524,7 @@ CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceId() const { } void CefRenderWidgetHostViewOSR::UpdateLocalSurfaceIdFromEmbeddedClient( - const base::Optional& + const absl::optional& embedded_client_local_surface_id) { if (embedded_client_local_surface_id) { parent_local_surface_id_allocator_->UpdateFromChild( @@ -652,7 +652,7 @@ void CefRenderWidgetHostViewOSR::Destroy() { delete this; } -void CefRenderWidgetHostViewOSR::SetTooltipText( +void CefRenderWidgetHostViewOSR::UpdateTooltipUnderCursor( const std::u16string& tooltip_text) { if (!browser_impl_.get()) return; @@ -667,7 +667,7 @@ void CefRenderWidgetHostViewOSR::SetTooltipText( gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), - current_device_scale_factor()); + GetCurrentDeviceScaleFactor()); } uint32_t CefRenderWidgetHostViewOSR::GetCaptureSequenceNumber() const { @@ -890,7 +890,7 @@ void CefRenderWidgetHostViewOSR::DidNavigate() { GetLocalSurfaceId()); } else { SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), - base::nullopt); + absl::nullopt); } } if (delegated_frame_host_) @@ -927,8 +927,8 @@ void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation( // Send the notification asynchronously. CEF_POST_TASK( CEF_UIT, - base::Bind(&CefRenderWidgetHostViewOSR::OnScrollOffsetChanged, - weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&CefRenderWidgetHostViewOSR::OnScrollOffsetChanged, + weak_ptr_factory_.GetWeakPtr())); } } } @@ -961,12 +961,12 @@ void CefRenderWidgetHostViewOSR::WasResized() { } SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), - base::nullopt); + absl::nullopt); } void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const base::Optional& child_local_surface_id) { + const absl::optional& child_local_surface_id) { SetFrameRate(); const bool resized = ResizeRootLayer(); @@ -1005,7 +1005,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { return; SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(), - base::nullopt); + absl::nullopt); if (render_widget_host_->delegate()) render_widget_host_->delegate()->SendScreenRects(); @@ -1180,8 +1180,8 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( // some other callback. CEF_POST_TASK( CEF_UIT, - base::Bind(&CefRenderWidgetHostViewOSR::CancelWidget, - popup_host_view_->weak_ptr_factory_.GetWeakPtr())); + base::BindOnce(&CefRenderWidgetHostViewOSR::CancelWidget, + popup_host_view_->weak_ptr_factory_.GetWeakPtr())); } } else if (!guest_host_views_.empty()) { for (auto guest_host_view : guest_host_views_) { @@ -1394,7 +1394,7 @@ void CefRenderWidgetHostViewOSR::UpdateFrameRate() { gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() { return gfx::ScaleToCeiledSize(GetViewBounds().size(), - current_device_scale_factor()); + GetCurrentDeviceScaleFactor()); } #if defined(OS_MAC) @@ -1490,10 +1490,10 @@ bool CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { DCHECK(!hold_resize_); const float new_scale_factor = ::GetDeviceScaleFactor(browser_impl_.get()); - if (new_scale_factor == current_device_scale_factor()) + if (new_scale_factor == GetCurrentDeviceScaleFactor()) return false; - set_current_device_scale_factor(new_scale_factor); + SetCurrentDeviceScaleFactor(new_scale_factor); // Notify the guest hosts if any. for (auto guest_host_view : guest_host_views_) { @@ -1503,13 +1503,25 @@ bool CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { auto guest_view_osr = static_cast(rwhi->GetView()); if (guest_view_osr) { - guest_view_osr->set_current_device_scale_factor(new_scale_factor); + guest_view_osr->SetCurrentDeviceScaleFactor(new_scale_factor); } } return true; } +void CefRenderWidgetHostViewOSR::SetCurrentDeviceScaleFactor(float scale) { + // Initialize a display struct as needed, to cache the scale factor. + if (display_list_.displays().empty()) { + display_list_ = display::DisplayList( + {display::Display(display::kDefaultDisplayId)}, + display::kDefaultDisplayId, display::kDefaultDisplayId); + } + display::Display current_display = display_list_.GetCurrentDisplay(); + current_display.set_device_scale_factor(scale); + display_list_.UpdateDisplay(current_display); +} + bool CefRenderWidgetHostViewOSR::SetViewBounds() { // This method should not be called while the resize hold is active. DCHECK(!hold_resize_); @@ -1537,7 +1549,7 @@ bool CefRenderWidgetHostViewOSR::SetRootLayerSize(bool force) { if (compositor_) { compositor_local_surface_id_allocator_.GenerateId(); compositor_->SetScaleAndSize( - current_device_scale_factor(), SizeInPixels(), + GetCurrentDeviceScaleFactor(), SizeInPixels(), compositor_local_surface_id_allocator_.GetCurrentLocalSurfaceId()); } @@ -1566,8 +1578,9 @@ void CefRenderWidgetHostViewOSR::ReleaseResizeHold() { hold_resize_ = false; if (pending_resize_) { pending_resize_ = false; - CEF_POST_TASK(CEF_UIT, base::Bind(&CefRenderWidgetHostViewOSR::WasResized, - weak_ptr_factory_.GetWeakPtr())); + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&CefRenderWidgetHostViewOSR::WasResized, + weak_ptr_factory_.GetWeakPtr())); } } diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 2f63d0d7d..8f9470a67 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -19,7 +19,6 @@ #include "libcef/browser/osr/motion_event_osr.h" #include "base/memory/weak_ptr.h" -#include "base/optional.h" #include "build/build_config.h" #include "cc/layers/deadline_policy.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" @@ -29,6 +28,7 @@ #include "content/browser/renderer_host/text_input_manager.h" #include "content/public/browser/render_frame_metadata_provider.h" #include "content/public/common/widget_type.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/cursor/cursor.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/compositor/compositor.h" @@ -117,9 +117,9 @@ class CefRenderWidgetHostViewOSR void EnsureSurfaceSynchronizedForWebTest() override; gfx::Rect GetViewBounds() override; void SetBackgroundColor(SkColor color) override; - base::Optional GetBackgroundColor() override; + absl::optional GetBackgroundColor() override; void UpdateBackgroundColor() override; - base::Optional GetDisplayFeature() override; + absl::optional GetDisplayFeature() override; void SetDisplayFeatureForTesting( const content::DisplayFeature* display_feature) override; blink::mojom::PointerLockResult LockMouse( @@ -150,7 +150,7 @@ class CefRenderWidgetHostViewOSR void SetIsLoading(bool is_loading) override; void RenderProcessGone() override; void Destroy() override; - void SetTooltipText(const std::u16string& tooltip_text) override; + void UpdateTooltipUnderCursor(const std::u16string& tooltip_text) override; content::CursorManager* GetCursorManager() override; gfx::Size GetCompositorViewportPixelSize() override; void CopyFromSurface( @@ -215,7 +215,7 @@ class CefRenderWidgetHostViewOSR void WasResized(); void SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const base::Optional& child_local_surface_id); + const absl::optional& child_local_surface_id); void OnScreenInfoChanged(); void Invalidate(CefBrowserHost::PaintElementType type); void SendExternalBeginFrame(); @@ -277,6 +277,7 @@ class CefRenderWidgetHostViewOSR private: void SetFrameRate(); bool SetDeviceScaleFactor(); + void SetCurrentDeviceScaleFactor(float scale); bool SetViewBounds(); bool SetRootLayerSize(bool force); @@ -315,7 +316,7 @@ class CefRenderWidgetHostViewOSR // has allocated one. Also sets child sequence number component of the // viz::LocalSurfaceId allocator. void UpdateLocalSurfaceIdFromEmbeddedClient( - const base::Optional& local_surface_id); + const absl::optional& local_surface_id); // Returns the current viz::LocalSurfaceIdAllocation. const viz::LocalSurfaceId& GetOrCreateLocalSurfaceId(); diff --git a/libcef/browser/osr/video_consumer_osr.cc b/libcef/browser/osr/video_consumer_osr.cc index 97bfbdb26..87e4cee9c 100644 --- a/libcef/browser/osr/video_consumer_osr.cc +++ b/libcef/browser/osr/video_consumer_osr.cc @@ -66,7 +66,7 @@ void CefVideoConsumerOSR::SizeChanged(const gfx::Size& size_in_pixels) { } void CefVideoConsumerOSR::RequestRefreshFrame( - const base::Optional& bounds_in_pixels) { + const absl::optional& bounds_in_pixels) { bounds_in_pixels_ = bounds_in_pixels; video_capturer_->RequestRefreshFrame(); } @@ -112,7 +112,7 @@ void CefVideoConsumerOSR::OnFrameCaptured( // Use the bounds passed to RequestRefreshFrame(). damage_rect = gfx::Rect(info->coded_size); damage_rect.Intersect(*bounds_in_pixels_); - bounds_in_pixels_ = base::nullopt; + bounds_in_pixels_ = absl::nullopt; } else { // Retrieve the rectangular region of the frame that has changed since the // frame with the directly preceding CAPTURE_COUNTER. If that frame was not diff --git a/libcef/browser/osr/video_consumer_osr.h b/libcef/browser/osr/video_consumer_osr.h index f393a7704..840296010 100644 --- a/libcef/browser/osr/video_consumer_osr.h +++ b/libcef/browser/osr/video_consumer_osr.h @@ -2,9 +2,9 @@ #define LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_ #include "base/callback.h" -#include "base/optional.h" #include "components/viz/host/client_frame_sink_video_capturer.h" #include "media/capture/mojom/video_capture_types.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" class CefRenderWidgetHostViewOSR; @@ -16,7 +16,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { void SetActive(bool active); void SetFrameRate(base::TimeDelta frame_rate); void SizeChanged(const gfx::Size& size_in_pixels); - void RequestRefreshFrame(const base::Optional& bounds_in_pixels); + void RequestRefreshFrame(const absl::optional& bounds_in_pixels); private: // viz::mojom::FrameSinkVideoConsumer implementation. @@ -33,7 +33,7 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer { std::unique_ptr video_capturer_; gfx::Size size_in_pixels_; - base::Optional bounds_in_pixels_; + absl::optional bounds_in_pixels_; DISALLOW_COPY_AND_ASSIGN(CefVideoConsumerOSR); }; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 282a4ccbc..bf7058930 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -249,6 +249,10 @@ std::unique_ptr CreatePrefService(Profile* profile, false); registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false); + // Profile preferences. + // Based on chrome/browser/profiles/profiles_state.cc RegisterPrefs. + registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); + if (profile) { // Call RegisterProfilePrefs() for all services listed by // EnsureBrowserContextKeyedServiceFactoriesBuilt(). @@ -310,10 +314,6 @@ std::unique_ptr CreatePrefService(Profile* profile, registry->SetDefaultPrefValue(spellcheck::prefs::kSpellCheckEnable, base::Value(!enable_spelling_service_)); - // Pepper flash preferences. - // Modify defaults from DeviceIDFetcher::RegisterProfilePrefs. - registry->SetDefaultPrefValue(prefs::kEnableDRM, base::Value(false)); - // DevTools preferences. // Based on DevToolsWindow::RegisterProfilePrefs. registry->RegisterDictionaryPref(prefs::kDevToolsPreferences); diff --git a/libcef/browser/printing/constrained_window_views_client.cc b/libcef/browser/printing/constrained_window_views_client.cc index 1670f411d..413a9f3d2 100644 --- a/libcef/browser/printing/constrained_window_views_client.cc +++ b/libcef/browser/printing/constrained_window_views_client.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "base/notreached.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/ui/browser_finder.h" #include "components/web_modal/web_contents_modal_dialog_host.h" diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index 254289d10..b733eb55b 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -39,8 +39,9 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { dialog_ = nullptr; } } else { - CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogCallbackImpl::Continue, - this, settings)); + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&CefPrintDialogCallbackImpl::Continue, this, + settings)); } } @@ -52,7 +53,7 @@ class CefPrintDialogCallbackImpl : public CefPrintDialogCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintDialogCallbackImpl::Cancel, this)); + base::BindOnce(&CefPrintDialogCallbackImpl::Cancel, this)); } } @@ -78,7 +79,7 @@ class CefPrintJobCallbackImpl : public CefPrintJobCallback { } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefPrintJobCallbackImpl::Continue, this)); + base::BindOnce(&CefPrintJobCallbackImpl::Continue, this)); } } @@ -214,8 +215,9 @@ void CefPrintDialogLinux::PrintDocument( } // No errors, continue printing. - CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogLinux::SendDocumentToPrinter, - this, document_name)); + CEF_POST_TASK( + CEF_UIT, base::BindOnce(&CefPrintDialogLinux::SendDocumentToPrinter, this, + document_name)); } void CefPrintDialogLinux::AddRefToDialog() { diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index b53d169d8..ceca19795 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -149,7 +149,7 @@ void StopWorker(int document_cookie) { // Write the PDF file to disk. void SavePdfFile(scoped_refptr data, const base::FilePath& path, - const CefPrintViewManager::PdfPrintCallback& callback) { + CefPrintViewManager::PdfPrintCallback callback) { CEF_REQUIRE_BLOCKING(); DCHECK_GT(data->size(), 0U); @@ -161,8 +161,8 @@ void SavePdfFile(scoped_refptr data, bool ok = file.IsValid() && metafile.SaveTo(&file); if (!callback.is_null()) { - content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE, - base::Bind(callback, ok)); + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), ok)); } } @@ -185,7 +185,7 @@ CefPrintViewManager::~CefPrintViewManager() { bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, const base::FilePath& path, const CefPdfPrintSettings& settings, - const PdfPrintCallback& callback) { + PdfPrintCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Don't start print again while printing is currently in progress. @@ -200,7 +200,7 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, pdf_print_state_.reset(new PdfPrintState); pdf_print_state_->printing_rfh_ = rfh; pdf_print_state_->output_path_ = path; - pdf_print_state_->callback_ = callback; + pdf_print_state_->callback_ = std::move(callback); FillInDictionaryFromPdfPrintSettings(settings, ++next_pdf_request_id_, pdf_print_state_->settings_); @@ -276,15 +276,15 @@ void CefPrintViewManager::MetafileReadyForPrinting( } const base::FilePath output_path = pdf_print_state_->output_path_; - const PdfPrintCallback print_callback = pdf_print_state_->callback_; + PdfPrintCallback print_callback = std::move(pdf_print_state_->callback_); // Reset state information. pdf_print_state_.reset(); pdf_print_receiver_.reset(); // Save the PDF file to disk and then execute the callback. - CEF_POST_USER_VISIBLE_TASK( - base::Bind(&SavePdfFile, shared_buf, output_path, print_callback)); + CEF_POST_USER_VISIBLE_TASK(base::BindOnce( + &SavePdfFile, shared_buf, output_path, std::move(print_callback))); } void CefPrintViewManager::PrintPreviewFailed(int32_t document_cookie, @@ -350,7 +350,8 @@ void CefPrintViewManager::TerminatePdfPrintJob() { if (!pdf_print_state_->callback_.is_null()) { // Execute the callback. content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, base::Bind(pdf_print_state_->callback_, false)); + FROM_HERE, + base::BindOnce(std::move(pdf_print_state_->callback_), false)); } // Reset state information. diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index 14843f869..ec912fc9f 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -7,6 +7,7 @@ #include "include/internal/cef_types_wrappers.h" +#include "base/callback_forward.h" #include "base/macros.h" #include "chrome/browser/printing/print_view_manager.h" #include "components/printing/common/print.mojom-forward.h" @@ -30,13 +31,13 @@ class CefPrintViewManager : public PrintViewManager, ~CefPrintViewManager() override; // Callback executed on PDF printing completion. - typedef base::Callback PdfPrintCallback; + typedef base::OnceCallback PdfPrintCallback; // Print the current document to a PDF file. Execute |callback| on completion. bool PrintToPDF(content::RenderFrameHost* rfh, const base::FilePath& path, const CefPdfPrintSettings& settings, - const PdfPrintCallback& callback); + PdfPrintCallback callback); // mojom::PrintManagerHost methods: void GetDefaultPrintSettings( diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 47801015d..74809b450 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -47,8 +47,6 @@ const char* GetTypeString(base::Value::Type type) { return "DICTIONARY"; case base::Value::Type::LIST: return "LIST"; - case base::Value::Type::DEAD: - return "DEAD"; } NOTREACHED(); @@ -62,7 +60,7 @@ struct ResolveHostHelperOld { void OnResolveCompleted(int result) { std::vector resolved_ips; - base::Optional maybe_address_list = + absl::optional maybe_address_list = request_->GetAddressResults(); if (maybe_address_list) { net::AddressList::const_iterator iter = maybe_address_list->begin(); @@ -71,8 +69,8 @@ struct ResolveHostHelperOld { } CEF_POST_TASK( CEF_UIT, - base::Bind(&CefResolveCallback::OnResolveCompleted, callback_, - static_cast(result), resolved_ips)); + base::BindOnce(&CefResolveCallback::OnResolveCompleted, callback_, + static_cast(result), resolved_ips)); delete this; } @@ -90,11 +88,11 @@ class ResolveHostHelper : public network::ResolveHostClientBase { CEF_REQUIRE_UIT(); browser_context->GetNetworkContext()->CreateHostResolver( - base::nullopt, host_resolver_.BindNewPipeAndPassReceiver()); + absl::nullopt, host_resolver_.BindNewPipeAndPassReceiver()); host_resolver_.set_disconnect_handler(base::BindOnce( &ResolveHostHelper::OnComplete, base::Unretained(this), net::ERR_FAILED, - net::ResolveErrorInfo(net::ERR_FAILED), base::nullopt)); + net::ResolveErrorInfo(net::ERR_FAILED), absl::nullopt)); host_resolver_->ResolveHost( net::HostPortPair::FromURL(GURL(origin.ToString())), @@ -106,7 +104,7 @@ class ResolveHostHelper : public network::ResolveHostClientBase { void OnComplete( int32_t result, const ::net::ResolveErrorInfo& resolve_error_info, - const base::Optional& resolved_addresses) override { + const absl::optional& resolved_addresses) override { CEF_REQUIRE_UIT(); host_resolver_.reset(); @@ -731,11 +729,11 @@ void CefRequestContextImpl::ClearCertificateExceptionsInternal( content::SSLHostStateDelegate* ssl_delegate = browser_context->AsBrowserContext()->GetSSLHostStateDelegate(); if (ssl_delegate) - ssl_delegate->Clear(base::Callback()); + ssl_delegate->Clear(base::NullCallback()); if (callback) { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefCompletionCallback::OnComplete, callback)); + base::BindOnce(&CefCompletionCallback::OnComplete, callback)); } } @@ -748,7 +746,7 @@ void CefRequestContextImpl::ClearHttpAuthCredentialsInternal( browser_context->GetNetworkContext()->ClearHttpAuthCache( /*start_time=*/base::Time(), /*end_time=*/base::Time::Max(), - base::Bind(&CefCompletionCallback::OnComplete, callback)); + base::BindOnce(&CefCompletionCallback::OnComplete, callback)); } void CefRequestContextImpl::CloseAllConnectionsInternal( @@ -759,7 +757,7 @@ void CefRequestContextImpl::CloseAllConnectionsInternal( return; browser_context->GetNetworkContext()->CloseAllConnections( - base::Bind(&CefCompletionCallback::OnComplete, callback)); + base::BindOnce(&CefCompletionCallback::OnComplete, callback)); } void CefRequestContextImpl::ResolveHostInternal( diff --git a/libcef/browser/simple_menu_model_impl.cc b/libcef/browser/simple_menu_model_impl.cc index 4af530cd0..4b263dd61 100644 --- a/libcef/browser/simple_menu_model_impl.cc +++ b/libcef/browser/simple_menu_model_impl.cc @@ -421,7 +421,7 @@ bool CefSimpleMenuModelImpl::SetAcceleratorAt(int index, bool CefSimpleMenuModelImpl::RemoveAccelerator(int command_id) { if (!VerifyContext() || command_id == kInvalidIndex) return false; - state_delegate_->SetAccelerator(command_id, base::nullopt); + state_delegate_->SetAccelerator(command_id, absl::nullopt); return true; } diff --git a/libcef/browser/simple_menu_model_impl.h b/libcef/browser/simple_menu_model_impl.h index 66cfed5e6..1923c9ee5 100644 --- a/libcef/browser/simple_menu_model_impl.h +++ b/libcef/browser/simple_menu_model_impl.h @@ -23,7 +23,7 @@ class CefSimpleMenuModelImpl : public CefMenuModel { public: virtual void SetChecked(int command_id, bool checked) = 0; virtual void SetAccelerator(int command_id, - base::Optional accel) = 0; + absl::optional accel) = 0; protected: virtual ~StateDelegate() {} diff --git a/libcef/browser/trace_subscriber.cc b/libcef/browser/trace_subscriber.cc index 6c5c3c10b..243b08bc7 100644 --- a/libcef/browser/trace_subscriber.cc +++ b/libcef/browser/trace_subscriber.cc @@ -17,12 +17,13 @@ namespace { // represented by |message_loop_proxy|. void CreateTemporaryFileOnBackgroundThread( scoped_refptr message_loop_proxy, - base::Callback callback) { + base::OnceCallback callback) { CEF_REQUIRE_BLOCKING(); base::FilePath file_path; if (!base::CreateTemporaryFile(&file_path)) LOG(ERROR) << "Failed to create temporary file."; - message_loop_proxy->PostTask(FROM_HERE, base::Bind(callback, file_path)); + message_loop_proxy->PostTask(FROM_HERE, + base::BindOnce(std::move(callback), file_path)); } // Release the wrapped callback object after completion. @@ -102,19 +103,20 @@ bool CefTraceSubscriber::EndTracing(const base::FilePath& tracing_file, if (tracing_file.empty()) { // Create a new temporary file path on the FILE thread, then continue. CEF_POST_USER_VISIBLE_TASK( - base::Bind(CreateTemporaryFileOnBackgroundThread, - base::ThreadTaskRunnerHandle::Get(), - base::Bind(&CefTraceSubscriber::ContinueEndTracing, - weak_factory_.GetWeakPtr(), callback))); + base::BindOnce(CreateTemporaryFileOnBackgroundThread, + base::ThreadTaskRunnerHandle::Get(), + base::BindOnce(&CefTraceSubscriber::ContinueEndTracing, + weak_factory_.GetWeakPtr(), callback))); return true; } - base::Closure result_callback = - base::Bind(&CefTraceSubscriber::OnTracingFileResult, - weak_factory_.GetWeakPtr(), callback, tracing_file); + auto result_callback = + base::BindOnce(&CefTraceSubscriber::OnTracingFileResult, + weak_factory_.GetWeakPtr(), callback, tracing_file); TracingController::GetInstance()->StopTracing( - TracingController::CreateFileEndpoint(tracing_file, result_callback)); + TracingController::CreateFileEndpoint(tracing_file, + std::move(result_callback))); return true; } diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 729e0ba28..601ace142 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -53,8 +53,8 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { views::Button::ButtonState new_state = static_cast(state); - if (ParentClass::root_view()->ink_drop_mode() != - views::Button::InkDropMode::OFF && + if (ParentClass::root_view()->ink_drop()->ink_drop_mode() != + views::InkDropHost::InkDropMode::OFF && !ParentClass::root_view()->IsFocusable()) { // Ink drop state does not get set properly on state change when the button // is non-focusable. @@ -64,7 +64,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { } else if (old_state == views::Button::STATE_PRESSED) { ink_state = views::InkDropState::DEACTIVATED; } - ParentClass::root_view()->AnimateInkDrop(ink_state, nullptr); + ParentClass::root_view()->ink_drop()->AnimateToState(ink_state, nullptr); } ParentClass::root_view()->SetState(new_state); @@ -77,11 +77,11 @@ CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() { CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { CEF_REQUIRE_VALID_RETURN_VOID(); - ParentClass::root_view()->SetInkDropMode( - enabled ? views::InkDropHostView::InkDropMode::ON - : views::InkDropHostView::InkDropMode::OFF); + ParentClass::root_view()->ink_drop()->SetMode( + enabled ? views::InkDropHost::InkDropMode::ON + : views::InkDropHost::InkDropMode::OFF); if (enabled) { - ParentClass::root_view()->SetInkDropBaseColor( + ParentClass::root_view()->ink_drop()->SetBaseColor( color_utils::BlendTowardMaxContrast( ParentClass::root_view()->background()->get_color(), 0x61)); } diff --git a/libcef/browser/views/button_view.h b/libcef/browser/views/button_view.h index 5538e6089..7296430a6 100644 --- a/libcef/browser/views/button_view.h +++ b/libcef/browser/views/button_view.h @@ -59,15 +59,16 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed( // Callback may trigger new animation state. if (ParentClass::cef_delegate()) ParentClass::cef_delegate()->OnButtonPressed(GetCefButton()); - if (ParentClass::ink_drop_mode() != views::Button::InkDropMode::OFF && + if (ParentClass::ink_drop()->ink_drop_mode() != + views::InkDropHost::InkDropMode::OFF && !ParentClass::IsFocusable() && ParentClass::GetState() != views::Button::STATE_PRESSED) { // Ink drop state does not get reset properly on click when the button is // non-focusable. Reset the ink drop state here if the state has not been // explicitly set to pressed by the OnButtonPressed callback calling // SetState (which also sets the ink drop state). - ParentClass::AnimateInkDrop(views::InkDropState::HIDDEN, - ui::LocatedEvent::FromIfValid(&event)); + ParentClass::ink_drop()->AnimateToState( + views::InkDropState::HIDDEN, ui::LocatedEvent::FromIfValid(&event)); } } diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index eeb1fcced..40103d22b 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -13,6 +13,7 @@ #include "libcef/browser/views/window_view.h" #include "ui/base/test/ui_controls.h" +#include "ui/compositor/compositor.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/controls/button/menu_button.h" #include "ui/views/controls/menu/menu_runner.h" @@ -434,11 +435,11 @@ void CefWindowImpl::ShowMenu(views::MenuButton* menu_button, // We'll send the MenuClosed notification manually for better accuracy. menu_model_->set_auto_notify_menu_closed(false); - menu_runner_.reset( - new views::MenuRunner(menu_model_impl->model(), - menu_button ? views::MenuRunner::HAS_MNEMONICS - : views::MenuRunner::CONTEXT_MENU, - base::Bind(&CefWindowImpl::MenuClosed, this))); + menu_runner_.reset(new views::MenuRunner( + menu_model_impl->model(), + menu_button ? views::MenuRunner::HAS_MNEMONICS + : views::MenuRunner::CONTEXT_MENU, + base::BindRepeating(&CefWindowImpl::MenuClosed, this))); menu_runner_->RunMenuAt( widget_, menu_button ? menu_button->button_controller() : nullptr, diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 9d811e030..1d172e198 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -9,7 +9,6 @@ #include "libcef/browser/views/window_impl.h" #include "libcef/features/runtime.h" -#include "third_party/skia/include/core/SkRegion.h" #include "ui/base/hit_test.h" #include "ui/views/widget/widget.h" #include "ui/views/window/native_frame_view.h" @@ -285,7 +284,7 @@ void CefWindowView::CreateWidget() { can_activate = can_activate_menu; if (can_activate_menu) - params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; + params.activatable = views::Widget::InitParams::Activatable::kYes; } } } diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index 188a5ae30..cf9e7cef1 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -11,11 +11,10 @@ #include "libcef/browser/views/panel_view.h" +#include "third_party/skia/include/core/SkRegion.h" #include "ui/display/display.h" #include "ui/views/widget/widget_delegate.h" -class SkRegion; - // Manages the views-based root window. This object will be deleted // automatically when the associated root window is destroyed. class CefWindowView diff --git a/libcef/browser/web_plugin_impl.cc b/libcef/browser/web_plugin_impl.cc index d61449a19..3e9903321 100644 --- a/libcef/browser/web_plugin_impl.cc +++ b/libcef/browser/web_plugin_impl.cc @@ -39,9 +39,9 @@ void DeliverWidevineCdmError(const std::string& error_message, if (callback.get()) { CEF_POST_TASK( CEF_UIT, - base::Bind(&CefRegisterCdmCallback::OnCdmRegistrationComplete, - callback.get(), CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED, - error_message)); + base::BindOnce(&CefRegisterCdmCallback::OnCdmRegistrationComplete, + callback.get(), CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED, + error_message)); } } @@ -87,10 +87,10 @@ void CefVisitWebPluginInfo(CefRefPtr visitor) { if (CEF_CURRENTLY_ON_UIT()) { content::PluginServiceImpl::GetInstance()->GetPlugins( - base::Bind(PluginsCallbackImpl, visitor)); + base::BindOnce(PluginsCallbackImpl, visitor)); } else { // Execute on the UI thread. - CEF_POST_TASK(CEF_UIT, base::Bind(CefVisitWebPluginInfo, visitor)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(CefVisitWebPluginInfo, visitor)); } } @@ -139,7 +139,7 @@ void CefRegisterWebPluginCrash(const CefString& path) { base::FilePath(path)); } else { // Execute on the IO thread. - CEF_POST_TASK(CEF_IOT, base::Bind(CefRegisterWebPluginCrash, path)); + CEF_POST_TASK(CEF_IOT, base::BindOnce(CefRegisterWebPluginCrash, path)); } } @@ -162,7 +162,8 @@ void CefIsWebPluginUnstable(const CefString& path, base::FilePath(path))); } else { // Execute on the IO thread. - CEF_POST_TASK(CEF_IOT, base::Bind(CefIsWebPluginUnstable, path, callback)); + CEF_POST_TASK(CEF_IOT, + base::BindOnce(CefIsWebPluginUnstable, path, callback)); } } diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index bc5edc3b0..721401c01 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -32,7 +32,6 @@ #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/embedder_support/switches.h" #include "components/viz/common/features.h" -#include "content/browser/browser_process_sub_thread.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" @@ -75,8 +74,8 @@ AlloyMainDelegate::AlloyMainDelegate(CefMainRunnerHandler* runner, AlloyMainDelegate::~AlloyMainDelegate() {} -void AlloyMainDelegate::PreCreateMainMessageLoop() { - runner_->PreCreateMainMessageLoop(); +void AlloyMainDelegate::PreBrowserMain() { + runner_->PreBrowserMain(); } bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { @@ -139,17 +138,18 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox); if (settings_->user_agent.length > 0) { - command_line->AppendSwitchASCII(embedder_support::kUserAgent, - CefString(&settings_->user_agent)); + command_line->AppendSwitchASCII( + embedder_support::kUserAgent, + CefString(&settings_->user_agent).ToString()); } else if (settings_->user_agent_product.length > 0) { command_line->AppendSwitchASCII( switches::kUserAgentProductAndVersion, - CefString(&settings_->user_agent_product)); + CefString(&settings_->user_agent_product).ToString()); } if (settings_->locale.length > 0) { command_line->AppendSwitchASCII(switches::kLang, - CefString(&settings_->locale)); + CefString(&settings_->locale).ToString()); } else if (!command_line->HasSwitch(switches::kLang)) { command_line->AppendSwitchASCII(switches::kLang, "en-US"); } @@ -198,8 +198,9 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { } if (settings_->javascript_flags.length > 0) { - command_line->AppendSwitchASCII(switches::kJavaScriptFlags, - CefString(&settings_->javascript_flags)); + command_line->AppendSwitchASCII( + switches::kJavaScriptFlags, + CefString(&settings_->javascript_flags).ToString()); } if (settings_->pack_loading_disabled) { diff --git a/libcef/common/alloy/alloy_main_delegate.h b/libcef/common/alloy/alloy_main_delegate.h index 424957e81..f12438154 100644 --- a/libcef/common/alloy/alloy_main_delegate.h +++ b/libcef/common/alloy/alloy_main_delegate.h @@ -39,7 +39,7 @@ class AlloyMainDelegate : public content::ContentMainDelegate, ~AlloyMainDelegate() override; // content::ContentMainDelegate overrides. - void PreCreateMainMessageLoop() override; + void PreBrowserMain() override; bool BasicStartupComplete(int* exit_code) override; void PreSandboxStartup() override; void SandboxInitialized(const std::string& process_type) override; diff --git a/libcef/common/chrome/chrome_main_delegate_cef.cc b/libcef/common/chrome/chrome_main_delegate_cef.cc index c8bf98f34..fdc8ed7a3 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.cc +++ b/libcef/common/chrome/chrome_main_delegate_cef.cc @@ -82,24 +82,26 @@ bool ChromeMainDelegateCef::BasicStartupComplete(int* exit_code) { } if (settings_->user_agent.length > 0) { - command_line->AppendSwitchASCII(embedder_support::kUserAgent, - CefString(&settings_->user_agent)); + command_line->AppendSwitchASCII( + embedder_support::kUserAgent, + CefString(&settings_->user_agent).ToString()); } else if (settings_->user_agent_product.length > 0) { command_line->AppendSwitchASCII( switches::kUserAgentProductAndVersion, - CefString(&settings_->user_agent_product)); + CefString(&settings_->user_agent_product).ToString()); } if (settings_->locale.length > 0) { command_line->AppendSwitchASCII(switches::kLang, - CefString(&settings_->locale)); + CefString(&settings_->locale).ToString()); } else if (!command_line->HasSwitch(switches::kLang)) { command_line->AppendSwitchASCII(switches::kLang, "en-US"); } if (settings_->javascript_flags.length > 0) { - command_line->AppendSwitchASCII(switches::kJavaScriptFlags, - CefString(&settings_->javascript_flags)); + command_line->AppendSwitchASCII( + switches::kJavaScriptFlags, + CefString(&settings_->javascript_flags).ToString()); } if (settings_->remote_debugging_port >= 1024 && @@ -157,11 +159,11 @@ void ChromeMainDelegateCef::PreSandboxStartup() { crash_reporting::PreSandboxStartup(*command_line, process_type); } -void ChromeMainDelegateCef::PreCreateMainMessageLoop() { +void ChromeMainDelegateCef::PreBrowserMain() { // The parent ChromeMainDelegate implementation creates the NSApplication // instance on macOS, and we intentionally don't want to do that here. // TODO(macos): Do we need l10n_util::OverrideLocaleWithCocoaLocale()? - runner_->PreCreateMainMessageLoop(); + runner_->PreBrowserMain(); } int ChromeMainDelegateCef::RunProcess( diff --git a/libcef/common/chrome/chrome_main_delegate_cef.h b/libcef/common/chrome/chrome_main_delegate_cef.h index 410d45d86..b62d81098 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.h +++ b/libcef/common/chrome/chrome_main_delegate_cef.h @@ -35,7 +35,7 @@ class ChromeMainDelegateCef : public ChromeMainDelegate, // ChromeMainDelegate overrides. bool BasicStartupComplete(int* exit_code) override; void PreSandboxStartup() override; - void PreCreateMainMessageLoop() override; + void PreBrowserMain() override; int RunProcess( const std::string& process_type, const content::MainFunctionParams& main_function_params) override; diff --git a/libcef/common/command_line_impl.cc b/libcef/common/command_line_impl.cc index 78a3baf5e..ba63c2985 100644 --- a/libcef/common/command_line_impl.cc +++ b/libcef/common/command_line_impl.cc @@ -108,16 +108,16 @@ void CefCommandLineImpl::GetSwitches(SwitchMap& switches) { void CefCommandLineImpl::AppendSwitch(const CefString& name) { CEF_VALUE_VERIFY_RETURN_VOID(true); - mutable_value()->AppendSwitch(name); + mutable_value()->AppendSwitch(name.ToString()); } void CefCommandLineImpl::AppendSwitchWithValue(const CefString& name, const CefString& value) { CEF_VALUE_VERIFY_RETURN_VOID(true); #if defined(OS_WIN) - mutable_value()->AppendSwitchNative(name, value.ToWString()); + mutable_value()->AppendSwitchNative(name.ToString(), value.ToWString()); #else - mutable_value()->AppendSwitchNative(name, value.ToString()); + mutable_value()->AppendSwitchNative(name.ToString(), value.ToString()); #endif } @@ -136,12 +136,20 @@ void CefCommandLineImpl::GetArguments(ArgumentList& arguments) { void CefCommandLineImpl::AppendArgument(const CefString& argument) { CEF_VALUE_VERIFY_RETURN_VOID(true); - mutable_value()->AppendArgNative(argument); +#if defined(OS_WIN) + mutable_value()->AppendArgNative(argument.ToWString()); +#else + mutable_value()->AppendArgNative(argument.ToString()); +#endif } void CefCommandLineImpl::PrependWrapper(const CefString& wrapper) { CEF_VALUE_VERIFY_RETURN_VOID(true); - mutable_value()->PrependWrapper(wrapper); +#if defined(OS_WIN) + mutable_value()->PrependWrapper(wrapper.ToWString()); +#else + mutable_value()->PrependWrapper(wrapper.ToString()); +#endif } // CefCommandLine implementation. diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index b3088b4d7..8e5e1ce03 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -234,7 +234,7 @@ CefCrashReporterClient* g_crash_reporter_client = nullptr; const char kKeyMapDelim = ','; std::string NormalizeCrashKey(const base::StringPiece& key) { - std::string str = key.as_string(); + std::string str(key); std::replace(str.begin(), str.end(), kKeyMapDelim, '-'); if (str.length() > crashpad::Annotation::kNameMaxLength) { return str.substr(0, crashpad::Annotation::kNameMaxLength); diff --git a/libcef/common/json_impl.cc b/libcef/common/json_impl.cc index c98a32e65..6a80e5e64 100644 --- a/libcef/common/json_impl.cc +++ b/libcef/common/json_impl.cc @@ -42,7 +42,7 @@ CefRefPtr CefParseJSON(const void* json, cef_json_parser_options_t options) { if (!json || json_size == 0) return nullptr; - base::Optional parse_result = base::JSONReader::Read( + absl::optional parse_result = base::JSONReader::Read( base::StringPiece(static_cast(json), json_size), GetJSONReaderOptions(options)); if (parse_result) { diff --git a/libcef/common/main_runner_handler.h b/libcef/common/main_runner_handler.h index 5597b9061..20b1483da 100644 --- a/libcef/common/main_runner_handler.h +++ b/libcef/common/main_runner_handler.h @@ -13,7 +13,7 @@ struct MainFunctionParams; // Handles running of the main process. class CefMainRunnerHandler { public: - virtual void PreCreateMainMessageLoop() = 0; + virtual void PreBrowserMain() = 0; virtual int RunMainProcess( const content::MainFunctionParams& main_function_params) = 0; diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index f9788fb61..5ccf9e14a 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -34,9 +34,9 @@ base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes( return nullptr; } -base::Optional CefResourceBundleDelegate::LoadDataResourceString( +absl::optional CefResourceBundleDelegate::LoadDataResourceString( int resource_id) { - return base::nullopt; + return absl::nullopt; } bool CefResourceBundleDelegate::GetRawDataResource( diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index bbaba5e31..ab7221fcf 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -31,7 +31,7 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { base::RefCountedStaticMemory* LoadDataResourceBytes( int resource_id, ui::ScaleFactor scale_factor) override; - base::Optional LoadDataResourceString(int resource_id) override; + absl::optional LoadDataResourceString(int resource_id) override; bool GetRawDataResource(int resource_id, ui::ScaleFactor scale_factor, base::StringPiece* value) const override; diff --git a/libcef/common/task_impl.cc b/libcef/common/task_impl.cc index b74db2ecb..de90e626f 100644 --- a/libcef/common/task_impl.cc +++ b/libcef/common/task_impl.cc @@ -25,7 +25,7 @@ bool CefPostTask(CefThreadId threadId, CefRefPtr task) { CefTaskRunnerImpl::GetTaskRunner(threadId); if (task_runner.get()) { return task_runner->PostTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get())); + base::BindOnce(&CefTask::Execute, task.get())); } LOG(WARNING) << "No task runner for threadId " << threadId; @@ -39,7 +39,7 @@ bool CefPostDelayedTask(CefThreadId threadId, CefTaskRunnerImpl::GetTaskRunner(threadId); if (task_runner.get()) { return task_runner->PostDelayedTask( - FROM_HERE, base::Bind(&CefTask::Execute, task.get()), + FROM_HERE, base::BindOnce(&CefTask::Execute, task.get()), base::TimeDelta::FromMilliseconds(delay_ms)); } diff --git a/libcef/common/task_runner_impl.cc b/libcef/common/task_runner_impl.cc index 4c0895d28..cf90d60c9 100644 --- a/libcef/common/task_runner_impl.cc +++ b/libcef/common/task_runner_impl.cc @@ -138,12 +138,12 @@ bool CefTaskRunnerImpl::BelongsToThread(CefThreadId threadId) { bool CefTaskRunnerImpl::PostTask(CefRefPtr task) { return task_runner_->PostTask(FROM_HERE, - base::Bind(&CefTask::Execute, task.get())); + base::BindOnce(&CefTask::Execute, task.get())); } bool CefTaskRunnerImpl::PostDelayedTask(CefRefPtr task, int64 delay_ms) { return task_runner_->PostDelayedTask( - FROM_HERE, base::Bind(&CefTask::Execute, task.get()), + FROM_HERE, base::BindOnce(&CefTask::Execute, task.get()), base::TimeDelta::FromMilliseconds(delay_ms)); } diff --git a/libcef/common/thread_impl.cc b/libcef/common/thread_impl.cc index adcce19da..ca4cff69c 100644 --- a/libcef/common/thread_impl.cc +++ b/libcef/common/thread_impl.cc @@ -49,7 +49,7 @@ CefThreadImpl::~CefThreadImpl() { // Delete |thread_| on the correct thread. owner_task_runner_->PostTask( FROM_HERE, - base::Bind(StopAndDestroy, base::Unretained(thread_.release()))); + base::BindOnce(StopAndDestroy, base::Unretained(thread_.release()))); } else { StopAndDestroy(thread_.release()); } diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index 5884116de..d3ce3db38 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -748,8 +748,6 @@ CefValueType CefDictionaryValueImpl::GetType(const CefString& key) { return VTYPE_DICTIONARY; case base::Value::Type::LIST: return VTYPE_LIST; - case base::Value::Type::DEAD: - return VTYPE_INVALID; } } @@ -1159,8 +1157,6 @@ CefValueType CefListValueImpl::GetType(size_t index) { return VTYPE_DICTIONARY; case base::Value::Type::LIST: return VTYPE_LIST; - case base::Value::Type::DEAD: - return VTYPE_INVALID; } } diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index 27be13ce8..d3d6a4b3d 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -104,7 +104,7 @@ const char kCdmSupportedEncryptionSchemeCbcs[] = "cbcs"; struct CdmInfoArgs { base::FilePath path; std::string version; - content::CdmCapability capability; + media::CdmCapability capability; }; std::unique_ptr ParseManifestFile( @@ -389,10 +389,11 @@ void DeliverWidevineCdmCallback(cef_cdm_registration_error_t result, } content::CdmInfo MakeCdmInfo(const CdmInfoArgs& args) { - return content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, - base::Version(args.version), args.path, - kWidevineCdmFileSystemId, args.capability, - kWidevineKeySystem, false); + return content::CdmInfo( + kWidevineKeySystem, content::CdmInfo::Robustness::kSoftwareSecure, + std::move(args.capability), /*supports_sub_key_systems=*/false, + kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(args.version), + args.path, kWidevineCdmFileSystemId); } void RegisterWidevineCdmOnUIThread(std::unique_ptr args, diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index d2035e291..315aa35a3 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -159,7 +159,7 @@ void AlloyContentRendererClient::RunSingleProcessCleanup() { } else { base::PostTask( FROM_HERE, {content::BrowserThread::UI}, - base::Bind( + base::BindOnce( &AlloyContentRendererClient::RunSingleProcessCleanupOnUIThread, base::Unretained(this))); } @@ -294,7 +294,7 @@ void AlloyContentRendererClient::RenderFrameCreated( } bool browser_created; - base::Optional is_windowless; + absl::optional is_windowless; render_manager_->RenderFrameCreated(render_frame, render_frame_observer, browser_created, is_windowless); if (browser_created) { @@ -312,7 +312,7 @@ void AlloyContentRendererClient::RenderFrameCreated( void AlloyContentRendererClient::RenderViewCreated( content::RenderView* render_view) { bool browser_created; - base::Optional is_windowless; + absl::optional is_windowless; render_manager_->RenderViewCreated(render_view, browser_created, is_windowless); if (browser_created) { @@ -485,7 +485,7 @@ void AlloyContentRendererClient::WillDestroyCurrentMessageLoop() { void AlloyContentRendererClient::OnBrowserCreated( content::RenderView* render_view, - base::Optional is_windowless) { + absl::optional is_windowless) { #if defined(OS_MAC) const bool windowless = is_windowless.has_value() && *is_windowless; diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index df38d5783..13d7d68b4 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -117,7 +117,7 @@ class AlloyContentRendererClient private: void OnBrowserCreated(content::RenderView* render_view, - base::Optional is_windowless); + absl::optional is_windowless); // Perform cleanup work for single-process mode. void RunSingleProcessCleanupOnUIThread(); diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.cc b/libcef/renderer/alloy/alloy_render_thread_observer.cc index 0a24514fa..9393f95ea 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.cc +++ b/libcef/renderer/alloy/alloy_render_thread_observer.cc @@ -37,7 +37,7 @@ AlloyRenderThreadObserver::GetDynamicParams() { void AlloyRenderThreadObserver::RegisterMojoInterfaces( blink::AssociatedInterfaceRegistry* associated_interfaces) { - associated_interfaces->AddInterface(base::Bind( + associated_interfaces->AddInterface(base::BindRepeating( &AlloyRenderThreadObserver::OnRendererConfigurationAssociatedRequest, base::Unretained(this))); } diff --git a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc index e2527b8a7..99ad48340 100644 --- a/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc +++ b/libcef/renderer/chrome/chrome_content_renderer_client_cef.cc @@ -45,7 +45,7 @@ void ChromeContentRendererClientCef::RenderFrameCreated( new CefRenderFrameObserver(render_frame); bool browser_created; - base::Optional is_windowless; + absl::optional is_windowless; render_manager_->RenderFrameCreated(render_frame, render_frame_observer, browser_created, is_windowless); if (is_windowless.has_value() && *is_windowless) { @@ -58,7 +58,7 @@ void ChromeContentRendererClientCef::RenderViewCreated( ChromeContentRendererClient::RenderViewCreated(render_view); bool browser_created; - base::Optional is_windowless; + absl::optional is_windowless; render_manager_->RenderViewCreated(render_view, browser_created, is_windowless); if (is_windowless.has_value() && *is_windowless) { diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index ff1db96a3..f5d56a248 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -110,8 +110,8 @@ bool CefExtensionsRendererClient::OverrideCreatePlugin( bool guest_view_api_available = false; extension_dispatcher_->script_context_set_iterator()->ForEach( - render_frame, base::Bind(&IsGuestViewApiAvailableToScriptContext, - &guest_view_api_available)); + render_frame, base::BindRepeating(&IsGuestViewApiAvailableToScriptContext, + &guest_view_api_available)); return !guest_view_api_available; } diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 28dff3e77..5efe62dab 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -356,7 +356,7 @@ void CefFrameImpl::OnDraggableRegionsChanged() { auto& browser_frame = GetBrowserFrame(); if (browser_frame) { browser_frame->UpdateDraggableRegions( - regions.empty() ? base::nullopt + regions.empty() ? absl::nullopt : base::make_optional(std::move(regions))); } } diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index 7bf0203d0..3dc2e3dea 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -100,7 +100,7 @@ void CefRenderManager::RenderFrameCreated( content::RenderFrame* render_frame, CefRenderFrameObserver* render_frame_observer, bool& browser_created, - base::Optional& is_windowless) { + absl::optional& is_windowless) { auto browser = MaybeCreateBrowser(render_frame->GetRenderView(), render_frame, &browser_created, &is_windowless); if (browser) { @@ -112,7 +112,7 @@ void CefRenderManager::RenderFrameCreated( void CefRenderManager::RenderViewCreated(content::RenderView* render_view, bool& browser_created, - base::Optional& is_windowless) { + absl::optional& is_windowless) { MaybeCreateBrowser(render_view, render_view->GetMainRenderFrame(), &browser_created, &is_windowless); } @@ -260,7 +260,7 @@ CefRefPtr CefRenderManager::MaybeCreateBrowser( content::RenderView* render_view, content::RenderFrame* render_frame, bool* browser_created, - base::Optional* is_windowless) { + absl::optional* is_windowless) { if (browser_created) *browser_created = false; diff --git a/libcef/renderer/render_manager.h b/libcef/renderer/render_manager.h index cff83f4ba..b2a3d1496 100644 --- a/libcef/renderer/render_manager.h +++ b/libcef/renderer/render_manager.h @@ -11,11 +11,11 @@ #include "include/internal/cef_ptr.h" -#include "base/optional.h" #include "cef/libcef/common/mojom/cef.mojom.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" +#include "third_party/abseil-cpp/absl/types/optional.h" namespace blink { class WebFrame; @@ -49,10 +49,10 @@ class CefRenderManager : public cef::mojom::RenderManager { void RenderFrameCreated(content::RenderFrame* render_frame, CefRenderFrameObserver* render_frame_observer, bool& browser_created, - base::Optional& is_windowless); + absl::optional& is_windowless); void RenderViewCreated(content::RenderView* render_view, bool& browser_created, - base::Optional& is_windowless); + absl::optional& is_windowless); void DevToolsAgentAttached(); void DevToolsAgentDetached(); void ExposeInterfacesToBrowser(mojo::BinderMap* binders); @@ -87,7 +87,7 @@ class CefRenderManager : public cef::mojom::RenderManager { content::RenderView* render_view, content::RenderFrame* render_frame, bool* browser_created, - base::Optional* is_windowless); + absl::optional* is_windowless); // Called from CefBrowserImpl::OnDestruct(). void OnBrowserDestroyed(CefBrowserImpl* browser); diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index 29f3b35b9..aa167b20b 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -147,7 +147,6 @@ class CefRenderURLRequest::Context loader_ = frame_impl->CreateURLLoader(); loader_->LoadAsynchronously( std::move(resource_request), /*extra_data=*/nullptr, - /*requestor_id=*/0, /*no_mime_sniffing=*/false, frame_impl->CreateResourceLoadInfoNotifierWrapper(), url_client_.get()); return true; diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 30c998250..24bd2aeb7 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -1176,7 +1176,7 @@ void CefV8ValueImpl::Handle::SetWeakIfNecessary() { if (!BelongsToCurrentThread()) { task_runner()->PostTask( FROM_HERE, - base::Bind(&CefV8ValueImpl::Handle::SetWeakIfNecessary, this)); + base::BindOnce(&CefV8ValueImpl::Handle::SetWeakIfNecessary, this)); return; } diff --git a/patch/patch.cfg b/patch/patch.cfg index be25fd26b..9938c3a03 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -542,5 +542,11 @@ patches = [ # Linux: Fix ATK assertion error when generating ARM build config. # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 'name': 'linux_atk_1123214', + }, + { + # Linux: Fix unknown type name 'uffdio_writeprotect' when building with + # use_sysroot=false on Ubuntu 18.04 (kernel version < 5.8). + # https://bugs.chromium.org/p/chromium/issues/detail?id=1206047#c8 + 'name': 'linux_allocator_uffd_1206047', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 68c5c5428..c6578bdba 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index f9e098611a176..f956745c27fbe 100644 +index 6f993be10f692..bce42da34941f 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index f9e098611a176..f956745c27fbe 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1742,7 +1743,11 @@ component("base") { +@@ -1769,7 +1770,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index f9e098611a176..f956745c27fbe 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1951,6 +1956,12 @@ component("base") { +@@ -2010,6 +2015,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch index 9a7879166..142241ec4 100644 --- a/patch/patches/base_string_piece_1049498.patch +++ b/patch/patches/base_string_piece_1049498.patch @@ -1,12 +1,12 @@ diff --git base/strings/string_piece.h base/strings/string_piece.h -index f4f37ad5242b2..ddb9b3fd87474 100644 +index 85a63d103a7f7..c17412d9c191a 100644 --- base/strings/string_piece.h +++ base/strings/string_piece.h -@@ -24,6 +24,7 @@ +@@ -23,6 +23,7 @@ #include +#include #include + #include #include - #include diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 1cf65ba57..884b32a0d 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,5 +1,5 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index 82801d316d76c..4616c1caf4934 100644 +index cf85dd542a27a..d663df4fa92af 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc @@ -240,7 +240,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 6bcd82c2e..05376d058 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index efb7c635e6885..cbbf37a092441 100644 +index d548b3d7e0a0a..cb93301271cda 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1728,6 +1728,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1719,6 +1719,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,10 +20,10 @@ index efb7c635e6885..cbbf37a092441 100644 // TODO(wjmaclean): We should update the ProcessLock comparison API diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 12132d0bc651a..4c4b7821d9131 100644 +index 751ee13227ae6..d4676b47955f8 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -5304,6 +5304,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { +@@ -5314,6 +5314,12 @@ url::Origin NavigationRequest::GetOriginForURLLoaderFactory() { // Calculate an approximation of the origin. The sandbox/csp are ignored. url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 4d7527b83..c0940a0c8 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 72ea590d69681..0c34d20addfa8 100644 +index 96545ed8a9e5b..6987659bff52b 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1834,8 +1834,6 @@ config("thin_archive") { +@@ -1849,8 +1849,6 @@ config("thin_archive") { # archives. if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 17022f3af..45bceb15c 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 c7970e581a976..045e18b4313b5 100644 +index e0409fb795f27..8a3023ae62e82 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -13,6 +13,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index c7970e581a976..045e18b4313b5 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1902,6 +1903,7 @@ static_library("browser") { +@@ -1923,6 +1924,7 @@ static_library("browser") { "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index c7970e581a976..045e18b4313b5 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2450,6 +2452,10 @@ static_library("browser") { +@@ -2480,6 +2482,10 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index d5b134344..cb0778659 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index 3f0c080690084..52d0d8eb43c3e 100644 +index c7780ede01c83..6b856949d3c0a 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm @@ -31,6 +31,7 @@ @@ -10,7 +10,7 @@ index 3f0c080690084..52d0d8eb43c3e 100644 #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/apps/app_shim/app_shim_manager_mac.h" #include "chrome/browser/apps/app_shim/app_shim_termination_manager.h" -@@ -1211,6 +1212,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1290,6 +1291,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // Run a (background) application in a new tab. - (void)executeApplication:(id)sender { @@ -18,7 +18,7 @@ index 3f0c080690084..52d0d8eb43c3e 100644 NSInteger tag = [sender tag]; Profile* profile = [self lastProfile]; DCHECK(profile); -@@ -1219,6 +1221,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1298,6 +1300,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; tag < static_cast(applications.size())); const extensions::Extension* extension = applications.GetExtension(tag); BackgroundModeManager::LaunchBackgroundApplication(profile, extension); @@ -26,7 +26,7 @@ index 3f0c080690084..52d0d8eb43c3e 100644 } // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1606,6 +1609,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1693,6 +1696,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit // tests which use the mock in place of the profile-initialized model. @@ -34,7 +34,7 @@ index 3f0c080690084..52d0d8eb43c3e 100644 // Avoid breaking unit tests which have no profile. if (profile) { BackgroundApplicationListModel applications(profile); -@@ -1632,6 +1636,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1719,6 +1723,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; } } } @@ -42,7 +42,7 @@ index 3f0c080690084..52d0d8eb43c3e 100644 return dockMenu; } -@@ -1861,11 +1866,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1948,11 +1953,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; namespace { void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { @@ -72,10 +72,10 @@ index 3d634db18900a..96e44ad48e5e5 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 89a682d5c9352..946ccbda587c7 100644 +index cce917cdc65db..5da3a16aef1c7 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -947,18 +947,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -952,18 +952,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -128,46 +128,3 @@ index e0cafee5eedd6..06ded156be3cc 100644 // Make a copy of the BrowserList to simplify the case where we need to // destroy a Browser during the loop. -diff --git chrome/browser/sessions/app_session_service.cc chrome/browser/sessions/app_session_service.cc -index 071884fe257bb..47160e3e47bdb 100644 ---- chrome/browser/sessions/app_session_service.cc -+++ chrome/browser/sessions/app_session_service.cc -@@ -90,8 +90,11 @@ void AppSessionService::MaybeDeleteSessionOnlyData() { - // Clear session data if the last window for a profile has been closed and - // closing the last window would normally close Chrome, unless background mode - // is active. Tests don't have a background_mode_manager. -- if (browser_defaults::kBrowserAliveWithNoWindows || -- g_browser_process->background_mode_manager()->IsBackgroundModeActive()) { -+ if (browser_defaults::kBrowserAliveWithNoWindows -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) -+ || g_browser_process->background_mode_manager()->IsBackgroundModeActive() -+#endif -+ ) { - return; - } - -diff --git chrome/browser/sessions/session_service.cc chrome/browser/sessions/session_service.cc -index e5074800fbb00..e6c59d05ee204 100644 ---- chrome/browser/sessions/session_service.cc -+++ chrome/browser/sessions/session_service.cc -@@ -553,12 +553,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { - if (profile()->AsTestingProfile()) - return; - -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) -+ const bool background_mode_active = -+ g_browser_process->background_mode_manager()->IsBackgroundModeActive(); -+#else -+ const bool background_mode_active = false; -+#endif -+ - // Clear session data if the last window for a profile has been closed and - // closing the last window would normally close Chrome, unless background mode - // is active. Tests don't have a background_mode_manager. - if (has_open_trackable_browsers_ || - browser_defaults::kBrowserAliveWithNoWindows || -- g_browser_process->background_mode_manager()->IsBackgroundModeActive()) { -+ background_mode_active) { - return; - } - diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index f765d7150..849f8df76 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,10 +13,10 @@ index ba0c5c3fc0446..b4df9af95ecd1 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 37b121e2b667d..ae70272bf2764 100644 +index 268f6547ff84b..29e1b4b1b4dba 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -257,6 +257,20 @@ +@@ -263,6 +263,20 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -37,7 +37,7 @@ index 37b121e2b667d..ae70272bf2764 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -481,6 +495,13 @@ Browser::Browser(const CreateParams& params) +@@ -492,6 +506,13 @@ Browser::Browser(const CreateParams& params) tab_strip_model_->AddObserver(this); @@ -51,7 +51,7 @@ index 37b121e2b667d..ae70272bf2764 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -1320,6 +1341,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1336,6 +1357,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index 37b121e2b667d..ae70272bf2764 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1327,8 +1356,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1343,8 +1372,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index 37b121e2b667d..ae70272bf2764 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1549,6 +1588,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1569,6 +1608,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index 37b121e2b667d..ae70272bf2764 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1648,6 +1695,15 @@ void Browser::AddNewContents(WebContents* source, +@@ -1668,6 +1715,15 @@ void Browser::AddNewContents(WebContents* source, source, disposition); } @@ -118,7 +118,7 @@ index 37b121e2b667d..ae70272bf2764 100644 chrome::AddWebContents(this, source, std::move(new_contents), target_url, disposition, initial_rect); } -@@ -1666,6 +1722,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1686,6 +1742,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -127,7 +127,7 @@ index 37b121e2b667d..ae70272bf2764 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1693,6 +1751,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1713,6 +1771,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -136,7 +136,7 @@ index 37b121e2b667d..ae70272bf2764 100644 if (!GetStatusBubble()) return; -@@ -1700,6 +1760,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1720,6 +1780,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -154,7 +154,7 @@ index 37b121e2b667d..ae70272bf2764 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1816,6 +1887,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1836,6 +1907,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -165,7 +165,7 @@ index 37b121e2b667d..ae70272bf2764 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1852,6 +1927,8 @@ void Browser::RendererResponsive( +@@ -1872,6 +1947,8 @@ void Browser::RendererResponsive( void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); @@ -174,7 +174,7 @@ index 37b121e2b667d..ae70272bf2764 100644 } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1898,11 +1975,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1918,11 +1995,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -190,7 +190,7 @@ index 37b121e2b667d..ae70272bf2764 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2742,6 +2823,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2767,6 +2848,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveTranslationObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -200,7 +200,7 @@ index 37b121e2b667d..ae70272bf2764 100644 void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index f1c66751bff73..886375f473b91 100644 +index 946c447afbde1..cce4aaade2ea3 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -21,6 +21,7 @@ @@ -208,10 +208,10 @@ index f1c66751bff73..886375f473b91 100644 #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/runtime.h" - #include "chrome/browser/devtools/devtools_toggle_action.h" - #include "chrome/browser/profiles/scoped_profile_keep_alive.h" #include "chrome/browser/themes/theme_service_observer.h" -@@ -56,6 +57,10 @@ + #include "chrome/browser/ui/bookmarks/bookmark_bar.h" + #include "chrome/browser/ui/bookmarks/bookmark_tab_helper_observer.h" +@@ -45,6 +46,10 @@ #include "ui/gfx/geometry/rect.h" #include "ui/shell_dialogs/select_file_dialog.h" @@ -222,7 +222,7 @@ index f1c66751bff73..886375f473b91 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -279,6 +284,11 @@ class Browser : public TabStripModelObserver, +@@ -274,6 +279,11 @@ class Browser : public TabStripModelObserver, // maximizable. bool can_maximize = true; @@ -234,7 +234,7 @@ index f1c66751bff73..886375f473b91 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -343,6 +353,13 @@ class Browser : public TabStripModelObserver, +@@ -338,6 +348,13 @@ class Browser : public TabStripModelObserver, bool is_focus_mode() const { return is_focus_mode_; } @@ -248,7 +248,7 @@ index f1c66751bff73..886375f473b91 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -401,6 +418,12 @@ class Browser : public TabStripModelObserver, +@@ -396,6 +413,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); @@ -261,7 +261,7 @@ index f1c66751bff73..886375f473b91 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -781,6 +804,11 @@ class Browser : public TabStripModelObserver, +@@ -777,6 +800,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -273,7 +273,7 @@ index f1c66751bff73..886375f473b91 100644 void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1171,6 +1199,8 @@ class Browser : public TabStripModelObserver, +@@ -1167,6 +1195,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -282,7 +282,7 @@ index f1c66751bff73..886375f473b91 100644 // Tracks when this browser is being created by session restore. bool is_session_restore_; -@@ -1231,6 +1261,10 @@ class Browser : public TabStripModelObserver, +@@ -1227,6 +1257,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -294,10 +294,10 @@ index f1c66751bff73..886375f473b91 100644 // The following factory is used for chrome update coalescing. diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index a50d5b83afa2d..21c6ca8d7188f 100644 +index 29890d8b342a4..514affa254df4 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -454,6 +454,13 @@ std::unique_ptr CreateTargetContents( +@@ -456,6 +456,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); @@ -312,7 +312,7 @@ index a50d5b83afa2d..21c6ca8d7188f 100644 // tab helpers, so the entire set of tab helpers needs to be set up // immediately. diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc -index 899b0e532c451..2fad68ec3e513 100644 +index 72ad734682957..668a1b950df6b 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc @@ -30,9 +30,13 @@ void AddTabAt(Browser* browser, diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index b2b6a44c8..f874560e5 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc -index c1e6c77a57267..d3c41d3dac053 100644 +index 173582c7c4904..bbf57904b6de9 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -8,6 +8,7 @@ @@ -54,7 +54,7 @@ index c1e6c77a57267..d3c41d3dac053 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index b6b38ab9a2513..048c6f8c544f1 100644 +index ab24e00ee02aa..818fb4e7d1841 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc @@ -172,7 +172,7 @@ ContentSetting GetContentSettingFromRulesImpl( diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index 0376117e2..71d913f4e 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 13ad2a7529bb1..0b003c26815e0 100644 +index 41b804eef6426..b1e54d8e95008 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -254,6 +254,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -264,6 +264,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 13ad2a7529bb1..0b003c26815e0 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -463,6 +470,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -473,6 +480,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index 13ad2a7529bb1..0b003c26815e0 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -618,6 +629,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -628,6 +639,14 @@ RenderViewContextMenu::RenderViewContextMenu( } set_content_type( ContextMenuContentTypeFactory::Create(source_web_contents_, params)); @@ -42,7 +42,7 @@ index 13ad2a7529bb1..0b003c26815e0 100644 } RenderViewContextMenu::~RenderViewContextMenu() = default; -@@ -973,6 +992,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -983,6 +1002,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 13ad2a7529bb1..0b003c26815e0 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -2594,6 +2619,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( +@@ -2636,6 +2661,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( *GetMenuShownCallback() = std::move(cb); } @@ -69,10 +69,10 @@ index 13ad2a7529bb1..0b003c26815e0 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { 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 5178db60ba644..845461049e54e 100644 +index b6d55e7322c45..014d89c4c7bfe 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -91,6 +91,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -92,6 +92,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { static void RegisterMenuShownCallbackForTesting( base::OnceCallback cb); @@ -85,7 +85,7 @@ index 5178db60ba644..845461049e54e 100644 protected: Profile* GetProfile() const; -@@ -265,6 +271,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { +@@ -266,6 +272,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase { ui::SimpleMenuModel protocol_handler_submenu_model_; ProtocolHandlerRegistry* protocol_handler_registry_; @@ -96,7 +96,7 @@ index 5178db60ba644..845461049e54e 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 feec153dcc146..0959c1020bad9 100644 +index 0271d19c5c33b..40d2063e4ed98 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 @@ -136,6 +136,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, @@ -110,10 +110,10 @@ index feec153dcc146..0959c1020bad9 100644 // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index 62100403d27f0..54182e7d97e3c 100644 +index 6585ac1d01907..d2e939fce0df6 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc -@@ -375,6 +375,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { +@@ -376,6 +376,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { return false; } @@ -132,10 +132,10 @@ index 62100403d27f0..54182e7d97e3c 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index 52002b190fded..ce3277e9f9350 100644 +index 051953091fd4f..7e771526ce52a 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h -@@ -81,6 +81,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -82,6 +82,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, const ui::SimpleMenuModel& menu_model() const { return menu_model_; } const content::ContextMenuParams& params() const { return params_; } @@ -145,7 +145,7 @@ index 52002b190fded..ce3277e9f9350 100644 // Returns true if the specified command id is known and valid for // this menu. If the command is known |enabled| is set to indicate -@@ -89,6 +92,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -90,6 +93,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, // SimpleMenuModel::Delegate implementation. bool IsCommandIdChecked(int command_id) const override; @@ -155,7 +155,7 @@ index 52002b190fded..ce3277e9f9350 100644 void ExecuteCommand(int command_id, int event_flags) override; void OnMenuWillShow(ui::SimpleMenuModel* source) override; void MenuClosed(ui::SimpleMenuModel* source) override; -@@ -119,6 +125,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -120,6 +126,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, content::WebContents* GetWebContents() const override; content::BrowserContext* GetBrowserContext() const override; @@ -165,7 +165,7 @@ index 52002b190fded..ce3277e9f9350 100644 protected: friend class RenderViewContextMenuTest; friend class RenderViewContextMenuPrefsTest; -@@ -156,9 +165,6 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, +@@ -157,9 +166,6 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, // TODO(oshima): Remove this. virtual void AppendPlatformEditableItems() {} diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index fd16cf2ba..8848541d6 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 94e40ecd52276..597810f96ba53 100644 +index adadb4264e6b7..b7c910f035fe6 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index 94e40ecd52276..597810f96ba53 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -335,6 +336,10 @@ static_library("ui") { +@@ -329,6 +330,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index 94e40ecd52276..597810f96ba53 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 -@@ -357,6 +362,7 @@ static_library("ui") { +@@ -351,6 +356,7 @@ static_library("ui") { "//build:branding_buildflags", "//build:chromeos_buildflags", "//cc/paint", @@ -29,16 +29,16 @@ index 94e40ecd52276..597810f96ba53 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1609,6 +1615,7 @@ static_library("ui") { - "//components/page_load_metrics/browser", - "//components/performance_manager:site_data_proto", +@@ -4774,6 +4780,7 @@ static_library("ui") { + if (enable_basic_printing) { + deps += [ "//components/printing/browser", + "//components/printing/common:mojo_interfaces", - "//components/profile_metrics", - "//components/reading_list/features:flags", - "//components/safe_browsing/core/common:safe_browsing_policy_handler", + "//printing", + ] + if (use_cups) { diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc -index a12ad7b5e7eb6..9dba0f6642313 100644 +index fcd1f66b3a7a4..4f135460de918 100644 --- chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc @@ -21,6 +21,7 @@ @@ -60,7 +60,7 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 #if defined(OS_ANDROID) #include "chrome/browser/android/intent_helper.h" #endif -@@ -136,6 +141,13 @@ class NetExportMessageHandler +@@ -137,6 +142,13 @@ class NetExportMessageHandler // NetLog file. void ShowSelectFileDialog(const base::FilePath& default_path); @@ -74,7 +74,7 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 // Cached pointer to SystemNetworkContextManager's NetExportFileWriter. net_log::NetExportFileWriter* file_writer_; -@@ -230,6 +242,13 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { +@@ -232,6 +244,13 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { if (UsingMobileUI()) { StartNetLog(base::FilePath()); } else { @@ -88,7 +88,7 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 base::FilePath initial_dir = last_save_dir.Pointer()->empty() ? DownloadPrefs::FromBrowserContext( web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() : -@@ -246,6 +265,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -248,6 +267,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { std::unique_ptr ui_thread_polled_data( new base::DictionaryValue()); @@ -96,7 +96,7 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 Profile* profile = Profile::FromWebUI(web_ui()); SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo", chrome_browser_net::GetPrerenderInfo(profile)); -@@ -255,6 +275,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -257,6 +277,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders", chrome_browser_net::GetWindowsServiceProviders()); #endif @@ -104,7 +104,7 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 file_writer_->StopNetLog(std::move(ui_thread_polled_data)); } -@@ -372,6 +393,42 @@ void NetExportMessageHandler::ShowSelectFileDialog( +@@ -373,6 +394,42 @@ void NetExportMessageHandler::ShowSelectFileDialog( &file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr); } @@ -129,8 +129,8 @@ index a12ad7b5e7eb6..9dba0f6642313 100644 + params.accept_types.push_back(CefString(initial_path.Extension())); + + cef_browser->RunFileChooser( -+ params, base::Bind(&NetExportMessageHandler::SaveAsDialogDismissed, -+ weak_ptr_factory_.GetWeakPtr())); ++ params, base::BindOnce(&NetExportMessageHandler::SaveAsDialogDismissed, ++ weak_ptr_factory_.GetWeakPtr())); +} + +void NetExportMessageHandler::SaveAsDialogDismissed( diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 3ebdeb545..851848db5 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc -index 69d6f442d1208..46f2be62e0466 100644 +index e0010fdd55000..f89c622c6fd96 100644 --- chrome/browser/profiles/profile_window.cc +++ chrome/browser/profiles/profile_window.cc -@@ -262,7 +262,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, +@@ -273,7 +273,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode, *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; return; case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT: @@ -14,7 +14,7 @@ index 69d6f442d1208..46f2be62e0466 100644 : profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; } diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index b6ce61c8f4b03..dc5d111325b1f 100644 +index ae41e1031c95e..16ee4f7766a78 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -37,7 +37,9 @@ @@ -29,12 +29,12 @@ index b6ce61c8f4b03..dc5d111325b1f 100644 chrome::RecordDialogCreation( diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index 319404417dc43..795dccb655e07 100644 +index 905c775ba0471..b1cf9288f4975 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -494,7 +494,9 @@ void ProfileMenuViewBase::ShowBubble( - ProfileMenuViewBase* bubble; +@@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble( + ProfileMenuViewBase* bubble = nullptr; if (view_mode == profiles::BUBBLE_VIEW_MODE_INCOGNITO) { - DCHECK(browser->profile()->IsIncognitoProfile()); + DCHECK(browser->profile()->IsIncognitoProfile() || diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 9c7950bd1..2f664a5f9 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc -index 4e361cfd4ec86..bd156f6b76696 100644 +index 0fbe58dcd4d28..57fab623ec276 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc -@@ -644,7 +644,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( +@@ -633,7 +633,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( #endif if (!profile) profile = std::make_unique(parent, otr_profile_id); @@ -14,18 +14,18 @@ index 4e361cfd4ec86..bd156f6b76696 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 94aafe60eb458..ebc3ecc2585a3 100644 +index 7ee045c66e37b..65cb34a7a7e1c 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -81,6 +81,7 @@ base::LazyInstance>::Leaky +@@ -85,6 +85,7 @@ base::LazyInstance>::Leaky namespace { +const char kCEFOTRProfileIDPrefix[] = "CEF::BrowserContext"; const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; - -@@ -94,6 +95,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { + const char kTestOTRProfileIDPrefix[] = "Test::OTR"; +@@ -99,6 +100,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext and MediaRouter::Presentation are an // exception to this ban. return *this == PrimaryID() || @@ -34,7 +34,7 @@ index 94aafe60eb458..ebc3ecc2585a3 100644 base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::CompareCase::SENSITIVE) || base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, -@@ -115,6 +118,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( +@@ -120,6 +123,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( base::GUID::GenerateRandomV4().AsLowercaseString().c_str())); } @@ -52,11 +52,11 @@ index 94aafe60eb458..ebc3ecc2585a3 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index a2b145ece628e..41afec2cfa4cb 100644 +index 92baa51c80944..9726edaea9c4d 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -120,6 +120,10 @@ class Profile : public content::BrowserContext { - // Creates a unique OTR profile id with the given profile id prefix. +@@ -119,6 +119,10 @@ class Profile : public content::BrowserContext { + // be applicable to run. Please see crbug.com/1098697#c3 for more details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); + // Creates a unique OTR profile id to be used for CEF browser contexts. @@ -66,16 +66,16 @@ index a2b145ece628e..41afec2cfa4cb 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -524,6 +528,8 @@ class Profile : public content::BrowserContext { +@@ -528,6 +532,8 @@ class Profile : public content::BrowserContext { virtual void RecordMainFrameNavigation() = 0; + void NotifyOffTheRecordProfileCreated(Profile* off_the_record); + protected: - void set_is_guest_profile(bool is_guest_profile) { - is_guest_profile_ = is_guest_profile; -@@ -543,8 +549,6 @@ class Profile : public content::BrowserContext { + // Creates an OffTheRecordProfile which points to this Profile. + static std::unique_ptr CreateOffTheRecordProfile( +@@ -539,8 +545,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -85,10 +85,10 @@ index a2b145ece628e..41afec2cfa4cb 100644 virtual bool IsSignedIn() = 0; diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 14417b3a65486..9f0fc4b5316bc 100644 +index 0f051ffa90eb2..7def9e1f948e3 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -979,7 +979,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -982,7 +982,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -100,10 +100,10 @@ index 14417b3a65486..9f0fc4b5316bc 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index b470744df3fa1..8a4ecc623feab 100644 +index e5227bb58f532..e9620f11a256a 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -435,7 +435,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -511,7 +511,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) base::Unretained(this))); #endif @@ -113,10 +113,10 @@ index b470744df3fa1..8a4ecc623feab 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 88ee84697998c..40ba18c66127e 100644 +index cd6fdbba9b435..0fbc56702d7a3 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -116,7 +116,7 @@ class ProfileManager : public Profile::Delegate { +@@ -118,7 +118,7 @@ class ProfileManager : public Profile::Delegate { // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -134,17 +134,8 @@ index 88ee84697998c..40ba18c66127e 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -161,7 +161,7 @@ class ProfileManager : public Profile::Delegate { - // stored in Local State, hand back the Default profile. - // TODO(https://crbug.com/1195201): Remove `user_data_dir` parameter since it - // always must match `user_data_dir_` field. -- Profile* GetLastUsedProfile(const base::FilePath& user_data_dir); -+ virtual Profile* GetLastUsedProfile(const base::FilePath& user_data_dir); - - // Get the path of the last used profile, or if that's undefined, the default - // profile. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 8920c217f0b26..f4864793c5a29 100644 +index 5e71c1f56da15..db5c46cb5f85f 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -8,6 +8,7 @@ @@ -155,15 +146,15 @@ index 8920c217f0b26..f4864793c5a29 100644 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" -@@ -58,8 +59,12 @@ void GetGuestViewDefaultContentSettingRules( +@@ -57,8 +58,12 @@ void GetGuestViewDefaultContentSettingRules( + } // namespace - RendererUpdater::RendererUpdater(Profile* profile) - : profile_(profile), identity_manager_observer_(this) { + RendererUpdater::RendererUpdater(Profile* profile) : profile_(profile) { + if (cef::IsAlloyRuntimeEnabled()) { + identity_manager_ = nullptr; + } else { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); - identity_manager_observer_.Add(identity_manager_); + identity_manager_observation_.Observe(identity_manager_); + } #if BUILDFLAG(IS_CHROMEOS_ASH) oauth2_login_manager_ = diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 0d70dc2c1..d82cf7f38 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 825663c0ead5e..2029a401663f1 100644 +index 4d46dbb1c0a44..022b7021fd245 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -27,6 +27,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_sharesheet_1123388.patch b/patch/patches/chrome_browser_sharesheet_1123388.patch index 43eb4811b..d95392fb0 100644 --- a/patch/patches/chrome_browser_sharesheet_1123388.patch +++ b/patch/patches/chrome_browser_sharesheet_1123388.patch @@ -1,14 +1,14 @@ diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc -index 3cb0c531e382e..a40b50e060483 100644 +index f250b1b444de0..d0b7efeadbe18 100644 --- chrome/browser/sharesheet/sharesheet_service_delegate.cc +++ chrome/browser/sharesheet/sharesheet_service_delegate.cc @@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate( gfx::NativeWindow native_window, SharesheetService* sharesheet_service) : native_window_(native_window), -+#if defined(OS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_ASH) sharesheet_bubble_view_( - std::make_unique(native_window, this)), + new ash::sharesheet::SharesheetBubbleView(native_window, this)), +#endif sharesheet_service_(sharesheet_service) {} @@ -17,69 +17,49 @@ index 3cb0c531e382e..a40b50e060483 100644 } return; } -+#if defined(OS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_ASH) sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent), std::move(delivered_callback)); +#endif is_bubble_open_ = true; } -@@ -52,15 +56,19 @@ void SharesheetServiceDelegate::ShowNearbyShareBubble( - } - return; - } -+#if defined(OS_CHROMEOS) - sharesheet_bubble_view_->ShowNearbyShareBubble(std::move(intent), - std::move(delivered_callback)); -+#endif - is_bubble_open_ = true; - } - #endif // BUILDFLAG(IS_CHROMEOS_ASH) - - void SharesheetServiceDelegate::OnBubbleClosed( - const std::u16string& active_action) { -+#if defined(OS_CHROMEOS) - sharesheet_bubble_view_.release(); -+#endif - sharesheet_service_->OnBubbleClosed(native_window_, active_action); - // This object is now deleted and nothing can be accessed any more. - // Therefore there is no need to set is_bubble_open_ to false. -@@ -82,7 +90,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed( +@@ -81,7 +85,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed( } void SharesheetServiceDelegate::OnActionLaunched() { -+#if defined(OS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_ASH) sharesheet_bubble_view_->ShowActionView(); +#endif } const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon( -@@ -102,11 +112,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, +@@ -101,11 +107,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, const int& height) { DCHECK_GT(width, 0); DCHECK_GT(height, 0); -+#if defined(OS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_ASH) sharesheet_bubble_view_->ResizeBubble(width, height); +#endif } void SharesheetServiceDelegate::CloseSharesheet() { -+#if defined(OS_CHROMEOS) ++#if BUILDFLAG(IS_CHROMEOS_ASH) sharesheet_bubble_view_->CloseBubble(); +#endif } } // namespace sharesheet diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h -index cba3392d1057c..b307678693797 100644 +index 24dc55adca062..236eb65db6a45 100644 --- chrome/browser/sharesheet/sharesheet_service_delegate.h +++ chrome/browser/sharesheet/sharesheet_service_delegate.h -@@ -72,7 +72,9 @@ class SharesheetServiceDelegate : public SharesheetController { - gfx::NativeWindow native_window_; +@@ -77,7 +77,9 @@ class SharesheetServiceDelegate : public SharesheetController { std::u16string active_action_; -+#if defined(OS_CHROMEOS) - std::unique_ptr sharesheet_bubble_view_; + // Owned by views. ++#if BUILDFLAG(IS_CHROMEOS_ASH) + ash::sharesheet::SharesheetBubbleView* sharesheet_bubble_view_; +#endif SharesheetService* sharesheet_service_; }; diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index 9b97db6a4..a7fbb86c5 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 e48400619537d..635959d7ba9a7 100644 +index ca830ceefd5d5..8b3af9620670d 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc @@ -27,6 +27,7 @@ @@ -9,9 +9,9 @@ index e48400619537d..635959d7ba9a7 100644 +#include "cef/libcef/features/runtime.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" - #include "chrome/browser/infobars/infobar_service.h" -@@ -57,6 +58,10 @@ - #include "extensions/common/extension_set.h" + #include "chrome/browser/profiles/profile.h" +@@ -59,6 +60,10 @@ + #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/layout.h" +#if BUILDFLAG(ENABLE_CEF) @@ -19,9 +19,9 @@ index e48400619537d..635959d7ba9a7 100644 +#endif + #if BUILDFLAG(ENABLE_EXTENSIONS) - #include "base/scoped_observer.h" + #include "base/scoped_observation.h" #include "extensions/browser/extension_registry_observer.h" -@@ -280,11 +285,19 @@ void ThemeService::Init() { +@@ -281,11 +286,19 @@ void ThemeService::Init() { // OnExtensionServiceReady. Otherwise, the ThemeObserver won't be // constructed in time to observe the corresponding events. #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index ed6c5fe5c..83fa9f047 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -151,7 +151,7 @@ index a0b3175223f3e..a1117001ad1fc 100644 Profile* profile = Profile::FromBrowserContext(browser_context); const std::vector& allowlist = diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc -index 6555dfc37d5ce..d54030b6f2368 100644 +index e42b4e7dbdec2..a2bebe0128a04 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc @@ -7,6 +7,7 @@ @@ -173,7 +173,7 @@ index 6555dfc37d5ce..d54030b6f2368 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/extension_urls.h" #endif -@@ -168,6 +173,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( +@@ -157,6 +162,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( const GURL& response_url, network::mojom::URLResponseHead* response_head, bool* defer) { @@ -186,10 +186,10 @@ index 6555dfc37d5ce..d54030b6f2368 100644 // that the X-Frame-Options protection mechanism is set to either DENY or // SAMEORIGIN. diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index ceb29f83a9dc1..3f1601ae17931 100644 +index 21bc479c64b31..ce00212ed4f86 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -862,6 +862,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -895,6 +895,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -197,7 +197,7 @@ index ceb29f83a9dc1..3f1601ae17931 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1067,7 +1068,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1100,7 +1101,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -207,7 +207,7 @@ index ceb29f83a9dc1..3f1601ae17931 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1076,7 +1078,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1109,7 +1111,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -217,7 +217,7 @@ index ceb29f83a9dc1..3f1601ae17931 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1086,7 +1089,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1119,7 +1122,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -227,7 +227,7 @@ index ceb29f83a9dc1..3f1601ae17931 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1094,7 +1098,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1127,7 +1131,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -238,10 +238,10 @@ index ceb29f83a9dc1..3f1601ae17931 100644 } } diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h -index cb6a2dfb9adcf..02f316d646cf7 100644 +index bc13113e725e0..2bc15de23ec4a 100644 --- content/browser/browser_plugin/browser_plugin_guest.h +++ content/browser/browser_plugin/browser_plugin_guest.h -@@ -116,6 +116,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, +@@ -113,6 +113,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, gfx::Point GetScreenCoordinates(const gfx::Point& relative_position) const; diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 95f62b365..4fc417eb9 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 cd4395923de75..61069e6965057 100644 +index 5f60593886e37..34d8abbc0acbd 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index cd4395923de75..61069e6965057 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -147,6 +148,7 @@ static_library("renderer") { +@@ -148,6 +149,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index cd4395923de75..61069e6965057 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -233,6 +235,10 @@ static_library("renderer") { +@@ -238,6 +240,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index ef766905a..51611a8fd 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 94e871ea16b08..69929718b2704 100644 +index c64f406ba5b8f..75453789a6052 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -29,6 +29,7 @@ @@ -19,7 +19,7 @@ index 94e871ea16b08..69929718b2704 100644 #if defined(OS_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. -@@ -662,7 +665,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -666,7 +669,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index 94e871ea16b08..69929718b2704 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -955,6 +960,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -959,6 +964,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index 94e871ea16b08..69929718b2704 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -965,6 +971,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -969,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,7 +45,7 @@ index 94e871ea16b08..69929718b2704 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1088,6 +1095,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1092,6 +1099,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } @@ -53,7 +53,7 @@ index 94e871ea16b08..69929718b2704 100644 #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1120,6 +1128,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1124,6 +1132,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -61,7 +61,7 @@ index 94e871ea16b08..69929718b2704 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1218,6 +1227,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1222,6 +1231,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index 94e871ea16b08..69929718b2704 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 = -@@ -1234,6 +1244,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1238,6 +1248,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,7 +78,7 @@ index 94e871ea16b08..69929718b2704 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 86b9a324e5da5..b4e1bfebe1162 100644 +index cf7f295bf92f6..1a7859d698a8c 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -49,6 +49,7 @@ @@ -89,7 +89,7 @@ index 86b9a324e5da5..b4e1bfebe1162 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -896,8 +897,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -906,8 +907,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #if !defined(OS_ANDROID) // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // its QuitClosure to the BrowserProcessImpl to call when it is time to exit. @@ -101,7 +101,7 @@ index 86b9a324e5da5..b4e1bfebe1162 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1639,11 +1642,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1665,11 +1668,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. @@ -118,7 +118,7 @@ index 86b9a324e5da5..b4e1bfebe1162 100644 // of lacros-chrome is complete. #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index 8a33ce57766c5..ca69a37eee22b 100644 +index 95d1ebc190910..13cdfa52db108 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm @@ -16,6 +16,7 @@ @@ -129,7 +129,7 @@ index 8a33ce57766c5..ca69a37eee22b 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { +@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { } } @@ -137,7 +137,7 @@ index 8a33ce57766c5..ca69a37eee22b 100644 // Create the app delegate. This object is intentionally leaked as a global // singleton. It is accessed through -[NSApp delegate]. AppController* app_controller = [[AppController alloc] init]; -@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { +@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -156,7 +156,7 @@ index 8a33ce57766c5..ca69a37eee22b 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 3f152fd798e8c..19346821464f5 100644 +index af089ae5fa35a..b7498d1a2ee79 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -37,6 +37,7 @@ @@ -166,8 +166,8 @@ index 3f152fd798e8c..19346821464f5 100644 +#include "cef/libcef/features/features.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" - #include "chrome/browser/accessibility/caption_util.h" -@@ -3643,9 +3644,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( + #include "chrome/browser/after_startup_task_utils.h" +@@ -3590,9 +3591,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // defined(OS_ANDROID) @@ -180,7 +180,7 @@ index 3f152fd798e8c..19346821464f5 100644 base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { diff --git chrome/browser/notifications/alert_dispatcher_xpc.mm chrome/browser/notifications/alert_dispatcher_xpc.mm -index d126ddd3a24dd..5e8c5ae7c093a 100644 +index ab4c2b03755d3..8e813496f9df6 100644 --- chrome/browser/notifications/alert_dispatcher_xpc.mm +++ chrome/browser/notifications/alert_dispatcher_xpc.mm @@ -19,6 +19,7 @@ @@ -191,7 +191,7 @@ index d126ddd3a24dd..5e8c5ae7c093a 100644 #include "chrome/browser/notifications/notification_platform_bridge_mac_utils.h" #import "chrome/browser/ui/cocoa/notifications/notification_delivery.h" #include "chrome/browser/ui/cocoa/notifications/xpc_mach_port.h" -@@ -180,6 +181,12 @@ void RecordXPCEvent(XPCConnectionEvent event) { +@@ -179,6 +180,12 @@ void RecordXPCEvent(XPCConnectionEvent event) { - (id)serviceProxy { id proxy = [_xpcConnection remoteObjectProxy]; @@ -205,7 +205,7 @@ index d126ddd3a24dd..5e8c5ae7c093a 100644 base::mac::ScopedMachSendRight exceptionPort( crash_reporter::GetCrashpadClient().GetHandlerMachPort()); diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 7f814486ab674..512dbd488d752 100644 +index b18cc56bb82b0..4760db368c6e0 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -10,6 +10,7 @@ @@ -216,7 +216,7 @@ index 7f814486ab674..512dbd488d752 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_ui.h" -@@ -159,6 +160,10 @@ +@@ -161,6 +162,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -227,8 +227,8 @@ index 7f814486ab674..512dbd488d752 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -974,6 +979,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, - RegisterSessionServiceLogProfilePrefs(registry); +@@ -1019,6 +1024,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + SessionDataService::RegisterProfilePrefs(registry); #endif +#if BUILDFLAG(ENABLE_CEF) diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index a1a94b0d1..73eb6f9ee 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index b0bde494f7b6f..19b11ac5766d0 100644 +index cfefe1f227283..402d848368269 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc -@@ -354,8 +354,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( +@@ -351,8 +351,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( // CommandUpdaterDelegate and CommandUpdater declare this function so we // choose to not implement CommandUpdaterDelegate inside this class and // therefore command_updater_ doesn't have the delegate set). @@ -14,7 +14,7 @@ index b0bde494f7b6f..19b11ac5766d0 100644 // No commands are enabled if there is not yet any selected tab. // TODO(pkasting): It seems like we should not need this, because either -@@ -952,11 +954,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -942,11 +944,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( // BrowserCommandController, private: bool BrowserCommandController::IsShowingMainUI() { @@ -31,10 +31,10 @@ index b0bde494f7b6f..19b11ac5766d0 100644 void BrowserCommandController::InitCommandState() { diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index 5aff6e51d2186..55a95564fb826 100644 +index 3fca382fde67e..6adddf506bb16 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -65,15 +65,23 @@ bool IsUsingGtkTheme(Profile* profile) { +@@ -69,15 +69,23 @@ bool IsUsingGtkTheme(Profile* profile) { //////////////////////////////////////////////////////////////////////////////// // BrowserFrame, public: @@ -60,7 +60,7 @@ index 5aff6e51d2186..55a95564fb826 100644 } BrowserFrame::~BrowserFrame() {} -@@ -132,6 +140,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( +@@ -137,6 +145,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( } int BrowserFrame::GetTopInset() const { @@ -73,7 +73,7 @@ index 5aff6e51d2186..55a95564fb826 100644 return browser_frame_view_->GetTopInset(false); } -@@ -166,15 +180,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, +@@ -171,15 +185,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, content::KeyboardEventProcessingResult BrowserFrame::PreHandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { @@ -95,21 +95,21 @@ index 5aff6e51d2186..55a95564fb826 100644 browser_frame_view_->OnBrowserViewInitViewsComplete(); } -@@ -207,7 +227,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { - } +@@ -341,7 +361,8 @@ void BrowserFrame::SelectNativeTheme() { + // Select between regular, dark and GTK theme. + ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); - const ui::NativeTheme* BrowserFrame::GetNativeTheme() const { -- if (browser_view_->browser()->profile()->IsIncognitoProfile() && +- if (browser_view_->browser()->profile()->IsIncognitoProfile()) { + if (browser_view_ && -+ browser_view_->browser()->profile()->IsIncognitoProfile() && - ThemeServiceFactory::GetForProfile(browser_view_->browser()->profile()) - ->UsingDefaultTheme()) { - return ui::NativeTheme::GetInstanceForDarkUI(); ++ browser_view_->browser()->profile()->IsIncognitoProfile()) { + // If the flag is enabled, then no matter if we are using the default theme + // or not we always use the dark ui instance. + if (base::FeatureList::IsEnabled( diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h -index 050c0e05e4e3b..0bbcf4af9a92a 100644 +index 0ce7abdeb7d9f..8197a6bb7da98 100644 --- chrome/browser/ui/views/frame/browser_frame.h +++ chrome/browser/ui/views/frame/browser_frame.h -@@ -53,7 +53,9 @@ enum class TabDragKind { +@@ -54,7 +54,9 @@ enum class TabDragKind { // This is a virtual interface that allows system specific browser frames. class BrowserFrame : public views::Widget, public views::ContextMenuController { public: @@ -120,10 +120,10 @@ index 050c0e05e4e3b..0bbcf4af9a92a 100644 // Initialize the frame (creates the underlying native window). diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index 7fc9e5493ca49..9cb598b648194 100644 +index e852eb7d20ed6..bb73d3055936d 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -576,11 +576,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -586,11 +586,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -147,7 +147,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 SetShowIcon(::ShouldShowWindowIcon(browser_.get())); // In forced app mode, all size controls are always disabled. Otherwise, use -@@ -594,7 +605,6 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -604,7 +615,6 @@ BrowserView::BrowserView(std::unique_ptr browser) } browser_->tab_strip_model()->AddObserver(this); @@ -155,7 +155,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -638,8 +648,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -648,8 +658,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -173,7 +173,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1407,6 +1424,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1430,6 +1447,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -182,7 +182,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2427,7 +2446,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { +@@ -2423,7 +2442,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { } void BrowserView::ReparentTopContainerForEndOfImmersive() { @@ -192,7 +192,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -2889,8 +2909,10 @@ void BrowserView::Layout() { +@@ -2878,8 +2898,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -205,7 +205,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -2947,6 +2969,11 @@ void BrowserView::AddedToWidget() { +@@ -2942,6 +2964,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -217,7 +217,7 @@ index 7fc9e5493ca49..9cb598b648194 100644 toolbar_->Init(); #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -2987,13 +3014,9 @@ void BrowserView::AddedToWidget() { +@@ -2977,13 +3004,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -234,10 +234,10 @@ index 7fc9e5493ca49..9cb598b648194 100644 MaybeInitializeWebUITabStrip(); diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 59ddc0ac10f94..d5f04bfd7ca5f 100644 +index f6db8a6928831..a5302d7f73ba6 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -112,7 +112,9 @@ class BrowserView : public BrowserWindow, +@@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, public webapps::AppBannerManager::Observer { public: METADATA_HEADER(BrowserView); @@ -247,7 +247,7 @@ index 59ddc0ac10f94..d5f04bfd7ca5f 100644 BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; -@@ -624,6 +626,12 @@ class BrowserView : public BrowserWindow, +@@ -642,6 +644,12 @@ class BrowserView : public BrowserWindow, return accessibility_focus_highlight_.get(); } @@ -261,10 +261,10 @@ index 59ddc0ac10f94..d5f04bfd7ca5f 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 56ef53cf379d9..f0f1057896bdb 100644 +index 0e810789a99d7..14d69bd755fa2 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc -@@ -415,6 +415,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { +@@ -420,6 +420,12 @@ int BrowserViewLayout::LayoutWebUITabStrip(int top) { int BrowserViewLayout::LayoutToolbar(int top) { TRACE_EVENT0("ui", "BrowserViewLayout::LayoutToolbar"); @@ -278,10 +278,10 @@ index 56ef53cf379d9..f0f1057896bdb 100644 bool toolbar_visible = delegate_->IsToolbarVisible(); int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index 9220245ea195d..90dd93503b570 100644 +index 50c10d73b9102..46f375b11d82c 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -@@ -571,37 +571,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( +@@ -582,37 +582,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( } bool BrowserTabStripController::IsFrameCondensed() const { @@ -328,18 +328,18 @@ index 9220245ea195d..90dd93503b570 100644 return GetFrameView()->GetToolbarTopSeparatorColor(); } - base::Optional BrowserTabStripController::GetCustomBackgroundId( + absl::optional BrowserTabStripController::GetCustomBackgroundId( BrowserFrameActiveState active_state) const { + if (!GetFrameView()) -+ return base::nullopt; ++ return absl::nullopt; return GetFrameView()->GetCustomBackgroundId(active_state); } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 5f6e182d017d9..be85e6df707d1 100644 +index 650fb98f63b0b..fd3d28bd70aac 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -156,12 +156,13 @@ auto& GetViewCommandMap() { +@@ -160,12 +160,13 @@ auto& GetViewCommandMap() { //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: @@ -355,7 +355,7 @@ index 5f6e182d017d9..be85e6df707d1 100644 SetID(VIEW_ID_TOOLBAR); UpgradeDetector::GetInstance()->AddObserver(this); -@@ -194,7 +195,7 @@ void ToolbarView::Init() { +@@ -198,7 +199,7 @@ void ToolbarView::Init() { #endif auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, @@ -365,10 +365,10 @@ index 5f6e182d017d9..be85e6df707d1 100644 size_animation_.Reset(1); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 99358217419a6..425a0741b55a3 100644 +index c232c1c703500..d3b1593be5496 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -87,7 +87,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -91,7 +91,8 @@ class ToolbarView : public views::AccessiblePaneView, // needs to be displayed. }; diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 9e5717716..87c05797c 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,5 +1,5 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index e5009f30f6f5a..8190a72bd450b 100644 +index 24668a4acf22d..ac1f02c0779e4 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn @@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni") diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index ffab43338..1109eb01c 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,18 +1,18 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index d106889e860ff..af57383e609b8 100644 +index 7edfd5dd9c140..f018b8f085e65 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h -@@ -12,6 +12,7 @@ +@@ -11,6 +11,7 @@ + #include - #include "base/optional.h" +#include "content/common/content_export.h" #include "content/common/navigation_params.mojom.h" #include "content/public/browser/certificate_request_result_type.h" #include "mojo/public/cpp/bindings/pending_receiver.h" @@ -81,7 +82,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, - base::Optional* override_out); + absl::optional* override_out); -bool WillCreateURLLoaderFactory( +CONTENT_EXPORT bool WillCreateURLLoaderFactory( @@ -89,18 +89,18 @@ index 86bbf620ff0d9..6c06b461c6da1 100644 "//base", "//build:chromeos_buildflags", diff --git ui/events/keycodes/keyboard_code_conversion_xkb.h ui/events/keycodes/keyboard_code_conversion_xkb.h -index 8f56878d4bb42..f0d2457f6a29d 100644 +index e1fefa4cead9e..8213402ff263d 100644 --- ui/events/keycodes/keyboard_code_conversion_xkb.h +++ ui/events/keycodes/keyboard_code_conversion_xkb.h -@@ -10,6 +10,7 @@ - #include +@@ -9,6 +9,7 @@ + #include "ui/events/keycodes/dom/dom_key.h" +#include "ui/events/keycodes/keycodes_x_export.h" #include "ui/events/keycodes/xkb_keysym.h" namespace ui { -@@ -25,7 +26,7 @@ DomKey NonPrintableXKeySymToDomKey(xkb_keysym_t keysym); +@@ -24,7 +25,7 @@ DomKey NonPrintableXKeySymToDomKey(xkb_keysym_t keysym); // char16_t DeadXKeySymToCombiningCharacter(xkb_keysym_t keysym); // Return the DomKey determined by the XKB layout result (keysym, character). diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index dbf4e00a1..739335864 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index f094105ac70c8..b5f4616ff821e 100644 +index 181732fa49c2d..29eeb60091ce6 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -672,7 +672,7 @@ void IsHandledBySafePlugin(int render_process_id, +@@ -677,7 +677,7 @@ void IsHandledBySafePlugin(int render_process_id, content::PluginService* plugin_service = content::PluginService::GetInstance(); bool plugin_found = plugin_service->GetPluginInfo( @@ -12,10 +12,10 @@ index f094105ac70c8..b5f4616ff821e 100644 if (is_stale && stale_plugin_action == RETRY_IF_STALE_PLUGIN_LIST) { // The GetPlugins call causes the plugin list to be refreshed. Once that's diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc -index c2bd9b8c3131e..d1283cf3d9b21 100644 +index 27f7028908745..35e1cdb72874f 100644 --- chrome/browser/plugins/chrome_plugin_service_filter.cc +++ chrome/browser/plugins/chrome_plugin_service_filter.cc -@@ -132,6 +132,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( +@@ -133,6 +133,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( int render_process_id, int render_frame_id, const GURL& plugin_content_url, @@ -49,10 +49,10 @@ index d0a5a12620bd3..a02e13bbd8154 100644 false /* allow_wildcard */, is_stale, &plugin_info, nullptr /* actual_mime_type */); diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index df02e848472f6..955edd0b7ff1f 100644 +index 92dced6c08aa4..73cdaf388123b 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc -@@ -81,7 +81,7 @@ void OnFindURLMimeType(const GURL& url, +@@ -82,7 +82,7 @@ void OnFindURLMimeType(const GURL& url, #if BUILDFLAG(ENABLE_PLUGINS) content::WebPluginInfo plugin; result = result || content::PluginService::GetInstance()->GetPluginInfo( @@ -62,7 +62,7 @@ index df02e848472f6..955edd0b7ff1f 100644 #endif diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 7df791af69af7..6005886106e58 100644 +index 30267bc6d214e..c01f4ff040c05 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc @@ -574,7 +574,7 @@ void DevToolsHttpHandler::OnJsonRequest( @@ -75,10 +75,10 @@ index 7df791af69af7..6005886106e58 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index a46dbf3c52abe..2d83757cef53a 100644 +index 178a234311337..51555a02e2409 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -639,6 +639,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -633,6 +633,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -92,7 +92,7 @@ index a46dbf3c52abe..2d83757cef53a 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -859,7 +866,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -853,7 +860,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -102,10 +102,10 @@ index a46dbf3c52abe..2d83757cef53a 100644 if (stale) { diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 12e48ad8e3e31..1fd51c85ad6fb 100644 +index 9be14f9a03219..00e2520112d81 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -269,6 +269,7 @@ bool PluginServiceImpl::GetPluginInfoArray( +@@ -270,6 +270,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -113,7 +113,7 @@ index 12e48ad8e3e31..1fd51c85ad6fb 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -286,7 +287,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -287,7 +288,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->IsPluginAvailable(render_process_id, render_frame_id, url, @@ -124,7 +124,7 @@ index 12e48ad8e3e31..1fd51c85ad6fb 100644 if (actual_mime_type) *actual_mime_type = mime_types[i]; diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h -index 3ce3ad55eef18..77674a7224551 100644 +index b0fb11b4d5ba7..1bce64c6b20ee 100644 --- content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h @@ -54,6 +54,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { @@ -136,10 +136,10 @@ index 3ce3ad55eef18..77674a7224551 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc -index a6d6188fb1390..7ac57de6fd55a 100644 +index 68ccb16a86ad0..7e9aeed8c8c32 100644 --- content/browser/renderer_host/plugin_registry_impl.cc +++ content/browser/renderer_host/plugin_registry_impl.cc -@@ -29,6 +29,7 @@ void PluginRegistryImpl::Bind( +@@ -30,6 +30,7 @@ void PluginRegistryImpl::Bind( } void PluginRegistryImpl::GetPlugins(bool refresh, @@ -147,7 +147,7 @@ index a6d6188fb1390..7ac57de6fd55a 100644 const url::Origin& main_frame_origin, GetPluginsCallback callback) { auto* plugin_service = PluginServiceImpl::GetInstance(); -@@ -50,10 +51,11 @@ void PluginRegistryImpl::GetPlugins(bool refresh, +@@ -51,10 +52,11 @@ void PluginRegistryImpl::GetPlugins(bool refresh, plugin_service->GetPlugins(base::BindOnce( &PluginRegistryImpl::GetPluginsComplete, weak_factory_.GetWeakPtr(), @@ -160,7 +160,7 @@ index a6d6188fb1390..7ac57de6fd55a 100644 const url::Origin& main_frame_origin, GetPluginsCallback callback, const std::vector& all_plugins) { -@@ -76,6 +78,7 @@ void PluginRegistryImpl::GetPluginsComplete( +@@ -77,6 +79,7 @@ void PluginRegistryImpl::GetPluginsComplete( // TODO(crbug.com/621724): Pass an url::Origin instead of a GURL. if (!filter || filter->IsPluginAvailable(render_process_id_, routing_id, main_frame_origin.GetURL(), @@ -188,10 +188,10 @@ index 632ae86c6fd69..55b749ec12421 100644 const std::vector& all_plugins); diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index e5b9d4722ff48..e15707aa31976 100644 +index b4c2b23799188..3bdc6327c2c18 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10749,6 +10749,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( +@@ -11216,6 +11216,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( } void RenderFrameHostImpl::GetPluginInfo(const GURL& url, @@ -199,7 +199,7 @@ index e5b9d4722ff48..e15707aa31976 100644 const url::Origin& main_frame_origin, const std::string& mime_type, GetPluginInfoCallback callback) { -@@ -10756,7 +10757,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, +@@ -11223,7 +11224,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, WebPluginInfo info; std::string actual_mime_type; bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( @@ -210,10 +210,10 @@ index e5b9d4722ff48..e15707aa31976 100644 std::move(callback).Run(found, info, actual_mime_type); } diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h -index d8d7676dc885c..0cf11c7de7454 100644 +index a2eb6268b937d..625518ccf5971 100644 --- content/browser/renderer_host/render_frame_host_impl.h +++ content/browser/renderer_host/render_frame_host_impl.h -@@ -2338,6 +2338,7 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2383,6 +2383,7 @@ class CONTENT_EXPORT RenderFrameHostImpl int32_t plugin_child_id, const base::FilePath& path) override; void GetPluginInfo(const GURL& url, @@ -234,7 +234,7 @@ index a544bfed7ed85..60aad01350c2f 100644 string mime_type) => (bool found, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 0fadf2a320b0c..8c491e3b48064 100644 +index 0a22650086512..847cea49a484d 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ @@ -247,7 +247,7 @@ index 0fadf2a320b0c..8c491e3b48064 100644 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index b031e69e4fe09..8c91423f8c140 100644 +index 71d40028ce3ea..440305180e643 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -32,6 +32,7 @@ @@ -258,8 +258,8 @@ index b031e69e4fe09..8c91423f8c140 100644 #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" #include "device/vr/buildflags/buildflags.h" -@@ -1747,6 +1748,14 @@ class CONTENT_EXPORT ContentBrowserClient { - const base::Optional& initiating_origin, +@@ -1763,6 +1764,14 @@ class CONTENT_EXPORT ContentBrowserClient { + const absl::optional& initiating_origin, mojo::PendingRemote* out_factory); + // Same as above, but exposing the whole ResourceRequest object. @@ -273,7 +273,7 @@ index b031e69e4fe09..8c91423f8c140 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1820,6 +1829,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1836,6 +1845,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -297,10 +297,10 @@ index 90fb0fcfa822b..d48e64b1573ca 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/public/browser/plugin_service_filter.h content/public/browser/plugin_service_filter.h -index 98c59005599e4..69752184745d3 100644 +index 570b5a4738b94..923a5f7195c53 100644 --- content/public/browser/plugin_service_filter.h +++ content/public/browser/plugin_service_filter.h -@@ -32,6 +32,7 @@ class PluginServiceFilter { +@@ -30,6 +30,7 @@ class PluginServiceFilter { virtual bool IsPluginAvailable(int render_process_id, int render_frame_id, const GURL& url, @@ -309,10 +309,10 @@ index 98c59005599e4..69752184745d3 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index f84df6e581606..38e5eeef558b6 100644 +index 601633452b5f9..03bc3f8e5f70a 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -82,6 +82,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -81,6 +81,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -322,7 +322,7 @@ index f84df6e581606..38e5eeef558b6 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -298,6 +301,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -292,6 +295,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -334,10 +334,10 @@ index f84df6e581606..38e5eeef558b6 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 580974507f1a3..86a0514c8b558 100644 +index aa5503a16409a..b1da8198722e2 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3548,7 +3548,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3177,7 +3177,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( WebPluginInfo info; std::string mime_type; bool found = false; @@ -348,10 +348,10 @@ index 580974507f1a3..86a0514c8b558 100644 &mime_type); if (!found) diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 36365398f8fae..b2d3fa8798563 100644 +index 5bb7fec55d93e..634ccfc09889a 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -618,6 +618,8 @@ void RenderThreadImpl::Init() { +@@ -599,6 +599,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -361,10 +361,10 @@ index 36365398f8fae..b2d3fa8798563 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 7aec578843ce5..f631601f1bb1e 100644 +index 1ee1fdf477745..74e3ddf4d19dc 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1022,6 +1022,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -1110,6 +1110,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -381,12 +381,12 @@ index 7aec578843ce5..f631601f1bb1e 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 7a836b82ee155..8e026751ce350 100644 +index faa1d91bf74a9..81e367bfb9b10 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -220,6 +220,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - const blink::WebString& top_url) override; - SkBitmap* GetSadPageBitmap() override; +@@ -255,6 +255,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { + std::unique_ptr CreateWebV8ValueConverter() + override; + void DevToolsAgentAttached() override; + void DevToolsAgentDetached() override; diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 1286b94ef..4d599f876 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,8 +1,8 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index 2aba28d210db9..00edc202e2c46 100644 +index e953579110eb9..1caa761f4297c 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -205,15 +205,10 @@ void InitializeMojo(mojo::core::Configuration* config) { +@@ -209,15 +209,10 @@ void InitializeMojo(mojo::core::Configuration* config) { } // namespace @@ -20,7 +20,7 @@ index 2aba28d210db9..00edc202e2c46 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -295,12 +290,6 @@ int RunContentProcess(const ContentMainParams& params, +@@ -299,12 +294,6 @@ int RunContentProcess(const ContentMainParams& params, #endif #if defined(OS_MAC) @@ -33,7 +33,7 @@ index 2aba28d210db9..00edc202e2c46 100644 InitializeMac(); #endif -@@ -310,7 +299,7 @@ int RunContentProcess(const ContentMainParams& params, +@@ -318,7 +307,7 @@ int RunContentProcess(const ContentMainParams& params, ui::RegisterPathProvider(); tracker = base::debug::GlobalActivityTracker::Get(); @@ -42,7 +42,7 @@ index 2aba28d210db9..00edc202e2c46 100644 if (exit_code >= 0) { if (tracker) { -@@ -369,8 +358,16 @@ int RunContentProcess(const ContentMainParams& params, +@@ -377,8 +366,16 @@ int RunContentProcess(const ContentMainParams& params, if (IsSubprocess()) CommonSubprocessInit(); @@ -60,7 +60,7 @@ index 2aba28d210db9..00edc202e2c46 100644 if (tracker) { if (exit_code == 0) { tracker->SetProcessPhaseIfEnabled( -@@ -381,19 +378,45 @@ int RunContentProcess(const ContentMainParams& params, +@@ -389,19 +386,45 @@ int RunContentProcess(const ContentMainParams& params, tracker->process_data().SetInt("exit-code", exit_code); } } @@ -111,10 +111,10 @@ index 2aba28d210db9..00edc202e2c46 100644 return RunContentProcess(params, runner.get()); } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 81e48e33cad43..84eabf287b0e9 100644 +index 8b557bdeb4b8f..49580985176ea 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -44,6 +44,7 @@ +@@ -43,6 +43,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/hang_watcher.h" #include "base/threading/platform_thread.h" @@ -122,7 +122,7 @@ index 81e48e33cad43..84eabf287b0e9 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1111,6 +1112,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1110,6 +1111,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 0523bf80d..1df8a49f4 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -371,17 +371,16 @@ index 27f5504d544a3..fd901ccd5b759 100644 ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled); } diff --git components/crash/core/app/crashpad_mac.mm components/crash/core/app/crashpad_mac.mm -index 2be2fd857bc5f..04ebef6442af2 100644 +index e3fc1fb2bcab3..56395d7100f94 100644 --- components/crash/core/app/crashpad_mac.mm +++ components/crash/core/app/crashpad_mac.mm -@@ -16,12 +16,15 @@ +@@ -16,11 +16,14 @@ #include "base/files/file_path.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" +#include "base/path_service.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" - #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "build/branding_buildflags.h" #include "components/crash/core/app/crash_reporter_client.h" @@ -390,7 +389,7 @@ index 2be2fd857bc5f..04ebef6442af2 100644 #include "third_party/crashpad/crashpad/client/crash_report_database.h" #include "third_party/crashpad/crashpad/client/crashpad_client.h" #include "third_party/crashpad/crashpad/client/crashpad_info.h" -@@ -39,14 +42,24 @@ std::map GetProcessSimpleAnnotations() { +@@ -38,14 +41,24 @@ std::map GetProcessSimpleAnnotations() { std::map process_annotations; @autoreleasepool { NSBundle* outer_bundle = base::mac::OuterBundle(); @@ -420,7 +419,7 @@ index 2be2fd857bc5f..04ebef6442af2 100644 #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable. -@@ -77,12 +90,20 @@ std::map GetProcessSimpleAnnotations() { +@@ -76,12 +89,20 @@ std::map GetProcessSimpleAnnotations() { } } @@ -446,7 +445,7 @@ index 2be2fd857bc5f..04ebef6442af2 100644 } // @autoreleasepool return process_annotations; }(); -@@ -142,10 +163,10 @@ base::FilePath PlatformCrashpadInitialization( +@@ -141,10 +162,10 @@ base::FilePath PlatformCrashpadInitialization( if (initial_client) { @autoreleasepool { @@ -461,7 +460,7 @@ index 2be2fd857bc5f..04ebef6442af2 100644 // Is there a way to recover if this fails? CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -174,6 +195,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -173,6 +194,12 @@ base::FilePath PlatformCrashpadInitialization( "--reset-own-crash-exception-port-to-system-default"); } diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index a4cab606f..44a9282f4 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -40,7 +40,7 @@ index 07a70980f12af..ddf7f17325fed 100644 virtual ~PruneCondition() {} diff --git third_party/crashpad/crashpad/client/settings.cc third_party/crashpad/crashpad/client/settings.cc -index 0aa525f1b4c00..2ddb73e7dd0cb 100644 +index 3855b9b6a4b20..263f985043716 100644 --- third_party/crashpad/crashpad/client/settings.cc +++ third_party/crashpad/crashpad/client/settings.cc @@ -86,7 +86,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) { @@ -146,7 +146,7 @@ index 5761c6b965b5c..aee4e6c96033e 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index 1d5951e8fc00c..599dde825883e 100644 +index a697b338e8eeb..96d4b45c5aa51 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -157,7 +157,7 @@ index 1d5951e8fc00c..599dde825883e 100644 import("../build/crashpad_buildconfig.gni") static_library("handler") { -@@ -64,6 +65,17 @@ static_library("handler") { +@@ -58,6 +59,17 @@ static_library("handler") { ] } @@ -175,7 +175,7 @@ index 1d5951e8fc00c..599dde825883e 100644 public_configs = [ "..:crashpad_config" ] public_deps = [ -@@ -77,6 +89,7 @@ static_library("handler") { +@@ -73,6 +85,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 63985a31a..e97d1c180 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,16 +1,16 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index 569518f209aeb..0cf7c2cc23c43 100644 +index 1f8de242c42d0..4ba07378b94a3 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc -@@ -7,6 +7,7 @@ - #include "base/command_line.h" +@@ -8,6 +8,7 @@ + #include "base/no_destructor.h" #include "base/strings/strcat.h" #include "build/branding_buildflags.h" +#include "cef/libcef/common/cef_switches.h" #include "components/embedder_support/switches.h" #include "components/version_info/version_info.h" #include "content/public/browser/web_contents.h" -@@ -20,6 +21,12 @@ +@@ -21,6 +22,12 @@ namespace embedder_support { std::string GetProduct() { diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index a211b44f7..311a5ed34 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -27,7 +27,7 @@ index 5c903a13a14ed..d385c6c0c95c4 100644 auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 231a3b6c8ce1d..14776d981f506 100644 +index 7e38155c3b695..78768b28d8c99 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -63,11 +63,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -127,7 +127,7 @@ index 305726557f2ea..caa4b798a013e 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/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 7eb3d073c7b79..3844a9c6033a5 100644 +index 216e445c0488b..cd6502cc3f059 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h @@ -27,6 +27,7 @@ @@ -162,10 +162,10 @@ index 7eb3d073c7b79..3844a9c6033a5 100644 // once each time the extensions system is loaded per browser_context. The // implementation may wish to use the BrowserContext to record the current diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc -index 26bff09c646be..830ff12c5fc9c 100644 +index 0bf4809cb6f60..fccf3478b8669 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc -@@ -392,9 +392,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, +@@ -393,9 +393,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, return true; // TODO(kalman): return false here? It might break things... DVLOG(1) << "CreateBackgroundHost " << extension->id(); diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index 8ad561719..40ce61ebb 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 5b010cc8b0147..6f7dce7dd8e4b 100644 +index a7c8ed4b4d7ed..26629eaefc234 100644 --- .gn +++ .gn -@@ -184,6 +184,8 @@ exec_script_whitelist = +@@ -176,6 +176,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,7 +12,7 @@ index 5b010cc8b0147..6f7dce7dd8e4b 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 106e853ef8179..2d2fa6b9c284f 100644 +index 19aee8c70e7a6..94be39e1137fe 100644 --- BUILD.gn +++ BUILD.gn @@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,7 +23,7 @@ index 106e853ef8179..2d2fa6b9c284f 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/media/router/features.gni") import("//components/nacl/features.gni") -@@ -251,6 +252,9 @@ group("gn_all") { +@@ -257,6 +258,9 @@ group("gn_all") { "//media/cast:cast_unittests", "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", ] @@ -79,7 +79,7 @@ index 839144aa1e9bd..29c8ab32398a7 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 8e17878f175bf..3d8fc8848fe9c 100644 +index 95378c12ca6d9..f8fed0d6c3418 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -4,6 +4,7 @@ @@ -88,9 +88,9 @@ index 8e17878f175bf..3d8fc8848fe9c 100644 import("//build/config/locales.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") - import("//chrome/browser/resources/pdf/ink/ink.gni") import("//chrome/common/features.gni") -@@ -277,6 +278,10 @@ template("chrome_extra_paks") { + import("//extensions/buildflags/buildflags.gni") +@@ -287,6 +288,10 @@ template("chrome_extra_paks") { "//chrome/browser/resources/welcome:resources", ] } @@ -125,7 +125,7 @@ index a64a23560460a..b08eee1f789a7 100644 source_patterns += [ "${root_gen_dir}/extensions/strings/extensions_strings_" ] diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index ae43217ef2075..2f0b956872631 100644 +index 51fa0d7f4cf77..2ede68e9377eb 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/compiler/compiler.gni") @@ -136,7 +136,7 @@ index ae43217ef2075..2f0b956872631 100644 import("//chrome/process_version_rc_template.gni") import("//components/nacl/features.gni") import("//third_party/ffmpeg/ffmpeg_options.gni") -@@ -122,11 +123,13 @@ python2_action("mini_installer_archive") { +@@ -121,11 +122,13 @@ action("mini_installer_archive") { inputs = [ "$root_out_dir/chrome.dll", "$root_out_dir/chrome.exe", diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 04b7de1fe..19b1437b2 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 1d3809cbdc35c..f5206f1c96c32 100644 +index b5b86bb00d59e..2cbb930d9e791 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -750,4 +750,13 @@ +@@ -784,4 +784,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/linux_allocator_uffd_1206047.patch b/patch/patches/linux_allocator_uffd_1206047.patch new file mode 100644 index 000000000..49f4a6e40 --- /dev/null +++ b/patch/patches/linux_allocator_uffd_1206047.patch @@ -0,0 +1,17 @@ +diff --git base/allocator/partition_allocator/partition_alloc_config.h base/allocator/partition_allocator/partition_alloc_config.h +index c5ccd81..6d15bfd 100644 +--- base/allocator/partition_allocator/partition_alloc_config.h ++++ base/allocator/partition_allocator/partition_alloc_config.h +@@ -33,9 +33,12 @@ + + #if defined(PA_HAS_64_BITS_POINTERS) && \ + (defined(OS_LINUX) || defined(OS_ANDROID)) ++#include + // TODO(bikineev): Enable for ChromeOS. ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) + #define PA_STARSCAN_UFFD_WRITE_PROTECTOR_SUPPORTED + #endif ++#endif + + // POSIX is not only UNIX, e.g. macOS and other OSes. We do use Linux-specific + // features such as futex(2). diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 1f9153f01..e22f6f401 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -1,5 +1,5 @@ diff --git content/browser/child_process_launcher_helper_linux.cc content/browser/child_process_launcher_helper_linux.cc -index f3d40b628ec20..7efc41048b3c1 100644 +index bbc1d4d057291..a7c7d75f61df6 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -162,7 +162,7 @@ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( @@ -12,7 +12,7 @@ index f3d40b628ec20..7efc41048b3c1 100644 base::File file(exe_dir.Append(path), base::File::FLAG_OPEN | base::File::FLAG_READ); diff --git sandbox/linux/suid/client/setuid_sandbox_host.cc sandbox/linux/suid/client/setuid_sandbox_host.cc -index 0aaed76c1dda2..517c3d8b57725 100644 +index f88c5077c6d63..8a010b882f2b7 100644 --- sandbox/linux/suid/client/setuid_sandbox_host.cc +++ sandbox/linux/suid/client/setuid_sandbox_host.cc @@ -120,7 +120,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index a6ec943ea..d815179a4 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -1,5 +1,5 @@ diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 0a3f329f4a524..9546c5add9c8c 100644 +index 04a5dcf91d0ca..935c22f9ee963 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ @@ -10,7 +10,7 @@ index 0a3f329f4a524..9546c5add9c8c 100644 #include "base/message_loop/message_pump_win.h" #include -@@ -493,7 +494,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { +@@ -497,7 +498,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { ctx.event()->set_chrome_message_pump(); msg_pump_data->set_sent_messages_in_queue(more_work_is_plausible); }); diff --git a/patch/patches/message_pump_mac_2495.patch b/patch/patches/message_pump_mac_2495.patch index 0cbb2282a..a65c25bcd 100644 --- a/patch/patches/message_pump_mac_2495.patch +++ b/patch/patches/message_pump_mac_2495.patch @@ -1,8 +1,8 @@ diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm -index 5846dcf03078b..b8d8d9e684161 100644 +index d085795608eca..b1efb62818635 100644 --- base/message_loop/message_pump_mac.mm +++ base/message_loop/message_pump_mac.mm -@@ -670,7 +670,8 @@ void MessagePumpUIApplication::Detach() { +@@ -682,7 +682,8 @@ void MessagePumpUIApplication::Detach() { #else ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { @@ -12,7 +12,7 @@ index 5846dcf03078b..b8d8d9e684161 100644 DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask()); // Pumping events in private runloop modes is known to interact badly with // app modal windows like NSAlert. -@@ -680,7 +681,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { +@@ -692,7 +693,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() { } ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() { diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index a5ab09fa4..e508416c7 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -12,7 +12,7 @@ index cdbc0273838e5..ee2809a0bb98a 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index e2b5240255bfd..da0648c1eabc4 100644 +index a28112a99dfdc..bcd58be410e10 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -205,6 +205,8 @@ void MimeHandlerViewGuest::CreateWebContents( diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 86e3263bc..53b6145de 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,10 +10,10 @@ index 96d1a51ec1078..e8120a818b1f2 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 393b89a5624a3..ba6e79471c7ba 100644 +index b2405754498bf..1619937c56eb8 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -549,7 +549,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { +@@ -559,7 +559,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { // 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. @@ -24,7 +24,7 @@ index 393b89a5624a3..ba6e79471c7ba 100644 request_->force_ignore_site_for_cookies(); if (cookie_store->cookie_access_delegate() && diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index f1bc5816aad10..dfe54f1169e8e 100644 +index ccb92aa863713..51986649b4174 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc @@ -233,7 +233,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index b188f5725..2f3b1331a 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c67..84f3b9ed7cf49 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index a0e7d4a24f658..e1dec578df6bd 100644 +index b38b11e555791..5d8da2cef9b2d 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3042,6 +3042,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3037,6 +3037,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index a0e7d4a24f658..e1dec578df6bd 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 7b2ea5e91a29a..5fda523b778de 100644 +index ce8aa5ba1f4f5..460dc054a0bcf 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -756,6 +756,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -758,6 +758,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 07f8a7e54..8c9359f26 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 a95103026c8c3..ae6c676defcc6 100644 +index f5ce4b6b6649f..32a176a7cc8fe 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -24,6 +24,7 @@ @@ -30,7 +30,7 @@ index a95103026c8c3..ae6c676defcc6 100644 + return static_cast(context)->GetDownloadPrefs(); + } +#endif - return FromDownloadManager(BrowserContext::GetDownloadManager(context)); + return FromDownloadManager(context->GetDownloadManager()); } diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc @@ -58,7 +58,7 @@ index 74536431f6649..3fc69b6560298 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc -index 9aa99b764ad86..c45424d20315a 100644 +index 376f426b7bab4..c6039e0481712 100644 --- chrome/browser/printing/print_view_manager_base.cc +++ chrome/browser/printing/print_view_manager_base.cc @@ -21,6 +21,7 @@ @@ -80,7 +80,7 @@ index 9aa99b764ad86..c45424d20315a 100644 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) #include "chrome/browser/printing/print_error_dialog.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -198,8 +203,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, +@@ -237,8 +242,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = GetWebContentsForRenderFrame(render_process_id, render_frame_id); @@ -97,10 +97,10 @@ index 9aa99b764ad86..c45424d20315a 100644 void NotifySystemDialogCancelled(int render_process_id, int routing_id) { diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h -index a96e5a33643e4..def5bced1c965 100644 +index 62f4dc6083a13..1371b43f6208a 100644 --- chrome/browser/printing/print_view_manager_base.h +++ chrome/browser/printing/print_view_manager_base.h -@@ -122,9 +122,6 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -124,9 +124,6 @@ class PrintViewManagerBase : public content::NotificationObserver, // Manages the low-level talk to the printer. scoped_refptr print_job_; @@ -111,7 +111,7 @@ index a96e5a33643e4..def5bced1c965 100644 void Observe(int type, const content::NotificationSource& source, diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html -index df858712d3be8..cd146ea0f26b4 100644 +index 920f646f06484..76c0b5e5ee04b 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html +++ chrome/browser/resources/print_preview/ui/destination_dialog.html @@ -25,10 +25,7 @@ @@ -126,21 +126,6 @@ index df858712d3be8..cd146ea0f26b4 100644 $i18n{cancel} -diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html -index 6d3d49c902e7b..4769176b9550c 100644 ---- chrome/browser/resources/print_preview/ui/destination_select.html -+++ chrome/browser/resources/print_preview/ui/destination_select.html -@@ -20,10 +20,6 @@ - -- -