From 015e3621a3ccaf4b90301d7b24e1fbd5abae7150 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 8 Oct 2020 15:54:42 -0400 Subject: [PATCH] Update to Chromium version 87.0.4280.0 (#812852) - Windows: VS2015 Update 2 is now the minimum version requirement for linking cef_sandbox from official build binary distributions. --- BUILD.gn | 3 +- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- CMakeLists.txt.in | 4 +- include/capi/cef_parser_capi.h | 6 +- include/cef_api_hash.h | 8 +- include/cef_parser.h | 4 +- include/internal/cef_types.h | 16 - .../browser/alloy/alloy_browser_host_impl.cc | 16 +- .../browser/alloy/alloy_browser_host_impl.h | 8 +- libcef/browser/alloy/alloy_browser_main.cc | 7 +- .../alloy/alloy_content_browser_client.cc | 24 +- .../alloy/alloy_content_browser_client.h | 7 +- .../alloy/browser_platform_delegate_alloy.cc | 19 +- .../alloy/chrome_browser_process_alloy.cc | 6 + .../alloy/chrome_browser_process_alloy.h | 2 + libcef/browser/alloy/chrome_profile_alloy.cc | 9 +- libcef/browser/alloy/chrome_profile_alloy.h | 1 + ...browser_context_keyed_service_factories.cc | 2 + libcef/browser/browser_info.cc | 4 +- libcef/browser/browser_platform_delegate.cc | 6 +- libcef/browser/browser_platform_delegate.h | 19 +- .../chrome_content_browser_client_cef.cc | 5 +- .../chrome_content_browser_client_cef.h | 1 + libcef/browser/devtools/devtools_frontend.cc | 23 +- .../browser/extensions/api/tabs/tabs_api.cc | 14 +- libcef/browser/extensions/api/tabs/tabs_api.h | 16 +- .../extensions/browser_extensions_util.cc | 3 +- .../extensions/chrome_api_registration.cc | 2 + libcef/browser/frame_host_impl.cc | 2 +- libcef/browser/main_runner.cc | 46 +-- libcef/browser/main_runner.h | 13 +- .../browser/media_router/media_route_impl.h | 2 +- .../browser/media_router/media_router_impl.h | 2 +- .../media_router/media_router_manager.cc | 8 +- .../media_router/media_router_manager.h | 4 +- .../browser/media_router/media_sink_impl.cc | 4 +- libcef/browser/media_router/media_sink_impl.h | 2 +- .../browser/media_router/media_source_impl.h | 2 +- .../browser_platform_delegate_native_linux.cc | 12 +- .../browser/native/file_dialog_runner_win.cc | 4 +- libcef/browser/native/window_x11.cc | 383 ++++++++---------- libcef/browser/native/window_x11.h | 27 +- libcef/browser/net/chrome_scheme_handler.cc | 2 +- .../net_service/proxy_url_loader_factory.cc | 15 +- .../net_service/url_loader_factory_getter.cc | 4 +- .../osr/browser_platform_delegate_osr.cc | 18 +- .../osr/browser_platform_delegate_osr.h | 6 +- .../osr/render_widget_host_view_osr.cc | 164 ++++---- .../browser/osr/render_widget_host_view_osr.h | 44 +- .../osr/render_widget_host_view_osr_linux.cc | 208 +--------- .../osr/render_widget_host_view_osr_win.cc | 5 + libcef/browser/osr/web_contents_view_osr.cc | 7 +- libcef/browser/osr/web_contents_view_osr.h | 6 +- libcef/browser/prefs/browser_prefs.cc | 5 +- libcef/browser/prefs/renderer_prefs.cc | 38 +- libcef/browser/prefs/renderer_prefs.h | 14 +- libcef/browser/printing/print_dialog_linux.cc | 33 +- libcef/browser/printing/print_dialog_linux.h | 2 +- libcef/browser/printing/print_view_manager.cc | 73 +++- libcef/browser/printing/print_view_manager.h | 30 +- .../printing/printing_message_filter.cc | 133 +++--- .../printing/printing_message_filter.h | 16 +- libcef/browser/request_context_impl.cc | 3 +- libcef/browser/views/button_impl.h | 4 +- libcef/browser/views/menu_button_view.h | 6 +- libcef/browser/views/view_util.cc | 11 +- libcef/browser/views/window_view.cc | 35 +- .../common/chrome/chrome_main_delegate_cef.cc | 1 - libcef/common/crash_reporter_client.cc | 4 +- libcef/common/crash_reporting.cc | 3 +- libcef/common/json_impl.cc | 3 - libcef/common/request_impl.cc | 5 +- libcef/common/resource_bundle_delegate.cc | 12 +- libcef/common/resource_bundle_delegate.h | 4 +- libcef/common/widevine_loader.cc | 3 +- .../alloy/alloy_content_renderer_client.cc | 11 - .../alloy/alloy_content_renderer_client.h | 5 - libcef/renderer/blink_glue.cc | 33 +- libcef/renderer/blink_glue.h | 6 +- libcef/renderer/browser_impl.cc | 2 +- .../extensions/extensions_renderer_client.cc | 15 - .../extensions/extensions_renderer_client.h | 5 - libcef/renderer/v8_impl.cc | 7 +- libcef_dll/libcef_dll.cc | 16 +- libcef_dll/wrapper/libcef_dll_dylib.cc | 8 +- libcef_dll/wrapper/libcef_dll_wrapper.cc | 6 +- patch/patch.cfg | 68 ++-- patch/patches/base_sandbox_2743.patch | 17 +- patch/patches/base_string_piece_1049498.patch | 2 +- patch/patches/browser_compositor_mac.patch | 6 +- patch/patches/browser_scheduler.patch | 4 +- .../browser_security_policy_1081397.patch | 32 +- patch/patches/build.patch | 6 +- patch/patches/chrome_browser.patch | 87 +--- ...rome_browser_background_mode_1100085.patch | 20 +- patch/patches/chrome_browser_browser.patch | 44 +- .../chrome_browser_content_settings.patch | 8 +- patch/patches/chrome_browser_net_export.patch | 30 +- .../chrome_browser_product_override.patch | 10 +- patch/patches/chrome_browser_profiles.patch | 12 +- .../chrome_browser_safe_browsing.patch | 4 +- .../chrome_browser_sharesheet_1123388.patch | 70 ++++ patch/patches/chrome_browser_themes.patch | 4 +- patch/patches/chrome_plugins.patch | 21 +- patch/patches/chrome_renderer.patch | 6 +- patch/patches/chrome_runtime.patch | 47 +-- patch/patches/chrome_widevine.patch | 2 +- patch/patches/component_build.patch | 46 +-- patch/patches/content_2015.patch | 116 +++--- patch/patches/content_app_shutdown_2798.patch | 73 ---- patch/patches/content_main_654986.patch | 215 ++++++++++ patch/patches/crashpad_1995.patch | 10 +- patch/patches/crashpad_tp_1995.patch | 20 +- patch/patches/extensions_1947.patch | 8 +- patch/patches/font_family_cache_1501.patch | 2 +- patch/patches/gn_config.patch | 14 +- patch/patches/gritsettings.patch | 4 +- patch/patches/libxml_visibility.patch | 2 +- patch/patches/linux_assets_path_1936.patch | 2 +- patch/patches/message_loop.patch | 10 +- .../mime_handler_view_guest_1565_2727.patch | 4 +- patch/patches/net_cookie_flags.patch | 39 ++ patch/patches/osr_fling_2745.patch | 8 +- patch/patches/prefs_content_1161.patch | 49 --- patch/patches/print_preview_123.patch | 46 ++- patch/patches/printing_context_2196.patch | 4 +- patch/patches/renderer_host_1070713.patch | 4 +- .../renderer_preferences_util_545103.patch | 6 +- patch/patches/resource_bundle_2512.patch | 6 +- patch/patches/runhooks.patch | 4 +- patch/patches/rwh_background_color_1984.patch | 6 +- patch/patches/service_manager_654986.patch | 193 --------- patch/patches/services_network_2622.patch | 14 +- patch/patches/services_network_2718.patch | 6 +- .../patches/set_resize_background_color.patch | 12 +- patch/patches/storage_incognito_2289.patch | 10 +- patch/patches/trace_event.patch | 2 +- patch/patches/ui_gl_utils_1123950.patch | 13 - patch/patches/views_1749_2102.patch | 46 +-- ...views_widget_180_1481_1565_1677_1749.patch | 70 ++-- patch/patches/viz_osr_2575.patch | 20 +- patch/patches/web_contents_1257_1565.patch | 49 +-- patch/patches/webkit_plugin_info_2015.patch | 26 +- .../patches/webkit_pointer_event_781966.patch | 13 - patch/patches/webkit_popups.patch | 76 ---- .../webkit_popups_and_background.patch | 151 +++++++ patch/patches/webui_2037.patch | 8 +- patch/patches/webview_plugin_2020.patch | 4 +- patch/patches/win_rt_2274.patch | 4 +- tests/ceftests/parser_unittest.cc | 8 +- tests/ceftests/scheme_handler_unittest.cc | 54 +-- tests/ceftests/test_util.cc | 11 - tests/ceftests/test_util.h | 3 - tests/ceftests/views/test_window_delegate.cc | 10 +- tests/shared/browser/extension_util.cc | 5 +- tools/gn_args.py | 12 +- 156 files changed, 1709 insertions(+), 2088 deletions(-) create mode 100644 patch/patches/chrome_browser_sharesheet_1123388.patch delete mode 100644 patch/patches/content_app_shutdown_2798.patch create mode 100644 patch/patches/content_main_654986.patch create mode 100644 patch/patches/net_cookie_flags.patch delete mode 100644 patch/patches/prefs_content_1161.patch delete mode 100644 patch/patches/service_manager_654986.patch delete mode 100644 patch/patches/ui_gl_utils_1123950.patch delete mode 100644 patch/patches/webkit_pointer_event_781966.patch delete mode 100644 patch/patches/webkit_popups.patch create mode 100644 patch/patches/webkit_popups_and_background.patch diff --git a/BUILD.gn b/BUILD.gn index b190d1509..2c7b88d68 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -859,6 +859,7 @@ static_library("libcef_static") { "//components/google/core/common", "//components/keyed_service/content:content", "//components/keyed_service/core:core", + "//components/media_router/common/mojom:media_router", "//components/navigation_interception", "//components/network_session_configurator/common", "//components/pdf/browser", @@ -906,7 +907,6 @@ static_library("libcef_static") { "//printing/buildflags", "//services/network:network_service", "//services/network/public/cpp", - "//services/service_manager/embedder", "//services/service_manager/public/cpp", "//skia", "//storage/browser", @@ -1186,7 +1186,6 @@ static_library("libcef_static") { sources += [ # Support for UI input events. # Part of //ui/aura:test_support which is testingonly. - "//ui/aura/test/x11_event_sender.cc", "//ui/aura/test/x11_event_sender.h", # Part of //ui/views:test_support which is testingonly. "//ui/views/test/ui_controls_factory_desktop_aurax11.cc", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index a10710033..517909a4c 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/86.0.4240.0' + 'chromium_checkout': 'refs/tags/87.0.4280.0' } diff --git a/CMakeLists.txt.in b/CMakeLists.txt.in index d4898bec3..51aa74554 100644 --- a/CMakeLists.txt.in +++ b/CMakeLists.txt.in @@ -53,8 +53,8 @@ # installed. Only 64-bit builds are supported. # # - Windows requirements: -# Visual Studio 2015 or newer building on Windows 7 or newer. Visual Studio -# 2019 and Windows 10 64-bit are recommended. +# Visual Studio 2015 Update 2 or newer building on Windows 7 or newer. Visual +# Studio 2019 and Windows 10 64-bit are recommended. # # BUILD EXAMPLES # diff --git a/include/capi/cef_parser_capi.h b/include/capi/cef_parser_capi.h index 51e51bbe1..294911b8a 100644 --- a/include/capi/cef_parser_capi.h +++ b/include/capi/cef_parser_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=14cf03e02d8ca3416e65f756470afd8185c7bc78$ +// $hash=19337a70a13352e70452be7fcc25ef2de4b1ae4c$ // #ifndef CEF_INCLUDE_CAPI_CEF_PARSER_CAPI_H_ @@ -153,13 +153,11 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer( /// // Parses the specified |json_string| and returns a dictionary or list // representation. If JSON parsing fails this function returns NULL and -// populates |error_code_out| and |error_msg_out| with an error code and a -// formatted error message respectively. +// populates |error_msg_out| with a formatted error message. /// CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( const cef_string_t* json_string, cef_json_parser_options_t options, - cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out); /// diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 3e3d07aa0..bd57404e4 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "988c60ace9a075ec0d6d5439f8a845296549f666" +#define CEF_API_HASH_UNIVERSAL "22df40aa24a8bd920a2d18500c94dcc1b2c9508f" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "9928400d4500073e22954f2793c9ab78749b7b67" +#define CEF_API_HASH_PLATFORM "7698e6c4e3bc0f749609a0172a24d34cddbe8a1f" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "1c49b8f3d13ac6dd5b04d827f283ede33c7aba7b" +#define CEF_API_HASH_PLATFORM "5189bd75f9d076d7f136bf140b6cc5990ad452ec" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "7634bb7366cf7be31efdbf7c86815ad47b412317" +#define CEF_API_HASH_PLATFORM "96412a3d498054d352e5f9dcf5ad8ff90917c361" #endif #ifdef __cplusplus diff --git a/include/cef_parser.h b/include/cef_parser.h index bae958bf7..6b6ee5e35 100644 --- a/include/cef_parser.h +++ b/include/cef_parser.h @@ -146,14 +146,12 @@ CefRefPtr CefParseJSON(const void* json, /// // Parses the specified |json_string| and returns a dictionary or list // representation. If JSON parsing fails this method returns NULL and populates -// |error_code_out| and |error_msg_out| with an error code and a formatted error -// message respectively. +// |error_msg_out| with a formatted error message. /// /*--cef()--*/ CefRefPtr CefParseJSONAndReturnError( const CefString& json_string, cef_json_parser_options_t options, - cef_json_parser_error_t& error_code_out, CefString& error_msg_out); /// diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index c861e041d..94a6cf736 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2367,22 +2367,6 @@ typedef enum { JSON_PARSER_ALLOW_TRAILING_COMMAS = 1 << 0, } cef_json_parser_options_t; -/// -// Error codes that can be returned from CefParseJSONAndReturnError. -/// -typedef enum { - JSON_NO_ERROR = 0, - JSON_INVALID_ESCAPE, - JSON_SYNTAX_ERROR, - JSON_UNEXPECTED_TOKEN, - JSON_TRAILING_COMMA, - JSON_TOO_MUCH_NESTING, - JSON_UNEXPECTED_DATA_AFTER_ROOT, - JSON_UNSUPPORTED_ENCODING, - JSON_UNQUOTED_DICTIONARY_KEY, - JSON_PARSE_ERROR_COUNT -} cef_json_parser_error_t; - /// // Options that can be passed to CefWriteJSON. /// diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index bd979a416..473c3cdfb 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -240,8 +240,12 @@ CefRefPtr AlloyBrowserHostImpl::CreateInternal( // expected order. // 1. Notify the browser's LifeSpanHandler. This must always be the first - // notification for the browser. - browser->OnAfterCreated(); + // notification for the browser. Block navigation to avoid issues with focus + // changes being sent to an unbound interface. + { + auto navigation_lock = browser_info->CreateNavigationLock(); + browser->OnAfterCreated(); + } // 2. Notify the platform delegate. With Views this will result in a call to // CefBrowserViewDelegate::OnBrowserCreated(). @@ -1368,7 +1372,7 @@ bool AlloyBrowserHostImpl::PreHandleGestureEvent( bool AlloyBrowserHostImpl::CanDragEnter(content::WebContents* source, const content::DropData& data, - blink::WebDragOperationsMask mask) { + blink::DragOperationsMask mask) { CefRefPtr handler; if (client_) handler = client_->GetDragHandler(); @@ -1734,10 +1738,10 @@ gfx::Point AlloyBrowserHostImpl::GetScreenPoint(const gfx::Point& view) const { void AlloyBrowserHostImpl::StartDragging( const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) { if (platform_delegate_) { platform_delegate_->StartDragging(drop_data, allowed_ops, image, @@ -1745,7 +1749,7 @@ void AlloyBrowserHostImpl::StartDragging( } } -void AlloyBrowserHostImpl::UpdateDragCursor(blink::WebDragOperation operation) { +void AlloyBrowserHostImpl::UpdateDragCursor(blink::DragOperation operation) { if (platform_delegate_) platform_delegate_->UpdateDragCursor(operation); } diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index c97936c79..b5e2d034a 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -198,12 +198,12 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, gfx::Point GetScreenPoint(const gfx::Point& view) const; void StartDragging(const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh); - void UpdateDragCursor(blink::WebDragOperation operation); + void UpdateDragCursor(blink::DragOperation operation); // Thread safe accessors. SkColor GetBackgroundColor() const; @@ -267,7 +267,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, const blink::WebGestureEvent& event) override; bool CanDragEnter(content::WebContents* source, const content::DropData& data, - blink::WebDragOperationsMask operations_allowed) override; + blink::DragOperationsMask operations_allowed) override; void GetCustomWebContentsView( content::WebContents* web_contents, const GURL& target_url, diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index 38fe33c7e..73adde93a 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -27,15 +27,16 @@ #include "base/strings/string_number_conversions.h" #include "base/task/post_task.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/media/router/chrome_media_router_factory.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/plugins/plugin_finder.h" #include "components/constrained_window/constrained_window_views.h" #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/network_service_instance.h" +#include "content/public/common/result_codes.h" #include "extensions/browser/extension_system.h" #include "extensions/common/constants.h" #include "net/base/net_module.h" -#include "services/service_manager/embedder/result_codes.h" #include "ui/base/resource/resource_bundle.h" #if defined(USE_AURA) && defined(USE_X11) @@ -88,7 +89,7 @@ int AlloyBrowserMainParts::PreEarlyInitialization() { ui::InitializeInputMethodForTesting(); #endif - return service_manager::RESULT_CODE_NORMAL_EXIT; + return content::RESULT_CODE_NORMAL_EXIT; } void AlloyBrowserMainParts::ToolkitInitialized() { @@ -130,6 +131,8 @@ void AlloyBrowserMainParts::PreMainMessageLoopStart() { // setup.exe. In Chrome, these strings are in the locale files. ChromeBrowserMainPartsWin::SetupInstallerUtilStrings(); #endif // defined(OS_WIN) + + media_router::ChromeMediaRouterFactory::DoPlatformInit(); } void AlloyBrowserMainParts::PostMainMessageLoopStart() { diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 9f393fdd3..8a62885a5 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -75,8 +75,8 @@ #include "components/content_settings/core/browser/cookie_settings.h" #include "components/spellcheck/common/spellcheck.mojom.h" #include "components/version_info/version_info.h" -#include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/plugin_service_impl.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_ppapi_host.h" #include "content/public/browser/browser_thread.h" @@ -97,7 +97,6 @@ #include "content/public/common/storage_quota_params.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" -#include "content/public/common/web_preferences.h" #include "extensions/browser/extension_message_filter.h" #include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_registry.h" @@ -117,9 +116,9 @@ #include "sandbox/policy/switches.h" #include "services/network/public/cpp/network_switches.h" #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" -#include "services/service_manager/embedder/switches.h" #include "services/service_manager/public/mojom/connector.mojom.h" #include "storage/browser/quota/quota_settings.h" +#include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" #include "third_party/blink/public/mojom/prerender/prerender.mojom.h" #include "third_party/blink/public/web/web_window_features.h" @@ -758,7 +757,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches( } #if defined(OS_LINUX) - if (process_type == service_manager::switches::kZygoteProcess) { + if (process_type == switches::kZygoteProcess) { // Propagate the following switches to the zygote command line (along with // any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { @@ -966,7 +965,7 @@ bool AlloyContentBrowserClient::CanCreateWindow( void AlloyContentBrowserClient::OverrideWebkitPrefs( content::RenderViewHost* rvh, - content::WebPreferences* prefs) { + blink::web_pref::WebPreferences* prefs) { // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // when this method is called. renderer_prefs::PopulateWebPreferences(rvh, *prefs); @@ -979,7 +978,7 @@ void AlloyContentBrowserClient::OverrideWebkitPrefs( bool AlloyContentBrowserClient::OverrideWebPreferencesAfterNavigation( content::WebContents* web_contents, - content::WebPreferences* prefs) { + blink::web_pref::WebPreferences* prefs) { return renderer_prefs::PopulateWebPreferencesAfterNavigation(web_contents, *prefs); } @@ -1045,7 +1044,7 @@ void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess( content::PosixFileDescriptorInfo* mappings) { int crash_signal_fd = GetCrashSignalFD(command_line); if (crash_signal_fd >= 0) { - mappings->Share(service_manager::kCrashDumpSignal, crash_signal_fd); + mappings->Share(kCrashDumpSignal, crash_signal_fd); } } #endif // defined(OS_LINUX) @@ -1100,6 +1099,7 @@ AlloyContentBrowserClient::CreateLoginDelegate( void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( int frame_tree_node_id, base::UkmSourceId ukm_source_id, + NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories, NonNetworkURLLoaderFactoryMap* factories) { if (!extensions::ExtensionsEnabled()) return; @@ -1116,6 +1116,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, + NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories, NonNetworkURLLoaderFactoryMap* factories) { if (!extensions::ExtensionsEnabled()) return; @@ -1157,10 +1158,10 @@ void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( allowed_webui_hosts.emplace_back(chrome::kChromeUIThemeHost); } if (!allowed_webui_hosts.empty()) { - factories->emplace( - content::kChromeUIScheme, - content::CreateWebUIURLLoader(frame_host, content::kChromeUIScheme, - std::move(allowed_webui_hosts))); + factories->emplace(content::kChromeUIScheme, + content::CreateWebUIURLLoaderFactory( + frame_host, content::kChromeUIScheme, + std::move(allowed_webui_hosts))); } } @@ -1171,6 +1172,7 @@ bool AlloyContentBrowserClient::WillCreateURLLoaderFactory( URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, + base::UkmSourceId ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 781c55d77..3ac8a034b 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -102,10 +102,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { bool opener_suppressed, bool* no_javascript_access) override; void OverrideWebkitPrefs(content::RenderViewHost* rvh, - content::WebPreferences* prefs) override; + blink::web_pref::WebPreferences* prefs) override; bool OverrideWebPreferencesAfterNavigation( content::WebContents* web_contents, - content::WebPreferences* prefs) override; + blink::web_pref::WebPreferences* prefs) override; void BrowserURLHandlerCreated(content::BrowserURLHandler* handler) override; std::string GetDefaultDownloadName() override; void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; @@ -151,10 +151,12 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { void RegisterNonNetworkNavigationURLLoaderFactories( int frame_tree_node_id, base::UkmSourceId ukm_source_id, + NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories, NonNetworkURLLoaderFactoryMap* factories) override; void RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, + NonNetworkURLLoaderFactoryDeprecatedMap* uniquely_owned_factories, NonNetworkURLLoaderFactoryMap* factories) override; bool WillCreateURLLoaderFactory( content::BrowserContext* browser_context, @@ -163,6 +165,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, + base::UkmSourceId ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 35b1463ed..2d0235c5a 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -25,6 +25,15 @@ #include "extensions/browser/process_manager.h" #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h" +namespace { + +printing::CefPrintViewManager* GetPrintViewManager( + content::WebContents* web_contents) { + return printing::CefPrintViewManager::FromWebContents(web_contents); +} + +} // namespace + CefBrowserPlatformDelegateAlloy::CefBrowserPlatformDelegateAlloy() : weak_ptr_factory_(this) {} @@ -348,11 +357,9 @@ void CefBrowserPlatformDelegateAlloy::Print() { auto rfh = actionable_contents->GetMainFrame(); if (IsPrintPreviewSupported()) { - printing::CefPrintViewManager::FromWebContents(actionable_contents) - ->PrintPreviewNow(rfh, false); + GetPrintViewManager(actionable_contents)->PrintPreviewNow(rfh, false); } else { - printing::PrintViewManager::FromWebContents(actionable_contents) - ->PrintNow(rfh); + GetPrintViewManager(actionable_contents)->PrintNow(rfh); } } @@ -370,7 +377,7 @@ void CefBrowserPlatformDelegateAlloy::PrintToPDF( pdf_callback = base::Bind(&CefPdfPrintCallback::OnPdfPrintFinished, callback.get(), path); } - printing::CefPrintViewManager::FromWebContents(actionable_contents) + GetPrintViewManager(actionable_contents) ->PrintToPDF(actionable_contents->GetMainFrame(), base::FilePath(path), settings, pdf_callback); } @@ -394,7 +401,7 @@ void CefBrowserPlatformDelegateAlloy::Find(int identifier, auto options = blink::mojom::FindOptions::New(); options->forward = forward; options->match_case = matchCase; - options->find_next_if_selection_matches = findNext; + options->find_match = findNext; web_contents_->Find(identifier, searchText, std::move(options)); } diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index 9067afaca..fbe0b79a1 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -325,6 +325,12 @@ ChromeBrowserProcessAlloy::floc_blocklist_service() { return nullptr; } +federated_learning::FlocSortingLshClustersService* +ChromeBrowserProcessAlloy::floc_sorting_lsh_clusters_service() { + NOTREACHED(); + return nullptr; +} + optimization_guide::OptimizationGuideService* ChromeBrowserProcessAlloy::optimization_guide_service() { NOTREACHED(); diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index 9135b1f56..b29a90087 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -83,6 +83,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { subresource_filter::RulesetService* subresource_filter_ruleset_service() override; federated_learning::FlocBlocklistService* floc_blocklist_service() override; + federated_learning::FlocSortingLshClustersService* + floc_sorting_lsh_clusters_service() override; optimization_guide::OptimizationGuideService* optimization_guide_service() override; StartupData* startup_data() override; diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index f55e3c418..5b59e79f4 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -23,9 +23,10 @@ class CefVariationsClient : public variations::VariationsClient { return browser_context_->IsOffTheRecord(); } - std::string GetVariationsHeader() const override { + variations::mojom::VariationsHeadersPtr GetVariationsHeaders() + const override { return variations::VariationsIdsProvider::GetInstance() - ->GetClientDataHeader(false /* is_signed_in */); + ->GetClientDataHeaders(false /* is_signed_in */); } private: @@ -171,3 +172,7 @@ base::Time ChromeProfileAlloy::GetCreationTime() const { void ChromeProfileAlloy::SetCreationTimeForTesting(base::Time creation_time) { NOTREACHED(); } + +void ChromeProfileAlloy::RecordMainFrameNavigation() { + NOTREACHED(); +} diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index 32b4d0129..9ea789a87 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -50,6 +50,7 @@ class ChromeProfileAlloy : public Profile { ExitType GetLastSessionExitType() const override; base::Time GetCreationTime() const override; void SetCreationTimeForTesting(base::Time creation_time) override; + void RecordMainFrameNavigation() override; private: std::unique_ptr variations_client_; diff --git a/libcef/browser/browser_context_keyed_service_factories.cc b/libcef/browser/browser_context_keyed_service_factories.cc index f89c3e8c4..32a11de3e 100644 --- a/libcef/browser/browser_context_keyed_service_factories.cc +++ b/libcef/browser/browser_context_keyed_service_factories.cc @@ -6,6 +6,7 @@ #include "libcef/common/extensions/extensions_util.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" +#include "chrome/browser/media/router/chrome_media_router_factory.h" #include "chrome/browser/plugins/plugin_prefs_factory.h" #include "chrome/browser/profiles/renderer_updater_factory.h" #include "chrome/browser/spellchecker/spellcheck_factory.h" @@ -19,6 +20,7 @@ namespace cef { void EnsureBrowserContextKeyedServiceFactoriesBuilt() { CookieSettingsFactory::GetInstance(); + media_router::ChromeMediaRouterFactory::GetInstance(); PluginPrefsFactory::GetInstance(); PrefsTabHelper::GetServiceInstance(); RendererUpdaterFactory::GetInstance(); diff --git a/libcef/browser/browser_info.cc b/libcef/browser/browser_info.cc index d9237b668..03074ece3 100644 --- a/libcef/browser/browser_info.cc +++ b/libcef/browser/browser_info.cc @@ -9,8 +9,8 @@ #include "libcef/common/values_impl.h" #include "base/logging.h" -#include "content/browser/frame_host/frame_tree_node.h" -#include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/browser/renderer_host/frame_tree_node.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/public/browser/render_process_host.h" #include "ipc/ipc_message.h" diff --git a/libcef/browser/browser_platform_delegate.cc b/libcef/browser/browser_platform_delegate.cc index 2dc417e3a..1ed11ebc3 100644 --- a/libcef/browser/browser_platform_delegate.cc +++ b/libcef/browser/browser_platform_delegate.cc @@ -309,16 +309,16 @@ void CefBrowserPlatformDelegate::DragTargetDrop(const CefMouseEvent& event) { void CefBrowserPlatformDelegate::StartDragging( const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) { NOTREACHED(); } void CefBrowserPlatformDelegate::UpdateDragCursor( - blink::WebDragOperation operation) { + blink::DragOperation operation) { NOTREACHED(); } diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index 55f30d339..6fea7f441 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -16,7 +16,8 @@ #include "base/callback_forward.h" #include "extensions/common/view_type.h" -#include "third_party/blink/public/common/page/web_drag_operation.h" +#include "third_party/blink/public/common/page/drag_operation.h" +#include "third_party/blink/public/mojom/page/drag.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" #include "ui/base/window_open_disposition.h" @@ -33,7 +34,6 @@ class WebTouchEvent; namespace content { struct AXEventNotificationDetails; struct AXLocationChangeNotificationDetails; -struct DragEventSourceInfo; struct DropData; struct NativeWebKeyboardEvent; class RenderViewHost; @@ -320,13 +320,14 @@ class CefBrowserPlatformDelegate { cef_drag_operations_mask_t allowed_ops); virtual void DragTargetDragLeave(); virtual void DragTargetDrop(const CefMouseEvent& event); - virtual void StartDragging(const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, - const gfx::ImageSkia& image, - const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, - content::RenderWidgetHostImpl* source_rwh); - virtual void UpdateDragCursor(blink::WebDragOperation operation); + virtual void StartDragging( + const content::DropData& drop_data, + blink::DragOperationsMask allowed_ops, + const gfx::ImageSkia& image, + const gfx::Vector2d& image_offset, + const blink::mojom::DragEventSourceInfo& event_info, + content::RenderWidgetHostImpl* source_rwh); + virtual void UpdateDragCursor(blink::DragOperation operation); virtual void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op); virtual void DragSourceSystemDragEnded(); virtual void AccessibilityEventReceived( diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index 1cfc3126b..174671291 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -154,6 +154,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, + base::UkmSourceId ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, @@ -162,8 +163,8 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( network::mojom::URLLoaderFactoryOverridePtr* factory_override) { bool use_proxy = ChromeContentBrowserClient::WillCreateURLLoaderFactory( browser_context, frame, render_process_id, type, request_initiator, - navigation_id, factory_receiver, header_client, bypass_redirect_checks, - disable_secure_dns, factory_override); + navigation_id, ukm_source_id, factory_receiver, header_client, + bypass_redirect_checks, disable_secure_dns, factory_override); if (use_proxy) { // The chrome layer will handle the request. return use_proxy; diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 1fd71b976..d1d178760 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -47,6 +47,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { URLLoaderFactoryType type, const url::Origin& request_initiator, base::Optional navigation_id, + base::UkmSourceId ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* header_client, diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index 93e6d2299..a8aca14a6 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -54,6 +54,7 @@ #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" +#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "storage/browser/file_system/native_file_util.h" @@ -445,15 +446,15 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl); resource_request->headers.AddHeadersFromString(headers); - std::unique_ptr file_url_loader_factory; - scoped_refptr network_url_loader_factory; - std::unique_ptr webui_url_loader_factory; - network::mojom::URLLoaderFactory* url_loader_factory; + scoped_refptr url_loader_factory; if (gurl.SchemeIsFile()) { - file_url_loader_factory = content::CreateFileURLLoaderFactory( - base::FilePath() /* profile_path */, - nullptr /* shared_cors_origin_access_list */); - url_loader_factory = file_url_loader_factory.get(); + mojo::PendingRemote pending_remote = + content::CreateFileURLLoaderFactory( + base::FilePath() /* profile_path */, + nullptr /* shared_cors_origin_access_list */); + url_loader_factory = network::SharedURLLoaderFactory::Create( + std::make_unique( + std::move(pending_remote))); } else if (content::HasWebUIScheme(gurl)) { base::DictionaryValue response; response.SetInteger("statusCode", 403); @@ -462,15 +463,13 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( } else { auto* partition = content::BrowserContext::GetStoragePartitionForSite( web_contents()->GetBrowserContext(), gurl); - network_url_loader_factory = - partition->GetURLLoaderFactoryForBrowserProcess(); - url_loader_factory = network_url_loader_factory.get(); + url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess(); } auto simple_url_loader = network::SimpleURLLoader::Create( std::move(resource_request), traffic_annotation); auto resource_loader = std::make_unique( - stream_id, this, std::move(simple_url_loader), url_loader_factory, + stream_id, this, std::move(simple_url_loader), url_loader_factory.get(), request_id); loaders_.insert(std::move(resource_loader)); return; diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index 0e9f1728d..6c397dfc8 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -130,6 +130,14 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { return set_init_result(SUCCESS); } +bool ExecuteCodeInTabFunction::ShouldInsertCSS() const { + return false; +} + +bool ExecuteCodeInTabFunction::ShouldRemoveCSS() const { + return false; +} + bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) { CHECK_GE(execute_tab_id_, 0); @@ -225,11 +233,11 @@ void ExecuteCodeInTabFunction::LoadFileComplete( DidLoadAndLocalizeFile(file, success, std::move(data)); } -bool TabsExecuteScriptFunction::ShouldInsertCSS() const { - return false; +bool TabsInsertCSSFunction::ShouldInsertCSS() const { + return true; } -bool TabsInsertCSSFunction::ShouldInsertCSS() const { +bool TabsRemoveCSSFunction::ShouldRemoveCSS() const { return true; } diff --git a/libcef/browser/extensions/api/tabs/tabs_api.h b/libcef/browser/extensions/api/tabs/tabs_api.h index a195109f7..45bd70449 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.h +++ b/libcef/browser/extensions/api/tabs/tabs_api.h @@ -42,7 +42,7 @@ class TabsCreateFunction : public ExtensionFunction { const CefExtensionFunctionDetails cef_details_; }; -// Implement API call tabs.executeScript and tabs.insertCSS. +// Implement API calls tabs.executeScript, tabs.insertCSS, and tabs.removeCSS. class ExecuteCodeInTabFunction : public ExecuteCodeFunction { public: ExecuteCodeInTabFunction(); @@ -52,6 +52,8 @@ class ExecuteCodeInTabFunction : public ExecuteCodeFunction { // Initializes |execute_tab_id_| and |details_|. InitResult Init() override; + bool ShouldInsertCSS() const override; + bool ShouldRemoveCSS() const override; bool CanExecuteScriptOnPage(std::string* error) override; ScriptExecutor* GetScriptExecutor(std::string* error) override; bool IsWebView() const override; @@ -69,9 +71,6 @@ class ExecuteCodeInTabFunction : public ExecuteCodeFunction { }; class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction { - protected: - bool ShouldInsertCSS() const override; - private: ~TabsExecuteScriptFunction() override {} @@ -87,6 +86,15 @@ class TabsInsertCSSFunction : public ExecuteCodeInTabFunction { DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) }; +class TabsRemoveCSSFunction : public ExecuteCodeInTabFunction { + private: + ~TabsRemoveCSSFunction() override {} + + bool ShouldRemoveCSS() const override; + + DECLARE_EXTENSION_FUNCTION("tabs.removeCSS", TABS_INSERTCSS) +}; + // Based on ChromeAsyncExtensionFunction. class ZoomAPIFunction : public ExtensionFunction { public: diff --git a/libcef/browser/extensions/browser_extensions_util.cc b/libcef/browser/extensions/browser_extensions_util.cc index 57b5b934c..48e83e6e3 100644 --- a/libcef/browser/extensions/browser_extensions_util.cc +++ b/libcef/browser/extensions/browser_extensions_util.cc @@ -64,8 +64,7 @@ content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) { content::BrowserPluginGuest* plugin_guest = guest_impl->GetBrowserPluginGuest(); if (plugin_guest) { - return content::WebContents::FromRenderFrameHost( - plugin_guest->GetEmbedderFrame()); + return plugin_guest->owner_web_contents(); } // Maybe it's a print preview dialog. diff --git a/libcef/browser/extensions/chrome_api_registration.cc b/libcef/browser/extensions/chrome_api_registration.cc index c08281804..8631b75df 100644 --- a/libcef/browser/extensions/chrome_api_registration.cc +++ b/libcef/browser/extensions/chrome_api_registration.cc @@ -53,6 +53,7 @@ const char* const kSupportedAPIs[] = { EXTENSION_FUNCTION_NAME(cefimpl::TabsCreateFunction), EXTENSION_FUNCTION_NAME(cefimpl::TabsExecuteScriptFunction), EXTENSION_FUNCTION_NAME(cefimpl::TabsInsertCSSFunction), + EXTENSION_FUNCTION_NAME(cefimpl::TabsRemoveCSSFunction), EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomFunction), EXTENSION_FUNCTION_NAME(cefimpl::TabsGetZoomFunction), EXTENSION_FUNCTION_NAME(cefimpl::TabsSetZoomSettingsFunction), @@ -91,6 +92,7 @@ void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) { registry->RegisterFunction(); registry->RegisterFunction(); registry->RegisterFunction(); + registry->RegisterFunction(); registry->RegisterFunction(); registry->RegisterFunction(); registry->RegisterFunction(); diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index 257096f0a..a3cda706e 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -17,7 +17,7 @@ #include "libcef/common/request_impl.h" #include "libcef/common/task_runner_impl.h" -#include "content/browser/frame_host/frame_tree_node.h" +#include "content/browser/renderer_host/frame_tree_node.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index 5cbf26991..875111ea3 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -21,11 +21,12 @@ #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" -#include "content/app/content_service_manager_main_delegate.h" +#include "content/app/content_main_runner_impl.h" #include "content/browser/scheduler/browser_task_executor.h" +#include "content/public/app/content_main.h" +#include "content/public/app/content_main_runner.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_switches.h" -#include "services/service_manager/embedder/main.h" #if defined(OS_WIN) #include @@ -362,7 +363,10 @@ int CefMainRunner::ContentMainInitialize(const CefMainArgs& args, main_delegate_->BeforeMainThreadInitialize(args); // Initialize the content runner. - content::ContentMainParams params(main_delegate_->GetContentMainDelegate()); + main_runner_ = content::ContentMainRunner::Create(); + main_params_ = std::make_unique( + main_delegate_->GetContentMainDelegate()); + #if defined(OS_WIN) sandbox::SandboxInterfaceInfo sandbox_info = {0}; if (windows_sandbox_info == nullptr) { @@ -370,25 +374,15 @@ int CefMainRunner::ContentMainInitialize(const CefMainArgs& args, *no_sandbox = true; } - params.instance = args.instance; - params.sandbox_info = + main_params_->instance = args.instance; + main_params_->sandbox_info = static_cast(windows_sandbox_info); #else - params.argc = args.argc; - params.argv = const_cast(args.argv); + main_params_->argc = args.argc; + main_params_->argv = const_cast(args.argv); #endif - sm_main_delegate_.reset( - new content::ContentServiceManagerMainDelegate(params)); - sm_main_params_.reset( - new service_manager::MainParams(sm_main_delegate_.get())); - -#if defined(OS_POSIX) && !defined(OS_ANDROID) - sm_main_params_->argc = params.argc; - sm_main_params_->argv = params.argv; -#endif - - return service_manager::MainInitialize(*sm_main_params_); + return content::ContentMainInitialize(*main_params_, main_runner_.get()); } bool CefMainRunner::ContentMainRun(bool* initialized, @@ -402,7 +396,8 @@ bool CefMainRunner::ContentMainRun(bool* initialized, if (!CreateUIThread(base::BindOnce( [](CefMainRunner* runner, base::WaitableEvent* event) { - service_manager::MainRun(*runner->sm_main_params_); + content::ContentMainRun(*runner->main_params_, + runner->main_runner_.get()); event->Signal(); }, base::Unretained(this), @@ -412,11 +407,11 @@ bool CefMainRunner::ContentMainRun(bool* initialized, *initialized = true; - // We need to wait until service_manager::MainRun has finished. + // We need to wait until content::ContentMainRun has finished. uithread_startup_event.Wait(); } else { *initialized = true; - service_manager::MainRun(*sm_main_params_); + content::ContentMainRun(*main_params_, main_runner_.get()); } if (CEF_CURRENTLY_ON_UIT()) { @@ -484,7 +479,8 @@ void CefMainRunner::FinishShutdownOnUIThread( base::WaitableEvent* uithread_shutdown_event) { CEF_REQUIRE_UIT(); - sm_main_delegate_->ShutdownOnUIThread(); + static_cast(main_runner_.get()) + ->ShutdownOnUIThread(); std::move(shutdown_on_ui_thread).Run(); main_delegate_->AfterUIThreadShutdown(); @@ -508,10 +504,10 @@ void CefMainRunner::FinalizeShutdown(base::OnceClosure finalize_shutdown) { } // Shut down the content runner. - service_manager::MainShutdown(*sm_main_params_); + content::ContentMainShutdown(*main_params_, main_runner_.get()); - sm_main_params_.reset(); - sm_main_delegate_.reset(); + main_params_.reset(); + main_runner_.reset(); std::move(finalize_shutdown).Run(); main_delegate_->AfterMainThreadShutdown(); diff --git a/libcef/browser/main_runner.h b/libcef/browser/main_runner.h index 6493263d5..503e6765b 100644 --- a/libcef/browser/main_runner.h +++ b/libcef/browser/main_runner.h @@ -20,15 +20,10 @@ class WaitableEvent; } namespace content { -class ContentMainDelegate; -class ContentServiceManagerMainDelegate; -struct MainFunctionParams; +class ContentMainRunner; +struct ContentMainParams; } // namespace content -namespace service_manager { -struct MainParams; -} - class CefUIThread; // Manages the main process lifespan and related objects. @@ -87,8 +82,8 @@ class CefMainRunner : public CefMainRunnerHandler { const bool external_message_pump_; std::unique_ptr main_delegate_; - std::unique_ptr sm_main_delegate_; - std::unique_ptr sm_main_params_; + std::unique_ptr main_runner_; + std::unique_ptr main_params_; std::unique_ptr browser_runner_; std::unique_ptr ui_thread_; diff --git a/libcef/browser/media_router/media_route_impl.h b/libcef/browser/media_router/media_route_impl.h index 9e707c642..6366cdd8f 100644 --- a/libcef/browser/media_router/media_route_impl.h +++ b/libcef/browser/media_router/media_route_impl.h @@ -9,7 +9,7 @@ #include "include/cef_media_router.h" #include "libcef/browser/browser_context.h" -#include "chrome/common/media_router/media_route.h" +#include "components/media_router/common/media_route.h" // Implementation of the CefMediaRoute interface. Only created on the UI thread. class CefMediaRouteImpl : public CefMediaRoute { diff --git a/libcef/browser/media_router/media_router_impl.h b/libcef/browser/media_router/media_router_impl.h index 6512f356e..05dc40851 100644 --- a/libcef/browser/media_router/media_router_impl.h +++ b/libcef/browser/media_router/media_router_impl.h @@ -9,7 +9,7 @@ #include "include/cef_media_router.h" #include "libcef/browser/browser_context.h" -#include "chrome/common/media_router/mojom/media_router.mojom.h" +#include "components/media_router/common/mojom/media_router.mojom.h" class CefRegistrationImpl; diff --git a/libcef/browser/media_router/media_router_manager.cc b/libcef/browser/media_router/media_router_manager.cc index c1b703f50..e349f9d61 100644 --- a/libcef/browser/media_router/media_router_manager.cc +++ b/libcef/browser/media_router/media_router_manager.cc @@ -7,10 +7,10 @@ #include "libcef/browser/browser_context.h" #include "libcef/browser/thread_util.h" -#include "chrome/browser/media/router/media_router_factory.h" -#include "chrome/browser/media/router/media_routes_observer.h" -#include "chrome/browser/media/router/route_message_observer.h" -#include "chrome/browser/media/router/route_message_util.h" +#include "components/media_router/browser/media_router_factory.h" +#include "components/media_router/browser/media_routes_observer.h" +#include "components/media_router/browser/route_message_observer.h" +#include "components/media_router/browser/route_message_util.h" namespace { diff --git a/libcef/browser/media_router/media_router_manager.h b/libcef/browser/media_router/media_router_manager.h index 854db44ab..6116aef08 100644 --- a/libcef/browser/media_router/media_router_manager.h +++ b/libcef/browser/media_router/media_router_manager.h @@ -10,9 +10,9 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "chrome/browser/media/router/media_router.h" #include "chrome/browser/ui/media_router/query_result_manager.h" -#include "chrome/common/media_router/mojom/media_router.mojom.h" +#include "components/media_router/browser/media_router.h" +#include "components/media_router/common/mojom/media_router.mojom.h" namespace content { class BrowserContext; diff --git a/libcef/browser/media_router/media_sink_impl.cc b/libcef/browser/media_router/media_sink_impl.cc index ee284276c..385d192d7 100644 --- a/libcef/browser/media_router/media_sink_impl.cc +++ b/libcef/browser/media_router/media_sink_impl.cc @@ -9,8 +9,8 @@ #include "base/strings/string_number_conversions.h" #include "chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h" #include "chrome/browser/media/router/providers/cast/dual_media_sink_service.h" -#include "chrome/common/media_router/discovery/media_sink_internal.h" -#include "chrome/common/media_router/discovery/media_sink_service_base.h" +#include "components/media_router/common/discovery/media_sink_internal.h" +#include "components/media_router/common/discovery/media_sink_service_base.h" namespace { diff --git a/libcef/browser/media_router/media_sink_impl.h b/libcef/browser/media_router/media_sink_impl.h index cc91b84b0..70ce68cf3 100644 --- a/libcef/browser/media_router/media_sink_impl.h +++ b/libcef/browser/media_router/media_sink_impl.h @@ -8,7 +8,7 @@ #include "include/cef_media_router.h" -#include "chrome/common/media_router/media_sink.h" +#include "components/media_router/common/media_sink.h" // Implementation of the CefMediaSink interface. May be created on any thread. class CefMediaSinkImpl : public CefMediaSink { diff --git a/libcef/browser/media_router/media_source_impl.h b/libcef/browser/media_router/media_source_impl.h index 4f87f5ed0..eb8961952 100644 --- a/libcef/browser/media_router/media_source_impl.h +++ b/libcef/browser/media_router/media_source_impl.h @@ -8,7 +8,7 @@ #include "include/cef_media_router.h" -#include "chrome/common/media_router/media_source.h" +#include "components/media_router/common/media_source.h" // Implementation of the CefMediaSource interface. May be created on any thread. class CefMediaSourceImpl : public CefMediaSource { diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 29a9dd8d8..e9eedbc65 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -72,12 +72,20 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { #if defined(USE_X11) DCHECK(!window_x11_); + + x11::Window parent_window = x11::Window::None; + if (window_info_.parent_window != kNullWindowHandle) { + parent_window = static_cast(window_info_.parent_window); + } + // Create a new window object. It will delete itself when the associated X11 // window is destroyed. window_x11_ = - new CefWindowX11(browser_, window_info_.parent_window, rect, + new CefWindowX11(browser_, parent_window, rect, CefString(&window_info_.window_name).ToString()); - window_info_.window = window_x11_->xwindow(); + DCHECK_NE(window_x11_->xwindow(), x11::Window::None); + window_info_.window = + static_cast(window_x11_->xwindow()); host_window_created_ = true; diff --git a/libcef/browser/native/file_dialog_runner_win.cc b/libcef/browser/native/file_dialog_runner_win.cc index b36a2c9d9..eec07f332 100644 --- a/libcef/browser/native/file_dialog_runner_win.cc +++ b/libcef/browser/native/file_dialog_runner_win.cc @@ -92,9 +92,9 @@ std::wstring FormatFilterForExtensions( if (unique_exts.size() > 1) { std::wstring ext; auto it = unique_exts.cbegin(); - ext = it->as_string(); + ext = std::wstring(*it); for (++it; it != unique_exts.cend(); ++it) { - ext += L";" + it->as_string(); + ext += L";" + std::wstring(*it); } std::wstring desc = l10n_util::GetStringUTF16(IDS_CUSTOM_FILES) + L" (" + ext + L")"; diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index 241728336..538847c83 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -4,10 +4,6 @@ // found in the LICENSE file. #include "libcef/browser/native/window_x11.h" -#include -#include -#include -#include #include "libcef/browser/alloy/alloy_browser_host_impl.h" #include "libcef/browser/browser_host_base.h" @@ -16,73 +12,49 @@ #include "ui/base/x/x11_util.h" #include "ui/events/platform/platform_event_source.h" #include "ui/events/x/x11_event_translation.h" +#include "ui/events/x/x11_window_event_manager.h" +#include "ui/gfx/x/connection.h" +#include "ui/gfx/x/xproto_util.h" #include "ui/platform_window/x11/x11_topmost_window_finder.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" namespace { -// Restore Xlib constants that were #undef'ed by gen/ui/gfx/x/xproto.h. -constexpr int CopyFromParent = 0; -constexpr int InputOutput = 1; - const char kAtom[] = "ATOM"; -const char kWMDeleteWindow[] = "WM_DELETE_WINDOW"; -const char kWMProtocols[] = "WM_PROTOCOLS"; -const char kNetWMName[] = "_NET_WM_NAME"; const char kNetWMPid[] = "_NET_WM_PID"; const char kNetWMPing[] = "_NET_WM_PING"; const char kNetWMState[] = "_NET_WM_STATE"; +const char kNetWMStateKeepAbove[] = "_NET_WM_STATE_KEEP_ABOVE"; +const char kWMDeleteWindow[] = "WM_DELETE_WINDOW"; +const char kWMProtocols[] = "WM_PROTOCOLS"; const char kXdndProxy[] = "XdndProxy"; -const char kUTF8String[] = "UTF8_STRING"; -// See https://crbug.com/1066670#c57 for background. -inline x11::Window ToX11Window(::Window window) { - return static_cast(window); -} -inline ::Window ToWindow(x11::Window window) { - return static_cast<::Window>(window); -} - -// See https://crbug.com/1066670#c29 for background. -inline ::Atom GetAtom(const std::string& atom_name) { - return static_cast<::Atom>(gfx::GetAtom(atom_name)); -} - -::Window FindChild(::Display* display, ::Window window) { - ::Window root; - ::Window parent; - ::Window* children; - ::Window child_window = x11::None; - unsigned int nchildren; - if (XQueryTree(display, window, &root, &parent, &children, &nchildren) && - nchildren == 1) { - child_window = children[0]; - XFree(children); +x11::Window FindChild(x11::Window window) { + auto query_tree = x11::Connection::Get()->QueryTree({window}).Sync(); + if (query_tree && query_tree->children.size() == 1U) { + return query_tree->children[0]; } - return child_window; + + return x11::Window::None; } -::Window FindToplevelParent(::Display* display, ::Window window) { - ::Window top_level_window = window; - ::Window root = x11::None; - ::Window parent = x11::None; - ::Window* children = nullptr; - unsigned int nchildren = 0; - // Enumerate all parents of "window" to find the highest level window - // that either: - // - has a parent that does not contain the _NET_WM_PID property - // - has a parent that is the root window. - while (XQueryTree(display, window, &root, &parent, &children, &nchildren)) { - if (children) { - XFree(children); - } +x11::Window FindToplevelParent(x11::Window window) { + x11::Window top_level_window = window; + + do { + auto query_tree = x11::Connection::Get()->QueryTree({window}).Sync(); + if (!query_tree) + break; top_level_window = window; - if (!ui::PropertyExists(ToX11Window(parent), kNetWMPid) || parent == root) { + if (!ui::PropertyExists(query_tree->parent, kNetWMPid) || + query_tree->parent == query_tree->root) { break; } - window = parent; - } + + window = query_tree->parent; + } while (true); + return top_level_window; } @@ -95,85 +67,93 @@ CEF_EXPORT XDisplay* cef_get_xdisplay() { } CefWindowX11::CefWindowX11(CefRefPtr browser, - ::Window parent_xwindow, + x11::Window parent_xwindow, const gfx::Rect& bounds, const std::string& title) : browser_(browser), - xdisplay_(gfx::GetXDisplay()), + connection_(x11::Connection::Get()), parent_xwindow_(parent_xwindow), - xwindow_(0), - window_mapped_(false), bounds_(bounds), - focus_pending_(false), weak_ptr_factory_(this) { - if (parent_xwindow_ == x11::None) - parent_xwindow_ = DefaultRootWindow(xdisplay_); + if (parent_xwindow_ == x11::Window::None) + parent_xwindow_ = ui::GetX11RootWindow(); - XSetWindowAttributes swa; - memset(&swa, 0, sizeof(swa)); - swa.background_pixmap = x11::None; - swa.override_redirect = false; - xwindow_ = XCreateWindow(xdisplay_, parent_xwindow_, bounds.x(), bounds.y(), - bounds.width(), bounds.height(), - 0, // border width - CopyFromParent, // depth - InputOutput, - nullptr, // visual - CWBackPixmap | CWOverrideRedirect, &swa); - CHECK(xwindow_); + x11::VisualId visual; + uint8_t depth; + x11::ColorMap colormap; + ui::XVisualManager::GetInstance()->ChooseVisualForWindow( + /*want_argb_visual=*/false, &visual, &depth, &colormap, + /*visual_has_alpha=*/nullptr); + + xwindow_ = connection_->GenerateId(); + connection_->CreateWindow({ + .depth = depth, + .wid = xwindow_, + .parent = parent_xwindow_, + .x = bounds.x(), + .y = bounds.y(), + .width = bounds.width(), + .height = bounds.height(), + .c_class = x11::WindowClass::InputOutput, + .visual = visual, + .background_pixel = 0, + .border_pixel = 0, + .override_redirect = x11::Bool32(false), + .event_mask = x11::EventMask::FocusChange | + x11::EventMask::StructureNotify | + x11::EventMask::PropertyChange, + .colormap = colormap, + }); + + connection_->Flush(); DCHECK(ui::X11EventSource::HasInstance()); ui::X11EventSource::GetInstance()->AddXEventDispatcher(this); - long event_mask = FocusChangeMask | StructureNotifyMask | PropertyChangeMask; - XSelectInput(xdisplay_, xwindow_, event_mask); - XFlush(xdisplay_); + std::vector protocols = { + gfx::GetAtom(kWMDeleteWindow), + gfx::GetAtom(kNetWMPing), + }; + ui::SetArrayProperty(xwindow_, gfx::GetAtom(kWMProtocols), x11::Atom::ATOM, + protocols); - // TODO(erg): We currently only request window deletion events. We also - // should listen for activation events and anything else that GTK+ listens - // for, and do something useful. - ::Atom protocols[2]; - protocols[0] = GetAtom(kWMDeleteWindow); - protocols[1] = GetAtom(kNetWMPing); - XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); - - // We need a WM_CLIENT_MACHINE and WM_LOCALE_NAME value so we integrate with - // the desktop environment. - XSetWMProperties(xdisplay_, xwindow_, NULL, NULL, NULL, 0, NULL, NULL, NULL); + // We need a WM_CLIENT_MACHINE value so we integrate with the desktop + // environment. + ui::SetStringProperty(xwindow_, x11::Atom::WM_CLIENT_MACHINE, + x11::Atom::STRING, net::GetHostName()); // Likewise, the X server needs to know this window's pid so it knows which // program to kill if the window hangs. // XChangeProperty() expects "pid" to be long. - static_assert(sizeof(long) >= sizeof(pid_t), - "pid_t should not be larger than long"); - long pid = getpid(); - XChangeProperty(xdisplay_, xwindow_, GetAtom(kNetWMPid), XA_CARDINAL, 32, - PropModeReplace, reinterpret_cast(&pid), 1); + static_assert(sizeof(uint32_t) >= sizeof(pid_t), + "pid_t should not be larger than uint32_t"); + uint32_t pid = getpid(); + ui::SetProperty(xwindow_, gfx::GetAtom(kNetWMPid), x11::Atom::CARDINAL, pid); // Set the initial window name, if provided. if (!title.empty()) { - XChangeProperty(xdisplay_, xwindow_, GetAtom(kNetWMName), - GetAtom(kUTF8String), 8, PropModeReplace, - reinterpret_cast(title.c_str()), - title.size()); + ui::SetStringProperty(xwindow_, x11::Atom::WM_NAME, x11::Atom::STRING, + title); + ui::SetStringProperty(xwindow_, x11::Atom::WM_ICON_NAME, x11::Atom::STRING, + title); } } CefWindowX11::~CefWindowX11() { - DCHECK(!xwindow_); + DCHECK_EQ(xwindow_, x11::Window::None); DCHECK(ui::X11EventSource::HasInstance()); ui::X11EventSource::GetInstance()->RemoveXEventDispatcher(this); } void CefWindowX11::Close() { - XEvent ev = {0}; - ev.xclient.type = ClientMessage; - ev.xclient.window = xwindow_; - ev.xclient.message_type = GetAtom(kWMProtocols); - ev.xclient.format = 32; - ev.xclient.data.l[0] = GetAtom(kWMDeleteWindow); - ev.xclient.data.l[1] = x11::CurrentTime; - XSendEvent(xdisplay_, xwindow_, false, NoEventMask, &ev); + if (xwindow_ == x11::Window::None) + return; + + ui::SendClientMessage( + xwindow_, xwindow_, gfx::GetAtom(kWMProtocols), + {static_cast(gfx::GetAtom(kWMDeleteWindow)), + static_cast(x11::Time::CurrentTime), 0, 0, 0}, + x11::EventMask::NoEvent); auto host = GetHost(); if (host) @@ -181,120 +161,122 @@ void CefWindowX11::Close() { } void CefWindowX11::Show() { - if (xwindow_ == x11::None) + if (xwindow_ == x11::Window::None) return; if (!window_mapped_) { // Before we map the window, set size hints. Otherwise, some window managers // will ignore toplevel XMoveWindow commands. - XSizeHints size_hints; - size_hints.flags = PPosition | PWinGravity; + ui::SizeHints size_hints; + memset(&size_hints, 0, sizeof(size_hints)); + ui::GetWmNormalHints(xwindow_, &size_hints); + size_hints.flags |= ui::SIZE_HINT_P_POSITION; size_hints.x = bounds_.x(); size_hints.y = bounds_.y(); - // Set StaticGravity so that the window position is not affected by the - // frame width when running with window manager. - size_hints.win_gravity = StaticGravity; - XSetWMNormalHints(xdisplay_, xwindow_, &size_hints); + ui::SetWmNormalHints(xwindow_, size_hints); - XMapWindow(xdisplay_, xwindow_); + connection_->MapWindow({xwindow_}); // TODO(thomasanderson): Find out why this flush is necessary. - XFlush(xdisplay_); + connection_->Flush(); window_mapped_ = true; // Setup the drag and drop proxy on the top level window of the application // to be the child of this window. - ::Window child = FindChild(xdisplay_, xwindow_); - ::Window toplevel_window = FindToplevelParent(xdisplay_, xwindow_); - DCHECK(toplevel_window); - if (child && toplevel_window) { + auto child = FindChild(xwindow_); + auto toplevel_window = FindToplevelParent(xwindow_); + DCHECK_NE(toplevel_window, x11::Window::None); + if (child != x11::Window::None && toplevel_window != x11::Window::None) { // Configure the drag&drop proxy property for the top-most window so // that all drag&drop-related messages will be sent to the child // DesktopWindowTreeHostLinux. The proxy property is referenced by // DesktopDragDropClientAuraX11::FindWindowFor. x11::Window window = x11::Window::None; - ui::GetProperty(ToX11Window(toplevel_window), gfx::GetAtom(kXdndProxy), - &window); - ::Window proxy_target = ToWindow(window); + auto dndproxy_atom = gfx::GetAtom(kXdndProxy); + ui::GetProperty(toplevel_window, dndproxy_atom, &window); - if (proxy_target != child) { + if (window != child) { // Set the proxy target for the top-most window. - XChangeProperty(xdisplay_, toplevel_window, GetAtom(kXdndProxy), - XA_WINDOW, 32, PropModeReplace, - reinterpret_cast(&child), 1); + ui::SetProperty(toplevel_window, dndproxy_atom, x11::Atom::WINDOW, + child); // Do the same for the proxy target per the spec. - XChangeProperty(xdisplay_, child, GetAtom(kXdndProxy), XA_WINDOW, 32, - PropModeReplace, - reinterpret_cast(&child), 1); + ui::SetProperty(child, dndproxy_atom, x11::Atom::WINDOW, child); } } } } void CefWindowX11::Hide() { - if (xwindow_ == x11::None) + if (xwindow_ == x11::Window::None) return; if (window_mapped_) { - XWithdrawWindow(xdisplay_, xwindow_, 0); + ui::WithdrawWindow(xwindow_); window_mapped_ = false; } } void CefWindowX11::Focus() { - if (xwindow_ == x11::None || !window_mapped_) + if (xwindow_ == x11::Window::None || !window_mapped_) return; + x11::Window focus_target = xwindow_; + if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child && ui::IsWindowVisible(ToX11Window(child))) { + auto child = FindChild(xwindow_); + if (child != x11::Window::None && ui::IsWindowVisible(child)) { // Give focus to the child DesktopWindowTreeHostLinux. - XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime); + focus_target = child; } - } else { - XSetInputFocus(xdisplay_, xwindow_, RevertToParent, x11::CurrentTime); } + + // Directly ask the X server to give focus to the window. Note that the call + // would have raised an X error if the window is not mapped. + connection_ + ->SetInputFocus( + {x11::InputFocus::Parent, focus_target, x11::Time::CurrentTime}) + .IgnoreError(); } void CefWindowX11::SetBounds(const gfx::Rect& bounds) { - if (xwindow_ == x11::None) + if (xwindow_ == x11::Window::None) return; + x11::ConfigureWindowRequest req{.window = xwindow_}; + bool origin_changed = bounds_.origin() != bounds.origin(); bool size_changed = bounds_.size() != bounds.size(); - XWindowChanges changes = {0}; - unsigned value_mask = 0; if (size_changed) { - changes.width = bounds.width(); - changes.height = bounds.height(); - value_mask = CWHeight | CWWidth; + req.width = bounds.width(); + req.height = bounds.height(); } if (origin_changed) { - changes.x = bounds.x(); - changes.y = bounds.y(); - value_mask |= CWX | CWY; + req.x = bounds.x(); + req.y = bounds.y(); } - if (value_mask) - XConfigureWindow(xdisplay_, xwindow_, value_mask, &changes); + if (origin_changed || size_changed) { + connection_->ConfigureWindow(req); + } } gfx::Rect CefWindowX11::GetBoundsInScreen() { - int x, y; - Window child; - if (XTranslateCoordinates(xdisplay_, xwindow_, DefaultRootWindow(xdisplay_), - 0, 0, &x, &y, &child)) { - return gfx::Rect(gfx::Point(x, y), bounds_.size()); + if (auto coords = + connection_ + ->TranslateCoordinates({xwindow_, ui::GetX11RootWindow(), 0, 0}) + .Sync()) { + return gfx::Rect(gfx::Point(coords->dst_x, coords->dst_y), bounds_.size()); } + return gfx::Rect(); } views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() { if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child) { + auto child = FindChild(xwindow_); + if (child != x11::Window::None) { return static_cast( views::DesktopWindowTreeHostLinux::GetHostForWidget( static_cast(child))); @@ -304,12 +286,12 @@ views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() { } bool CefWindowX11::CanDispatchEvent(const ui::PlatformEvent& event) { - DCHECK_NE(xwindow_, x11::None); + DCHECK_NE(xwindow_, x11::Window::None); return !!current_xevent_; } uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { - DCHECK_NE(xwindow_, x11::None); + DCHECK_NE(xwindow_, x11::Window::None); DCHECK(event); DCHECK(current_xevent_); @@ -347,44 +329,27 @@ void CefWindowX11::ContinueFocus() { } bool CefWindowX11::TopLevelAlwaysOnTop() const { - ::Window toplevel_window = FindToplevelParent(xdisplay_, xwindow_); + auto toplevel_window = FindToplevelParent(xwindow_); + if (toplevel_window == x11::Window::None) + return false; - Atom state_atom = GetAtom("_NET_WM_STATE"); - Atom state_keep_above = GetAtom("_NET_WM_STATE_KEEP_ABOVE"); - Atom* states; - - Atom actual_type; - int actual_format; - unsigned long num_items; - unsigned long bytes_after; - - XGetWindowProperty(xdisplay_, toplevel_window, state_atom, 0, 1024, - x11::False, XA_ATOM, &actual_type, &actual_format, - &num_items, &bytes_after, - reinterpret_cast(&states)); - - bool always_on_top = false; - - for (unsigned long i = 0; i < num_items; ++i) { - if (states[i] == state_keep_above) { - always_on_top = true; - break; - } + std::vector wm_states; + if (ui::GetAtomArrayProperty(toplevel_window, kNetWMState, &wm_states)) { + x11::Atom keep_above_atom = gfx::GetAtom(kNetWMStateKeepAbove); + if (base::Contains(wm_states, keep_above_atom)) + return true; } - - XFree(states); - - return always_on_top; + return false; } bool CefWindowX11::IsTargetedBy(const x11::Event& x11_event) const { - return ToWindow(x11_event.window()) == xwindow_; + return x11_event.window() == xwindow_; } void CefWindowX11::ProcessXEvent(x11::Event* event) { if (auto* configure = event->As()) { - DCHECK_EQ(xwindow_, ToWindow(configure->event)); - DCHECK_EQ(xwindow_, ToWindow(configure->window)); + DCHECK_EQ(xwindow_, configure->event); + DCHECK_EQ(xwindow_, configure->window); // It's possible that the X window may be resized by some other means // than from within Aura (e.g. the X window manager can change the // size). Make sure the root window size is maintained properly. @@ -392,13 +357,15 @@ void CefWindowX11::ProcessXEvent(x11::Event* event) { configure->height); if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child) { + auto child = FindChild(xwindow_); + if (child != x11::Window::None) { // Resize the child DesktopWindowTreeHostLinux to match this window. - XWindowChanges changes = {0}; - changes.width = bounds_.width(); - changes.height = bounds_.height(); - XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes); + x11::ConfigureWindowRequest req{ + .window = child, + .width = bounds_.width(), + .height = bounds_.height(), + }; + connection_->ConfigureWindow(req); browser_->NotifyMoveOrResizeStarted(); } @@ -410,9 +377,8 @@ void CefWindowX11::ProcessXEvent(x11::Event* event) { // We have received a close message from the window manager. if (!browser_ || browser_->TryCloseBrowser()) { // Allow the close. - XDestroyWindow(xdisplay_, xwindow_); - - xwindow_ = x11::None; + connection_->DestroyWindow({xwindow_}); + xwindow_ = x11::Window::None; if (browser_) { // Force the browser to be destroyed and release the reference @@ -425,10 +391,10 @@ void CefWindowX11::ProcessXEvent(x11::Event* event) { } } else if (protocol == gfx::GetAtom(kNetWMPing)) { x11::ClientMessageEvent reply_event = *client; - reply_event.window = ToX11Window(parent_xwindow_); - ui::SendEvent(reply_event, reply_event.window, - x11::EventMask::SubstructureNotify | - x11::EventMask::SubstructureRedirect); + reply_event.window = parent_xwindow_; + x11::SendEvent(reply_event, reply_event.window, + x11::EventMask::SubstructureNotify | + x11::EventMask::SubstructureRedirect); } } } else if (auto* focus = event->As()) { @@ -456,27 +422,14 @@ void CefWindowX11::ProcessXEvent(x11::Event* event) { if (property->atom == gfx::GetAtom(kNetWMState)) { // State change event like minimize/maximize. if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child) { + auto child = FindChild(xwindow_); + if (child != x11::Window::None) { // Forward the state change to the child DesktopWindowTreeHostLinux // window so that resource usage will be reduced while the window is - // minimized. + // minimized. |atom_list| may be empty. std::vector atom_list; - if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState, - &atom_list) && - !atom_list.empty()) { - ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM", - atom_list); - } else { - // Set an empty list of property values to pass the check in - // DesktopWindowTreeHostLinux::OnWMStateUpdated(). - XChangeProperty(xdisplay_, child, - GetAtom(kNetWMState), // name - GetAtom(kAtom), // type - 32, // size in bits of items in 'value' - PropModeReplace, NULL, - 0); // num items - } + ui::GetAtomArrayProperty(xwindow_, kNetWMState, &atom_list); + ui::SetAtomArrayProperty(child, kNetWMState, kAtom, atom_list); } } } diff --git a/libcef/browser/native/window_x11.h b/libcef/browser/native/window_x11.h index 559e27804..d9d89652a 100644 --- a/libcef/browser/native/window_x11.h +++ b/libcef/browser/native/window_x11.h @@ -7,10 +7,7 @@ #define CEF_LIBCEF_BROWSER_NATIVE_WINDOW_X11_H_ #pragma once -// Avoid including -typedef unsigned long Window; -struct _XDisplay; -typedef struct _XDisplay Display; +#include #include "include/internal/cef_ptr.h" @@ -19,6 +16,11 @@ typedef struct _XDisplay Display; #include "ui/events/platform/x11/x11_event_source.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/x/x11_atom_cache.h" +#include "ui/gfx/x/x11_types.h" + +namespace ui { +class XScopedEventSelector; +} namespace views { class DesktopWindowTreeHostLinux; @@ -32,7 +34,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, public ui::XEventDispatcher { public: CefWindowX11(CefRefPtr browser, - ::Window parent_xwindow, + x11::Window parent_xwindow, const gfx::Rect& bounds, const std::string& title); ~CefWindowX11() override; @@ -60,7 +62,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, ui::PlatformEventDispatcher* GetPlatformEventDispatcher() override; bool DispatchXEvent(x11::Event* x11_event) override; - ::Window xwindow() const { return xwindow_; } + x11::Window xwindow() const { return xwindow_; } gfx::Rect bounds() const { return bounds_; } bool TopLevelAlwaysOnTop() const; @@ -74,17 +76,20 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, CefRefPtr browser_; // The display and the native X window hosting the root window. - ::Display* xdisplay_; - ::Window parent_xwindow_; - ::Window xwindow_; + x11::Connection* const connection_; + x11::Window parent_xwindow_; + x11::Window xwindow_; + + // Events selected on |xwindow_|. + std::unique_ptr xwindow_events_; // Is the window mapped to the screen? - bool window_mapped_; + bool window_mapped_ = false; // The bounds of |xwindow_|. gfx::Rect bounds_; - bool focus_pending_; + bool focus_pending_ = false; // Tells if this dispatcher can process next translated event based on a // previous check in ::CheckCanDispatchNextPlatformEvent based on a XID diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index ba745563d..33fdce0dc 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -34,7 +34,7 @@ #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" #include "chrome/browser/ui/webui/theme_source.h" #include "chrome/common/url_constants.h" -#include "content/browser/frame_host/debug_urls.h" +#include "content/browser/renderer_host/debug_urls.h" #include "content/browser/webui/content_web_ui_controller_factory.h" #include "content/public/browser/browser_url_handler.h" #include "content/public/browser/content_browser_client.h" diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index b6e33dc45..c3ae94ebc 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -42,16 +42,6 @@ base::Optional GetHeaderString( return header_value; } -bool IsOutOfBlinkCorsEnabled() { - static int state = -1; - if (state == -1) { - state = base::FeatureList::IsEnabled(network::features::kOutOfBlinkCors) - ? 1 - : 0; - } - return !!state; -} - void CreateProxyHelper( content::WebContents::Getter web_contents_getter, mojo::PendingReceiver loader_receiver, @@ -439,7 +429,7 @@ void InterceptedRequest::Restart() { current_request_uses_header_client_ = !!factory_->url_loader_header_client_receiver_; - if (IsOutOfBlinkCorsEnabled() && request_.request_initiator && + if (request_.request_initiator && network::cors::ShouldCheckCors(request_.url, request_.request_initiator, request_.mode)) { if (scheme::IsCorsEnabledScheme(request_.url.scheme())) { @@ -1010,8 +1000,7 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) { // CORS check for requests that are handled by the client. Requests handled // by the network process will be checked there. - if (IsOutOfBlinkCorsEnabled() && stream_loader_ && !is_redirect && - request_.request_initiator && + if (stream_loader_ && !is_redirect && request_.request_initiator && network::cors::ShouldCheckCors(request_.url, request_.request_initiator, request_.mode)) { const auto error_status = network::cors::CheckAccess( diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index 8fff1a6b8..5da78b784 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -10,7 +10,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "content/browser/devtools/devtools_instrumentation.h" -#include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/content_client.h" @@ -65,7 +65,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 */, + url::Origin(), base::nullopt /* navigation_id */, base::UkmSourceId(), &maybe_proxy_factory_request, nullptr /* header_client */, nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, nullptr /* factory_override */); diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index c7293666c..aaaf180fe 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -312,8 +312,8 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter( base::AutoLock lock_scope(data_impl->lock()); content::DropData* drop_data = data_impl->drop_data(); const gfx::Point& screen_pt = GetScreenPoint(client_pt); - blink::WebDragOperationsMask ops = - static_cast(allowed_ops); + blink::DragOperationsMask ops = + static_cast(allowed_ops); int modifiers = TranslateWebEventModifiers(event.modifiers); current_rwh_for_drag_->FilterDropData(drop_data); @@ -376,8 +376,8 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragOver( if (!drag_data_) return; - blink::WebDragOperationsMask ops = - static_cast(allowed_ops); + blink::DragOperationsMask ops = + static_cast(allowed_ops); int modifiers = TranslateWebEventModifiers(event.modifiers); target_rwh->DragTargetDragOver(transformed_pt, gfx::PointF(screen_pt), ops, @@ -459,10 +459,10 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) { void CefBrowserPlatformDelegateOsr::StartDragging( const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) { drag_start_rwh_ = source_rwh->GetWeakPtr(); @@ -480,7 +480,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging( handled = handler->StartDragging( browser_, drag_data.get(), static_cast(allowed_ops), - event_info.event_location.x(), event_info.event_location.y()); + event_info.location.x(), event_info.location.y()); } if (!handled) @@ -488,7 +488,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging( } void CefBrowserPlatformDelegateOsr::UpdateDragCursor( - blink::WebDragOperation operation) { + blink::DragOperation operation) { CefRefPtr handler = browser_->GetClient()->GetRenderHandler(); if (handler.get()) { @@ -512,7 +512,7 @@ void CefBrowserPlatformDelegateOsr::DragSourceEndedAt( content::RenderWidgetHostImpl* source_rwh = drag_start_rwh_.get(); const gfx::Point client_loc(gfx::Point(x, y)); const gfx::Point& screen_loc = GetScreenPoint(client_loc); - blink::WebDragOperation drag_op = static_cast(op); + blink::DragOperation drag_op = static_cast(op); // |client_loc| and |screen_loc| are in the root coordinate space, for // non-root RenderWidgetHosts they need to be transformed. diff --git a/libcef/browser/osr/browser_platform_delegate_osr.h b/libcef/browser/osr/browser_platform_delegate_osr.h index c6ff9d79c..34a5ff1c4 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.h +++ b/libcef/browser/osr/browser_platform_delegate_osr.h @@ -76,12 +76,12 @@ class CefBrowserPlatformDelegateOsr void DragTargetDragLeave() override; void DragTargetDrop(const CefMouseEvent& event) override; void StartDragging(const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) override; - void UpdateDragCursor(blink::WebDragOperation operation) override; + void UpdateDragCursor(blink::DragOperation operation) override; void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op) override; void DragSourceSystemDragEnded() override; void AccessibilityEventReceived( diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 60818319e..e080eb017 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -54,11 +54,6 @@ #include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/size_conversions.h" -#if defined(USE_X11) -#include "ui/base/x/x11_cursor_loader.h" -#include "ui/base/x/x11_util.h" -#endif - namespace { // The maximum number of damage rects to cache for outstanding frame requests @@ -193,18 +188,6 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle( return ui::ImeTextSpan::UnderlineStyle::kSolid; } -#if defined(USE_AURA) -CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) { -#if defined(USE_X11) - // See https://crbug.com/1029142 for background. - return static_cast( - static_cast(cursor)->xcursor()); -#else - return cursor; -#endif -} -#endif // defined(USE_AURA) - } // namespace CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( @@ -378,25 +361,30 @@ void CefRenderWidgetHostViewOSR::Show() { is_showing_ = true; - // If the viz::LocalSurfaceIdAllocation is invalid, we may have been evicted, + // If the viz::LocalSurfaceId is invalid, we may have been evicted, // and no other visual properties have since been changed. Allocate a new id // and start synchronizing. - if (!GetLocalSurfaceIdAllocation().IsValid()) { + if (!GetLocalSurfaceId().is_valid()) { AllocateLocalSurfaceId(); SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(), - GetLocalSurfaceIdAllocation()); + GetLocalSurfaceId()); } if (render_widget_host_) { render_widget_host_->WasShown( - base::nullopt /* record_tab_switch_time_request */); + /*record_tab_switch_time_request=*/{}); + + // Call OnRenderFrameMetadataChangedAfterActivation for every frame. + auto provider = content::RenderWidgetHostImpl::From(render_widget_host_) + ->render_frame_metadata_provider(); + provider->AddObserver(this); + provider->ReportAllFrameSubmissionsForTesting(true); } if (delegated_frame_host_) { delegated_frame_host_->AttachToCompositor(compositor_.get()); - delegated_frame_host_->WasShown( - GetLocalSurfaceIdAllocation().local_surface_id(), - GetViewBounds().size(), base::nullopt); + delegated_frame_host_->WasShown(GetLocalSurfaceId(), GetViewBounds().size(), + /*record_tab_switch_time_request=*/{}); } if (!content::GpuDataManagerImpl::GetInstance()->IsGpuCompositingDisabled()) { @@ -408,14 +396,6 @@ void CefRenderWidgetHostViewOSR::Show() { video_consumer_->SetActive(true); } } - - if (render_widget_host_) { - // Call OnRenderFrameMetadataChangedAfterActivation for every frame. - content::RenderFrameMetadataProviderImpl* provider = - content::RenderWidgetHostImpl::From(render_widget_host_) - ->render_frame_metadata_provider(); - provider->ReportAllFrameSubmissionsForTesting(true); - } } void CefRenderWidgetHostViewOSR::Hide() { @@ -431,9 +411,14 @@ void CefRenderWidgetHostViewOSR::Hide() { video_consumer_->SetActive(false); } - if (render_widget_host_) + if (render_widget_host_) { render_widget_host_->WasHidden(); + auto provider = content::RenderWidgetHostImpl::From(render_widget_host_) + ->render_frame_metadata_provider(); + provider->RemoveObserver(this); + } + if (delegated_frame_host_) { delegated_frame_host_->WasHidden( content::DelegatedFrameHost::HiddenCause::kOther); @@ -509,11 +494,10 @@ void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete( // viz::LocalSurfaceId. However we do not want to embed surfaces while // hidden. Nor do we want to embed invalid ids when we are evicted. Becoming // visible will generate a new id, if necessary, and begin embedding. - UpdateLocalSurfaceIdFromEmbeddedClient( - metadata.local_surface_id_allocation); + UpdateLocalSurfaceIdFromEmbeddedClient(metadata.local_surface_id); } else { SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(), - metadata.local_surface_id_allocation); + metadata.local_surface_id); } } @@ -525,28 +509,27 @@ void CefRenderWidgetHostViewOSR::AllocateLocalSurfaceId() { parent_local_surface_id_allocator_->GenerateId(); } -const viz::LocalSurfaceIdAllocation& -CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceIdAllocation() const { - return parent_local_surface_id_allocator_ - ->GetCurrentLocalSurfaceIdAllocation(); +const viz::LocalSurfaceId& +CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceId() const { + return parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId(); } void CefRenderWidgetHostViewOSR::UpdateLocalSurfaceIdFromEmbeddedClient( - const base::Optional& - embedded_client_local_surface_id_allocation) { - if (embedded_client_local_surface_id_allocation) { + const base::Optional& + embedded_client_local_surface_id) { + if (embedded_client_local_surface_id) { parent_local_surface_id_allocator_->UpdateFromChild( - *embedded_client_local_surface_id_allocation); + *embedded_client_local_surface_id); } else { AllocateLocalSurfaceId(); } } -const viz::LocalSurfaceIdAllocation& -CefRenderWidgetHostViewOSR::GetOrCreateLocalSurfaceIdAllocation() { +const viz::LocalSurfaceId& +CefRenderWidgetHostViewOSR::GetOrCreateLocalSurfaceId() { if (!parent_local_surface_id_allocator_) AllocateLocalSurfaceId(); - return GetCurrentLocalSurfaceIdAllocation(); + return GetCurrentLocalSurfaceId(); } void CefRenderWidgetHostViewOSR::InvalidateLocalSurfaceId() { @@ -909,10 +892,10 @@ void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text, cef_range); } -const viz::LocalSurfaceIdAllocation& -CefRenderWidgetHostViewOSR::GetLocalSurfaceIdAllocation() const { +const viz::LocalSurfaceId& CefRenderWidgetHostViewOSR::GetLocalSurfaceId() + const { return const_cast(this) - ->GetOrCreateLocalSurfaceIdAllocation(); + ->GetOrCreateLocalSurfaceId(); } const viz::FrameSinkId& CefRenderWidgetHostViewOSR::GetFrameSinkId() const { @@ -925,38 +908,6 @@ viz::FrameSinkId CefRenderWidgetHostViewOSR::GetRootFrameSinkId() { return compositor_ ? compositor_->frame_sink_id() : viz::FrameSinkId(); } -void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation() { - auto metadata = - host_->render_frame_metadata_provider()->LastRenderFrameMetadata(); - - if (video_consumer_) { - // Need to wait for the first frame of the new size before calling - // SizeChanged. Otherwise, the video frame will be letterboxed. - video_consumer_->SizeChanged(metadata.viewport_size_in_pixels); - } - - gfx::Vector2dF root_scroll_offset; - if (metadata.root_scroll_offset) { - root_scroll_offset = *metadata.root_scroll_offset; - } - if (root_scroll_offset != last_scroll_offset_) { - last_scroll_offset_ = root_scroll_offset; - - if (!is_scroll_offset_changed_pending_) { - is_scroll_offset_changed_pending_ = true; - - // Send the notification asynchronously. - CEF_POST_TASK( - CEF_UIT, - base::Bind(&CefRenderWidgetHostViewOSR::OnScrollOffsetChanged, - weak_ptr_factory_.GetWeakPtr())); - } - } - - content::RenderWidgetHostViewBase:: - OnRenderFrameMetadataChangedAfterActivation(); -} - std::unique_ptr CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() { return std::make_unique(host()); @@ -986,7 +937,7 @@ void CefRenderWidgetHostViewOSR::DidNavigate() { // The first navigation does not need a new LocalSurfaceID. The renderer // can use the ID that was already provided. SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), - GetLocalSurfaceIdAllocation()); + GetLocalSurfaceId()); } else { SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), base::nullopt); @@ -1002,6 +953,35 @@ void CefRenderWidgetHostViewOSR::OnFrameComplete( // TODO(cef): is there something we need to track with this notification? } +void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation() { + auto metadata = + host_->render_frame_metadata_provider()->LastRenderFrameMetadata(); + + if (video_consumer_) { + // Need to wait for the first frame of the new size before calling + // SizeChanged. Otherwise, the video frame will be letterboxed. + video_consumer_->SizeChanged(metadata.viewport_size_in_pixels); + } + + gfx::Vector2dF root_scroll_offset; + if (metadata.root_scroll_offset) { + root_scroll_offset = *metadata.root_scroll_offset; + } + if (root_scroll_offset != last_scroll_offset_) { + last_scroll_offset_ = root_scroll_offset; + + if (!is_scroll_offset_changed_pending_) { + is_scroll_offset_changed_pending_ = true; + + // Send the notification asynchronously. + CEF_POST_TASK( + CEF_UIT, + base::Bind(&CefRenderWidgetHostViewOSR::OnScrollOffsetChanged, + weak_ptr_factory_.GetWeakPtr())); + } + } +} + std::unique_ptr CefRenderWidgetHostViewOSR::CreateHostDisplayClient() { host_display_client_ = @@ -1035,31 +1015,29 @@ void CefRenderWidgetHostViewOSR::WasResized() { void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const base::Optional& - child_local_surface_id_allocation) { + const base::Optional& child_local_surface_id) { SetFrameRate(); const bool resized = ResizeRootLayer(); bool surface_id_updated = false; - if (!resized && child_local_surface_id_allocation) { + if (!resized && child_local_surface_id) { // Update the current surface ID. parent_local_surface_id_allocator_->UpdateFromChild( - *child_local_surface_id_allocation); + *child_local_surface_id); surface_id_updated = true; } // Allocate a new surface ID if the surface has been resized or if the current // ID is invalid (meaning we may have been evicted). - if (resized || !GetCurrentLocalSurfaceIdAllocation().IsValid()) { + if (resized || !GetCurrentLocalSurfaceId().is_valid()) { AllocateLocalSurfaceId(); surface_id_updated = true; } if (surface_id_updated) { delegated_frame_host_->EmbedSurface( - GetCurrentLocalSurfaceIdAllocation().local_surface_id(), - GetViewBounds().size(), deadline_policy); + GetCurrentLocalSurfaceId(), GetViewBounds().size(), deadline_policy); // |render_widget_host_| will retrieve resize parameters from the // DelegatedFrameHost and this view, so SynchronizeVisualProperties must be @@ -1595,9 +1573,9 @@ bool CefRenderWidgetHostViewOSR::SetRootLayerSize(bool force) { if (compositor_) { compositor_local_surface_id_allocator_.GenerateId(); - compositor_->SetScaleAndSize(current_device_scale_factor_, SizeInPixels(), - compositor_local_surface_id_allocator_ - .GetCurrentLocalSurfaceIdAllocation()); + compositor_->SetScaleAndSize( + current_device_scale_factor_, SizeInPixels(), + compositor_local_surface_id_allocator_.GetCurrentLocalSurfaceId()); } return (scale_factor_changed || view_bounds_changed); diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index ac4039378..d5221a14f 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -27,6 +27,7 @@ #include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #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 "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/compositor/compositor.h" @@ -64,10 +65,6 @@ class CefVideoConsumerOSR; class CefWebContentsViewOSR; #if defined(USE_X11) -namespace ui { -class X11Cursor; -class XCursorLoader; -} // namespace ui class CefWindowX11; #endif @@ -93,10 +90,12 @@ class CefWindowX11; class MacHelper; #endif -class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, - public ui::CompositorDelegate, - public content::TextInputManager::Observer, - public ui::GestureProviderClient { +class CefRenderWidgetHostViewOSR + : public content::RenderWidgetHostViewBase, + public content::RenderFrameMetadataProvider::Observer, + public ui::CompositorDelegate, + public content::TextInputManager::Observer, + public ui::GestureProviderClient { public: CefRenderWidgetHostViewOSR(SkColor background_color, bool use_shared_texture, @@ -180,14 +179,20 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void SelectionChanged(const base::string16& text, size_t offset, const gfx::Range& range) override; - const viz::LocalSurfaceIdAllocation& GetLocalSurfaceIdAllocation() - const override; + const viz::LocalSurfaceId& GetLocalSurfaceId() const override; const viz::FrameSinkId& GetFrameSinkId() const override; viz::FrameSinkId GetRootFrameSinkId() override; - void OnRenderFrameMetadataChangedAfterActivation() override; void OnFrameComplete(const viz::BeginFrameAck& ack); + // RenderFrameMetadataProvider::Observer implementation. + void OnRenderFrameMetadataChangedBeforeActivation( + const cc::RenderFrameMetadata& metadata) override {} + void OnRenderFrameMetadataChangedAfterActivation() override; + void OnRenderFrameSubmission() override {} + void OnLocalSurfaceIdChanged( + const cc::RenderFrameMetadata& metadata) override {} + // ui::CompositorDelegate implementation. std::unique_ptr CreateHostDisplayClient() override; @@ -208,8 +213,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void WasResized(); void SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const base::Optional& - child_local_surface_id_allocation); + const base::Optional& child_local_surface_id); void OnScreenInfoChanged(); void Invalidate(CefBrowserHost::PaintElementType type); void SendExternalBeginFrame(); @@ -303,18 +307,16 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, // CompositorFrame submission in anticipation of a synchronization operation // that does not involve a resize or a device scale factor change. void AllocateLocalSurfaceId(); - const viz::LocalSurfaceIdAllocation& GetCurrentLocalSurfaceIdAllocation() - const; + const viz::LocalSurfaceId& GetCurrentLocalSurfaceId() const; // Sets the current viz::LocalSurfaceId, in cases where the embedded client // has allocated one. Also sets child sequence number component of the // viz::LocalSurfaceId allocator. void UpdateLocalSurfaceIdFromEmbeddedClient( - const base::Optional& - local_surface_id_allocation); + const base::Optional& local_surface_id); // Returns the current viz::LocalSurfaceIdAllocation. - const viz::LocalSurfaceIdAllocation& GetOrCreateLocalSurfaceIdAllocation(); + const viz::LocalSurfaceId& GetOrCreateLocalSurfaceId(); // Marks the current viz::LocalSurfaceId as invalid. AllocateLocalSurfaceId // must be called before submitting new CompositorFrames. @@ -328,6 +330,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, #if defined(USE_AURA) CefCursorHandle GetPlatformCursor(ui::mojom::CursorType type); + CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor); #endif // The background color of the web content. @@ -346,11 +349,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, parent_local_surface_id_allocator_; viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_; -#if defined(USE_X11) - std::unique_ptr cursor_loader_; - scoped_refptr invisible_cursor_; -#endif - std::unique_ptr cursor_manager_; // Provides |source_id| for BeginFrameArgs that we create. diff --git a/libcef/browser/osr/render_widget_host_view_osr_linux.cc b/libcef/browser/osr/render_widget_host_view_osr_linux.cc index b55752e9c..973ab2a1e 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_linux.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_linux.cc @@ -5,202 +5,28 @@ #include "libcef/browser/osr/render_widget_host_view_osr.h" -#if defined(USE_X11) -#include -#include - -#include "libcef/browser/native/window_x11.h" - -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/base/x/x11_cursor_loader.h" -#include "ui/base/x/x11_util.h" -#include "ui/gfx/x/x11_types.h" -#endif // defined(USE_X11) +#include "ui/base/cursor/cursor_factory.h" #if defined(USE_X11) -namespace { - -// Based on ui/base/cursor/cursor_loader_x11.cc. - -int ToCursorID(ui::mojom::CursorType type) { - switch (type) { - case ui::mojom::CursorType::kPointer: - return XC_left_ptr; - case ui::mojom::CursorType::kCross: - return XC_crosshair; - case ui::mojom::CursorType::kHand: - return XC_hand2; - case ui::mojom::CursorType::kIBeam: - return XC_xterm; - case ui::mojom::CursorType::kWait: - return XC_watch; - case ui::mojom::CursorType::kHelp: - return XC_question_arrow; - case ui::mojom::CursorType::kEastResize: - return XC_right_side; - case ui::mojom::CursorType::kNorthResize: - return XC_top_side; - case ui::mojom::CursorType::kNorthEastResize: - return XC_top_right_corner; - case ui::mojom::CursorType::kNorthWestResize: - return XC_top_left_corner; - case ui::mojom::CursorType::kSouthResize: - return XC_bottom_side; - case ui::mojom::CursorType::kSouthEastResize: - return XC_bottom_right_corner; - case ui::mojom::CursorType::kSouthWestResize: - return XC_bottom_left_corner; - case ui::mojom::CursorType::kWestResize: - return XC_left_side; - case ui::mojom::CursorType::kNorthSouthResize: - return XC_sb_v_double_arrow; - case ui::mojom::CursorType::kEastWestResize: - return XC_sb_h_double_arrow; - case ui::mojom::CursorType::kNorthEastSouthWestResize: - return XC_left_ptr; - case ui::mojom::CursorType::kNorthWestSouthEastResize: - return XC_left_ptr; - case ui::mojom::CursorType::kColumnResize: - return XC_sb_h_double_arrow; - case ui::mojom::CursorType::kRowResize: - return XC_sb_v_double_arrow; - case ui::mojom::CursorType::kMiddlePanning: - return XC_fleur; - case ui::mojom::CursorType::kEastPanning: - return XC_sb_right_arrow; - case ui::mojom::CursorType::kNorthPanning: - return XC_sb_up_arrow; - case ui::mojom::CursorType::kNorthEastPanning: - return XC_top_right_corner; - case ui::mojom::CursorType::kNorthWestPanning: - return XC_top_left_corner; - case ui::mojom::CursorType::kSouthPanning: - return XC_sb_down_arrow; - case ui::mojom::CursorType::kSouthEastPanning: - return XC_bottom_right_corner; - case ui::mojom::CursorType::kSouthWestPanning: - return XC_bottom_left_corner; - case ui::mojom::CursorType::kWestPanning: - return XC_sb_left_arrow; - case ui::mojom::CursorType::kMove: - return XC_fleur; - case ui::mojom::CursorType::kVerticalText: - return XC_left_ptr; - case ui::mojom::CursorType::kCell: - return XC_left_ptr; - case ui::mojom::CursorType::kContextMenu: - return XC_left_ptr; - case ui::mojom::CursorType::kAlias: - return XC_left_ptr; - case ui::mojom::CursorType::kProgress: - return XC_left_ptr; - case ui::mojom::CursorType::kNoDrop: - return XC_left_ptr; - case ui::mojom::CursorType::kCopy: - return XC_left_ptr; - case ui::mojom::CursorType::kNotAllowed: - return XC_left_ptr; - case ui::mojom::CursorType::kZoomIn: - return XC_left_ptr; - case ui::mojom::CursorType::kZoomOut: - return XC_left_ptr; - case ui::mojom::CursorType::kGrab: - return XC_left_ptr; - case ui::mojom::CursorType::kGrabbing: - return XC_left_ptr; - case ui::mojom::CursorType::kMiddlePanningVertical: - return XC_left_ptr; - case ui::mojom::CursorType::kMiddlePanningHorizontal: - return XC_left_ptr; - case ui::mojom::CursorType::kDndNone: - return XC_left_ptr; - case ui::mojom::CursorType::kDndMove: - return XC_left_ptr; - case ui::mojom::CursorType::kDndCopy: - return XC_left_ptr; - case ui::mojom::CursorType::kDndLink: - return XC_left_ptr; - case ui::mojom::CursorType::kNull: - return XC_left_ptr; - case ui::mojom::CursorType::kCustom: - case ui::mojom::CursorType::kNone: - break; - } - NOTREACHED(); - return 0; -} - -// The following XCursorCache code was deleted from ui/base/x/x11_util.cc in -// https://crbug.com/665574#c2 - -// A process wide singleton that manages the usage of X cursors. -class XCursorCache { - public: - XCursorCache() {} - ~XCursorCache() { Clear(); } - - ::Cursor GetCursor(int cursor_shape) { - // Lookup cursor by attempting to insert a null value, which avoids - // a second pass through the map after a cache miss. - std::pair::iterator, bool> it = - cache_.insert(std::make_pair(cursor_shape, 0)); - if (it.second) { - XDisplay* display = gfx::GetXDisplay(); - it.first->second = XCreateFontCursor(display, cursor_shape); - } - return it.first->second; - } - - void Clear() { - XDisplay* display = gfx::GetXDisplay(); - for (std::map::iterator it = cache_.begin(); - it != cache_.end(); ++it) { - XFreeCursor(display, it->second); - } - cache_.clear(); - } - - private: - // Maps X11 font cursor shapes to Cursor IDs. - std::map cache_; - - DISALLOW_COPY_AND_ASSIGN(XCursorCache); -}; - -XCursorCache* cursor_cache = nullptr; - -// Returns an X11 Cursor, sharable across the process. -// |cursor_shape| is an X font cursor shape, see XCreateFontCursor(). -::Cursor GetXCursor(int cursor_shape) { - if (!cursor_cache) - cursor_cache = new XCursorCache; - return cursor_cache->GetCursor(cursor_shape); -} - -// Based on ui/base/x/x11_cursor_factory.cc. -scoped_refptr CreateInvisibleCursor( - ui::XCursorLoader* cursor_loader) { - SkBitmap bitmap; - bitmap.allocN32Pixels(1, 1); - return cursor_loader->CreateCursor(bitmap, gfx::Point(0, 0)); -} - -} // namespace -#endif // defined(USE_X11) +#include "ui/base/x/x11_cursor.h" +#endif CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor( ui::mojom::CursorType type) { -#if defined(USE_X11) - if (type == ui::mojom::CursorType::kNone) { - if (!invisible_cursor_) { - cursor_loader_ = - std::make_unique(x11::Connection::Get()); - invisible_cursor_ = CreateInvisibleCursor(cursor_loader_.get()); - } - return static_cast<::Cursor>(invisible_cursor_->xcursor()); - } else { - return GetXCursor(ToCursorID(type)); + auto cursor = ui::CursorFactory::GetInstance()->GetDefaultCursor(type); + if (cursor) { + return ToCursorHandle(*cursor); } -#endif // defined(USE_X11) return 0; } + +CefCursorHandle CefRenderWidgetHostViewOSR::ToCursorHandle( + ui::PlatformCursor cursor) { +#if defined(USE_X11) + // See https://crbug.com/1029142 for background. + return static_cast( + static_cast(cursor)->xcursor()); +#else + return cursor; +#endif +} diff --git a/libcef/browser/osr/render_widget_host_view_osr_win.cc b/libcef/browser/osr/render_widget_host_view_osr_win.cc index 2ce0a95e3..daa14f4b0 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_win.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_win.cc @@ -172,3 +172,8 @@ CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor( return LoadCursor(module_handle, cursor_id); } + +CefCursorHandle CefRenderWidgetHostViewOSR::ToCursorHandle( + ui::PlatformCursor cursor) { + return cursor; +} diff --git a/libcef/browser/osr/web_contents_view_osr.cc b/libcef/browser/osr/web_contents_view_osr.cc index b74b7495f..5a6e71322 100644 --- a/libcef/browser/osr/web_contents_view_osr.cc +++ b/libcef/browser/osr/web_contents_view_osr.cc @@ -146,10 +146,10 @@ bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() { void CefWebContentsViewOSR::StartDragging( const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) { CefRefPtr browser = GetBrowser(); if (browser.get()) { @@ -161,8 +161,7 @@ void CefWebContentsViewOSR::StartDragging( } } -void CefWebContentsViewOSR::UpdateDragCursor( - blink::WebDragOperation operation) { +void CefWebContentsViewOSR::UpdateDragCursor(blink::DragOperation operation) { CefRefPtr browser = GetBrowser(); if (browser.get()) browser->UpdateDragCursor(operation); diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 449204e0b..166e5e173 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -62,12 +62,12 @@ class CefWebContentsViewOSR : public content::WebContentsView, // RenderViewHostDelegateView methods. void StartDragging(const content::DropData& drop_data, - blink::WebDragOperationsMask allowed_ops, + blink::DragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, - const content::DragEventSourceInfo& event_info, + const blink::mojom::DragEventSourceInfo& event_info, content::RenderWidgetHostImpl* source_rwh) override; - void UpdateDragCursor(blink::WebDragOperation operation) override; + void UpdateDragCursor(blink::DragOperation operation) override; virtual void GotFocus( content::RenderWidgetHostImpl* render_widget_host) override; virtual void LostFocus( diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 3ec73d377..c7187374f 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -49,6 +49,7 @@ #include "components/prefs/pref_service.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" +#include "components/safe_browsing/core/common/safe_browsing_prefs.h" #include "components/spellcheck/browser/pref_names.h" #include "components/sync_preferences/pref_service_syncable.h" #include "components/sync_preferences/pref_service_syncable_factory.h" @@ -203,9 +204,10 @@ std::unique_ptr CreatePrefService(Profile* profile, // Based on chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserPrefs. registry->RegisterBooleanPref(prefs::kAllowFileSelectionDialogs, true); - // From Chrome::RegisterBrowserUserPrefs. + // Based on chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs. registry->RegisterBooleanPref(prefs::kPrintPreviewUseSystemDefaultPrinter, false); + registry->RegisterBooleanPref(prefs::kWebRTCAllowLegacyTLSProtocols, false); if (command_line->HasSwitch(switches::kEnablePreferenceTesting)) { // Preferences used with unit tests. @@ -233,6 +235,7 @@ std::unique_ptr CreatePrefService(Profile* profile, media_router::RegisterProfilePrefs(registry.get()); MediaDeviceIDSalt::RegisterProfilePrefs(registry.get()); ProfileNetworkContextService::RegisterProfilePrefs(registry.get()); + safe_browsing::RegisterProfilePrefs(registry.get()); const std::string& locale = command_line->GetSwitchValueASCII(switches::kLang); diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index b0e33a968..6b18ecd7e 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -35,12 +35,12 @@ #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" -#include "content/public/common/web_preferences.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/view_type_utils.h" #include "extensions/common/constants.h" #include "media/media_buildflags.h" #include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h" +#include "third_party/blink/public/common/web_preferences/web_preferences.h" #include "ui/native_theme/native_theme.h" namespace renderer_prefs { @@ -50,7 +50,7 @@ namespace { // Set default values based on CEF command-line flags for preferences that are // not available via the PrefService. Chromium command-line flags should not // exist for these preferences. -void SetDefaultPrefs(content::WebPreferences& web) { +void SetDefaultPrefs(blink::web_pref::WebPreferences& web) { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -70,7 +70,7 @@ void SetDefaultPrefs(content::WebPreferences& web) { // Chrome preferences. // Should match ChromeContentBrowserClient::OverrideWebkitPrefs. -void SetChromePrefs(Profile* profile, content::WebPreferences& web) { +void SetChromePrefs(Profile* profile, blink::web_pref::WebPreferences& web) { PrefService* prefs = profile->GetPrefs(); // Fill per-script font preferences. @@ -134,11 +134,11 @@ void SetChromePrefs(Profile* profile, content::WebPreferences& web) { std::string image_animation_policy = prefs->GetString(prefs::kAnimationPolicy); if (image_animation_policy == kAnimationPolicyOnce) - web.animation_policy = content::IMAGE_ANIMATION_POLICY_ANIMATION_ONCE; + web.animation_policy = blink::web_pref::kImageAnimationPolicyAnimateOnce; else if (image_animation_policy == kAnimationPolicyNone) - web.animation_policy = content::IMAGE_ANIMATION_POLICY_NO_ANIMATION; + web.animation_policy = blink::web_pref::kImageAnimationPolicyNoAnimation; else - web.animation_policy = content::IMAGE_ANIMATION_POLICY_ALLOWED; + web.animation_policy = blink::web_pref::kImageAnimationPolicyAllowed; } // Make sure we will set the default_encoding with canonical encoding name. @@ -161,7 +161,7 @@ void SetChromePrefs(Profile* profile, content::WebPreferences& web) { // Extension preferences. // Should match ChromeContentBrowserClientExtensionsPart::OverrideWebkitPrefs. void SetExtensionPrefs(content::RenderViewHost* rvh, - content::WebPreferences& web) { + blink::web_pref::WebPreferences& web) { if (!extensions::ExtensionsEnabled()) return; @@ -199,29 +199,30 @@ void SetExtensionPrefs(content::RenderViewHost* rvh, web_var = false; // Set preferences based on CefBrowserSettings. -void SetCefPrefs(const CefBrowserSettings& cef, content::WebPreferences& web) { +void SetCefPrefs(const CefBrowserSettings& cef, + blink::web_pref::WebPreferences& web) { if (cef.standard_font_family.length > 0) { - web.standard_font_family_map[content::kCommonScript] = + web.standard_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.standard_font_family); } if (cef.fixed_font_family.length > 0) { - web.fixed_font_family_map[content::kCommonScript] = + web.fixed_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.fixed_font_family); } if (cef.serif_font_family.length > 0) { - web.serif_font_family_map[content::kCommonScript] = + web.serif_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.serif_font_family); } if (cef.sans_serif_font_family.length > 0) { - web.sans_serif_font_family_map[content::kCommonScript] = + web.sans_serif_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.sans_serif_font_family); } if (cef.cursive_font_family.length > 0) { - web.cursive_font_family_map[content::kCommonScript] = + web.cursive_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.cursive_font_family); } if (cef.fantasy_font_family.length > 0) { - web.fantasy_font_family_map[content::kCommonScript] = + web.fantasy_font_family_map[blink::web_pref::kCommonScript] = CefString(&cef.fantasy_font_family); } @@ -280,7 +281,7 @@ void SetBool(CommandLinePrefStore* prefs, const std::string& key, bool value) { // From chrome/browser/chrome_content_browser_client.cc bool UpdatePreferredColorSchemesBasedOnURLIfNeeded( - content::WebPreferences* web_prefs, + blink::web_pref::WebPreferences* web_prefs, const GURL& url) { // Force a light preferred color scheme on certain URLs if kWebUIDarkMode is // disabled; some of the UI is not yet correctly themed. @@ -352,7 +353,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, } void PopulateWebPreferences(content::RenderViewHost* rvh, - content::WebPreferences& web) { + blink::web_pref::WebPreferences& web) { REQUIRE_ALLOY_RUNTIME(); CefRefPtr browser = static_cast( extensions::GetOwnerBrowserForHost(rvh, nullptr).get()); @@ -399,8 +400,9 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, } } -bool PopulateWebPreferencesAfterNavigation(content::WebContents* web_contents, - content::WebPreferences& web) { +bool PopulateWebPreferencesAfterNavigation( + content::WebContents* web_contents, + blink::web_pref::WebPreferences& web) { return UpdatePreferredColorSchemesBasedOnURLIfNeeded( &web, web_contents->GetLastCommittedURL()); } diff --git a/libcef/browser/prefs/renderer_prefs.h b/libcef/browser/prefs/renderer_prefs.h index 50fe0ebc2..0d8ead4f8 100644 --- a/libcef/browser/prefs/renderer_prefs.h +++ b/libcef/browser/prefs/renderer_prefs.h @@ -10,10 +10,15 @@ class CommandLinePrefStore; +namespace blink { +namespace web_pref { +struct WebPreferences; +} +} // namespace blink + namespace content { class RenderViewHost; class WebContents; -struct WebPreferences; } // namespace content namespace user_prefs { @@ -34,9 +39,10 @@ void SetCommandLinePrefDefaults(CommandLinePrefStore* prefs); // Populate WebPreferences based on a combination of command-line values, // PrefService and CefBrowserSettings. void PopulateWebPreferences(content::RenderViewHost* rvh, - content::WebPreferences& web); -bool PopulateWebPreferencesAfterNavigation(content::WebContents* web_contents, - content::WebPreferences& web); + blink::web_pref::WebPreferences& web); +bool PopulateWebPreferencesAfterNavigation( + content::WebContents* web_contents, + blink::web_pref::WebPreferences& web); } // namespace renderer_prefs diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index c10d733eb..6ef97ad9f 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -128,31 +128,16 @@ gfx::Size CefPrintDialogLinux::GetPdfPaperSize( } // static -void CefPrintDialogLinux::OnPrintStart(int render_process_id, - int render_routing_id) { - if (!CEF_CURRENTLY_ON(CEF_UIT)) { - CEF_POST_TASK(CEF_UIT, base::Bind(&CefPrintDialogLinux::OnPrintStart, - render_process_id, render_routing_id)); - return; +void CefPrintDialogLinux::OnPrintStart(CefRefPtr browser) { + CEF_REQUIRE_UIT(); + DCHECK(browser); + if (auto app = CefAppManager::Get()->GetApplication()) { + if (auto browser_handler = app->GetBrowserProcessHandler()) { + if (auto print_handler = browser_handler->GetPrintHandler()) { + print_handler->OnPrintStart(browser.get()); + } + } } - - CefRefPtr app = CefAppManager::Get()->GetApplication(); - if (!app.get()) - return; - - CefRefPtr browser_handler = - app->GetBrowserProcessHandler(); - if (!browser_handler.get()) - return; - - CefRefPtr handler = browser_handler->GetPrintHandler(); - if (!handler.get()) - return; - - auto browser = extensions::GetOwnerBrowserForFrameRoute( - render_process_id, render_routing_id, nullptr); - if (browser.get()) - handler->OnPrintStart(browser.get()); } CefPrintDialogLinux::CefPrintDialogLinux(PrintingContextLinux* context) diff --git a/libcef/browser/printing/print_dialog_linux.h b/libcef/browser/printing/print_dialog_linux.h index 4209ab408..64aa5d398 100644 --- a/libcef/browser/printing/print_dialog_linux.h +++ b/libcef/browser/printing/print_dialog_linux.h @@ -38,7 +38,7 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface, static gfx::Size GetPdfPaperSize(printing::PrintingContextLinux* context); // Notify the client when printing has started. - static void OnPrintStart(int render_process_id, int render_routing_id); + static void OnPrintStart(CefRefPtr browser); // PrintDialogGtkInterface implementation. void UseDefaultSettings() override; diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index 05a2094f6..0fa0de82e 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -9,6 +9,7 @@ #include "libcef/browser/browser_info_manager.h" #include "libcef/browser/download_manager_delegate.h" #include "libcef/browser/extensions/extension_web_contents_observer.h" +#include "libcef/browser/thread_util.h" #include #include @@ -22,7 +23,6 @@ #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/printing/print_preview_dialog_controller.h" #include "chrome/browser/printing/print_preview_message_handler.h" -#include "chrome/browser/printing/print_view_manager.h" #include "chrome/browser/printing/printer_query.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" @@ -42,7 +42,9 @@ #include "printing/metafile_skia.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" -#include "libcef/browser/thread_util.h" +#if defined(OS_LINUX) +#include "libcef/browser/printing/print_dialog_linux.h" +#endif using content::BrowserThread; @@ -176,8 +178,7 @@ struct CefPrintViewManager::PdfPrintState { }; CefPrintViewManager::CefPrintViewManager(content::WebContents* web_contents) - : WebContentsObserver(web_contents) { - PrintViewManager::CreateForWebContents(web_contents); + : PrintViewManager(web_contents) { PrintPreviewMessageHandler::CreateForWebContents(web_contents); } @@ -218,10 +219,22 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, return true; } -bool CefPrintViewManager::PrintPreviewNow(content::RenderFrameHost* rfh, - bool has_selection) { - return PrintViewManager::FromWebContents(web_contents()) - ->PrintPreviewNow(rfh, has_selection); +void CefPrintViewManager::GetDefaultPrintSettings( + GetDefaultPrintSettingsCallback callback) { +#if defined(OS_LINUX) + // Send notification to the client. + auto browser = CefBrowserHostBase::GetBrowserForContents(web_contents()); + if (browser) { + CefPrintDialogLinux::OnPrintStart(browser); + } +#endif + PrintViewManager::GetDefaultPrintSettings(std::move(callback)); +} + +void CefPrintViewManager::DidShowPrintDialog() { + if (pdf_print_state_) + return; + PrintViewManager::DidShowPrintDialog(); } void CefPrintViewManager::RenderFrameDeleted( @@ -230,14 +243,17 @@ void CefPrintViewManager::RenderFrameDeleted( render_frame_host == pdf_print_state_->printing_rfh_) { TerminatePdfPrintJob(); } + PrintViewManager::RenderFrameDeleted(render_frame_host); } void CefPrintViewManager::NavigationStopped() { TerminatePdfPrintJob(); + PrintViewManager::NavigationStopped(); } void CefPrintViewManager::RenderProcessGone(base::TerminationStatus status) { TerminatePdfPrintJob(); + PrintViewManager::RenderProcessGone(status); } bool CefPrintViewManager::OnMessageReceived( @@ -253,13 +269,12 @@ bool CefPrintViewManager::OnMessageReceived( OnShowScriptedPrintPreview) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() - return false; + + return PrintViewManager::OnMessageReceived(message, render_frame_host); } IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefPrintViewManager, message, render_frame_host) - IPC_MESSAGE_HANDLER(PrintHostMsg_DidShowPrintDialog, - OnDidShowPrintDialog_PrintToPdf) IPC_MESSAGE_HANDLER(PrintHostMsg_RequestPrintPreview, OnRequestPrintPreview_PrintToPdf) IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, @@ -267,8 +282,35 @@ bool CefPrintViewManager::OnMessageReceived( IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() - return handled; + return handled || + PrintViewManager::OnMessageReceived(message, render_frame_host); } + +// static +void CefPrintViewManager::CreateForWebContents(content::WebContents* contents) { + DCHECK(contents); + if (!FromWebContents(contents)) { + contents->SetUserData(PrintViewManager::UserDataKey(), + base::WrapUnique(new CefPrintViewManager(contents))); + } +} + +// static +CefPrintViewManager* CefPrintViewManager::FromWebContents( + content::WebContents* contents) { + DCHECK(contents); + return static_cast( + contents->GetUserData(PrintViewManager::UserDataKey())); +} + +// static +const CefPrintViewManager* CefPrintViewManager::FromWebContents( + const content::WebContents* contents) { + DCHECK(contents); + return static_cast( + contents->GetUserData(PrintViewManager::UserDataKey())); +} + void CefPrintViewManager::OnRequestPrintPreview( content::RenderFrameHost* rfh, const PrintHostMsg_RequestPrintPreview_Params&) { @@ -281,9 +323,6 @@ void CefPrintViewManager::OnShowScriptedPrintPreview( InitializePrintPreview(rfh->GetFrameTreeNodeId()); } -void CefPrintViewManager::OnDidShowPrintDialog_PrintToPdf( - content::RenderFrameHost* rfh) {} - void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf( content::RenderFrameHost* rfh, const PrintHostMsg_RequestPrintPreview_Params&) { @@ -303,7 +342,7 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf( void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf( content::RenderFrameHost* rfh, const mojom::DidPreviewDocumentParams& params, - const PrintHostMsg_PreviewIds& ids) { + const mojom::PreviewIds& ids) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StopWorker(params.document_cookie); @@ -370,8 +409,6 @@ void CefPrintViewManager::InitializePrintPreview(int frame_tree_node_id) { ->Initialize(frame_tree_node_id); } -WEB_CONTENTS_USER_DATA_KEY_IMPL(CefPrintViewManager) - // CefPrintViewManager::PrintPreviewHelper CefPrintViewManager::PrintPreviewHelper::PrintPreviewHelper( diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index c3cc8c41b..f7b6ecd8d 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -8,6 +8,7 @@ #include "include/internal/cef_types_wrappers.h" #include "base/macros.h" +#include "chrome/browser/printing/print_view_manager.h" #include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" @@ -20,15 +21,12 @@ class WebContentsObserver; class CefBrowserInfo; -struct PrintHostMsg_PreviewIds; struct PrintHostMsg_RequestPrintPreview_Params; namespace printing { -// Manages the print commands for a WebContents. -class CefPrintViewManager - : public content::WebContentsObserver, - public content::WebContentsUserData { +// CEF handler for print commands. +class CefPrintViewManager : public PrintViewManager { public: ~CefPrintViewManager() override; @@ -41,16 +39,26 @@ class CefPrintViewManager const CefPdfPrintSettings& settings, const PdfPrintCallback& callback); - // Call to Chrome's PrintViewManager. - bool PrintPreviewNow(content::RenderFrameHost* rfh, bool has_selection); + // mojom::PrintManagerHost methods: + void GetDefaultPrintSettings( + GetDefaultPrintSettingsCallback callback) override; + void DidShowPrintDialog() override; - // content::WebContentsObserver implementation. + // content::WebContentsObserver methods: void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; void NavigationStopped() override; void RenderProcessGone(base::TerminationStatus status) override; bool OnMessageReceived(const IPC::Message& message, content::RenderFrameHost* render_frame_host) override; + // Inline versions of the content::WebContentsUserData methods to avoid + // ambiguous warnings due to the PrintViewManager base class also extending + // WebContentsUserData. + static void CreateForWebContents(content::WebContents* contents); + static CefPrintViewManager* FromWebContents(content::WebContents* contents); + static const CefPrintViewManager* FromWebContents( + const content::WebContents* contents); + // Used to track the lifespan of the print preview WebContents. class PrintPreviewHelper : public content::WebContentsObserver, @@ -72,7 +80,6 @@ class CefPrintViewManager private: explicit CefPrintViewManager(content::WebContents* web_contents); - friend class content::WebContentsUserData; // IPC Message handlers. void OnRequestPrintPreview(content::RenderFrameHost* rfh, @@ -82,11 +89,10 @@ class CefPrintViewManager void OnRequestPrintPreview_PrintToPdf( content::RenderFrameHost* rfh, const PrintHostMsg_RequestPrintPreview_Params&); - void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh); void OnMetafileReadyForPrinting_PrintToPdf( content::RenderFrameHost* rfh, const mojom::DidPreviewDocumentParams& params, - const PrintHostMsg_PreviewIds& ids); + const mojom::PreviewIds& ids); void InitializePrintPreview(int frame_tree_node_id); void TerminatePdfPrintJob(); @@ -94,7 +100,7 @@ class CefPrintViewManager int next_pdf_request_id_ = content::RenderFrameHost::kNoFrameTreeNodeId; struct PdfPrintState; std::unique_ptr pdf_print_state_; - WEB_CONTENTS_USER_DATA_KEY_DECL(); + DISALLOW_COPY_AND_ASSIGN(CefPrintViewManager); }; diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 7be7b9b98..a9dda3250 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -4,6 +4,8 @@ #include "libcef/browser/printing/printing_message_filter.h" +#include "libcef/browser/printing/print_view_manager.h" + #include #include #include @@ -19,6 +21,7 @@ #include "chrome/common/pref_names.h" #include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h" #include "components/printing/browser/print_manager_utils.h" +#include "components/printing/common/print.mojom.h" #include "components/printing/common/print_messages.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -27,10 +30,6 @@ #include "content/public/common/child_process_host.h" #include "printing/mojom/print.mojom.h" -#if defined(OS_LINUX) -#include "libcef/browser/printing/print_dialog_linux.h" -#endif - using content::BrowserThread; namespace printing { @@ -65,6 +64,25 @@ CefPrintingMessageFilterShutdownNotifierFactory::GetInstance() { return g_printing_message_filter_shutdown_notifier_factory.Pointer(); } +#if defined(OS_WIN) +content::WebContents* GetWebContentsForRenderFrame(int render_process_id, + int render_frame_id) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + content::RenderFrameHost* frame = + content::RenderFrameHost::FromID(render_process_id, render_frame_id); + return frame ? content::WebContents::FromRenderFrameHost(frame) : nullptr; +} + +CefPrintViewManager* GetPrintViewManager(int render_process_id, + int render_frame_id) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + content::WebContents* web_contents = + GetWebContentsForRenderFrame(render_process_id, render_frame_id); + return web_contents ? CefPrintViewManager::FromWebContents(web_contents) + : nullptr; +} +#endif // defined(OS_WIN) + } // namespace CefPrintingMessageFilter::CefPrintingMessageFilter(int render_process_id, @@ -104,8 +122,6 @@ void CefPrintingMessageFilter::OnDestruct() const { bool CefPrintingMessageFilter::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(CefPrintingMessageFilter, message) - IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_GetDefaultPrintSettings, - OnGetDefaultPrintSettings) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_ScriptedPrint, OnScriptedPrint) IPC_MESSAGE_HANDLER_DELAY_REPLY(PrintHostMsg_UpdatePrintSettings, OnUpdatePrintSettings) @@ -115,60 +131,8 @@ bool CefPrintingMessageFilter::OnMessageReceived(const IPC::Message& message) { return handled; } -void CefPrintingMessageFilter::OnGetDefaultPrintSettings( - IPC::Message* reply_msg) { - DCHECK_CURRENTLY_ON(BrowserThread::IO); -#if defined(OS_LINUX) - // Send notification to the client. - CefPrintDialogLinux::OnPrintStart(render_process_id_, - reply_msg->routing_id()); -#endif - - std::unique_ptr printer_query; - if (!is_printing_enabled_.GetValue()) { - // Reply with NULL query. - OnGetDefaultPrintSettingsReply(std::move(printer_query), reply_msg); - return; - } - printer_query = queue_->PopPrinterQuery(0); - if (!printer_query.get()) { - printer_query = - queue_->CreatePrinterQuery(render_process_id_, reply_msg->routing_id()); - } - - // Loads default settings. This is asynchronous, only the IPC message sender - // will hang until the settings are retrieved. - auto* printer_query_ptr = printer_query.get(); - printer_query_ptr->GetSettings( - PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, - printing::mojom::MarginType::kDefaultMargins, false, false, - base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply, - this, std::move(printer_query), reply_msg)); -} - -void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply( - std::unique_ptr printer_query, - IPC::Message* reply_msg) { - mojom::PrintParams params; - if (printer_query && printer_query->last_status() == PrintingContext::OK) { - RenderParamsFromPrintSettings(printer_query->settings(), ¶ms); - params.document_cookie = printer_query->cookie(); - } - PrintHostMsg_GetDefaultPrintSettings::WriteReplyParams(reply_msg, params); - Send(reply_msg); - // If printing was enabled. - if (printer_query.get()) { - // If user hasn't cancelled. - if (printer_query->cookie() && printer_query->settings().dpi()) { - queue_->QueuePrinterQuery(std::move(printer_query)); - } else { - printer_query->StopWorker(); - } - } -} - void CefPrintingMessageFilter::OnScriptedPrint( - const PrintHostMsg_ScriptedPrint_Params& params, + const mojom::ScriptedPrintParams& params, IPC::Message* reply_msg) { std::unique_ptr printer_query = queue_->PopPrinterQuery(params.cookie); @@ -187,18 +151,18 @@ void CefPrintingMessageFilter::OnScriptedPrint( void CefPrintingMessageFilter::OnScriptedPrintReply( std::unique_ptr printer_query, IPC::Message* reply_msg) { - PrintMsg_PrintPages_Params params; - if (printer_query->last_status() != PrintingContext::OK || - !printer_query->settings().dpi()) { - params.Reset(); - } else { - RenderParamsFromPrintSettings(printer_query->settings(), ¶ms.params); - params.params.document_cookie = printer_query->cookie(); + mojom::PrintPagesParams params; + params.params = mojom::PrintParams::New(); + if (printer_query->last_status() == PrintingContext::OK && + printer_query->settings().dpi()) { + RenderParamsFromPrintSettings(printer_query->settings(), + params.params.get()); + params.params->document_cookie = printer_query->cookie(); params.pages = PageRange::GetPages(printer_query->settings().ranges()); } PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params); Send(reply_msg); - if (!params.params.dpi.IsEmpty() && params.params.document_cookie) { + if (!params.params->dpi.IsEmpty() && params.params->document_cookie) { queue_->QueuePrinterQuery(std::move(printer_query)); } else { printer_query->StopWorker(); @@ -228,17 +192,26 @@ void CefPrintingMessageFilter::OnUpdatePrintSettings(int document_cookie, void CefPrintingMessageFilter::OnUpdatePrintSettingsReply( std::unique_ptr printer_query, IPC::Message* reply_msg) { - PrintMsg_PrintPages_Params params; - if (!printer_query.get() || - printer_query->last_status() != PrintingContext::OK) { - params.Reset(); - } else { - RenderParamsFromPrintSettings(printer_query->settings(), ¶ms.params); - params.params.document_cookie = printer_query->cookie(); + mojom::PrintPagesParams params; + params.params = mojom::PrintParams::New(); + if (printer_query && printer_query->last_status() == PrintingContext::OK) { + RenderParamsFromPrintSettings(printer_query->settings(), + params.params.get()); + params.params->document_cookie = printer_query->cookie(); params.pages = PageRange::GetPages(printer_query->settings().ranges()); } bool canceled = printer_query.get() && (printer_query->last_status() == PrintingContext::CANCEL); +#if defined(OS_WIN) + if (canceled) { + int routing_id = reply_msg->routing_id(); + content::GetUIThreadTaskRunner({})->PostTask( + FROM_HERE, + base::BindOnce(&CefPrintingMessageFilter::NotifySystemDialogCancelled, + this, routing_id)); + } +#endif + PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params, canceled); Send(reply_msg); @@ -252,10 +225,16 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply( } } -void CefPrintingMessageFilter::OnCheckForCancel( - const PrintHostMsg_PreviewIds& ids, - bool* cancel) { +void CefPrintingMessageFilter::OnCheckForCancel(const mojom::PreviewIds& ids, + bool* cancel) { *cancel = false; } +#if defined(OS_WIN) +void CefPrintingMessageFilter::NotifySystemDialogCancelled(int routing_id) { + auto manager = GetPrintViewManager(render_process_id_, routing_id); + manager->SystemDialogCancelled(); +} +#endif + } // namespace printing diff --git a/libcef/browser/printing/printing_message_filter.h b/libcef/browser/printing/printing_message_filter.h index d6d889b01..5689483e2 100644 --- a/libcef/browser/printing/printing_message_filter.h +++ b/libcef/browser/printing/printing_message_filter.h @@ -15,11 +15,10 @@ #include "build/build_config.h" #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" #include "components/prefs/pref_member.h" +#include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/browser_message_filter.h" #include "printing/buildflags/buildflags.h" -struct PrintHostMsg_PreviewIds; -struct PrintHostMsg_ScriptedPrint_Params; class Profile; namespace printing { @@ -47,16 +46,10 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter { void ShutdownOnUIThread(); - // Get the default print setting. - void OnGetDefaultPrintSettings(IPC::Message* reply_msg); - void OnGetDefaultPrintSettingsReply( - std::unique_ptr printer_query, - IPC::Message* reply_msg); - // The renderer host have to show to the user the print dialog and returns // the selected print settings. The task is handled by the print worker // thread and the UI thread. The reply occurs on the IO thread. - void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params, + void OnScriptedPrint(const mojom::ScriptedPrintParams& params, IPC::Message* reply_msg); void OnScriptedPrintReply(std::unique_ptr printer_query, IPC::Message* reply_msg); @@ -71,7 +64,10 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter { IPC::Message* reply_msg); // Check to see if print preview has been cancelled. - void OnCheckForCancel(const PrintHostMsg_PreviewIds& ids, bool* cancel); + void OnCheckForCancel(const mojom::PreviewIds& ids, bool* cancel); +#if defined(OS_WIN) + void NotifySystemDialogCancelled(int routing_id); +#endif std::unique_ptr printing_shutdown_notifier_; diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 50107aabc..becb3fef4 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -729,7 +729,8 @@ void CefRequestContextImpl::ClearHttpAuthCredentialsInternal( CEF_REQUIRE_UIT(); browser_context->GetNetworkContext()->ClearHttpAuthCache( - base::Time(), base::Bind(&CefCompletionCallback::OnComplete, callback)); + /*start_time=*/base::Time(), /*end_time=*/base::Time::Max(), + base::Bind(&CefCompletionCallback::OnComplete, callback)); } void CefRequestContextImpl::CloseAllConnectionsInternal( diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 4f4b89f41..729e0ba28 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -81,7 +81,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { enabled ? views::InkDropHostView::InkDropMode::ON : views::InkDropHostView::InkDropMode::OFF); if (enabled) { - ParentClass::root_view()->set_ink_drop_base_color( + ParentClass::root_view()->SetInkDropBaseColor( color_utils::BlendTowardMaxContrast( ParentClass::root_view()->background()->get_color(), 0x61)); } @@ -101,7 +101,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetAccessibleName( CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetFocusable(bool focusable) { CEF_REQUIRE_VALID_RETURN_VOID(); - ParentClass::root_view()->set_request_focus_on_press(focusable); + ParentClass::root_view()->SetRequestFocusOnPress(focusable); ParentClass::SetFocusable(focusable); } diff --git a/libcef/browser/views/menu_button_view.h b/libcef/browser/views/menu_button_view.h index ca488ece3..bb83f6826 100644 --- a/libcef/browser/views/menu_button_view.h +++ b/libcef/browser/views/menu_button_view.h @@ -18,11 +18,7 @@ // CefButtonView template. class MenuButtonEx : public views::MenuButton, public views::ButtonListener { public: - MenuButtonEx() : views::MenuButton(this, base::string16()) { - // TODO(cef): MenuButton should not use ButtonListener. See - // http://crbug.com/585252 for details. - Button::listener_ = this; - } + MenuButtonEx() : views::MenuButton(this) {} }; class CefMenuButtonView diff --git a/libcef/browser/views/view_util.cc b/libcef/browser/views/view_util.cc index 0430839e7..4e22f99e4 100644 --- a/libcef/browser/views/view_util.cc +++ b/libcef/browser/views/view_util.cc @@ -119,15 +119,6 @@ class UserData : public base::SupportsUserData::Data { CefView* view_ref_; }; -inline CefWindowHandle ToWindowHandle(gfx::AcceleratedWidget widget) { -#if defined(USE_X11) - // See https://crbug.com/1066670#c57 for background. - return static_cast(widget); -#else - return widget; -#endif -} - } // namespace const SkColor kDefaultBackgroundColor = SkColorSetARGB(255, 255, 255, 255); @@ -313,7 +304,7 @@ CefWindowHandle GetWindowHandle(views::Widget* widget) { if (widget) { aura::Window* window = widget->GetNativeWindow(); if (window && window->GetRootWindow()) - return ToWindowHandle(window->GetHost()->GetAcceleratedWidget()); + return window->GetHost()->GetAcceleratedWidget(); } return kNullWindowHandle; } diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 99faa05a8..54b805b83 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -14,7 +14,7 @@ #include "ui/views/window/native_frame_view.h" #if defined(OS_LINUX) && defined(USE_X11) -#include +#include "ui/base/x/x11_util.h" #include "ui/gfx/x/x11_types.h" #endif @@ -312,38 +312,9 @@ void CefWindowView::CreateWidget() { #if defined(OS_LINUX) && defined(USE_X11) if (is_frameless_) { - ::Window window = view_util::GetWindowHandle(widget); + auto window = view_util::GetWindowHandle(widget); DCHECK(window); - ::Display* display = gfx::GetXDisplay(); - DCHECK(display); - - // Make the window borderless. From - // http://stackoverflow.com/questions/1904445/borderless-windows-on-linux - struct MwmHints { - unsigned long flags; - unsigned long functions; - unsigned long decorations; - long input_mode; - unsigned long status; - }; - enum { - MWM_HINTS_FUNCTIONS = (1L << 0), - MWM_HINTS_DECORATIONS = (1L << 1), - - MWM_FUNC_ALL = (1L << 0), - MWM_FUNC_RESIZE = (1L << 1), - MWM_FUNC_MOVE = (1L << 2), - MWM_FUNC_MINIMIZE = (1L << 3), - MWM_FUNC_MAXIMIZE = (1L << 4), - MWM_FUNC_CLOSE = (1L << 5) - }; - - Atom mwmHintsProperty = XInternAtom(display, "_MOTIF_WM_HINTS", 0); - struct MwmHints hints = {}; - hints.flags = MWM_HINTS_DECORATIONS; - hints.decorations = 0; - XChangeProperty(display, window, mwmHintsProperty, mwmHintsProperty, 32, - PropModeReplace, (unsigned char*)&hints, 5); + ui::SetUseOSWindowFrame(static_cast(window), false); } #endif // defined(OS_LINUX) && defined(USE_X11) } diff --git a/libcef/common/chrome/chrome_main_delegate_cef.cc b/libcef/common/chrome/chrome_main_delegate_cef.cc index b12144d1c..354871159 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.cc +++ b/libcef/common/chrome/chrome_main_delegate_cef.cc @@ -17,7 +17,6 @@ #include "base/lazy_instance.h" #include "content/public/common/content_switches.h" #include "sandbox/policy/switches.h" -#include "services/service_manager/embedder/switches.h" #if defined(OS_MAC) #include "libcef/common/util_mac.h" diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 4f80f9264..20c58b236 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -20,7 +20,7 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "components/crash/core/common/crash_key.h" -#include "services/service_manager/embedder/switches.h" +#include "content/public/common/content_switches.h" #include "third_party/crashpad/crashpad/client/annotation.h" #if defined(OS_MAC) @@ -627,7 +627,7 @@ bool CefCrashReporterClient::EnableBreakpadForProcess( const std::string& process_type) { return process_type == switches::kRendererProcess || process_type == switches::kPpapiPluginProcess || - process_type == service_manager::switches::kZygoteProcess || + process_type == switches::kZygoteProcess || process_type == switches::kGpuProcess; } diff --git a/libcef/common/crash_reporting.cc b/libcef/common/crash_reporting.cc index d5b7c7b39..f0e409687 100644 --- a/libcef/common/crash_reporting.cc +++ b/libcef/common/crash_reporting.cc @@ -19,7 +19,6 @@ #include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_keys.h" #include "content/public/common/content_switches.h" -#include "services/service_manager/embedder/switches.h" #if defined(OS_MAC) #include "base/mac/foundation_util.h" @@ -133,7 +132,7 @@ void InitCrashReporter(const base::CommandLine& command_line, g_crash_reporting_enabled = true; #else // !defined(OS_MAC) - if (process_type != service_manager::switches::kZygoteProcess) { + if (process_type != switches::kZygoteProcess) { // Crash reporting for subprocesses created using the zygote will be // initialized in ZygoteForked. breakpad::InitCrashReporter(process_type); diff --git a/libcef/common/json_impl.cc b/libcef/common/json_impl.cc index d4cf45e72..c98a32e65 100644 --- a/libcef/common/json_impl.cc +++ b/libcef/common/json_impl.cc @@ -56,7 +56,6 @@ CefRefPtr CefParseJSON(const void* json, CefRefPtr CefParseJSONAndReturnError( const CefString& json_string, cef_json_parser_options_t options, - cef_json_parser_error_t& error_code_out, CefString& error_msg_out) { const std::string& json = json_string.ToString(); @@ -70,8 +69,6 @@ CefRefPtr CefParseJSONAndReturnError( .release()); } - error_code_out = - static_cast(value_and_error.error_code); error_msg_out = value_and_error.error_message; return nullptr; } diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index bca6b2a62..472e4e7dc 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -543,9 +543,8 @@ void CefRequestImpl::Get(network::ResourceRequest* request, } if (!(flags & UR_FLAG_ALLOW_STORED_CREDENTIALS)) { - net_flags |= net::LOAD_DO_NOT_SEND_AUTH_DATA | - net::LOAD_DO_NOT_SEND_COOKIES | - net::LOAD_DO_NOT_SAVE_COOKIES; + // This will disable all credentials including cookies, auth tokens, etc. + request->credentials_mode = network::mojom::CredentialsMode::kOmit; } request->load_flags = net_flags; diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index 0fa929731..5ef31146d 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -34,9 +34,10 @@ base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes( return nullptr; } -bool CefResourceBundleDelegate::GetRawDataResource(int resource_id, - ui::ScaleFactor scale_factor, - base::StringPiece* value) { +bool CefResourceBundleDelegate::GetRawDataResource( + int resource_id, + ui::ScaleFactor scale_factor, + base::StringPiece* value) const { auto application = CefAppManager::Get()->GetApplication(); if (application) { CefRefPtr handler = @@ -59,8 +60,9 @@ bool CefResourceBundleDelegate::GetRawDataResource(int resource_id, return (pack_loading_disabled_ || !value->empty()); } -bool CefResourceBundleDelegate::GetLocalizedString(int message_id, - base::string16* value) { +bool CefResourceBundleDelegate::GetLocalizedString( + int message_id, + base::string16* value) const { auto application = CefAppManager::Get()->GetApplication(); if (application) { CefRefPtr handler = diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index c5670b196..9447967b5 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -33,8 +33,8 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { ui::ScaleFactor scale_factor) override; bool GetRawDataResource(int resource_id, ui::ScaleFactor scale_factor, - base::StringPiece* value) override; - bool GetLocalizedString(int message_id, base::string16* value) override; + base::StringPiece* value) const override; + bool GetLocalizedString(int message_id, base::string16* value) const override; private: bool pack_loading_disabled_ = false; diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index 913d55e10..27be13ce8 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -26,7 +26,6 @@ #include "media/cdm/cdm_host_file.h" #include "media/cdm/supported_cdm_versions.h" #include "sandbox/policy/switches.h" -#include "services/service_manager/embedder/switches.h" #include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck namespace { @@ -472,7 +471,7 @@ void CefWidevineLoader::AddContentDecryptionModules( // errors during plugin loading. This is because the Zygote process must pre- // load all plugins before initializing the sandbox. if (command_line.GetSwitchValueASCII(switches::kProcessType) != - service_manager::switches::kZygoteProcess || + switches::kZygoteProcess || command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) { return; } diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 040296195..5e50d08a1 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -444,17 +444,6 @@ bool AlloyContentRendererClient::IsOriginIsolatedPepperPlugin( base::FilePath::FromUTF8Unsafe(AlloyContentClient::kPDFPluginPath); } -content::BrowserPluginDelegate* -AlloyContentRendererClient::CreateBrowserPluginDelegate( - content::RenderFrame* render_frame, - const content::WebPluginInfo& info, - const std::string& mime_type, - const GURL& original_url) { - DCHECK(extensions::ExtensionsEnabled()); - return extensions::CefExtensionsRendererClient::CreateBrowserPluginDelegate( - render_frame, info, mime_type, original_url); -} - void AlloyContentRendererClient::AddSupportedKeySystems( std::vector>* key_systems) { AddChromeKeySystems(key_systems); diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index ae251f249..ad22d8f72 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -97,11 +97,6 @@ class AlloyContentRendererClient uint64_t VisitedLinkHash(const char* canonical_url, size_t length) override; bool IsLinkVisited(uint64_t link_hash) override; bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; - content::BrowserPluginDelegate* CreateBrowserPluginDelegate( - content::RenderFrame* render_frame, - const content::WebPluginInfo& info, - const std::string& mime_type, - const GURL& original_url) override; void AddSupportedKeySystems( std::vector>* key_systems) override; diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index 6d777eb64..29812101d 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -5,6 +5,7 @@ #include "libcef/renderer/blink_glue.h" +#include "third_party/blink/public/mojom/v8_cache_options.mojom-blink.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url_response.h" #include "third_party/blink/public/web/web_document.h" @@ -13,6 +14,8 @@ #include "third_party/blink/public/web/web_node.h" #include "third_party/blink/public/web/web_view_client.h" +#include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h" +#include "third_party/blink/renderer/bindings/core/v8/script_evaluation_result.h" #include "third_party/blink/renderer/bindings/core/v8/script_source_code.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -163,27 +166,25 @@ bool IsTextControlElement(const blink::WebElement& element) { return web_element->IsTextControl(); } -v8::MaybeLocal ExecuteV8ScriptAndReturnValue( +v8::Local ExecuteV8ScriptAndReturnValue( const blink::WebString& source, const blink::WebString& source_url, int start_line, v8::Local context, v8::Isolate* isolate, - v8::TryCatch& tryCatch, - blink::SanitizeScriptErrors sanitizeScriptErrors) { + v8::TryCatch& tryCatch) { // Based on ScriptController::executeScriptAndReturnValue DCHECK(isolate); if (start_line < 1) start_line = 1; - v8::MaybeLocal result; - blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context); if (!frame) - return result; + return v8::Local(); - blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault); + blink::mojom::V8CacheOptions v8CacheOptions( + blink::mojom::V8CacheOptions::kDefault); if (const blink::Settings* settings = frame->GetSettings()) v8CacheOptions = settings->GetV8CacheOptions(); @@ -194,15 +195,21 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), WTF::OrdinalNumber::FromZeroBasedInt(0))); - result = blink::V8ScriptRunner::CompileAndRunScript( + // The Rethrow() message is unused due to kDoNotSanitize but it still needs + // to be non-nullopt for exceptions to be re-thrown as expected. + auto result = blink::V8ScriptRunner::CompileAndRunScript( isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc, - ssc.Url(), sanitizeScriptErrors, blink::ScriptFetchOptions(), - v8CacheOptions); - if (result.IsEmpty()) { - DCHECK(tryCatch.HasCaught()); + ssc.Url(), blink::SanitizeScriptErrors::kDoNotSanitize, + blink::ScriptFetchOptions(), std::move(v8CacheOptions), + blink::V8ScriptRunner::RethrowErrorsOption::Rethrow("")); + + if (result.GetResultType() == + blink::ScriptEvaluationResult::ResultType::kSuccess) { + return result.GetSuccessValue(); } - return result; + DCHECK(tryCatch.HasCaught()); + return v8::Local(); } bool IsScriptForbidden() { diff --git a/libcef/renderer/blink_glue.h b/libcef/renderer/blink_glue.h index 6f81e8ce9..dd15d7a0d 100644 --- a/libcef/renderer/blink_glue.h +++ b/libcef/renderer/blink_glue.h @@ -15,7 +15,6 @@ #include "base/macros.h" #include "third_party/blink/public/platform/web_common.h" -#include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h" #include "v8/include/v8.h" namespace blink { @@ -56,14 +55,13 @@ BLINK_EXPORT v8::MaybeLocal CallV8Function( v8::Local args[], v8::Isolate* isolate); -BLINK_EXPORT v8::MaybeLocal ExecuteV8ScriptAndReturnValue( +BLINK_EXPORT v8::Local ExecuteV8ScriptAndReturnValue( const blink::WebString& source, const blink::WebString& source_url, int start_line, v8::Local context, v8::Isolate* isolate, - v8::TryCatch& tryCatch, - blink::SanitizeScriptErrors sanitizeScriptErrors); + v8::TryCatch& tryCatch); BLINK_EXPORT bool IsScriptForbidden(); diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index 5983e3030..b126b54d2 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -120,7 +120,7 @@ void CefBrowserImpl::StopLoad() { if (render_view()->GetWebView()) { blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { - main_frame->ToWebLocalFrame()->StopLoading(); + main_frame->ToWebLocalFrame()->DeprecatedStopLoading(); } } } diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 90a99b196..8d1178922 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -21,9 +21,7 @@ #include "extensions/renderer/dispatcher.h" #include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extensions_render_frame_observer.h" -#include "extensions/renderer/guest_view/extensions_guest_view_container.h" #include "extensions/renderer/guest_view/extensions_guest_view_container_dispatcher.h" -#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h" #include "extensions/renderer/renderer_extension_registry.h" #include "extensions/renderer/script_context.h" #include "third_party/blink/public/web/web_document.h" @@ -177,17 +175,4 @@ bool CefExtensionsRendererClient::IsStandaloneExtensionProcess() { extensions::switches::kExtensionProcess); } -// static -content::BrowserPluginDelegate* -CefExtensionsRendererClient::CreateBrowserPluginDelegate( - content::RenderFrame* render_frame, - const content::WebPluginInfo& info, - const std::string& mime_type, - const GURL& original_url) { - if (mime_type == content::kBrowserPluginMimeType) - return new extensions::ExtensionsGuestViewContainer(render_frame); - return new extensions::MimeHandlerViewContainer(render_frame, info, mime_type, - original_url); -} - } // namespace extensions diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 206af6640..eb7f13d12 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -77,11 +77,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame); static bool IsStandaloneExtensionProcess(); - static content::BrowserPluginDelegate* CreateBrowserPluginDelegate( - content::RenderFrame* render_frame, - const content::WebPluginInfo& info, - const std::string& mime_type, - const GURL& original_url); private: std::unique_ptr extension_dispatcher_; diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 278da211e..a0127b251 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -1098,15 +1098,14 @@ bool CefV8ContextImpl::Eval(const CefString& code, v8::TryCatch try_catch(isolate); try_catch.SetVerbose(true); - v8::MaybeLocal func_rv = blink_glue::ExecuteV8ScriptAndReturnValue( - source, source_url, start_line, context, isolate, try_catch, - blink::SanitizeScriptErrors::kSanitize); + v8::Local func_rv = blink_glue::ExecuteV8ScriptAndReturnValue( + source, source_url, start_line, context, isolate, try_catch); if (try_catch.HasCaught()) { exception = new CefV8ExceptionImpl(context, try_catch.Message()); return false; } else if (!func_rv.IsEmpty()) { - retval = new CefV8ValueImpl(isolate, context, func_rv.ToLocalChecked()); + retval = new CefV8ValueImpl(isolate, context, func_rv); return true; } diff --git a/libcef_dll/libcef_dll.cc b/libcef_dll/libcef_dll.cc index 90df59aff..bb27219fa 100644 --- a/libcef_dll/libcef_dll.cc +++ b/libcef_dll/libcef_dll.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=c42cd0225d8e4286df471fcc622f9bbf9ed977d3$ +// $hash=b2bc3d843217869087e7b1a381d70d687b71a8ff$ // #include "include/capi/cef_app_capi.h" @@ -610,7 +610,6 @@ CEF_EXPORT struct _cef_value_t* cef_parse_json_buffer( CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( const cef_string_t* json_string, cef_json_parser_options_t options, - cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -618,28 +617,17 @@ CEF_EXPORT struct _cef_value_t* cef_parse_jsonand_return_error( DCHECK(json_string); if (!json_string) return NULL; - // Verify param: error_code_out; type: simple_byref - DCHECK(error_code_out); - if (!error_code_out) - return NULL; // Verify param: error_msg_out; type: string_byref DCHECK(error_msg_out); if (!error_msg_out) return NULL; - // Translate param: error_code_out; type: simple_byref - cef_json_parser_error_t error_code_outVal = - error_code_out ? *error_code_out : JSON_NO_ERROR; // Translate param: error_msg_out; type: string_byref CefString error_msg_outStr(error_msg_out); // Execute CefRefPtr _retval = CefParseJSONAndReturnError( - CefString(json_string), options, error_code_outVal, error_msg_outStr); - - // Restore param: error_code_out; type: simple_byref - if (error_code_out) - *error_code_out = error_code_outVal; + CefString(json_string), options, error_msg_outStr); // Return type: refptr_same return CefValueCppToC::Wrap(_retval); diff --git a/libcef_dll/wrapper/libcef_dll_dylib.cc b/libcef_dll/wrapper/libcef_dll_dylib.cc index 58a257d7c..4ac0cf058 100644 --- a/libcef_dll/wrapper/libcef_dll_dylib.cc +++ b/libcef_dll/wrapper/libcef_dll_dylib.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=66b734973339eb27399083e978844f7d5a6a6c44$ +// $hash=1a80e75d625c78a0ed31b6562f597cbf4d30dfb1$ // #include @@ -144,7 +144,6 @@ typedef struct _cef_value_t* ( typedef struct _cef_value_t* (*cef_parse_jsonand_return_error_ptr)( const cef_string_t*, cef_json_parser_options_t, - cef_json_parser_error_t*, cef_string_t*); typedef cef_string_userfree_t (*cef_write_json_ptr)(struct _cef_value_t*, cef_json_writer_options_t); @@ -1149,10 +1148,9 @@ NO_SANITIZE("cfi-icall") struct _cef_value_t* cef_parse_jsonand_return_error( const cef_string_t* json_string, cef_json_parser_options_t options, - cef_json_parser_error_t* error_code_out, cef_string_t* error_msg_out) { - return g_libcef_pointers.cef_parse_jsonand_return_error( - json_string, options, error_code_out, error_msg_out); + return g_libcef_pointers.cef_parse_jsonand_return_error(json_string, options, + error_msg_out); } NO_SANITIZE("cfi-icall") diff --git a/libcef_dll/wrapper/libcef_dll_wrapper.cc b/libcef_dll/wrapper/libcef_dll_wrapper.cc index 052e3a878..f19409aec 100644 --- a/libcef_dll/wrapper/libcef_dll_wrapper.cc +++ b/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=7db8dbe24a2510d9ae0649f1569909711017c064$ +// $hash=a62513bd0425ca940f4a91a836b97674351c8123$ // #include "include/capi/cef_app_capi.h" @@ -579,7 +579,6 @@ NO_SANITIZE("cfi-icall") CEF_GLOBAL CefRefPtr CefParseJSONAndReturnError( const CefString& json_string, cef_json_parser_options_t options, - cef_json_parser_error_t& error_code_out, CefString& error_msg_out) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -590,8 +589,7 @@ CEF_GLOBAL CefRefPtr CefParseJSONAndReturnError( // Execute cef_value_t* _retval = cef_parse_jsonand_return_error( - json_string.GetStruct(), options, &error_code_out, - error_msg_out.GetWritableStruct()); + json_string.GetStruct(), options, error_msg_out.GetWritableStruct()); // Return type: refptr_same return CefValueCToCpp::Wrap(_retval); diff --git a/patch/patch.cfg b/patch/patch.cfg index 155e03eb3..b07cfb4a5 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -44,10 +44,6 @@ patches = [ { # Support component builds (GN is_component_build=true). # https://bitbucket.org/chromiumembedded/cef/issues/1617 - # - # Export GetUnicodeCharacterFromXKeySym and XKeySymToDomKey - # to fix component builds. - # https://bitbucket.org/chromiumembedded/cef/issues/2587 'name': 'component_build', }, { @@ -72,7 +68,7 @@ patches = [ # # Allow customization of the WebView background color. # https://bitbucket.org/chromiumembedded/cef/issues/2345 - 'name': 'webkit_popups', + 'name': 'webkit_popups_and_background', }, { # Fix export of UnderlayOpenGLHostingWindow for 64-bit OS X builds. @@ -126,12 +122,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2727 'name': 'mime_handler_view_guest_1565_2727', }, - { - # Allow customization of the WebView background color. - # https://bitbucket.org/chromiumembedded/cef/issues/1161 - # https://codereview.chromium.org/228603007/ - 'name': 'prefs_content_1161', - }, { # Fix drag&drop of combined text and URL data on Linux/Aura. # https://codereview.chromium.org/208313009 @@ -148,12 +138,16 @@ patches = [ 'name': 'ime_1610', }, { - # Split service_manager::Main into the separate steps required by CEF. + # Split content::ContentMain into the separate steps required by CEF. # https://bugs.chromium.org/p/chromium/issues/detail?id=654986#c17 # # Remove DCHECK on Linux when initialized CEF from a non-main thread. # https://bitbucket.org/chromiumembedded/cef/issue/1639 - 'name': 'service_manager_654986', + # + # Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded + # message loop. + # https://bitbucket.org/chromiumembedded/cef/issues/2798 + 'name': 'content_main_654986', }, { # Fix missing check for defined(ENABLE_THEMES) in @@ -201,11 +195,8 @@ patches = [ { # Support CEF changes in chrome/browser. # - # Linux: Fix sharesheet-related linker errors. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 - # - # Linux: Fix ShareTarget duplicate symbols errors. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1123395 + # Linux: Fix duplicate symbol errors with Ozone and X11 enabled. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1085700#c92 'name': 'chrome_browser', }, { @@ -250,8 +241,8 @@ patches = [ # From chrome/browser/ui/browser_commands.cc via # chrome/browser/printing/print_view_manager_common.h # - # Linux: Fix sharesheet-related linker errors. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 + # Linux: Fix duplicate symbol errors with Ozone and X11 enabled. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1085700#c93 'name': 'chrome_browser_net_export', }, { @@ -267,8 +258,7 @@ patches = [ { # Allow CEF to share Chrome plugin loading code. # - # Restore the BrowserPluginGuest::GetEmbedderFrame() method removed in - # https://crbug.com/533069#c43. + # Add BrowserPluginGuest::owner_web_contents() method. 'name': 'chrome_plugins', }, { @@ -362,11 +352,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2274 'name': 'win_rt_2274', }, - { - # Fix DCHECK running OSRTest.DragDropUpdateCursor. - # https://bugs.chromium.org/p/chromium/issues/detail?id=781966 - 'name': 'webkit_pointer_event_781966', - }, { # macOS: Fix undesirable switch to discrete GPU during startup. # https://bitbucket.org/chromiumembedded/cef/issues/2398 @@ -426,6 +411,13 @@ patches = [ # Compute correct default quota when cache_path is unspecified. 'name': 'services_network_2718', }, + { + # Restore the net::LOAD_DO_NOT_SEND_COOKIES flag to support disabling of + # cookie load/save on a per-request basis. + # Partially reverts the changes from + # https://chromium.googlesource.com/chromium/src/+/25eaa43022 + 'name': 'net_cookie_flags', + }, { # Restore WebView::SetResizeBackgroundColor() that was removed. # http://crrev.com/3955c9f9eb @@ -470,16 +462,10 @@ patches = [ { # Remove cef_sandbox dependency on boringssl MD5/SHA1 functions. # https://bitbucket.org/chromiumembedded/cef/issues/2743 - 'name': 'base_sandbox_2743', - }, - { - # Fix component build error due to ContentServiceManagerMainDelegate not - # being exported. # - # Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded - # message loop. - # https://bitbucket.org/chromiumembedded/cef/issues/2798 - 'name': 'content_app_shutdown_2798', + # Enable the VS 2015 Update 2 fix when building with the MSVC standard + # library. + 'name': 'base_sandbox_2743', }, { # Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling @@ -520,15 +506,15 @@ patches = [ # https://bugs.chromium.org/p/chromium/issues/detail?id=1100085 'name': 'chrome_browser_background_mode_1100085', }, - { - # Windows: Fix flickering issue with GPU rendering. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1123950 - 'name': 'ui_gl_utils_1123950', - }, { # Windows: Fix cef_sandbox compile error due to missing include. # Fixed by the below change in more recent Chromium versions. # https://bugs.chromium.org/p/chromium/issues/detail?id=1049498#c14 'name': 'base_string_piece_1049498', + }, + { + # Linux: Fix Sharesheet undefined symbol error. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 + 'name': 'chrome_browser_sharesheet_1123388', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index f763a7d03..e0ae53623 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 b2a25c8c376c..c21bc286abf7 100644 +index 1d449b35bf40..0b859084ba1c 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -33,6 +33,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index b2a25c8c376c..c21bc286abf7 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1641,7 +1642,11 @@ component("base") { +@@ -1646,7 +1647,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,6 +23,19 @@ index b2a25c8c376c..c21bc286abf7 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", +@@ -1841,6 +1846,12 @@ component("base") { + defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] + } + ++ if (!use_custom_libcxx) { ++ # Enable the VS 2015 Update 2 fix when building with the MSVC standard ++ # library. ++ defines += [ "_ENABLE_ATOMIC_ALIGNMENT_FIX" ] ++ } ++ + # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. + configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] + diff --git base/hash/md5.h base/hash/md5.h index 8a49f08dcb04..2f03d7a6d1b3 100644 --- base/hash/md5.h diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch index 7f9a6fc8a..93d7e92ab 100644 --- a/patch/patches/base_string_piece_1049498.patch +++ b/patch/patches/base_string_piece_1049498.patch @@ -1,5 +1,5 @@ diff --git base/strings/string_piece.h base/strings/string_piece.h -index c650cfa84d59..0d6ff1ab5684 100644 +index b10707d94ef9..1bfa980cbbe6 100644 --- base/strings/string_piece.h +++ base/strings/string_piece.h @@ -24,6 +24,7 @@ diff --git a/patch/patches/browser_compositor_mac.patch b/patch/patches/browser_compositor_mac.patch index 626505376..1e5cd6930 100644 --- a/patch/patches/browser_compositor_mac.patch +++ b/patch/patches/browser_compositor_mac.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h -index 5d8eae87ed64..427c11ceb549 100644 +index 202bd7aa0d57..20067b203d96 100644 --- content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h @@ -58,6 +58,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, @@ -12,10 +12,10 @@ index 5d8eae87ed64..427c11ceb549 100644 // Force a new surface id to be allocated. Returns true if the // RenderWidgetHostImpl sent the resulting surface id to the renderer. diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm -index 07e91e20d4c1..565e98f015eb 100644 +index c9885b773743..dbd06e177d96 100644 --- content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -85,6 +85,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() { +@@ -86,6 +86,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() { return delegated_frame_host_.get(); } diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index d49b067fc..c4206fc36 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 df3ab602e8b8..fa864443fe35 100644 +index 82801d316d76..4616c1caf493 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc @@ -240,7 +240,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { @@ -10,4 +10,4 @@ index df3ab602e8b8..fa864443fe35 100644 + if (!g_browser_task_executor || !g_browser_task_executor->ui_thread_executor_) return; - DCHECK(g_browser_task_executor->ui_thread_executor_); + DCHECK(Get()->ui_thread_executor_); diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index b0e00cac2..1cdbfd884 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,21 +1,21 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index 9cd1ff2b9222..2f5264de68c4 100644 +index dfa87d00c03b..d04b6dd692dd 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1548,6 +1548,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( - // DeclarativeApiTest.PersistRules. - if (actual_process_lock.matches_scheme(url::kDataScheme)) - return true; +@@ -1680,6 +1680,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( + // DeclarativeApiTest.PersistRules. + if (actual_process_lock.matches_scheme(url::kDataScheme)) + return true; + -+ // Allow other schemes that are non-standard, non-local and WebSafe. -+ if (lock_url.is_valid() && -+ !lock_url.IsStandard() && -+ !base::Contains(url::GetLocalSchemes(), -+ lock_url.scheme_piece()) && -+ base::Contains(schemes_okay_to_request_in_any_process_, -+ lock_url.scheme_piece())) { -+ return true; -+ } - } ++ // Allow other schemes that are non-standard, non-local and WebSafe. ++ if (lock_url.is_valid() && ++ !lock_url.IsStandard() && ++ !base::Contains(url::GetLocalSchemes(), ++ lock_url.scheme_piece()) && ++ base::Contains(schemes_okay_to_request_in_any_process_, ++ lock_url.scheme_piece())) { ++ return true; ++ } + } - // TODO(wjmaclean): We should update the ProcessLock comparison API to + // TODO(wjmaclean): We should update the ProcessLock comparison API to diff --git a/patch/patches/build.patch b/patch/patches/build.patch index c6b1fc1e2..712b31fe0 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,10 +1,10 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 8166e38ceda5..178099b1ac62 100644 +index 4f6461b6b5f5..58bb48800898 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1767,8 +1767,6 @@ config("thin_archive") { +@@ -1766,8 +1766,6 @@ config("thin_archive") { # archive names to 16 characters, which is not what we want). - if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { + if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { arflags = [ "-T" ] - } else if (is_win && use_lld) { - arflags = [ "/llvmlibthin" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 49b590db8..ace1aff32 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 6cb9ee1f0764..8109a134907e 100644 +index e462f7d8bef1..6c1c686f161c 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/crypto.gni") @@ -10,15 +10,15 @@ index 6cb9ee1f0764..8109a134907e 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1870,6 +1871,7 @@ static_library("browser") { +@@ -1876,6 +1877,7 @@ static_library("browser") { "//build:branding_buildflags", - "//build:lacros_buildflags", + "//build:chromeos_buildflags", "//cc", + "//cef/libcef/features", "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2221,6 +2223,10 @@ static_library("browser") { +@@ -2354,6 +2356,10 @@ static_library("browser") { ] } @@ -29,75 +29,12 @@ index 6cb9ee1f0764..8109a134907e 100644 if (is_android) { sources += [ "after_startup_task_utils_android.cc", -@@ -3422,8 +3428,6 @@ static_library("browser") { - "nearby_sharing/outgoing_share_target_info.h", - "nearby_sharing/paired_key_verification_runner.cc", - "nearby_sharing/paired_key_verification_runner.h", -- "nearby_sharing/share_target.cc", -- "nearby_sharing/share_target.h", - "nearby_sharing/share_target_discovered_callback.h", - "nearby_sharing/share_target_info.cc", - "nearby_sharing/share_target_info.h", -@@ -3617,13 +3621,6 @@ static_library("browser") { - "serial/serial_chooser_context_factory.cc", - "serial/serial_chooser_context_factory.h", - "serial/serial_chooser_histograms.h", -- "sharesheet/sharesheet_controller.h", -- "sharesheet/sharesheet_service.cc", -- "sharesheet/sharesheet_service.h", -- "sharesheet/sharesheet_service_delegate.cc", -- "sharesheet/sharesheet_service_delegate.h", -- "sharesheet/sharesheet_service_factory.cc", -- "sharesheet/sharesheet_service_factory.h", - "sharing/click_to_call/click_to_call_context_menu_observer.cc", - "sharing/click_to_call/click_to_call_context_menu_observer.h", - "sharing/click_to_call/click_to_call_metrics.cc", -diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 7ccd06a9b0fe..183da2c7238d 100644 ---- chrome/browser/ui/views/toolbar/toolbar_view.cc -+++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -232,8 +232,8 @@ void ToolbarView::Init() { - media_button = std::make_unique(browser_); - } +@@ -4821,7 +4827,7 @@ static_library("browser") { + ] + } -- std::unique_ptr sharesheet_button; - #if defined(OS_CHROMEOS) -+ std::unique_ptr sharesheet_button; - if (base::FeatureList::IsEnabled(features::kSharesheet)) { - sharesheet_button = std::make_unique(browser_); - } -@@ -276,8 +276,10 @@ void ToolbarView::Init() { - if (media_button) - media_button_ = AddChildView(std::move(media_button)); - -+#if defined(OS_CHROMEOS) - if (sharesheet_button) - sharesheet_button_ = AddChildView(std::move(sharesheet_button)); -+#endif - - if (toolbar_account_icon_container) { - toolbar_account_icon_container_ = -@@ -966,3 +968,4 @@ void ToolbarView::OnTouchUiChanged() { - PreferredSizeChanged(); - } - } -+ -diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index f4af66fa98b3..3c4d171c091e 100644 ---- chrome/browser/ui/views/toolbar/toolbar_view.h -+++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -273,7 +273,9 @@ class ToolbarView : public views::AccessiblePaneView, - media_router::CastToolbarButton* cast_ = nullptr; - ToolbarAccountIconContainerView* toolbar_account_icon_container_ = nullptr; - AvatarToolbarButton* avatar_ = nullptr; -+#if defined(OS_CHROMEOS) - SharesheetButton* sharesheet_button_ = nullptr; -+#endif - MediaToolbarButtonView* media_button_ = nullptr; - BrowserAppMenuButton* app_menu_button_ = nullptr; - -@@ -302,3 +304,4 @@ class ToolbarView : public views::AccessiblePaneView, - }; - - #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ -+ +- if (use_ozone) { ++ if (use_ozone && !use_x11) { + sources += [ + "fullscreen_ozone.cc", + "media/webrtc/window_icon_util_ozone.cc", diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 8725e50a8..908a1cf52 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 8493d1b2233b..69efa5114c6f 100644 +index ce66d73e0fa4..cc62e05ba3ba 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm @@ -1141,6 +1141,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; @@ -35,10 +35,10 @@ index 8493d1b2233b..69efa5114c6f 100644 return dockMenu; } diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index 132f2a8d15fd..1262f31d39db 100644 +index b6fe1fee2cbb..84a75c6070d6 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h -@@ -201,10 +201,12 @@ class BrowserProcess { +@@ -202,10 +202,12 @@ class BrowserProcess { virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0; @@ -52,10 +52,10 @@ index 132f2a8d15fd..1262f31d39db 100644 // Returns the StatusTray, which provides an API for displaying status icons // in the system status tray. Returns NULL if status icons are not supported diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 254173b22652..93f0eb216cc7 100644 +index 443348c2de00..7486628a9912 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -955,24 +955,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -951,24 +951,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -83,7 +83,7 @@ index 254173b22652..93f0eb216cc7 100644 StatusTray* BrowserProcessImpl::status_tray() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index 124ebbf06ea2..c47e6b6cf24c 100644 +index 8a8d8a820690..c06d97c65ec2 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h @@ -163,9 +163,11 @@ class BrowserProcessImpl : public BrowserProcess, @@ -99,10 +99,10 @@ index 124ebbf06ea2..c47e6b6cf24c 100644 safe_browsing::SafeBrowsingService* safe_browsing_service() override; subresource_filter::RulesetService* subresource_filter_ruleset_service() diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index d20c93b35f39..badf57a88d90 100644 +index 845abd9ea9ab..29a5cfb36448 100644 --- chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc -@@ -148,12 +148,14 @@ void BrowserCloseManager::CloseBrowsers() { +@@ -147,12 +147,14 @@ void BrowserCloseManager::CloseBrowsers() { // exit can restore all browsers open before exiting. ProfileManager::ShutdownSessionServices(); #endif @@ -118,10 +118,10 @@ index d20c93b35f39..badf57a88d90 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/session_service.cc chrome/browser/sessions/session_service.cc -index 73d97b1da62a..eec9c645366f 100644 +index 1ed498e97be4..56e56b4d765a 100644 --- chrome/browser/sessions/session_service.cc +++ chrome/browser/sessions/session_service.cc -@@ -939,12 +939,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { +@@ -954,12 +954,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { if (!profile() || profile()->AsTestingProfile()) return; diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index eca6ed741..4cee4c2d6 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,7 +13,7 @@ index af2282034336..c49d920f73b5 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 71ec3bbbf1b6..10d47a4f021e 100644 +index 24954ee7e0e8..2b883c5316c6 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc @@ -257,6 +257,20 @@ @@ -37,7 +37,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -470,6 +484,13 @@ Browser::Browser(const CreateParams& params) +@@ -474,6 +488,13 @@ Browser::Browser(const CreateParams& params) CHECK(CanCreateBrowserForProfile(profile_)); @@ -51,7 +51,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 tab_strip_model_->AddObserver(this); location_bar_model_ = std::make_unique( -@@ -1318,6 +1339,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1346,6 +1367,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1325,8 +1354,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1353,8 +1382,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1601,6 +1640,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1609,6 +1648,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1713,6 +1760,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1721,6 +1768,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -111,7 +111,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1740,6 +1789,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1748,6 +1797,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -120,7 +120,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 if (!GetStatusBubble()) return; -@@ -1747,6 +1798,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1755,6 +1806,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -138,7 +138,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1863,6 +1925,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1871,6 +1933,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -149,7 +149,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1899,6 +1965,8 @@ void Browser::RendererResponsive( +@@ -1907,6 +1973,8 @@ void Browser::RendererResponsive( void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); @@ -158,7 +158,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1949,11 +2017,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1957,11 +2025,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -174,7 +174,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2814,6 +2886,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2822,6 +2894,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -184,7 +184,7 @@ index 71ec3bbbf1b6..10d47a4f021e 100644 void Browser::CloseFrame() { diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index ab2a03e6e878..aef94abf4fd8 100644 +index c67b79ec647a..532bb064b080 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -21,6 +21,7 @@ @@ -206,9 +206,9 @@ index ab2a03e6e878..aef94abf4fd8 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -241,6 +246,11 @@ class Browser : public TabStripModelObserver, - // default. Intended for testing. - BrowserWindow* window = nullptr; +@@ -247,6 +252,11 @@ class Browser : public TabStripModelObserver, + // User-set title of this browser window, if there is one. + std::string user_title; +#if BUILDFLAG(ENABLE_CEF) + // Opaque CEF-specific configuration. Will be propagated to new Browsers. @@ -218,7 +218,7 @@ index ab2a03e6e878..aef94abf4fd8 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -358,6 +368,12 @@ class Browser : public TabStripModelObserver, +@@ -365,6 +375,12 @@ class Browser : public TabStripModelObserver, return &signin_view_controller_; } @@ -231,7 +231,7 @@ index ab2a03e6e878..aef94abf4fd8 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -742,6 +758,11 @@ class Browser : public TabStripModelObserver, +@@ -755,6 +771,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -243,7 +243,7 @@ index ab2a03e6e878..aef94abf4fd8 100644 void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1206,6 +1227,10 @@ class Browser : public TabStripModelObserver, +@@ -1221,6 +1242,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -255,7 +255,7 @@ index ab2a03e6e878..aef94abf4fd8 100644 // Stores the list of browser windows showing via a menu. diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 6d6a3b90dcad..fbfe4a0c959c 100644 +index 675dae9023fe..770a85a45f8f 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc @@ -435,6 +435,13 @@ std::unique_ptr CreateTargetContents( @@ -273,10 +273,10 @@ index 6d6a3b90dcad..fbfe4a0c959c 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 c8df2ade2443..0e350adda289 100644 +index f5134591c3dd..8d0211b43791 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc -@@ -28,9 +28,13 @@ void AddTabAt(Browser* browser, +@@ -30,9 +30,13 @@ void AddTabAt(Browser* browser, // Time new tab page creation time. We keep track of the timing data in // WebContents, but we want to include the time it takes to create the // WebContents object too. diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 83b6025e1..7ab135220 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 3e2d1221d91e..4fbf30796bdb 100644 +index f3b51e20cb9c..b479022f1d3b 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 @@ @@ -36,7 +36,7 @@ index 3e2d1221d91e..4fbf30796bdb 100644 #endif } -@@ -98,10 +109,16 @@ scoped_refptr +@@ -97,10 +108,16 @@ scoped_refptr std::move(allowlist_provider)); #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -54,10 +54,10 @@ index 3e2d1221d91e..4fbf30796bdb 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 450005f9fc0b..13fca8b3e2d2 100644 +index 20ae512af806..e03946e7ce80 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc -@@ -183,7 +183,7 @@ ContentSetting GetContentSettingFromRulesImpl( +@@ -176,7 +176,7 @@ ContentSetting GetContentSettingFromRulesImpl( return rule.GetContentSetting(); } } diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index f483cef41..d29155f91 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 c7bd97a32af1..311f2c52af8d 100644 +index bf4ca6cdccc4..1b9607765313 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -10,6 +10,7 @@ import("//build/config/crypto.gni") @@ -10,7 +10,7 @@ index c7bd97a32af1..311f2c52af8d 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -334,6 +335,10 @@ static_library("ui") { +@@ -330,6 +331,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index c7bd97a32af1..311f2c52af8d 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 -@@ -355,6 +360,7 @@ static_library("ui") { +@@ -351,6 +356,7 @@ static_library("ui") { "//base/allocator:buildflags", "//build:branding_buildflags", "//cc/paint", @@ -29,23 +29,25 @@ index c7bd97a32af1..311f2c52af8d 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1532,6 +1538,7 @@ static_library("ui") { - "//components/network_session_configurator/common", +@@ -1525,6 +1531,7 @@ static_library("ui") { "//components/page_load_metrics/browser", "//components/performance_manager:site_data_proto", + "//components/printing/browser", + "//components/printing/common:mojo_interfaces", "//components/profile_metrics", "//components/safety_check", "//components/search_provider_logos", -@@ -3905,8 +3912,6 @@ static_library("ui") { - "views/toolbar/home_button.h", - "views/toolbar/reload_button.cc", - "views/toolbar/reload_button.h", -- "views/toolbar/sharesheet_button.cc", -- "views/toolbar/sharesheet_button.h", - "views/toolbar/toolbar_account_icon_container_view.cc", - "views/toolbar/toolbar_account_icon_container_view.h", - "views/toolbar/toolbar_action_view.cc", +@@ -3243,7 +3250,9 @@ static_library("ui") { + "views/frame/browser_desktop_window_tree_host_platform.h", + ] + } +- sources += [ "views/frame/native_browser_frame_factory_ozone.cc" ] ++ if (!use_x11) { ++ sources += [ "views/frame/native_browser_frame_factory_ozone.cc" ] ++ } + } + if (is_desktop_linux) { + sources += [ diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc index f27414c41891..5ff3bfa8f724 100644 --- chrome/browser/ui/webui/net_export_ui.cc diff --git a/patch/patches/chrome_browser_product_override.patch b/patch/patches/chrome_browser_product_override.patch index a398f3b33..c0de47a8c 100644 --- a/patch/patches/chrome_browser_product_override.patch +++ b/patch/patches/chrome_browser_product_override.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index e520e957ddea..34c402af6d35 100644 +index c5c7a662232d..c1d9e8c5434d 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -1022,10 +1022,6 @@ void LaunchURL(const GURL& url, +@@ -1035,10 +1035,6 @@ void LaunchURL(const GURL& url, } } @@ -13,7 +13,7 @@ index e520e957ddea..34c402af6d35 100644 void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { // |allowlist| combines pref/policy + cmdline switch in the browser process. // For renderer and utility (e.g. NetworkService) processes the switch is the -@@ -1204,6 +1200,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() { +@@ -1217,6 +1213,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() { return *greased_brand_version_list; } @@ -29,10 +29,10 @@ index e520e957ddea..34c402af6d35 100644 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUserAgent)) { diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index a47818dc2f0f..08148534aeea 100644 +index ef7da4343581..93ad5e8b1d9b 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -91,7 +91,8 @@ class ChromeXrIntegrationClient; +@@ -98,7 +98,8 @@ class ChromeXrIntegrationClient; } #endif diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index 5ce9585a5..9d42be252 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 9b9335369a4f..fea76956bd41 100644 +index 670a33244287..9c13775f385d 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -374,7 +374,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -373,7 +373,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -12,10 +12,10 @@ index 9b9335369a4f..fea76956bd41 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 93571e419253..bc77bebce943 100644 +index 8d0793739a72..8f5097889fcb 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -101,7 +101,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -99,7 +99,7 @@ class ProfileManager : public content::NotificationObserver, // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -24,7 +24,7 @@ index 93571e419253..bc77bebce943 100644 // Returns regular or off-the-record profile given its profile key. static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); -@@ -134,7 +134,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -132,7 +132,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -33,7 +33,7 @@ index 93571e419253..bc77bebce943 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -143,7 +143,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -141,7 +141,7 @@ class ProfileManager : public content::NotificationObserver, // Get the Profile last used (the Profile to which owns the most recently // focused window) with this Chrome build. If no signed profile has been // stored in Local State, hand back the Default profile. diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 217aeff30..b0b6ad66d 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 7f54cacab005..b4f509b766ca 100644 +index 8d48495d450e..eea8b9c41e54 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn -@@ -251,6 +251,7 @@ static_library("safe_browsing") { +@@ -260,6 +260,7 @@ static_library("safe_browsing") { "//chrome/common/safe_browsing:download_type_util", "//chrome/services/file_util/public/cpp", "//components/content_settings/core/browser", diff --git a/patch/patches/chrome_browser_sharesheet_1123388.patch b/patch/patches/chrome_browser_sharesheet_1123388.patch new file mode 100644 index 000000000..863326e95 --- /dev/null +++ b/patch/patches/chrome_browser_sharesheet_1123388.patch @@ -0,0 +1,70 @@ +diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc +index ceea6a38ca79..6e8e335222bc 100644 +--- chrome/browser/sharesheet/sharesheet_service_delegate.cc ++++ chrome/browser/sharesheet/sharesheet_service_delegate.cc +@@ -21,8 +21,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate( + content::WebContents* web_contents, + SharesheetService* sharesheet_service) + : id_(id), ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_( + std::make_unique(web_contents, this)), ++#endif + sharesheet_service_(sharesheet_service) {} + + SharesheetServiceDelegate::~SharesheetServiceDelegate() = default; +@@ -31,18 +33,24 @@ void SharesheetServiceDelegate::ShowBubble( + std::vector targets, + apps::mojom::IntentPtr intent, + sharesheet::CloseCallback close_callback) { ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent), + std::move(close_callback)); ++#endif + } + + void SharesheetServiceDelegate::OnBubbleClosed( + const base::string16& active_action) { ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_.release(); ++#endif + sharesheet_service_->OnBubbleClosed(id_, active_action); + } + + void SharesheetServiceDelegate::OnActionLaunched() { ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_->ShowActionView(); ++#endif + } + + void SharesheetServiceDelegate::OnTargetSelected( +@@ -66,11 +74,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width, + const int& height) { + DCHECK_GT(width, 0); + DCHECK_GT(height, 0); ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_->ResizeBubble(width, height); ++#endif + } + + void SharesheetServiceDelegate::CloseSharesheet() { ++#if defined(OS_CHROMEOS) + sharesheet_bubble_view_->CloseBubble(); ++#endif + } + + } // namespace sharesheet +diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h +index 47f15a6b4093..71189bfee8b9 100644 +--- chrome/browser/sharesheet/sharesheet_service_delegate.h ++++ chrome/browser/sharesheet/sharesheet_service_delegate.h +@@ -59,7 +59,9 @@ class SharesheetServiceDelegate : public SharesheetController { + private: + const uint32_t id_; + base::string16 active_action_; ++#if defined(OS_CHROMEOS) + std::unique_ptr sharesheet_bubble_view_; ++#endif + SharesheetService* sharesheet_service_; + }; + diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index ec302c4e8..8f5cb1483 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 e49552e272e4..b935ef2d47b9 100644 +index a63433f6a77c..ad603df13e79 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc @@ -26,6 +26,7 @@ @@ -21,7 +21,7 @@ index e49552e272e4..b935ef2d47b9 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/scoped_observer.h" #include "extensions/browser/extension_registry_observer.h" -@@ -271,11 +276,19 @@ void ThemeService::Init() { +@@ -275,11 +280,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 94ed2cd41..7bfe59b31 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -197,10 +197,10 @@ index c1870b0f56ef..d32b8d54fb3f 100644 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); if (response_url.SchemeIsHTTPOrHTTPS() && diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index eb6e5d353b33..62994a141421 100644 +index c9852764a59c..ffe26ef879b9 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -823,6 +823,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -825,6 +825,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -208,7 +208,7 @@ index eb6e5d353b33..62994a141421 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1026,7 +1027,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1028,7 +1029,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -218,7 +218,7 @@ index eb6e5d353b33..62994a141421 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1035,7 +1037,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1037,7 +1039,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -228,7 +228,7 @@ index eb6e5d353b33..62994a141421 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1045,7 +1048,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1047,7 +1050,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -238,7 +238,7 @@ index eb6e5d353b33..62994a141421 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1053,7 +1057,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1055,7 +1059,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -267,17 +267,14 @@ index 4e883820f752..267c6af2af6b 100644 std::string message = base::StringPrintf( diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h -index c44044339647..3cdb3fb4bb63 100644 +index 4e1cf0118cb7..af941abfe235 100644 --- content/browser/browser_plugin/browser_plugin_guest.h +++ content/browser/browser_plugin/browser_plugin_guest.h -@@ -130,6 +130,11 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, +@@ -127,6 +127,8 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, void EmbedderSystemDragEnded(); void EndSystemDragIfApplicable(); -+ // Returns the embedder frame for this guest. -+ RenderFrameHost* GetEmbedderFrame() const { -+ return delegate_->GetEmbedderFrame(); -+ } ++ WebContentsImpl* owner_web_contents() const { return owner_web_contents_; } + protected: // BrowserPluginGuest is a WebContentsObserver of |web_contents| and diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 092cab0cc..ad7f716a2 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 cbf9a60c385e..06146091eb43 100644 +index ce49b5924986..596069095d86 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -4,6 +4,7 @@ @@ -10,7 +10,7 @@ index cbf9a60c385e..06146091eb43 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -134,6 +135,7 @@ static_library("renderer") { +@@ -141,6 +142,7 @@ static_library("renderer") { public_deps = [ "//components/contextual_search:buildflags" ] deps = [ @@ -18,7 +18,7 @@ index cbf9a60c385e..06146091eb43 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -199,6 +201,10 @@ static_library("renderer") { +@@ -206,6 +208,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 695e49b38..fe355f0a0 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 313975f42c0d..ee7f27dab6b7 100644 +index 8b7b6f492b3e..1085e4b1e23d 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -27,6 +27,7 @@ @@ -19,7 +19,7 @@ index 313975f42c0d..ee7f27dab6b7 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. -@@ -624,7 +627,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -640,7 +643,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index 313975f42c0d..ee7f27dab6b7 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -906,6 +911,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -922,6 +927,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index 313975f42c0d..ee7f27dab6b7 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -916,6 +922,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -932,6 +938,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,15 +45,15 @@ index 313975f42c0d..ee7f27dab6b7 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1040,6 +1047,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1056,6 +1063,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } + if (!cef::IsChromeRuntimeEnabled()) { #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). - if (process_type != service_manager::switches::kZygoteProcess) { -@@ -1072,6 +1080,7 @@ void ChromeMainDelegate::PreSandboxStartup() { + if (process_type != switches::kZygoteProcess) { +@@ -1088,6 +1096,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 313975f42c0d..ee7f27dab6b7 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1170,6 +1179,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1186,6 +1195,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index 313975f42c0d..ee7f27dab6b7 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 = -@@ -1186,6 +1196,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1202,6 +1212,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,18 +78,18 @@ index 313975f42c0d..ee7f27dab6b7 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 68a92d3924f0..280ef9019551 100644 +index c9bf19474a2a..3c1d5eec82fa 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -49,6 +49,7 @@ #include "build/build_config.h" - #include "build/lacros_buildflags.h" + #include "build/chromeos_buildflags.h" #include "cc/base/switches.h" +#include "cef/libcef/features/runtime.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -892,8 +893,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -893,8 +894,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 68a92d3924f0..280ef9019551 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1608,11 +1611,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1613,11 +1616,13 @@ 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|. @@ -117,18 +117,18 @@ index 68a92d3924f0..280ef9019551 100644 // Initialize autoupdate timer. Timer callback costs basically nothing // when browser is not in persistent mode, so it's OK to let it ride on diff --git chrome/browser/notifications/notification_platform_bridge_mac.mm chrome/browser/notifications/notification_platform_bridge_mac.mm -index ad52e63ed83a..6b16ee3ccc96 100644 +index c2905bfd0df7..09bfcf942a7c 100644 --- chrome/browser/notifications/notification_platform_bridge_mac.mm +++ chrome/browser/notifications/notification_platform_bridge_mac.mm -@@ -24,6 +24,7 @@ +@@ -25,6 +25,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/system/sys_info.h" +#include "cef/libcef/features/runtime.h" - #include "chrome/browser/browser_process.h" + #include "chrome/browser/browser_features.h" #include "chrome/browser/notifications/notification_common.h" #include "chrome/browser/notifications/notification_display_service_impl.h" -@@ -651,6 +652,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId +@@ -449,6 +450,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId - (id)serviceProxy { id proxy = [_xpcConnection remoteObjectProxy]; @@ -141,16 +141,3 @@ index ad52e63ed83a..6b16ee3ccc96 100644 if (!_setExceptionPort) { base::mac::ScopedMachSendRight exceptionPort( crash_reporter::GetCrashpadClient().GetHandlerMachPort()); -diff --git ui/gtk/select_file_dialog_impl_kde.cc ui/gtk/select_file_dialog_impl_kde.cc -index 464aa72e1d47..30a621dea6fc 100644 ---- ui/gtk/select_file_dialog_impl_kde.cc -+++ ui/gtk/select_file_dialog_impl_kde.cc -@@ -6,6 +6,8 @@ - #include - #include - -+#undef Success -+ - #include - #include - diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 78d2bbcf3..5f1376d94 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 6225a610f11b..693f75b4bb1f 100644 +index 4a6b5bb81c17..de8c4e03a9c9 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn @@ -5,6 +5,7 @@ diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index cf9cbdd10..2ccf6f81e 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -42,7 +42,7 @@ index 4dd9b2645d60..23b46ce1a43a 100644 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); ~SyntheticGestureTargetBase() override; diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h -index 886bdf0edf8f..1d714000cce5 100644 +index 57072bf1263a..0a93446e4d21 100644 --- content/common/content_switches_internal.h +++ content/common/content_switches_internal.h @@ -15,7 +15,7 @@ class CommandLine; @@ -55,7 +55,7 @@ index 886bdf0edf8f..1d714000cce5 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index 9cfeb73eb397..de5bc486f204 100644 +index 87c15e50b7f0..8f42ae4da8de 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -25,6 +25,7 @@ component("controller") { @@ -66,22 +66,22 @@ index 9cfeb73eb397..de5bc486f204 100644 "//third_party/blink/renderer:config", "//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:non_test_config", -@@ -45,6 +46,8 @@ component("controller") { - "memory_usage_monitor.h", - "performance_manager/renderer_resource_coordinator_impl.cc", - "performance_manager/renderer_resource_coordinator_impl.h", -+ "//cef/libcef/renderer/blink_glue.cc", -+ "//cef/libcef/renderer/blink_glue.h", +@@ -49,6 +50,8 @@ component("controller") { + "performance_manager/v8_detailed_memory_reporter_impl.h", + "performance_manager/v8_worker_memory_reporter.cc", + "performance_manager/v8_worker_memory_reporter.h", ++ "//cef/libcef/renderer/blink_glue.cc", ++ "//cef/libcef/renderer/blink_glue.h", ] if (is_linux || is_chromeos) { diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn -index 12f3abf92434..d73901dece01 100644 +index 4aae406b9ace..40ca74281b78 100644 --- ui/events/keycodes/BUILD.gn +++ ui/events/keycodes/BUILD.gn -@@ -16,6 +16,8 @@ source_set("xkb") { - - public_deps = [ "//ui/base:buildflags" ] +@@ -19,6 +19,8 @@ source_set("xkb") { + "//ui/gfx/x/keysyms", + ] + defines = [ "KEYCODES_X_IMPLEMENTATION" ] + @@ -109,25 +109,3 @@ index a1f9b78704fb..c7d3558251d9 100644 } // namespace ui -diff --git ui/events/keycodes/keysym_to_unicode.h ui/events/keycodes/keysym_to_unicode.h -index a7983d179832..2bbee48e57ac 100644 ---- ui/events/keycodes/keysym_to_unicode.h -+++ ui/events/keycodes/keysym_to_unicode.h -@@ -5,6 +5,8 @@ - #ifndef UI_EVENTS_KEYCODES_KEYSYM_TO_UNICODE_H_ - #define UI_EVENTS_KEYCODES_KEYSYM_TO_UNICODE_H_ - -+#include "ui/events/keycodes/keycodes_x_export.h" -+ - #include - - namespace ui { -@@ -13,7 +15,7 @@ namespace ui { - // |keysym| doesn't represent a printable character, returns zero. We don't - // support characters outside the Basic Plane, and this function returns zero - // in that case. --uint16_t GetUnicodeCharacterFromXKeySym(unsigned long keysym); -+KEYCODES_X_EXPORT uint16_t GetUnicodeCharacterFromXKeySym(unsigned long keysym); - - } // namespace ui - diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index f7704706f..91b80652a 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -74,47 +74,11 @@ index f66e6bca5e2b..c99998449b6b 100644 version.SetString("User-Agent", GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); -diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index caa2c1d4d0ab..f20dfe7ca7fe 100644 ---- content/browser/frame_host/render_frame_message_filter.cc -+++ content/browser/frame_host/render_frame_message_filter.cc -@@ -300,6 +300,7 @@ void RenderFrameMessageFilter::OnCreateChildFrame( - void RenderFrameMessageFilter::OnGetPluginInfo( - int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool* found, -@@ -307,8 +308,9 @@ void RenderFrameMessageFilter::OnGetPluginInfo( - std::string* actual_mime_type) { - bool allow_wildcard = true; - *found = plugin_service_->GetPluginInfo( -- render_process_id_, render_frame_id, url, main_frame_origin, mime_type, -- allow_wildcard, nullptr, info, actual_mime_type); -+ render_process_id_, render_frame_id, url, is_main_frame, -+ main_frame_origin, mime_type, allow_wildcard, nullptr, info, -+ actual_mime_type); - } - - void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( -diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h -index 8d1c932e9f3a..e6a2c525da06 100644 ---- content/browser/frame_host/render_frame_message_filter.h -+++ content/browser/frame_host/render_frame_message_filter.h -@@ -83,6 +83,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter { - #if BUILDFLAG(ENABLE_PLUGINS) - void OnGetPluginInfo(int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool* found, diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 2b94b8b2839e..36506642484c 100644 +index 3a0f7d0a3a26..fd32c77e58cb 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -632,6 +632,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -638,6 +638,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -128,7 +92,7 @@ index 2b94b8b2839e..36506642484c 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -833,7 +840,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -839,7 +846,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( @@ -223,11 +187,47 @@ index 632ae86c6fd6..55b749ec1242 100644 GetPluginsCallback callback, const std::vector& all_plugins); +diff --git content/browser/renderer_host/render_frame_message_filter.cc content/browser/renderer_host/render_frame_message_filter.cc +index 17729c56fa29..84a14a89306f 100644 +--- content/browser/renderer_host/render_frame_message_filter.cc ++++ content/browser/renderer_host/render_frame_message_filter.cc +@@ -300,6 +300,7 @@ void RenderFrameMessageFilter::OnCreateChildFrame( + void RenderFrameMessageFilter::OnGetPluginInfo( + int render_frame_id, + const GURL& url, ++ bool is_main_frame, + const url::Origin& main_frame_origin, + const std::string& mime_type, + bool* found, +@@ -307,8 +308,9 @@ void RenderFrameMessageFilter::OnGetPluginInfo( + std::string* actual_mime_type) { + bool allow_wildcard = true; + *found = plugin_service_->GetPluginInfo( +- render_process_id_, render_frame_id, url, main_frame_origin, mime_type, +- allow_wildcard, nullptr, info, actual_mime_type); ++ render_process_id_, render_frame_id, url, is_main_frame, ++ main_frame_origin, mime_type, allow_wildcard, nullptr, info, ++ actual_mime_type); + } + + void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( +diff --git content/browser/renderer_host/render_frame_message_filter.h content/browser/renderer_host/render_frame_message_filter.h +index 0f197c63c11c..20d046827f56 100644 +--- content/browser/renderer_host/render_frame_message_filter.h ++++ content/browser/renderer_host/render_frame_message_filter.h +@@ -83,6 +83,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter { + #if BUILDFLAG(ENABLE_PLUGINS) + void OnGetPluginInfo(int render_frame_id, + const GURL& url, ++ bool is_main_frame, + const url::Origin& main_frame_origin, + const std::string& mime_type, + bool* found, diff --git content/common/frame_messages.h content/common/frame_messages.h -index 33db23c32723..acde4d008de3 100644 +index 65116e483c65..c97f731cef9a 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -502,9 +502,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -495,9 +495,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -240,20 +240,20 @@ index 33db23c32723..acde4d008de3 100644 std::string /* mime_type */, bool /* found */, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index e112645811cb..7758de1bf201 100644 +index da3aceed75b1..e88601502e28 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ // declarations instead of including more headers. If that is infeasible, adjust // the limit. For more info, see // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md --#pragma clang max_tokens_here 880000 -+// #pragma clang max_tokens_here 880000 +-#pragma clang max_tokens_here 890000 ++// #pragma clang max_tokens_here 890000 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 428ec871deba..16ac7abd2f04 100644 +index 27b7e117b531..80c92eed565d 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -31,6 +31,7 @@ @@ -264,7 +264,7 @@ index 428ec871deba..16ac7abd2f04 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" -@@ -1664,6 +1665,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1685,6 +1686,14 @@ class CONTENT_EXPORT ContentBrowserClient { const base::Optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -279,7 +279,7 @@ index 428ec871deba..16ac7abd2f04 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. -@@ -1735,6 +1744,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1756,6 +1765,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -315,7 +315,7 @@ index 98c59005599e..69752184745d 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 5b0784c844bd..a7b6d3f3c237 100644 +index 12e091c7c13d..513db858b8fa 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h @@ -84,6 +84,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -328,7 +328,7 @@ index 5b0784c844bd..a7b6d3f3c237 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -325,6 +328,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -312,6 +315,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -340,10 +340,10 @@ index 5b0784c844bd..a7b6d3f3c237 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 16a16b1f075d..94942f76489c 100644 +index 3b2626c3ef9d..c0acde278d5a 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3853,7 +3853,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3896,7 +3896,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -354,20 +354,20 @@ index 16a16b1f075d..94942f76489c 100644 if (!found) return nullptr; diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index a6118f1f5ce1..7ae0e25160bb 100644 +index 91daa69bf55a..40f79ddf47b9 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -632,6 +632,8 @@ void RenderThreadImpl::Init() { +@@ -636,6 +636,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( URLLoaderThrottleProviderType::kFrame); + GetContentClient()->renderer()->RenderThreadConnected(); + GetAssociatedInterfaceRegistry()->AddInterface(base::BindRepeating( - &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); - + &RenderThreadImpl::OnRouteProviderReceiver, base::Unretained(this))); + GetAssociatedInterfaceRegistry()->AddInterface(base::BindRepeating( diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index d6375e9d16dc..b9e33ebe62d1 100644 +index ca435bda981b..274c460a151e 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc @@ -915,6 +915,15 @@ void RendererBlinkPlatformImpl::SetRenderingColorSpace( @@ -387,10 +387,10 @@ index d6375e9d16dc..b9e33ebe62d1 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 cfced914c88d..a8f1ffc14cb7 100644 +index 30af7f4fed5f..3bea58414d5b 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -210,6 +210,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -211,6 +211,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { media::GpuVideoAcceleratorFactories* GetGpuFactories() override; void SetRenderingColorSpace(const gfx::ColorSpace& color_space) override; diff --git a/patch/patches/content_app_shutdown_2798.patch b/patch/patches/content_app_shutdown_2798.patch deleted file mode 100644 index 3126bcc81..000000000 --- a/patch/patches/content_app_shutdown_2798.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 1dec904333df..e1f2ec06d93f 100644 ---- content/app/content_main_runner_impl.cc -+++ content/app/content_main_runner_impl.cc -@@ -45,6 +45,7 @@ - #include "base/task/post_task.h" - #include "base/task/thread_pool/thread_pool_instance.h" - #include "base/threading/hang_watcher.h" -+#include "base/threading/thread_restrictions.h" - #include "base/trace_event/trace_event.h" - #include "components/discardable_memory/service/discardable_shared_memory_manager.h" - #include "components/download/public/common/download_task_runner.h" -@@ -1028,6 +1029,11 @@ void ContentMainRunnerImpl::Shutdown() { - is_shutdown_ = true; - } - -+void ContentMainRunnerImpl::ShutdownOnUIThread() { -+ base::ScopedAllowBaseSyncPrimitivesForTesting allow_wait; -+ discardable_shared_memory_manager_.reset(); -+} -+ - // static - ContentMainRunner* ContentMainRunner::Create() { - return ContentMainRunnerImpl::Create(); -diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index 50797fdcea18..33acf1f35429 100644 ---- content/app/content_main_runner_impl.h -+++ content/app/content_main_runner_impl.h -@@ -51,6 +51,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { - int Run(bool start_service_manager_only) override; - void Shutdown() override; - -+ void ShutdownOnUIThread(); -+ - private: - int RunServiceManager(MainFunctionParams& main_function_params, - bool start_service_manager_only); -diff --git content/app/content_service_manager_main_delegate.cc content/app/content_service_manager_main_delegate.cc -index 1e6ad316bc67..e11e443ae694 100644 ---- content/app/content_service_manager_main_delegate.cc -+++ content/app/content_service_manager_main_delegate.cc -@@ -174,4 +174,8 @@ void ContentServiceManagerMainDelegate::SetStartServiceManagerOnly( - start_service_manager_only_ = start_service_manager_only; - } - -+void ContentServiceManagerMainDelegate::ShutdownOnUIThread() { -+ content_main_runner_->ShutdownOnUIThread(); -+} -+ - } // namespace content -diff --git content/app/content_service_manager_main_delegate.h content/app/content_service_manager_main_delegate.h -index ae9796957e51..f26a578d60ed 100644 ---- content/app/content_service_manager_main_delegate.h -+++ content/app/content_service_manager_main_delegate.h -@@ -18,7 +18,8 @@ namespace content { - - class ContentMainRunnerImpl; - --class ContentServiceManagerMainDelegate : public service_manager::MainDelegate { -+class CONTENT_EXPORT ContentServiceManagerMainDelegate : -+ public service_manager::MainDelegate { - public: - explicit ContentServiceManagerMainDelegate(const ContentMainParams& params); - ~ContentServiceManagerMainDelegate() override; -@@ -46,6 +47,8 @@ class ContentServiceManagerMainDelegate : public service_manager::MainDelegate { - // full browser. - void SetStartServiceManagerOnly(bool start_service_manager_only); - -+ void ShutdownOnUIThread(); -+ - private: - ContentMainParams content_main_params_; - std::unique_ptr content_main_runner_; diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch new file mode 100644 index 000000000..8be8500c8 --- /dev/null +++ b/patch/patches/content_main_654986.patch @@ -0,0 +1,215 @@ +diff --git content/app/content_main.cc content/app/content_main.cc +index e463c4d677b1..5fbc0a732dee 100644 +--- content/app/content_main.cc ++++ content/app/content_main.cc +@@ -206,15 +206,10 @@ void InitializeMojo(mojo::core::Configuration* config) { + + } // namespace + +-int RunContentProcess(const ContentMainParams& params, +- ContentMainRunner* content_main_runner) { +- ContentMainParams content_main_params(params); +- ++int ContentMainInitialize(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { + int exit_code = -1; + base::debug::GlobalActivityTracker* tracker = nullptr; +-#if defined(OS_MAC) +- std::unique_ptr autorelease_pool; +-#endif + + // A flag to indicate whether Main() has been called before. On Android, we + // may re-run Main() without restarting the browser process. This flag +@@ -300,8 +295,7 @@ int RunContentProcess(const ContentMainParams& params, + // loop, but we don't want to leave them hanging around until the app quits. + // Each "main" needs to flush this pool right before it goes into its main + // event loop to get rid of the cruft. +- autorelease_pool = std::make_unique(); +- content_main_params.autorelease_pool = autorelease_pool.get(); ++ params.autorelease_pool = std::make_unique(); + InitializeMac(); + #endif + +@@ -311,7 +305,7 @@ int RunContentProcess(const ContentMainParams& params, + + ui::RegisterPathProvider(); + tracker = base::debug::GlobalActivityTracker::Get(); +- exit_code = content_main_runner->Initialize(content_main_params); ++ exit_code = content_main_runner->Initialize(params); + + if (exit_code >= 0) { + if (tracker) { +@@ -370,8 +364,16 @@ int RunContentProcess(const ContentMainParams& params, + + if (IsSubprocess()) + CommonSubprocessInit(); +- exit_code = content_main_runner->Run(params.minimal_browser_mode); + ++ return exit_code; ++} ++ ++int ContentMainRun(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { ++ int exit_code = content_main_runner->Run(params.minimal_browser_mode); ++ ++ base::debug::GlobalActivityTracker* tracker = ++ base::debug::GlobalActivityTracker::Get(); + if (tracker) { + if (exit_code == 0) { + tracker->SetProcessPhaseIfEnabled( +@@ -382,19 +384,33 @@ int RunContentProcess(const ContentMainParams& params, + tracker->process_data().SetInt("exit-code", exit_code); + } + } ++ ++ return exit_code; ++} + ++void ContentMainShutdown(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { + #if defined(OS_MAC) +- autorelease_pool.reset(); ++ params.autorelease_pool.reset(); + #endif + + #if !defined(OS_ANDROID) + content_main_runner->Shutdown(); + #endif ++} ++ ++int RunContentProcess(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { ++ int exit_code = ContentMainInitialize(params, content_main_runner); ++ if (exit_code >= 0) ++ return exit_code; ++ exit_code = ContentMainRun(params, content_main_runner); ++ ContentMainShutdown(params, content_main_runner); + + return exit_code; + } + +-int ContentMain(const ContentMainParams& params) { ++int ContentMain(ContentMainParams& params) { + auto runner = ContentMainRunner::Create(); + return RunContentProcess(params, runner.get()); + } +diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc +index a85c25303dfc..8fdc214608fc 100644 +--- content/app/content_main_runner_impl.cc ++++ content/app/content_main_runner_impl.cc +@@ -45,6 +45,7 @@ + #include "base/task/post_task.h" + #include "base/task/thread_pool/thread_pool_instance.h" + #include "base/threading/hang_watcher.h" ++#include "base/threading/thread_restrictions.h" + #include "base/trace_event/trace_event.h" + #include "components/discardable_memory/service/discardable_shared_memory_manager.h" + #include "components/download/public/common/download_task_runner.h" +@@ -571,7 +572,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { + #else // !OS_WIN + + #if defined(OS_MAC) +- autorelease_pool_ = params.autorelease_pool; ++ autorelease_pool_ = params.autorelease_pool.get(); + #endif // defined(OS_MAC) + + #if defined(OS_ANDROID) +@@ -1010,6 +1011,11 @@ void ContentMainRunnerImpl::Shutdown() { + is_shutdown_ = true; + } + ++void ContentMainRunnerImpl::ShutdownOnUIThread() { ++ base::ScopedAllowBaseSyncPrimitivesForTesting allow_wait; ++ discardable_shared_memory_manager_.reset(); ++} ++ + // static + std::unique_ptr ContentMainRunner::Create() { + return ContentMainRunnerImpl::Create(); +diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h +index 3eb986f3c7d4..58d1883f7948 100644 +--- content/app/content_main_runner_impl.h ++++ content/app/content_main_runner_impl.h +@@ -13,6 +13,7 @@ + #include "base/threading/hang_watcher.h" + #include "build/build_config.h" + #include "content/browser/startup_data_impl.h" ++#include "content/common/content_export.h" + #include "content/public/app/content_main.h" + #include "content/public/app/content_main_runner.h" + #include "content/public/common/main_function_params.h" +@@ -37,7 +38,7 @@ class ContentMainDelegate; + struct ContentMainParams; + class ServiceManagerEnvironment; + +-class ContentMainRunnerImpl : public ContentMainRunner { ++class CONTENT_EXPORT ContentMainRunnerImpl : public ContentMainRunner { + public: + static std::unique_ptr Create(); + +@@ -51,6 +52,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { + int Run(bool start_service_manager_only) override; + void Shutdown() override; + ++ void ShutdownOnUIThread(); ++ + private: + int RunServiceManager(MainFunctionParams& main_function_params, + bool start_service_manager_only); +diff --git content/common/set_process_title.cc content/common/set_process_title.cc +index 8b829a488773..a69a08869728 100644 +--- content/common/set_process_title.cc ++++ content/common/set_process_title.cc +@@ -54,7 +54,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { + bool have_argv0 = false; + + #if defined(OS_LINUX) || defined(OS_CHROMEOS) +- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); ++ // DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); + + if (main_argv) + setproctitle_init(main_argv); +diff --git content/public/app/content_main.h content/public/app/content_main.h +index 7384f3276f38..b84127a62b81 100644 +--- content/public/app/content_main.h ++++ content/public/app/content_main.h +@@ -5,6 +5,7 @@ + #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ + #define CONTENT_PUBLIC_APP_CONTENT_MAIN_H_ + ++#include + #include + + #include "base/callback_forward.h" +@@ -64,11 +65,20 @@ struct ContentMainParams { + + #if defined(OS_MAC) + // The outermost autorelease pool to pass to main entry points. +- base::mac::ScopedNSAutoreleasePool* autorelease_pool = nullptr; ++ std::unique_ptr autorelease_pool; + #endif + }; + +-CONTENT_EXPORT int RunContentProcess(const ContentMainParams& params, ++// Split RunContentProcess() into separate stages. ++CONTENT_EXPORT int ContentMainInitialize( ++ ContentMainParams& params, ++ ContentMainRunner* content_main_runner); ++CONTENT_EXPORT int ContentMainRun(ContentMainParams& params, ++ ContentMainRunner* content_main_runner); ++CONTENT_EXPORT void ContentMainShutdown(ContentMainParams& params, ++ ContentMainRunner* content_main_runner); ++ ++CONTENT_EXPORT int RunContentProcess(ContentMainParams& params, + ContentMainRunner* content_main_runner); + + #if defined(OS_ANDROID) +@@ -88,7 +98,7 @@ CONTENT_EXPORT ContentMainDelegate* GetContentMainDelegateForTesting(); + // initial setup for every process. The embedder has a chance to customize + // startup using the ContentMainDelegate interface. The embedder can also pass + // in null for |delegate| if they don't want to override default startup. +-CONTENT_EXPORT int ContentMain(const ContentMainParams& params); ++CONTENT_EXPORT int ContentMain(ContentMainParams& params); + #endif + + } // namespace content diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 22c3dfb1e..4f7c7a86a 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -127,7 +127,7 @@ index bcf172e645a2..f879aa745adf 100644 // on the given |command_line|. void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); diff --git components/crash/core/app/breakpad_linux.cc components/crash/core/app/breakpad_linux.cc -index 9b07ab4667e6..07b61ac63e9d 100644 +index 9d8370ef035f..9950cd16660e 100644 --- components/crash/core/app/breakpad_linux.cc +++ components/crash/core/app/breakpad_linux.cc @@ -28,6 +28,7 @@ @@ -138,7 +138,7 @@ index 9b07ab4667e6..07b61ac63e9d 100644 #include "base/files/file_path.h" #include "base/lazy_instance.h" #include "base/linux_util.h" -@@ -719,7 +720,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, +@@ -718,7 +719,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, info.process_type_length = 7; info.distro = base::g_linux_distro; info.distro_length = my_strlen(base::g_linux_distro); @@ -147,7 +147,7 @@ index 9b07ab4667e6..07b61ac63e9d 100644 info.process_start_time = g_process_start_time; info.oom_size = base::g_oom_size; info.pid = g_pid; -@@ -1733,10 +1734,19 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1732,10 +1733,19 @@ void HandleCrashDump(const BreakpadInfo& info) { GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); writer.AddBoundary(); @@ -169,7 +169,7 @@ index 9b07ab4667e6..07b61ac63e9d 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -1853,6 +1863,9 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1852,6 +1862,9 @@ void HandleCrashDump(const BreakpadInfo& info) { crash_reporter::internal::TransitionalCrashKeyStorage; CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys); const CrashKeyStorage::Entry* entry; @@ -179,7 +179,7 @@ index 9b07ab4667e6..07b61ac63e9d 100644 while ((entry = crash_key_iterator.Next())) { size_t key_size, value_size; // Check for malformed messages. -@@ -1863,7 +1876,13 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1862,7 +1875,13 @@ void HandleCrashDump(const BreakpadInfo& info) { ? CrashKeyStorage::value_size - 1 : my_strlen(entry->value); diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index f71f74e40..b23942f67 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -146,7 +146,7 @@ index 5761c6b965b5..aee4e6c96033 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index 54af69767c8a..8b659955db3e 100644 +index 332117d78126..e7babc8f1764 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644 //! \brief Calls ProcessPendingReports() in response to ReportPending() having //! been called on any thread, as well as periodically on a timer. diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc -index c8001f457199..6c64610c69d4 100644 +index 33649291e253..1bb3c8dc5ac9 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc @@ -36,8 +36,10 @@ @@ -262,8 +262,8 @@ index c8001f457199..6c64610c69d4 100644 #include "client/crash_report_database.h" #include "client/crashpad_client.h" #include "client/crashpad_info.h" -@@ -91,6 +93,10 @@ - #include "handler/linux/exception_handler_server.h" +@@ -88,6 +90,10 @@ + #include "util/win/session_end_watcher.h" #endif // OS_APPLE +#if BUILDFLAG(ENABLE_CEF) @@ -273,7 +273,7 @@ index c8001f457199..6c64610c69d4 100644 namespace crashpad { namespace { -@@ -215,6 +221,9 @@ struct Options { +@@ -212,6 +218,9 @@ struct Options { bool periodic_tasks; bool rate_limit; bool upload_gzip; @@ -283,7 +283,7 @@ index c8001f457199..6c64610c69d4 100644 #if defined(OS_CHROMEOS) bool use_cros_crash_reporter = false; base::FilePath minidump_dir_for_tests; -@@ -568,6 +577,9 @@ int HandlerMain(int argc, +@@ -566,6 +575,9 @@ int HandlerMain(int argc, kOptionTraceParentWithException, #endif kOptionURL, @@ -293,7 +293,7 @@ index c8001f457199..6c64610c69d4 100644 #if defined(OS_CHROMEOS) kOptionUseCrosCrashReporter, kOptionMinidumpDirForTests, -@@ -669,6 +681,9 @@ int HandlerMain(int argc, +@@ -667,6 +679,9 @@ int HandlerMain(int argc, #endif // OS_ANDROID {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, @@ -303,7 +303,7 @@ index c8001f457199..6c64610c69d4 100644 {nullptr, 0, nullptr, 0}, }; -@@ -824,6 +839,27 @@ int HandlerMain(int argc, +@@ -822,6 +837,27 @@ int HandlerMain(int argc, options.url = optarg; break; } @@ -331,7 +331,7 @@ index c8001f457199..6c64610c69d4 100644 #if defined(OS_CHROMEOS) case kOptionUseCrosCrashReporter: { options.use_cros_crash_reporter = true; -@@ -973,8 +1009,14 @@ int HandlerMain(int argc, +@@ -971,8 +1007,14 @@ int HandlerMain(int argc, upload_thread_options.upload_gzip = options.upload_gzip; upload_thread_options.watch_pending_reports = options.periodic_tasks; @@ -346,7 +346,7 @@ index c8001f457199..6c64610c69d4 100644 upload_thread.Get()->Start(); } -@@ -1044,7 +1086,8 @@ int HandlerMain(int argc, +@@ -1042,7 +1084,8 @@ int HandlerMain(int argc, ScopedStoppable prune_thread; if (options.periodic_tasks) { prune_thread.Reset(new PruneCrashReportThread( diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 4f2396511..b45101540 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -132,10 +132,10 @@ index 11bfec21cc9f..416de61f85fa 100644 // A weak pointer to the current or pending RenderViewHost. We don't access // this through the host_contents because we want to deal with the pending diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 829941a3f095..dd6d5334c692 100644 +index 1832f5e9acd6..059cb2a43578 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h -@@ -57,6 +57,7 @@ class ComponentExtensionResourceManager; +@@ -62,6 +62,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -143,7 +143,7 @@ index 829941a3f095..dd6d5334c692 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -197,6 +198,14 @@ class ExtensionsBrowserClient { +@@ -204,6 +205,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; @@ -159,7 +159,7 @@ index 829941a3f095..dd6d5334c692 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 fc25df40852a..5f14f04835bb 100644 +index 5c593b03d84e..c9588c09f23f 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc @@ -385,9 +385,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, diff --git a/patch/patches/font_family_cache_1501.patch b/patch/patches/font_family_cache_1501.patch index ba0ff0397..8747d1f43 100644 --- a/patch/patches/font_family_cache_1501.patch +++ b/patch/patches/font_family_cache_1501.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/font_family_cache.h chrome/browser/font_family_cache.h -index a99372e6744c..ce40a8448868 100644 +index 3e15bc56d69a..c398bfec8583 100644 --- chrome/browser/font_family_cache.h +++ chrome/browser/font_family_cache.h @@ -19,6 +19,8 @@ class Profile; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index a0294deb1..3ce34ef80 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index aff8517d72f4..6ad4c7aefdff 100644 +index c5c73f805e8f..449ad9eaaf5e 100644 --- .gn +++ .gn -@@ -385,6 +385,8 @@ exec_script_whitelist = +@@ -350,6 +350,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,10 +12,10 @@ index aff8517d72f4..6ad4c7aefdff 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 4e74a1d6948f..044f4016a2b6 100644 +index 39b9075b1267..f25586e6cb72 100644 --- BUILD.gn +++ BUILD.gn -@@ -226,6 +226,7 @@ group("gn_all") { +@@ -230,6 +230,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ @@ -56,7 +56,7 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 5a7d02d80a89..dcc77f0e8b33 100644 +index 9323a774a565..913b5cdc6be4 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -3,6 +3,7 @@ @@ -67,7 +67,7 @@ index 5a7d02d80a89..dcc77f0e8b33 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/components/media_app_ui/media_app_ui.gni") -@@ -315,6 +316,7 @@ template("chrome_paks") { +@@ -325,6 +326,7 @@ template("chrome_paks") { } } @@ -75,7 +75,7 @@ index 5a7d02d80a89..dcc77f0e8b33 100644 chrome_repack_locales("${target_name}_locales") { forward_variables_from(invoker, [ -@@ -337,14 +339,17 @@ template("chrome_paks") { +@@ -347,14 +349,17 @@ template("chrome_paks") { output_locales = locales } } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index be8146cce..78c5c246f 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 0818d6986440..90d0d4df9c85 100644 +index a411c2a5788d..5001def6b476 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -663,4 +663,13 @@ +@@ -685,4 +685,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/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index ce91a0034..f0d36c780 100644 --- a/patch/patches/libxml_visibility.patch +++ b/patch/patches/libxml_visibility.patch @@ -1,5 +1,5 @@ diff --git third_party/libxml/BUILD.gn third_party/libxml/BUILD.gn -index a155534f66d2..7a29f910be79 100644 +index 8068e573cbd4..2fc10cf03bc5 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn @@ -142,6 +142,7 @@ static_library("libxml") { diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 80c49b491..a23578e05 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 c1b5d30fd927..2e1811fc6af5 100644 +index f3d40b628ec2..7efc41048b3c 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -162,7 +162,7 @@ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 201e8c46d..29003f11d 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 2a286b4d269b..55ee14d93545 100644 +index 2ba623bd01aa..b7049ead1f69 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ @@ -10,10 +10,10 @@ index 2a286b4d269b..55ee14d93545 100644 #include "base/message_loop/message_pump_win.h" #include -@@ -486,7 +487,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { - TRACE_EVENT1("base", - "MessagePumpForUI::ProcessNextWindowsMessage PeekMessage", - "sent_messages_in_queue", more_work_is_plausible); +@@ -495,7 +496,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { + ctx.event()->set_chrome_message_pump(); + msg_pump_data->set_sent_messages_in_queue(more_work_is_plausible); + }); - has_msg = ::PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE; + + // We should not process all window messages if we are in the context of an diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 961c7b4b1..08234b42c 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 954e32c842a5..7563507d52d0 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 60c4fe742d7e..e47f7daa6414 100644 +index 998d6d0c481f..e0f95ee4f7a0 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 @@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -47,7 +47,7 @@ index 60c4fe742d7e..e47f7daa6414 100644 WebContents* source, const content::OpenURLParams& params) { diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index 3e287fd18fee..4d5fca9bc322 100644 +index a7f0b19a8ab9..dca296badbf6 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h @@ -129,6 +129,7 @@ class MimeHandlerViewGuest diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch new file mode 100644 index 000000000..61d7af844 --- /dev/null +++ b/patch/patches/net_cookie_flags.patch @@ -0,0 +1,39 @@ +diff --git net/base/load_flags_list.h net/base/load_flags_list.h +index 96d1a51ec107..e8120a818b1f 100644 +--- net/base/load_flags_list.h ++++ net/base/load_flags_list.h +@@ -101,3 +101,6 @@ LOAD_FLAG(RESTRICTED_PREFETCH, 1 << 15) + // is considered privileged, and therefore this flag must only be set from a + // trusted process. + LOAD_FLAG(CAN_USE_RESTRICTED_PREFETCH, 1 << 16) ++ ++// 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 f5e754f4ea02..5dd6fc5ca061 100644 +--- net/url_request/url_request_http_job.cc ++++ net/url_request/url_request_http_job.cc +@@ -567,7 +567,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. +- if (cookie_store && request_->allow_credentials()) { ++ if (cookie_store && request_->allow_credentials() && ++ !(request_info_.load_flags & LOAD_DO_NOT_SEND_COOKIES)) { + CookieOptions options; + options.set_return_excluded_cookies(); + options.set_include_httponly(); +diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc +index 8f1b36b6befd..979874409d23 100644 +--- services/network/public/cpp/resource_request.cc ++++ services/network/public/cpp/resource_request.cc +@@ -126,7 +126,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { + } + + bool ResourceRequest::SendsCookies() const { +- return credentials_mode == network::mojom::CredentialsMode::kInclude; ++ return credentials_mode == network::mojom::CredentialsMode::kInclude && ++ !(load_flags & net::LOAD_DO_NOT_SEND_COOKIES); + } + + bool ResourceRequest::SavesCookies() const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 051270c70..e2b643e08 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c6..84f3b9ed7cf4 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index ec8d2a0697de..d1adc797ebc5 100644 +index 529a5b71b998..dcc5eeda89d3 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -2870,6 +2870,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -2831,6 +2831,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index ec8d2a0697de..d1adc797ebc5 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 ffeeca6e6165..9773d91492ff 100644 +index 9d7d10136a68..eb989750dd5f 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -726,6 +726,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -730,6 +730,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch deleted file mode 100644 index db52afeaf..000000000 --- a/patch/patches/prefs_content_1161.patch +++ /dev/null @@ -1,49 +0,0 @@ -diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h -index 8e810871066b..107f15b92829 100644 ---- content/public/common/common_param_traits_macros.h -+++ content/public/common/common_param_traits_macros.h -@@ -174,6 +174,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) - IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) - IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) - IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) -+ IPC_STRUCT_TRAITS_MEMBER(base_background_color) - IPC_STRUCT_TRAITS_MEMBER(cookie_enabled) - IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) - IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) -diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc -index 839e3cbde987..ef1b0d7be31f 100644 ---- content/public/common/web_preferences.cc -+++ content/public/common/web_preferences.cc -@@ -181,6 +181,7 @@ WebPreferences::WebPreferences() - #endif - spatial_navigation_enabled(false), - navigate_on_drag_drop(true), -+ base_background_color(0xFFFFFFFF), // Color::white - v8_cache_options(blink::mojom::V8CacheOptions::kDefault), - record_whole_document(false), - cookie_enabled(true), -diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h -index 700b47b5f521..4cd1cdceaf42 100644 ---- content/public/common/web_preferences.h -+++ content/public/common/web_preferences.h -@@ -179,6 +179,7 @@ struct CONTENT_EXPORT WebPreferences { - bool smart_insert_delete_enabled; - bool spatial_navigation_enabled; - bool navigate_on_drag_drop; -+ uint32_t base_background_color; - blink::mojom::V8CacheOptions v8_cache_options; - bool record_whole_document; - -diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index 49619a9b5683..52e09111aad3 100644 ---- content/renderer/render_view_impl.cc -+++ content/renderer/render_view_impl.cc -@@ -950,6 +950,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, - #endif - - WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available); -+ -+ web_view->SetBaseBackgroundColor(prefs.base_background_color); - } - - /*static*/ diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index b19273cf3..ea93591b4 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -57,6 +57,26 @@ index 3fadaba3336f..5ef67b35883d 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; +diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h +index 1498facaafea..b5ef086b88b5 100644 +--- chrome/browser/printing/print_view_manager_base.h ++++ chrome/browser/printing/print_view_manager_base.h +@@ -115,7 +115,6 @@ class PrintViewManagerBase : public content::NotificationObserver, + // Manages the low-level talk to the printer. + scoped_refptr print_job_; + +- private: + // content::NotificationObserver implementation. + void Observe(int type, + const content::NotificationSource& source, +@@ -127,6 +126,7 @@ class PrintViewManagerBase : public content::NotificationObserver, + // Cancels the print job. + void NavigationStopped() override; + ++ private: + // printing::PrintManager: + void OnDidPrintDocument( + content::RenderFrameHost* render_frame_host, diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html index bc7f30dba388..2cc53441f17d 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html @@ -112,7 +132,7 @@ index b59728f623e3..6fd443962836 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index bb362bbd321e..24e94cfd4211 100644 +index c48314e52e83..f0a64a0be931 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc @@ -20,6 +20,7 @@ @@ -123,7 +143,7 @@ index bb362bbd321e..24e94cfd4211 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_prefs.h" -@@ -54,6 +55,10 @@ +@@ -53,6 +54,10 @@ #include "chrome/browser/chromeos/drive/drive_integration_service.h" #endif @@ -134,7 +154,7 @@ index bb362bbd321e..24e94cfd4211 100644 namespace printing { namespace { -@@ -380,10 +385,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -376,10 +381,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -162,7 +182,7 @@ index bb362bbd321e..24e94cfd4211 100644 // Get default download directory. This will be used as a fallback if the // save directory does not exist. DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext(profile_); -@@ -391,8 +413,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -387,8 +409,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -172,7 +192,7 @@ index bb362bbd321e..24e94cfd4211 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -433,6 +454,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -429,6 +450,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -242,7 +262,7 @@ index 26954aeae08f..48afeb608f83 100644 base::FilePath GetSaveLocation() const; diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index ba451b6c854d..0f062e69fd47 100644 +index 2cea700c8279..03d086e4fa65 100644 --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -24,6 +24,7 @@ @@ -253,7 +273,7 @@ index ba451b6c854d..0f062e69fd47 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" #include "chrome/browser/browser_process.h" -@@ -1254,7 +1255,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1265,7 +1266,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return extension_printer_handler_.get(); } @@ -262,7 +282,7 @@ index ba451b6c854d..0f062e69fd47 100644 if (printer_type == PrinterType::kPrivet) { if (!privet_printer_handler_) { privet_printer_handler_ = -@@ -1262,6 +1263,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1273,6 +1274,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -272,7 +292,7 @@ index ba451b6c854d..0f062e69fd47 100644 #endif if (printer_type == PrinterType::kPdf) { if (!pdf_printer_handler_) { -@@ -1334,6 +1338,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, +@@ -1345,6 +1349,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, } void PrintPreviewHandler::RegisterForGaiaCookieChanges() { @@ -280,7 +300,7 @@ index ba451b6c854d..0f062e69fd47 100644 DCHECK(!identity_manager_); cloud_print_enabled_ = !base::Contains(printer_type_deny_list_, PrinterType::kCloud) && -@@ -1350,6 +1355,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { +@@ -1361,6 +1366,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); identity_manager_->AddObserver(this); @@ -289,10 +309,10 @@ index ba451b6c854d..0f062e69fd47 100644 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index 48dfc6e95863..5b80d64f4b47 100644 +index 5999318f3620..d4ab6b034f73 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include "base/synchronization/lock.h" #include "base/values.h" #include "build/build_config.h" @@ -300,7 +320,7 @@ index 48dfc6e95863..5b80d64f4b47 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/pdf/pdf_extension_util.h" #include "chrome/browser/printing/background_printing_manager.h" -@@ -80,12 +81,16 @@ namespace printing { +@@ -81,12 +82,16 @@ namespace printing { namespace { diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index 807fe4ee7..37107c418 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index 17788cb2b506..9014f48ed0dd 100644 +index 89c7798d8ddf..63a1770d7b4e 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc -@@ -133,6 +133,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) +@@ -134,6 +134,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) PrintingContext::Create(printing_context_delegate_.get())), thread_("Printing_Worker") { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index d07ba6857..bb925519a 100644 --- a/patch/patches/renderer_host_1070713.patch +++ b/patch/patches/renderer_host_1070713.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_view_host_impl.cc content/browser/renderer_host/render_view_host_impl.cc -index 4f914119d21b..5be76fbbda36 100644 +index 5326b36457f2..694aff3c7144 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -522,6 +522,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -584,6 +584,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index 915b6cbef..e26fb84ad 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index 0acace592ca4..66cc3c360b79 100644 +index ddc3c1d4bdc4..8b5618a2b9b5 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc -@@ -33,7 +33,8 @@ +@@ -34,7 +34,8 @@ #include "ui/base/cocoa/defaults_utils.h" #endif @@ -12,7 +12,7 @@ index 0acace592ca4..66cc3c360b79 100644 #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "ui/views/linux_ui/linux_ui.h" -@@ -155,7 +156,8 @@ void UpdateFromSystemSettings(blink::mojom::RendererPreferences* prefs, +@@ -164,7 +165,8 @@ void UpdateFromSystemSettings(blink::mojom::RendererPreferences* prefs, prefs->caret_blink_interval = interval; #endif diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index b1d9b8fb3..5a04036a5 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,5 +1,5 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index df4b0a7c9bb0..140574fe2886 100644 +index d14bc858f566..0c9e50916bb1 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc @@ -868,6 +868,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) @@ -28,10 +28,10 @@ index df4b0a7c9bb0..140574fe2886 100644 void ResourceBundle::InitSharedInstance(Delegate* delegate) { DCHECK(g_shared_instance_ == nullptr) << "ResourceBundle initialized twice"; diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h -index 9cbc1d512acb..26b5f99f5214 100644 +index 317ad685e414..1d3935b2ae3d 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h -@@ -160,6 +160,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { +@@ -161,6 +161,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { // Return the global resource loader instance. static ResourceBundle& GetSharedInstance(); diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index 580332df8..1de25cae1 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,8 +1,8 @@ diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index d9cd61297548..9bfbc5212ed6 100644 +index 58bf3e8caf4e..c224432e8af2 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -149,13 +149,17 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): +@@ -155,13 +155,17 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): del os.environ['INCLUDE'] del os.environ['LIB'] del os.environ['LIBPATH'] diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 167cdb272..d0b6a8b82 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 8eeff7b2af9d..be36b6b265b9 100644 +index f6cd4515bf8f..ba8da481274e 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -675,10 +675,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -678,10 +678,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,7 +19,7 @@ index 8eeff7b2af9d..be36b6b265b9 100644 } void RenderWidgetHostViewAura::WindowTitleChanged() { -@@ -2040,6 +2042,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2046,6 +2048,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // Init(), because it needs to have the layer. if (frame_sink_id_.is_valid()) window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/service_manager_654986.patch b/patch/patches/service_manager_654986.patch deleted file mode 100644 index 6f8d86397..000000000 --- a/patch/patches/service_manager_654986.patch +++ /dev/null @@ -1,193 +0,0 @@ -diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc -index 607618c0fad8..d55d1c2d4046 100644 ---- services/service_manager/embedder/main.cc -+++ services/service_manager/embedder/main.cc -@@ -244,22 +244,36 @@ int RunService(MainDelegate* delegate) { - return 0; - } - -+ProcessType GetProcessType(MainDelegate* delegate, -+ const base::CommandLine& command_line) { -+ ProcessType process_type = delegate->OverrideProcessType(); -+ if (process_type == ProcessType::kDefault) { -+ const std::string& type_switch = -+ command_line.GetSwitchValueASCII(switches::kProcessType); -+ if (type_switch == switches::kProcessTypeServiceManager) { -+ process_type = ProcessType::kServiceManager; -+ } else if (type_switch == switches::kProcessTypeService) { -+ process_type = ProcessType::kService; -+ } else { -+ process_type = ProcessType::kEmbedder; -+ } -+ } -+ return process_type; -+} -+ - } // namespace - - MainParams::MainParams(MainDelegate* delegate) : delegate(delegate) {} - - MainParams::~MainParams() {} - --int Main(const MainParams& params) { -+int MainInitialize(MainParams& params) { - MainDelegate* delegate = params.delegate; - DCHECK(delegate); - - int exit_code = -1; - base::debug::GlobalActivityTracker* tracker = nullptr; - ProcessType process_type = delegate->OverrideProcessType(); --#if defined(OS_MAC) -- std::unique_ptr autorelease_pool; --#endif - - // A flag to indicate whether Main() has been called before. On Android, we - // may re-run Main() without restarting the browser process. This flag -@@ -345,12 +359,7 @@ int Main(const MainParams& params) { - MainDelegate::InitializeParams init_params; - - #if defined(OS_MAC) -- // We need this pool for all the objects created before we get to the event -- // loop, but we don't want to leave them hanging around until the app quits. -- // Each "main" needs to flush this pool right before it goes into its main -- // event loop to get rid of the cruft. -- autorelease_pool = std::make_unique(); -- init_params.autorelease_pool = autorelease_pool.get(); -+ init_params.autorelease_pool = params.autorelease_pool.get(); - InitializeMac(); - #endif - -@@ -421,18 +430,16 @@ int Main(const MainParams& params) { - } - } - -+ return exit_code; -+} -+ -+int MainRun(MainParams& params) { -+ MainDelegate* delegate = params.delegate; -+ DCHECK(delegate); -+ -+ int exit_code = 0; - const auto& command_line = *base::CommandLine::ForCurrentProcess(); -- if (process_type == ProcessType::kDefault) { -- std::string type_switch = -- command_line.GetSwitchValueASCII(switches::kProcessType); -- if (type_switch == switches::kProcessTypeServiceManager) { -- process_type = ProcessType::kServiceManager; -- } else if (type_switch == switches::kProcessTypeService) { -- process_type = ProcessType::kService; -- } else { -- process_type = ProcessType::kEmbedder; -- } -- } -+ const ProcessType process_type = GetProcessType(delegate, command_line); - switch (process_type) { - case ProcessType::kDefault: - NOTREACHED(); -@@ -454,6 +461,8 @@ int Main(const MainParams& params) { - break; - } - -+ base::debug::GlobalActivityTracker* tracker = -+ base::debug::GlobalActivityTracker::Get(); - if (tracker) { - if (exit_code == 0) { - tracker->SetProcessPhaseIfEnabled( -@@ -465,12 +474,38 @@ int Main(const MainParams& params) { - } - } - -+ return exit_code; -+} -+ -+void MainShutdown(MainParams& params) { -+ MainDelegate* delegate = params.delegate; -+ DCHECK(delegate); -+ - #if defined(OS_MAC) -- autorelease_pool.reset(); -+ params.autorelease_pool.reset(); - #endif - -+ const ProcessType process_type = -+ GetProcessType(delegate, *base::CommandLine::ForCurrentProcess()); - if (process_type == ProcessType::kEmbedder) - delegate->ShutDownEmbedderProcess(); -+} -+ -+int Main(MainParams& params) { -+#if defined(OS_MAC) -+ // We need this pool for all the objects created before we get to the event -+ // loop, but we don't want to leave them hanging around until the app quits. -+ // Each "main" needs to flush this pool right before it goes into its main -+ // event loop to get rid of the cruft. -+ params.autorelease_pool = -+ std::make_unique(); -+#endif -+ -+ int exit_code = MainInitialize(params); -+ if (exit_code >= 0) -+ return exit_code; -+ exit_code = MainRun(params); -+ MainShutdown(params); - - return exit_code; - } -diff --git services/service_manager/embedder/main.h services/service_manager/embedder/main.h -index 57e88aa85dfe..f28c9ef4c0ea 100644 ---- services/service_manager/embedder/main.h -+++ services/service_manager/embedder/main.h -@@ -5,9 +5,15 @@ - #ifndef SERVICES_SERVICE_MANAGER_EMBEDDER_MAIN_H_ - #define SERVICES_SERVICE_MANAGER_EMBEDDER_MAIN_H_ - -+#include -+ - #include "base/component_export.h" - #include "build/build_config.h" - -+#if defined(OS_MAC) -+#include "base/mac/scoped_nsautorelease_pool.h" -+#endif // defined(OS_MAC) -+ - namespace service_manager { - - class MainDelegate; -@@ -22,11 +28,22 @@ struct COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) MainParams { - int argc = 0; - const char** argv = nullptr; - #endif -+ -+#if defined(OS_MAC) -+ std::unique_ptr autorelease_pool; -+#endif - }; - -+// Split Main() into separate stages. -+int COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) -+ MainInitialize(MainParams& params); -+int COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) MainRun(MainParams& params); -+void COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) -+ MainShutdown(MainParams& params); -+ - // Main function which should be called as early as possible by any executable - // embedding the service manager. --int COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) Main(const MainParams& params); -+int COMPONENT_EXPORT(SERVICE_MANAGER_EMBEDDER) Main(MainParams& params); - - } // namespace service_manager - -diff --git services/service_manager/embedder/set_process_title.cc services/service_manager/embedder/set_process_title.cc -index a2ced5316c78..96946a2168aa 100644 ---- services/service_manager/embedder/set_process_title.cc -+++ services/service_manager/embedder/set_process_title.cc -@@ -53,7 +53,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { - bool have_argv0 = false; - - #if defined(OS_LINUX) || defined(OS_CHROMEOS) -- DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); -+ // DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); - - if (main_argv) - setproctitle_init(main_argv); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index de040c4ac..72b74274f 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index e5160aa3ff1a..f0ca556ed9e4 100644 +index 082cff368d80..7d7c2fe02646 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -19,6 +19,7 @@ @@ -10,7 +10,7 @@ index e5160aa3ff1a..f0ca556ed9e4 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -670,7 +671,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -666,7 +667,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( // Configure on-disk storage for non-OTR profiles. OTR profiles just use // default behavior (in memory storage, default sizes). @@ -31,7 +31,7 @@ index e5160aa3ff1a..f0ca556ed9e4 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -683,7 +696,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -679,7 +692,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -42,7 +42,7 @@ index e5160aa3ff1a..f0ca556ed9e4 100644 // change. network_context_params->http_server_properties_path = diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 265deed0e52e..89d37ae6218a 100644 +index 140b61a81dcd..bdad9d468e57 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc @@ -479,6 +479,25 @@ void CookieMonster::SetCookieableSchemes( @@ -123,7 +123,7 @@ index 1d988375b00a..e71cbc3b612f 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 5b4588fadf4b..1f685c4d6700 100644 +index 4de2f631d4d6..e9c066b50a07 100644 --- services/network/network_context.cc +++ services/network/network_context.cc @@ -1906,6 +1906,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( @@ -165,10 +165,10 @@ index 5b4588fadf4b..1f685c4d6700 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 87b26150440e..60c9eee375bb 100644 +index dfeaf3c49e33..434e88d1cc0e 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -274,6 +274,9 @@ struct NetworkContextParams { +@@ -275,6 +275,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index 9ecedd9cf..5c70fd351 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,5 +1,5 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index eead3ac6a092..372c511b6c77 100644 +index 9b5a44b6dd99..e90a651f6fba 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc @@ -487,10 +487,6 @@ class LoginHandlerDelegate { @@ -26,7 +26,7 @@ index eead3ac6a092..372c511b6c77 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2412,8 +2402,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2421,8 +2411,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index eead3ac6a092..372c511b6c77 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2425,6 +2419,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2434,6 +2428,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( browser_context_, is_in_memory_, relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index f4a5d22c4..9c4b2ae3a 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -1,8 +1,8 @@ diff --git ui/views/controls/native/native_view_host.cc ui/views/controls/native/native_view_host.cc -index 4779e4f07d92..13b98f8cc6a7 100644 +index d8e5cf4ddb62..59db8f266312 100644 --- ui/views/controls/native/native_view_host.cc +++ ui/views/controls/native/native_view_host.cc -@@ -154,7 +154,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { +@@ -152,7 +152,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { // It would be nice if this used some approximation of the page's // current background color. if (native_wrapper_->HasInstalledClip()) @@ -12,10 +12,10 @@ index 4779e4f07d92..13b98f8cc6a7 100644 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { diff --git ui/views/controls/native/native_view_host.h ui/views/controls/native/native_view_host.h -index f92961e9f79b..f1ff80b244ef 100644 +index 71cba0d714bd..82d3d6baa909 100644 --- ui/views/controls/native/native_view_host.h +++ ui/views/controls/native/native_view_host.h -@@ -86,6 +86,12 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -92,6 +92,12 @@ class VIEWS_EXPORT NativeViewHost : public View { void set_fast_resize(bool fast_resize) { fast_resize_ = fast_resize; } bool fast_resize() const { return fast_resize_; } @@ -28,7 +28,7 @@ index f92961e9f79b..f1ff80b244ef 100644 gfx::NativeView native_view() const { return native_view_; } void NativeViewDestroyed(); -@@ -132,6 +138,9 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -138,6 +144,9 @@ class VIEWS_EXPORT NativeViewHost : public View { // in the setter/accessor above. bool fast_resize_ = false; @@ -39,7 +39,7 @@ index f92961e9f79b..f1ff80b244ef 100644 }; diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 639ba0b04bed..538147e3fcbc 100644 +index 61e127ee3f2b..1efc22bfcc65 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc @@ -139,6 +139,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 5fb5714b4..5039dcd08 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -1,8 +1,8 @@ diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index d0318111b239..bcc733af5ddb 100644 +index 676c2cc22bac..e6f9642e1cba 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc -@@ -117,7 +117,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( +@@ -120,7 +120,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( // If we're not incognito mode, schedule all of our file tasks to enable // disk on the storage context. @@ -13,10 +13,10 @@ index d0318111b239..bcc733af5ddb 100644 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 18cb0f6c588d..93ef44e197fc 100644 +index 13837eb391ce..e3a15a7158b2 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -253,7 +253,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -251,7 +251,7 @@ StoragePartition* BrowserContext::GetStoragePartition( GetStoragePartitionMap(browser_context); auto config_to_use = storage_partition_config; @@ -25,7 +25,7 @@ index 18cb0f6c588d..93ef44e197fc 100644 config_to_use = storage_partition_config.CopyWithInMemorySet(); return partition_map->Get(config_to_use, can_create); -@@ -575,7 +575,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { +@@ -573,7 +573,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { kUseInMemoryDBDefault); std::unique_ptr stats_db; diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index dc15d6310..463c8ed47 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,5 +1,5 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index b94597784004..35e977e0d88a 100644 +index 97830615a4e2..63efe4c35ecb 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -58,6 +58,8 @@ diff --git a/patch/patches/ui_gl_utils_1123950.patch b/patch/patches/ui_gl_utils_1123950.patch deleted file mode 100644 index 7f401a909..000000000 --- a/patch/patches/ui_gl_utils_1123950.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git ui/gl/gl_utils.cc ui/gl/gl_utils.cc -index 2f0832c0ae75..f8a494b05e42 100644 ---- ui/gl/gl_utils.cc -+++ ui/gl/gl_utils.cc -@@ -130,7 +130,7 @@ bool ShouldForceDirectCompositionRootSurfaceFullDamage() { - if ((brga_flags & kSupportBits) == 0) - return false; - return true; -- }; -+ }(); - return should_force; - } - #endif // OS_WIN diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 69d0957b8..008946a67 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -106,10 +106,10 @@ index 4b39abb9d16c..c3b5debf995b 100644 }; diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index e6062daf0f1b..64aefc152a81 100644 +index 7a6dda99623b..7476e8966285 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h -@@ -149,6 +149,8 @@ class VIEWS_EXPORT InkDropHostView : public View { +@@ -142,6 +142,8 @@ class VIEWS_EXPORT InkDropHostView : public View { // changes, to trigger the corresponding property change notification here. void OnInkDropHighlightedChanged(); @@ -119,10 +119,10 @@ index e6062daf0f1b..64aefc152a81 100644 // Size used for the default SquareInkDropRipple. static constexpr gfx::Size kDefaultInkDropSize = gfx::Size(24, 24); diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 77c7f6830f9c..3a683e178668 100644 +index b8dada677222..87d790657722 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -508,6 +508,12 @@ void LabelButton::OnThemeChanged() { +@@ -513,6 +513,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -136,10 +136,10 @@ index 77c7f6830f9c..3a683e178668 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 45692ab8b7c3..f4484c069137 100644 +index 4990f7e6ee48..c111e11f5100 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -130,6 +130,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -134,6 +134,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ui::NativeTheme::State GetForegroundThemeState( ui::NativeTheme::ExtraParams* params) const override; @@ -150,7 +150,7 @@ index 45692ab8b7c3..f4484c069137 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index d0b00369f1a9..920df6ad1988 100644 +index 66ce6e76618b..ac584d47cea9 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc @@ -47,12 +47,27 @@ enum LabelPropertyKey { @@ -197,7 +197,7 @@ index d0b00369f1a9..920df6ad1988 100644 void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); if (tooltip_text_ == tooltip_text) -@@ -617,7 +641,19 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -619,7 +643,19 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SetFontList(font_list()); render_text->set_shadows(GetShadows()); render_text->SetCursorEnabled(false); @@ -219,10 +219,10 @@ index d0b00369f1a9..920df6ad1988 100644 render_text->SetMultiline(multiline); render_text->SetMaxLines(multiline ? GetMaxLines() : 0); diff --git ui/views/controls/label.h ui/views/controls/label.h -index 6cb286abd747..d05356e9caee 100644 +index f5b59c83c526..da238ea0a4ae 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -198,6 +198,10 @@ class VIEWS_EXPORT Label : public View, +@@ -199,6 +199,10 @@ class VIEWS_EXPORT Label : public View, gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); @@ -233,7 +233,7 @@ index 6cb286abd747..d05356e9caee 100644 // Gets/Sets the tooltip text. Default behavior for a label (single-line) is // to show the full text if it is wider than its bounds. Calling this // overrides the default behavior and lets you set a custom tooltip. To -@@ -432,6 +436,7 @@ class VIEWS_EXPORT Label : public View, +@@ -433,6 +437,7 @@ class VIEWS_EXPORT Label : public View, bool collapse_when_hidden_ = false; int fixed_width_ = 0; int max_width_ = 0; @@ -242,10 +242,10 @@ index 6cb286abd747..d05356e9caee 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index bad1730e19a0..2054d3b48e41 100644 +index e6a96689ef60..5dd54e402ce8 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2668,8 +2668,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2689,8 +2689,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -260,7 +260,7 @@ index bad1730e19a0..2054d3b48e41 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2688,8 +2693,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2709,8 +2714,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -312,10 +312,10 @@ index 158724b4752c..c82192848584 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index f14eb8069141..98b1fca6c190 100644 +index aaaddc97e057..2a335d26c3f9 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1070,6 +1070,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1075,6 +1075,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -331,7 +331,7 @@ index f14eb8069141..98b1fca6c190 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1137,6 +1146,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1142,6 +1151,13 @@ void MenuItemView::PaintMinorIconAndText( } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -453,10 +453,10 @@ index 78f832fd3acf..cb030c991614 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 3ba6950690e3..f500022cc083 100644 +index 979e2222ad7c..3644db9f087d 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -199,6 +199,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -200,6 +200,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = AddChildView(std::make_unique(content_view, false)); @@ -469,10 +469,10 @@ index 3ba6950690e3..f500022cc083 100644 content_view_->GetMenuItem()->GetMenuController()->GetAnchorPosition()); diff --git ui/views/test/ui_controls_factory_desktop_aurax11.cc ui/views/test/ui_controls_factory_desktop_aurax11.cc -index 2d80939961d7..ef2299910d75 100644 +index 82135658e188..53674f44d5d1 100644 --- ui/views/test/ui_controls_factory_desktop_aurax11.cc +++ ui/views/test/ui_controls_factory_desktop_aurax11.cc -@@ -154,10 +154,6 @@ class UIControlsDesktopX11 : public UIControlsAura { +@@ -135,10 +135,6 @@ class UIControlsDesktopX11 : public UIControlsAura { aura::test::QueryLatestMousePositionRequestInHost(host); host->ConvertPixelsToDIP(&root_current_location); @@ -484,7 +484,7 @@ index 2d80939961d7..ef2299910d75 100644 // Move the cursor because EnterNotify/LeaveNotify are generated with the // current mouse position as a result of XGrabPointer() diff --git ui/views/view.h ui/views/view.h -index 1990d29fcae1..dcfaaa7f6f3f 100644 +index ff42e9282492..b1f65d8e2c4d 100644 --- ui/views/view.h +++ ui/views/view.h @@ -24,6 +24,7 @@ @@ -495,7 +495,7 @@ index 1990d29fcae1..dcfaaa7f6f3f 100644 #include "build/build_config.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -@@ -275,6 +276,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -274,6 +275,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget_180_1481_1565_1677_1749.patch b/patch/patches/views_widget_180_1481_1565_1677_1749.patch index 2b2fd9bb6..c617bbbd2 100644 --- a/patch/patches/views_widget_180_1481_1565_1677_1749.patch +++ b/patch/patches/views_widget_180_1481_1565_1677_1749.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 934195fd77d2..8aec87d4a448 100644 +index b2139c2e9ee8..555121d711bb 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -560,6 +560,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -532,6 +532,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -14,14 +14,14 @@ index 934195fd77d2..8aec87d4a448 100644 + return has_external_parent_; +} + - uint32_t RenderWidgetHostViewBase::RendererFrameNumber() { - return renderer_frame_number_; - } + void RenderWidgetHostViewBase::OnAutoscrollStart() { + if (!GetMouseWheelPhaseHandler()) + return; diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index af80b343dcd9..507618362acd 100644 +index 5b2aa87a53fa..302626b947c6 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -65,6 +65,7 @@ class CursorManager; +@@ -66,6 +66,7 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index af80b343dcd9..507618362acd 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -82,6 +83,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -79,6 +80,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { float current_device_scale_factor() const { return current_device_scale_factor_; } @@ -39,16 +39,16 @@ index af80b343dcd9..507618362acd 100644 // Returns the focused RenderWidgetHost inside this |view|'s RWH. RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -116,6 +120,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -112,6 +116,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { + const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; - bool IsScrollOffsetAtTop() override; float GetDeviceScaleFactor() final; + void SetHasExternalParent(bool val) override; + bool HasExternalParent() const override; TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordContentToVisibleTimeRequest( -@@ -439,6 +445,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -418,6 +424,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { // helps to position the full screen widget on the correct monitor. virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; @@ -61,9 +61,9 @@ index af80b343dcd9..507618362acd 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -620,6 +632,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase - // specific RenderWidgetHostView. - base::Optional display_feature_; +@@ -598,6 +610,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { + protected: + ~RenderWidgetHostViewBase() override; + // True if the widget has a external parent view/window outside of the + // Chromium-controlled view/window hierarchy. @@ -73,7 +73,7 @@ index af80b343dcd9..507618362acd 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index 44586cc1789a..18705ef4e6e7 100644 +index b49d2f96efec..080a49940263 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -37,6 +37,10 @@ @@ -85,9 +85,9 @@ index 44586cc1789a..18705ef4e6e7 100644 +#endif + #if defined(OS_WIN) - #include "content/browser/frame_host/render_frame_host_impl.h" + #include "content/browser/renderer_host/render_frame_host_impl.h" #include "ui/aura/window_tree_host.h" -@@ -954,6 +958,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( +@@ -956,6 +960,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( } return; } @@ -103,10 +103,10 @@ index 44586cc1789a..18705ef4e6e7 100644 synthetic_move_position_ = center_in_screen; } diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index a7222155f4ea..77ac1f864161 100644 +index beba7a3a40b8..941acdfbff8b 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -243,6 +243,14 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -241,6 +241,14 @@ class CONTENT_EXPORT RenderWidgetHostView { // This must always return the same device scale factor as GetScreenInfo. virtual float GetDeviceScaleFactor() = 0; @@ -122,10 +122,10 @@ index a7222155f4ea..77ac1f864161 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/base/x/x11_window.cc ui/base/x/x11_window.cc -index 24dbb60257bb..59e731f9ba0b 100644 +index 7d151df864f4..b8f58d9294d5 100644 --- ui/base/x/x11_window.cc +++ ui/base/x/x11_window.cc -@@ -272,7 +272,8 @@ void XWindow::Init(const Configuration& config) { +@@ -264,7 +264,8 @@ void XWindow::Init(const Configuration& config) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(config.bounds); @@ -156,7 +156,7 @@ index af282d4190dd..147a2cd9ac4c 100644 XWindow(); diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index c0ba5c3a156e..c12372d6e435 100644 +index 7941edf6d3cb..520af3c90e97 100644 --- ui/platform_window/x11/x11_window.cc +++ ui/platform_window/x11/x11_window.cc @@ -93,6 +93,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig( @@ -245,7 +245,7 @@ index 4b6a5a4476a3..c9881d4a716c 100644 base::WeakPtrFactory weak_factory_{this}; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index e9e61a24dc87..7687ded2a82e 100644 +index 3b132d4d7618..bcb17600d7fa 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -140,8 +140,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -296,10 +296,10 @@ index 0229c1c41502..992f89126f7f 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index f02508580d16..a2be2ed6aa2d 100644 +index 710d52bcc34f..25608ba3d188 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -285,7 +285,8 @@ void Widget::Init(InitParams params) { +@@ -283,7 +283,8 @@ void Widget::Init(InitParams params) { params.name = params.delegate->GetContentsView()->GetClassName(); params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -309,10 +309,10 @@ index f02508580d16..a2be2ed6aa2d 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -369,7 +370,12 @@ void Widget::Init(InitParams params) { +@@ -365,7 +366,12 @@ void Widget::Init(InitParams params) { } } else if (delegate) { - SetContentsView(delegate->GetContentsView()); + SetContentsView(delegate->TransferOwnershipOfContentsView()); - SetInitialBoundsForFramelessWindow(bounds); + if (params.parent_widget != gfx::kNullAcceleratedWidget) { + // Set the bounds directly instead of applying an inset. @@ -323,7 +323,7 @@ index f02508580d16..a2be2ed6aa2d 100644 } observer_manager_.Add(GetNativeTheme()); -@@ -1153,10 +1159,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1149,10 +1155,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -341,10 +341,10 @@ index f02508580d16..a2be2ed6aa2d 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 032f77d5738a..085c4df9fa8c 100644 +index bb19a2cceb28..d62b6dbbecc9 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -315,6 +315,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -317,6 +317,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = nullptr; @@ -354,10 +354,10 @@ index 032f77d5738a..085c4df9fa8c 100644 // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index fdf697d54693..d21effca6422 100644 +index ce51f9d0f350..1121f523be23 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -301,6 +301,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -332,6 +332,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -366,8 +366,8 @@ index fdf697d54693..d21effca6422 100644 + virtual bool MaybeGetMaximumSize(gfx::Size* size) const { return false; } + bool focus_traverses_out() const { return params_.focus_traverses_out; } + bool owned_by_widget() const { return params_.owned_by_widget; } - private: diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc index 89f5b62f95df..8f6971929a12 100644 --- ui/views/widget/widget_hwnd_utils.cc @@ -382,10 +382,10 @@ index 89f5b62f95df..8f6971929a12 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 5e8d267d868d..414e20ad8203 100644 +index 754528f7d280..c929712cbd0d 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3071,10 +3071,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3074,10 +3074,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index d1d3cc722..2fb8c6b53 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,18 +80,18 @@ index 1026b739d283..fe562ab60ce9 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index d991c2126b23..cc51bb326e86 100644 +index 3d3fc4f52270..a9c9c5324a62 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -14,6 +14,8 @@ config("viz_service_implementation") { - - viz_component("service") { - sources = [ +@@ -183,6 +183,8 @@ viz_component("service") { + "surfaces/surface_reference.cc", + "surfaces/surface_reference.h", + "viz_service_export.h", + "//cef/libcef/browser/osr/software_output_device_proxy.cc", + "//cef/libcef/browser/osr/software_output_device_proxy.h", - "display/bsp_tree.cc", - "display/bsp_tree.h", - "display/bsp_walk_action.cc", + ] + + defines = [ "VIZ_SERVICE_IMPLEMENTATION" ] diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc index 2da653cc9c3c..e536a34dca33 100644 --- components/viz/service/display_embedder/output_surface_provider_impl.cc @@ -214,7 +214,7 @@ index 6b7fbb6cf13d..e2af75168cb9 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 13665946e08a..ceea7b60d44f 100644 +index 32cdffd116b7..d0303c7e79d9 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -25,7 +25,9 @@ @@ -252,7 +252,7 @@ index 13665946e08a..ceea7b60d44f 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -435,6 +448,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -430,6 +443,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 300d34444..4fcbc2873 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,39 +1,30 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index 4dca843104ac..63020b374688 100644 +index c3a2e5c241e3..4f746c94f316 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2561,15 +2561,22 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2763,7 +2763,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + // main frame - let's do the same thing here. std::string unique_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); - -- WebContentsViewDelegate* delegate = -- GetContentClient()->browser()->GetWebContentsViewDelegate(this); ++ + if (params.view && params.delegate_view) { + view_.reset(params.view); + render_view_host_delegate_view_ = params.delegate_view; + } -- if (browser_plugin_guest_) { -- view_.reset(new WebContentsViewChildFrame( -- this, delegate, &render_view_host_delegate_view_)); -- } else { -- view_.reset(CreateWebContentsView(this, delegate, -- &render_view_host_delegate_view_)); + if (!view_) { -+ WebContentsViewDelegate* delegate = -+ GetContentClient()->browser()->GetWebContentsViewDelegate(this); -+ -+ if (browser_plugin_guest_) { -+ view_.reset(new WebContentsViewChildFrame( -+ this, delegate, &render_view_host_delegate_view_)); -+ } else { -+ view_.reset(CreateWebContentsView(this, delegate, -+ &render_view_host_delegate_view_)); -+ } + WebContentsViewDelegate* delegate = + GetContentClient()->browser()->GetWebContentsViewDelegate(this); + +@@ -2774,6 +2780,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + view_.reset(CreateWebContentsView(this, delegate, + &render_view_host_delegate_view_)); } ++ } CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3368,6 +3375,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( + +@@ -3645,6 +3652,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -49,7 +40,7 @@ index 4dca843104ac..63020b374688 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -6850,6 +6866,10 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -7586,6 +7602,10 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } @@ -73,10 +64,10 @@ index f1dcf53ea481..192f7c0ddd04 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index f1c25ed4cf62..8bb6e9a374c7 100644 +index 0426cc1550f1..2c56fccadd2d 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -82,8 +82,10 @@ class BrowserContext; +@@ -86,8 +86,10 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -87,7 +78,7 @@ index f1c25ed4cf62..8bb6e9a374c7 100644 class WebUI; struct CustomContextMenuContext; struct DropData; -@@ -212,6 +214,10 @@ class WebContents : public PageNavigator, +@@ -221,6 +223,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; @@ -99,7 +90,7 @@ index f1c25ed4cf62..8bb6e9a374c7 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index a10c5caf5a4b..ef8d3c3c1056 100644 +index ee6b87d40496..338064935cc4 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -62,10 +62,12 @@ class EyeDropperListener; @@ -131,10 +122,10 @@ index a10c5caf5a4b..ef8d3c3c1056 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index 3666e0357038..b82c54816894 100644 +index 301fa10bcc3e..37ec8ddd4583 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -610,6 +610,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -613,6 +613,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 872242f3f..fe0a7ccf5 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,10 +10,10 @@ index ff7a8ed89e94..77f44956ff22 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index abfcd20b8941..634173c64a16 100644 +index 4c05fb9099e2..fadbb37d97ef 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -696,6 +696,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -697,6 +697,11 @@ class BLINK_PLATFORM_EXPORT Platform { // runs during Chromium's build step). virtual bool IsTakingV8ContextSnapshot() { return false; } @@ -26,10 +26,10 @@ index abfcd20b8941..634173c64a16 100644 static void InitializeMainThreadCommon(Platform* platform, std::unique_ptr main_thread); diff --git third_party/blink/renderer/core/dom/document_init.cc third_party/blink/renderer/core/dom/document_init.cc -index ba112d79de9a..83f5bd971bc9 100644 +index d49dc7cb85d5..dc4af48a458d 100644 --- third_party/blink/renderer/core/dom/document_init.cc +++ third_party/blink/renderer/core/dom/document_init.cc -@@ -176,11 +176,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { +@@ -182,11 +182,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { // frame()->tree().top()->securityContext() returns nullptr. // For that reason, the origin must be retrieved directly from |url|. if (frame->IsMainFrame()) @@ -44,10 +44,10 @@ index ba112d79de9a..83f5bd971bc9 100644 DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index 11b7b4a63f2e..c2714178a4a4 100644 +index c00d6f81db12..17c54cd0ca08 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1641,7 +1641,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1698,7 +1698,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) return nullptr; @@ -85,10 +85,10 @@ index 0608c4defc6d..54eaa2197957 100644 void DevToolsSession::DispatchProtocolCommand( diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index 45ef79f88b4d..074d5ea48b12 100644 +index c87fcbaaa194..2baae5c3bc64 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc -@@ -212,7 +212,8 @@ Page::Page(PageClients& page_clients) +@@ -211,7 +211,8 @@ Page::Page(PageClients& page_clients) MakeGarbageCollected(GetVisualViewport(), GetChromeClient())), link_highlight_(MakeGarbageCollected(*this)), @@ -98,7 +98,7 @@ index 45ef79f88b4d..074d5ea48b12 100644 // TODO(pdr): Initialize |validation_message_client_| lazily. validation_message_client_( MakeGarbageCollected(*this)), -@@ -395,21 +396,41 @@ void Page::InitialStyleChanged() { +@@ -391,21 +392,41 @@ void Page::InitialStyleChanged() { } } @@ -149,7 +149,7 @@ index 45ef79f88b4d..074d5ea48b12 100644 page->NotifyPluginsChanged(); } } -@@ -919,7 +940,8 @@ void Page::Trace(Visitor* visitor) const { +@@ -911,7 +932,8 @@ void Page::Trace(Visitor* visitor) const { visitor->Trace(link_highlight_); visitor->Trace(spatial_navigation_controller_); visitor->Trace(main_frame_); @@ -160,10 +160,10 @@ index 45ef79f88b4d..074d5ea48b12 100644 visitor->Trace(agent_metrics_collector_); visitor->Trace(plugins_changed_observers_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index b6a1caadf7b7..95fafb720083 100644 +index 4e4e496eb088..ed2ded8a397b 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h -@@ -150,7 +150,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -149,7 +149,8 @@ class CORE_EXPORT Page final : public GarbageCollected, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -173,7 +173,7 @@ index b6a1caadf7b7..95fafb720083 100644 // Resets the plugin data for all pages in the renderer process and notifies // PluginsChangedObservers. -@@ -431,7 +432,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -426,7 +427,8 @@ class CORE_EXPORT Page final : public GarbageCollected, const Member link_highlight_; Member spatial_navigation_controller_; diff --git a/patch/patches/webkit_pointer_event_781966.patch b/patch/patches/webkit_pointer_event_781966.patch deleted file mode 100644 index 172539a36..000000000 --- a/patch/patches/webkit_pointer_event_781966.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git third_party/blink/renderer/core/input/pointer_event_manager.cc third_party/blink/renderer/core/input/pointer_event_manager.cc -index 8d8f25e2f57a..5aa055ce855f 100644 ---- third_party/blink/renderer/core/input/pointer_event_manager.cc -+++ third_party/blink/renderer/core/input/pointer_event_manager.cc -@@ -304,7 +304,7 @@ void PointerEventManager::HandlePointerInterruption( - for (auto pointer_event : canceled_pointer_events) { - // If we are sending a pointercancel we have sent the pointerevent to some - // target before. -- CHECK(element_under_pointer_.Contains(pointer_event->pointerId())); -+ // CHECK(element_under_pointer_.Contains(pointer_event->pointerId())); - Element* target = - element_under_pointer_.at(pointer_event->pointerId())->target; - diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch deleted file mode 100644 index c658057de..000000000 --- a/patch/patches/webkit_popups.patch +++ /dev/null @@ -1,76 +0,0 @@ -diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index 4d55813fed92..f41bd4b5590e 100644 ---- third_party/blink/public/web/web_view.h -+++ third_party/blink/public/web/web_view.h -@@ -371,6 +371,7 @@ class WebView { - - // Sets whether select popup menus should be rendered by the browser. - BLINK_EXPORT static void SetUseExternalPopupMenus(bool); -+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0; - - // Cancels and hides the current popup (datetime, select...) if any. - virtual void CancelPagePopup() = 0; -diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index 4b42cd80d5c1..cafb43ea03f1 100644 ---- third_party/blink/renderer/core/exported/web_view_impl.cc -+++ third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -216,8 +216,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { - g_should_use_external_popup_menus = use_external_popup_menus; - } - --bool WebViewImpl::UseExternalPopupMenus() { -- return g_should_use_external_popup_menus; -+void WebViewImpl::SetUseExternalPopupMenusThisInstance( -+ bool use_external_popup_menus) { -+ should_use_external_popup_menus_ = use_external_popup_menus; -+} -+ -+bool WebViewImpl::UseExternalPopupMenus() const { -+ return should_use_external_popup_menus_; - } - - namespace { -@@ -323,6 +328,7 @@ WebViewImpl::WebViewImpl( - chrome_client_(MakeGarbageCollected(this)), - minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), - maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), -+ should_use_external_popup_menus_(g_should_use_external_popup_menus), - does_composite_(does_composite), - fullscreen_controller_(std::make_unique(this)), - receiver_(this, std::move(page_handle)) { -diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 510c555ca5af..242a208b7328 100644 ---- third_party/blink/renderer/core/exported/web_view_impl.h -+++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -125,7 +125,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, - static HashSet& AllInstances(); - // Returns true if popup menus should be rendered by the browser, false if - // they should be rendered by WebKit (which is the default). -- static bool UseExternalPopupMenus(); -+ void SetUseExternalPopupMenusThisInstance(bool) override; -+ bool UseExternalPopupMenus() const; - - // Returns whether frames under this WebView are backed by a compositor. - bool does_composite() const { return does_composite_; } -@@ -645,6 +646,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, - float fake_page_scale_animation_page_scale_factor_ = 0.f; - bool fake_page_scale_animation_use_anchor_ = false; - -+ bool should_use_external_popup_menus_; -+ - float compositor_device_scale_factor_override_ = 0.f; - TransformationMatrix device_emulation_transform_; - -diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index a923d3b27d36..d9d5b6200d31 100644 ---- third_party/blink/renderer/core/page/chrome_client_impl.cc -+++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -839,7 +839,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { - PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, - HTMLSelectElement& select) { - NotifyPopupOpeningObservers(); -- if (WebViewImpl::UseExternalPopupMenus()) -+ if (web_view_->UseExternalPopupMenus()) - return MakeGarbageCollected(frame, select); - - DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); diff --git a/patch/patches/webkit_popups_and_background.patch b/patch/patches/webkit_popups_and_background.patch new file mode 100644 index 000000000..ef65f8fa8 --- /dev/null +++ b/patch/patches/webkit_popups_and_background.patch @@ -0,0 +1,151 @@ +diff --git third_party/blink/common/web_preferences/web_preferences.cc third_party/blink/common/web_preferences/web_preferences.cc +index 980bd49381eb..d84817bd0388 100644 +--- third_party/blink/common/web_preferences/web_preferences.cc ++++ third_party/blink/common/web_preferences/web_preferences.cc +@@ -145,6 +145,7 @@ WebPreferences::WebPreferences() + accelerated_video_decode_enabled(false), + animation_policy(kImageAnimationPolicyAllowed), + user_gesture_required_for_presentation(true), ++ base_background_color(0xFFFFFFFF), // Color::kWhite + text_tracks_enabled(false), + text_track_margin_percentage(0.0f), + immersive_mode_enabled(false), +diff --git third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +index 4cbfb72c25d1..2e5261e4d714 100644 +--- third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc ++++ third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +@@ -465,6 +465,7 @@ bool StructTraitsuser_gesture_required_for_presentation = + data.user_gesture_required_for_presentation(); ++ out->base_background_color = data.base_background_color(); + out->text_tracks_enabled = data.text_tracks_enabled(); + out->text_track_margin_percentage = data.text_track_margin_percentage(); + out->immersive_mode_enabled = data.immersive_mode_enabled(); +diff --git third_party/blink/public/common/web_preferences/web_preferences.h third_party/blink/public/common/web_preferences/web_preferences.h +index 842d902e040f..81f6f226966c 100644 +--- third_party/blink/public/common/web_preferences/web_preferences.h ++++ third_party/blink/public/common/web_preferences/web_preferences.h +@@ -172,6 +172,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { + + bool user_gesture_required_for_presentation; + ++ uint32_t base_background_color; ++ + bool text_tracks_enabled; + + // These fields specify the foreground and background color for WebVTT text +diff --git third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +index 50c48c07228b..37c447ef1e12 100644 +--- third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h ++++ third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +@@ -522,6 +522,11 @@ struct BLINK_COMMON_EXPORT StructTraits(this)), + minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), + maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), ++ should_use_external_popup_menus_(g_should_use_external_popup_menus), + does_composite_(does_composite), + fullscreen_controller_(std::make_unique(this)), + receiver_(this, std::move(page_handle)) { +@@ -2254,6 +2260,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, + #endif + + WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available); ++ ++ web_view->SetBaseBackgroundColor(prefs.base_background_color); + } + + void WebViewImpl::ThemeChanged() { +diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h +index 64c52801dbfc..b57b61e609d2 100644 +--- third_party/blink/renderer/core/exported/web_view_impl.h ++++ third_party/blink/renderer/core/exported/web_view_impl.h +@@ -125,7 +125,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, + static HashSet& AllInstances(); + // Returns true if popup menus should be rendered by the browser, false if + // they should be rendered by WebKit (which is the default). +- static bool UseExternalPopupMenus(); ++ void SetUseExternalPopupMenusThisInstance(bool) override; ++ bool UseExternalPopupMenus() const; + + // Returns whether frames under this WebView are backed by a compositor. + bool does_composite() const { return does_composite_; } +@@ -694,6 +695,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, + float fake_page_scale_animation_page_scale_factor_ = 0.f; + bool fake_page_scale_animation_use_anchor_ = false; + ++ bool should_use_external_popup_menus_; ++ + float compositor_device_scale_factor_override_ = 0.f; + TransformationMatrix device_emulation_transform_; + +diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc +index 46e116800e5a..1c0ff3ba815f 100644 +--- third_party/blink/renderer/core/page/chrome_client_impl.cc ++++ third_party/blink/renderer/core/page/chrome_client_impl.cc +@@ -811,7 +811,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { + PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, + HTMLSelectElement& select) { + NotifyPopupOpeningObservers(); +- if (WebViewImpl::UseExternalPopupMenus()) ++ if (web_view_->UseExternalPopupMenus()) + return MakeGarbageCollected(frame, select); + + DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 46e29e446..c456af0de 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index 0a144a99349f..c673f09e5652 100644 +index 227e5b2618c1..7e7b32264b80 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -10,6 +10,7 @@ @@ -26,7 +26,7 @@ index 0a144a99349f..c673f09e5652 100644 #include "components/prefs/pref_service.h" #include "components/sync/driver/about_sync_util.h" #include "components/sync/driver/sync_service.h" -@@ -277,7 +280,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -335,7 +338,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -39,7 +39,7 @@ index 0a144a99349f..c673f09e5652 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); PopulateDataReductionProxyLogs(response.get()); -@@ -368,6 +375,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -430,6 +437,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -52,7 +52,7 @@ index 0a144a99349f..c673f09e5652 100644 extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry::Get(profile); std::string extensions_list; -@@ -474,6 +487,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -536,6 +549,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if defined(OS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index eeb572996..715baf293 100644 --- a/patch/patches/webview_plugin_2020.patch +++ b/patch/patches/webview_plugin_2020.patch @@ -1,8 +1,8 @@ diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd -index 4d07574af45c..56299e99f49e 100644 +index 54ad1ca860fa..f0981120284b 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -5068,7 +5068,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -5081,7 +5081,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/patch/patches/win_rt_2274.patch b/patch/patches/win_rt_2274.patch index c2386b83b..735843ac6 100644 --- a/patch/patches/win_rt_2274.patch +++ b/patch/patches/win_rt_2274.patch @@ -1,8 +1,8 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index d63d942c7e3e..a100fb4d685f 100644 +index 8c1e3aa58b6d..a51f5f10c9e9 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc -@@ -953,8 +953,11 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -1001,8 +1001,11 @@ ResultCode SandboxWin::StartSandboxedProcess( } // TODO(wfh): Relax strict handle checks for network process until root cause // for this crash can be resolved. See https://crbug.com/939590. diff --git a/tests/ceftests/parser_unittest.cc b/tests/ceftests/parser_unittest.cc index cc5e6be3f..b4544afb3 100644 --- a/tests/ceftests/parser_unittest.cc +++ b/tests/ceftests/parser_unittest.cc @@ -464,25 +464,21 @@ TEST(ParserTest, ParseJSONList) { TEST(ParserTest, ParseJSONAndReturnErrorInvalid) { const char data[] = "This is my test data"; - cef_json_parser_error_t error_code; CefString error_msg; CefRefPtr value = - CefParseJSONAndReturnError(data, JSON_PARSER_RFC, error_code, error_msg); + CefParseJSONAndReturnError(data, JSON_PARSER_RFC, error_msg); CefString expect_error_msg = "Line: 1, column: 1, Unexpected token."; EXPECT_FALSE(value.get()); - EXPECT_EQ(JSON_UNEXPECTED_TOKEN, error_code); EXPECT_EQ(expect_error_msg, error_msg); } TEST(ParserTest, ParseJSONAndReturnErrorTrailingComma) { const char data[] = "{\"key1\":123,}"; - cef_json_parser_error_t error_code; CefString error_msg; CefRefPtr value = - CefParseJSONAndReturnError(data, JSON_PARSER_RFC, error_code, error_msg); + CefParseJSONAndReturnError(data, JSON_PARSER_RFC, error_msg); CefString expect_error_msg = "Line: 1, column: 13, Trailing comma not allowed."; EXPECT_FALSE(value.get()); - EXPECT_EQ(JSON_TRAILING_COMMA, error_code); EXPECT_EQ(expect_error_msg, error_msg); } diff --git a/tests/ceftests/scheme_handler_unittest.cc b/tests/ceftests/scheme_handler_unittest.cc index d31a9387d..5ce64304d 100644 --- a/tests/ceftests/scheme_handler_unittest.cc +++ b/tests/ceftests/scheme_handler_unittest.cc @@ -1402,11 +1402,7 @@ TEST(SchemeHandlerTest, CustomStandardXHRDifferentOriginSync) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -1438,11 +1434,7 @@ TEST(SchemeHandlerTest, CustomStandardXHRDifferentOriginAsync) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -1474,11 +1466,7 @@ TEST(SchemeHandlerTest, CustomStandardFetchDifferentOrigin) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -1635,11 +1623,7 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginSync) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -1671,11 +1655,7 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginAsync) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -1707,11 +1687,7 @@ TEST(SchemeHandlerTest, HttpFetchDifferentOriginAsync) { EXPECT_TRUE(g_TestResults.got_read); EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -2259,11 +2235,7 @@ TEST(SchemeHandlerTest, CustomStandardXHRDifferentOriginRedirectSync) { EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_redirect); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -2297,11 +2269,7 @@ TEST(SchemeHandlerTest, CustomStandardXHRDifferentOriginRedirectAsync) { EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_redirect); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); @@ -2336,11 +2304,7 @@ TEST(SchemeHandlerTest, CustomStandardFetchDifferentOriginRedirect) { EXPECT_TRUE(g_TestResults.got_output); EXPECT_TRUE(g_TestResults.got_sub_redirect); EXPECT_TRUE(g_TestResults.got_sub_request); - if (!IsOutOfBlinkCorsEnabled()) { - EXPECT_TRUE(g_TestResults.got_sub_read); - } else { - EXPECT_FALSE(g_TestResults.got_sub_read); - } + EXPECT_FALSE(g_TestResults.got_sub_read); EXPECT_FALSE(g_TestResults.got_sub_success); ClearTestSchemes(); diff --git a/tests/ceftests/test_util.cc b/tests/ceftests/test_util.cc index 8da3df96a..3d8349951 100644 --- a/tests/ceftests/test_util.cc +++ b/tests/ceftests/test_util.cc @@ -281,17 +281,6 @@ bool TestOldResourceAPI() { return state ? true : false; } -bool IsOutOfBlinkCorsEnabled() { - static int state = -1; - if (state == -1) { - CefRefPtr command_line = - CefCommandLine::GetGlobalCommandLine(); - const std::string& value = command_line->GetSwitchValue("disable-features"); - state = value.find("OutOfBlinkCors") == std::string::npos ? 1 : 0; - } - return state ? true : false; -} - bool IsChromeRuntimeEnabled() { static int state = -1; if (state == -1) { diff --git a/tests/ceftests/test_util.h b/tests/ceftests/test_util.h index 547bddc74..c70185961 100644 --- a/tests/ceftests/test_util.h +++ b/tests/ceftests/test_util.h @@ -81,9 +81,6 @@ inline bool IsTestRequestContextModeCustom(TestRequestContextMode mode) { // Returns true if the old CefResourceHandler API should be tested. bool TestOldResourceAPI(); -// Returns true if OutOfBlinkCors is enabled. -bool IsOutOfBlinkCorsEnabled(); - // Returns true if the Chrome runtime is enabled. bool IsChromeRuntimeEnabled(); diff --git a/tests/ceftests/views/test_window_delegate.cc b/tests/ceftests/views/test_window_delegate.cc index 299ea8680..0d5ee47e6 100644 --- a/tests/ceftests/views/test_window_delegate.cc +++ b/tests/ceftests/views/test_window_delegate.cc @@ -68,7 +68,8 @@ void TestWindowDelegate::OnWindowCreated(CefRefPtr window) { EXPECT_FALSE(window->GetWindowIcon().get()); EXPECT_FALSE(window->GetWindowAppIcon().get()); - EXPECT_TRUE(window->GetDisplay().get()); + auto display = window->GetDisplay(); + EXPECT_TRUE(display.get()); // Size will come from GetGetInitialBounds() or GetPreferredSize() on // initial Window creation. @@ -83,9 +84,10 @@ void TestWindowDelegate::OnWindowCreated(CefRefPtr window) { EXPECT_EQ(config_.window_origin.x, client_bounds.x); EXPECT_EQ(config_.window_origin.y, client_bounds.y); } else { - // Default origin is (0,0). - EXPECT_EQ(0, client_bounds.x); - EXPECT_EQ(0, client_bounds.y); + // Default origin is the upper-left corner of the display's work area. + auto work_area = display->GetWorkArea(); + EXPECT_EQ(work_area.x, client_bounds.x); + EXPECT_EQ(work_area.y, client_bounds.y); } if (config_.frameless) { diff --git a/tests/shared/browser/extension_util.cc b/tests/shared/browser/extension_util.cc index 5d2e535e5..6b527a7ff 100644 --- a/tests/shared/browser/extension_util.cc +++ b/tests/shared/browser/extension_util.cc @@ -87,10 +87,9 @@ void GetInternalManifest(const std::string& extension_path, return; } - cef_json_parser_error_t error_code; CefString error_msg; - CefRefPtr value = CefParseJSONAndReturnError( - manifest_contents, JSON_PARSER_RFC, error_code, error_msg); + CefRefPtr value = + CefParseJSONAndReturnError(manifest_contents, JSON_PARSER_RFC, error_msg); if (!value || value->GetType() != VTYPE_DICTIONARY) { if (error_msg.empty()) error_msg = "Incorrectly formatted dictionary contents."; diff --git a/tools/gn_args.py b/tools/gn_args.py index 0a6516530..452904edf 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -222,10 +222,10 @@ def GetRecommendedDefaultArgs(): # component build on Windows. 'enable_background_mode': False, - # Disable support for resource whitelist generation. When enabled this + # Disable support for resource allowlist generation. When enabled this # introduces a Windows official build dependency on the # "//chrome:chrome_dll" target, which will fail to build with CEF. - 'enable_resource_whitelist_generation': False, + 'enable_resource_allowlist_generation': False, } if platform == 'linux': @@ -333,8 +333,8 @@ def ValidateArgs(args): if platform == 'mac': assert target_cpu == 'x64', 'target_cpu must be "x64"' elif platform == 'windows': - assert target_cpu in ( - 'x86', 'x64', 'arm64'), 'target_cpu must be "x86", "x64" or "arm64"' + assert target_cpu in ('x86', 'x64', + 'arm64'), 'target_cpu must be "x86", "x64" or "arm64"' elif platform == 'linux': assert target_cpu in ( 'x86', 'x64', 'arm', @@ -556,8 +556,8 @@ def GetAllPlatformConfigs(build_args): result['Debug_GN_' + cpu] = GetConfigArgs(args, True, cpu) result['Release_GN_' + cpu] = GetConfigArgs(args, False, cpu) - if platform in ('windows', 'mac') and GetArgValue( - args, 'is_official_build'): + if platform in ('windows', 'mac') and GetArgValue(args, + 'is_official_build'): # Build cef_sandbox.lib with a different configuration. if create_debug: result['Debug_GN_' + cpu + '_sandbox'] = GetConfigArgsSandbox(