From 2f1e782f62c21dbc2e35d546aed7a0d69bdd97c4 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 25 Jan 2024 21:12:43 -0500 Subject: [PATCH] Update to Chromium version 122.0.6261.0 (#1250580) Frame identifiers have changed from int64_t to string type. This is due to https://crbug.com/1502660 which removes access to frame routing IDs in the renderer process. New cross-process frame identifiers are 160-bit values (32-bit child process ID + 128-bit local frame token) and most easily represented as strings. All other frame-related expectations and behaviors remain the same. --- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- CHROMIUM_UPDATE.txt | 2 +- include/capi/cef_browser_capi.h | 14 +- include/capi/cef_cookie_capi.h | 6 +- include/capi/cef_frame_capi.h | 8 +- include/capi/cef_media_router_capi.h | 6 +- include/capi/cef_scheme_capi.h | 10 +- include/cef_api_hash.h | 8 +- include/cef_browser.h | 9 +- include/cef_frame.h | 4 +- include/internal/cef_types.h | 35 ++--- include/internal/cef_types_content_settings.h | 39 +++-- libcef/browser/alloy/alloy_browser_context.cc | 14 +- libcef/browser/alloy/alloy_browser_context.h | 3 - libcef/browser/alloy/alloy_browser_main.cc | 6 +- .../alloy/alloy_content_browser_client.cc | 23 ++- .../alloy/alloy_content_browser_client.h | 9 +- .../alloy/browser_platform_delegate_alloy.cc | 8 +- .../alloy/chrome_browser_process_alloy.cc | 38 ++++- .../alloy/chrome_browser_process_alloy.h | 4 +- libcef/browser/browser_contents_delegate.cc | 8 +- libcef/browser/browser_host_base.cc | 74 ++++++--- libcef/browser/browser_host_base.h | 18 ++- libcef/browser/browser_info.cc | 38 ++++- libcef/browser/browser_info.h | 19 ++- libcef/browser/browser_info_manager.cc | 62 ++++++-- libcef/browser/browser_info_manager.h | 22 ++- libcef/browser/browser_manager.cc | 5 +- libcef/browser/browser_manager.h | 2 +- .../chrome_content_browser_client_cef.cc | 14 +- .../chrome_content_browser_client_cef.h | 7 +- libcef/browser/download_manager_delegate.cc | 44 +++--- libcef/browser/download_manager_delegate.h | 3 +- .../extensions/extension_function_details.cc | 3 +- .../extensions/extensions_browser_client.cc | 7 + .../extensions/extensions_browser_client.h | 4 + libcef/browser/file_dialog_manager.cc | 30 +--- libcef/browser/frame_host_impl.cc | 98 ++++++------ libcef/browser/frame_host_impl.h | 44 ++++-- .../browser_platform_delegate_native_linux.cc | 24 +-- .../browser_platform_delegate_native_linux.h | 6 +- libcef/browser/native/cursor_util_aura.cc | 6 +- .../net_service/browser_urlrequest_impl.cc | 3 +- .../resource_request_handler_wrapper.cc | 3 +- libcef/browser/osr/motion_event_osr.h | 2 +- .../osr/render_widget_host_view_osr.cc | 24 +-- .../browser/osr/render_widget_host_view_osr.h | 14 +- libcef/browser/permission_prompt.cc | 4 +- libcef/browser/views/window_view.cc | 10 +- libcef/common/alloy/alloy_content_client.cc | 4 +- libcef/common/alloy/alloy_content_client.h | 2 +- libcef/common/alloy/alloy_main_delegate.cc | 12 +- .../extensions/extensions_api_provider.cc | 4 +- .../extensions/extensions_api_provider.h | 2 +- libcef/common/frame_util.cc | 60 ++++++-- libcef/common/frame_util.h | 46 +++--- libcef/common/mojom/cef.mojom | 4 +- .../alloy/alloy_content_renderer_client.cc | 8 +- .../alloy/alloy_content_renderer_client.h | 2 +- .../url_loader_throttle_provider_impl.cc | 7 +- .../alloy/url_loader_throttle_provider_impl.h | 2 +- libcef/renderer/blink_glue.cc | 2 - libcef/renderer/blink_glue.h | 2 - libcef/renderer/browser_impl.cc | 77 +++------- libcef/renderer/browser_impl.h | 25 ++- .../extensions/extensions_renderer_client.cc | 5 +- libcef/renderer/frame_impl.cc | 49 +++--- libcef/renderer/frame_impl.h | 10 +- libcef/renderer/render_frame_util.cc | 19 ++- libcef/renderer/render_frame_util.h | 14 +- libcef/renderer/render_manager.cc | 10 +- libcef/renderer/v8_impl.cc | 2 +- libcef_dll/cpptoc/browser_cpptoc.cc | 55 +++---- libcef_dll/cpptoc/frame_cpptoc.cc | 13 +- libcef_dll/ctocpp/browser_ctocpp.cc | 60 ++++---- libcef_dll/ctocpp/browser_ctocpp.h | 9 +- libcef_dll/ctocpp/frame_ctocpp.cc | 14 +- libcef_dll/ctocpp/frame_ctocpp.h | 4 +- patch/patch.cfg | 21 --- patch/patches/base_allocator_5120035.patch | 13 -- patch/patches/base_command_line_1872.patch | 4 +- patch/patches/base_sandbox_2743.patch | 32 ++-- patch/patches/base_sandbox_3519.patch | 2 +- patch/patches/base_test_4396276.patch | 8 +- patch/patches/blink_web_element_4200240.patch | 8 +- patch/patches/browser_scheduler.patch | 2 +- .../browser_security_policy_1081397.patch | 8 +- patch/patches/build.patch | 4 +- patch/patches/chrome_browser.patch | 6 +- ...rome_browser_background_mode_1100085.patch | 14 +- patch/patches/chrome_browser_browser.patch | 82 +++++----- .../chrome_browser_content_settings.patch | 16 +- .../chrome_browser_context_menus.patch | 26 ++-- .../chrome_browser_dialogs_native.patch | 48 +++--- .../chrome_browser_dialogs_widget.patch | 12 +- patch/patches/chrome_browser_frame_mac.patch | 2 +- .../chrome_browser_permission_prompt.patch | 22 ++- patch/patches/chrome_browser_policy.patch | 42 +++--- .../patches/chrome_browser_profile_menu.patch | 6 +- patch/patches/chrome_browser_profiles.patch | 26 ++-- .../chrome_browser_safe_browsing.patch | 2 +- patch/patches/chrome_browser_startup.patch | 6 +- patch/patches/chrome_browser_themes.patch | 4 +- patch/patches/chrome_plugins.patch | 10 +- patch/patches/chrome_renderer.patch | 4 +- patch/patches/chrome_runtime.patch | 120 +++++++-------- patch/patches/chrome_runtime_views.patch | 142 +++++++++--------- patch/patches/component_build.patch | 14 +- patch/patches/content_2015.patch | 50 +++--- patch/patches/content_main_654986.patch | 20 +-- .../patches/content_renderer_host_3617.patch | 4 +- patch/patches/crashpad_1995.patch | 4 +- patch/patches/extensions_1947.patch | 24 +-- patch/patches/gn_config.patch | 16 +- patch/patches/gritsettings.patch | 4 +- patch/patches/libxml_visibility.patch | 2 +- patch/patches/light_mode_3534.patch | 21 +-- patch/patches/linux_assets_path_1936.patch | 2 +- patch/patches/linux_blink_thread_local.patch | 4 +- patch/patches/linux_bluetooth_1319006.patch | 2 +- patch/patches/linux_connection_5115482.patch | 68 --------- .../linux_glib_deprecated_volatile.patch | 8 +- patch/patches/linux_libxml_tls_3616.patch | 13 -- patch/patches/linux_printing_context.patch | 2 +- .../mac_platform_style_bubble_893292.patch | 4 +- patch/patches/message_loop.patch | 14 +- patch/patches/mojo_generator_1422178.patch | 13 -- patch/patches/net_cookie_flags.patch | 8 +- patch/patches/net_test_server_3798752.patch | 6 +- patch/patches/osr_fling_2745.patch | 12 +- patch/patches/print_preview_123.patch | 8 +- patch/patches/printing_context_2196.patch | 16 +- patch/patches/renderer_host_1070713.patch | 4 +- patch/patches/rfh_navigation_4829483.patch | 4 +- patch/patches/rwh_background_color_1984.patch | 6 +- patch/patches/screen_1443650.patch | 6 +- patch/patches/services_network_2622.patch | 58 +++---- patch/patches/services_network_2718.patch | 30 +--- .../patches/set_resize_background_color.patch | 8 +- patch/patches/storage_incognito_2289.patch | 6 +- patch/patches/trace_event.patch | 2 +- patch/patches/views_1749_2102_3330.patch | 64 ++++---- patch/patches/views_widget.patch | 72 ++++----- patch/patches/viz_osr_2575.patch | 16 +- patch/patches/web_contents_1257_1565.patch | 26 ++-- patch/patches/webkit_plugin_info_2015.patch | 6 +- patch/patches/webkit_popups.patch | 12 +- patch/patches/webui_2037.patch | 8 +- patch/patches/win_sandbox_3210.patch | 4 +- patch/patches/win_sandbox_policy.patch | 4 +- tests/ceftests/frame_handler_unittest.cc | 35 ++--- tests/ceftests/frame_unittest.cc | 59 ++++---- .../message_router_multi_query_unittest.cc | 21 ++- tests/ceftests/os_rendering_unittest.cc | 20 ++- .../resource_request_handler_unittest.cc | 14 +- tests/ceftests/urlrequest_unittest.cc | 3 +- 156 files changed, 1452 insertions(+), 1436 deletions(-) delete mode 100644 patch/patches/base_allocator_5120035.patch delete mode 100644 patch/patches/linux_connection_5115482.patch delete mode 100644 patch/patches/linux_libxml_tls_3616.patch delete mode 100644 patch/patches/mojo_generator_1422178.patch diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 545b09611..be27e2a23 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/121.0.6167.0' + 'chromium_checkout': 'refs/tags/122.0.6261.0' } diff --git a/CHROMIUM_UPDATE.txt b/CHROMIUM_UPDATE.txt index 523813075..85a89ab14 100644 --- a/CHROMIUM_UPDATE.txt +++ b/CHROMIUM_UPDATE.txt @@ -38,7 +38,7 @@ 'chrome/common/extensions/api/*_features.json', 'chrome/renderer/chrome_content_renderer_client.*', 'chrome/renderer/extensions/chrome_extensions_renderer_client.*', - 'components/content_settings/core/common/content_settings_types.h', + 'components/content_settings/core/common/content_settings_types.mojom', 'content/browser/renderer_host/render_widget_host_view_base.*', 'content/public/browser/content_browser_client.*', 'content/public/browser/render_widget_host_view.h', diff --git a/include/capi/cef_browser_capi.h b/include/capi/cef_browser_capi.h index 2397d0ad3..4300126fc 100644 --- a/include/capi/cef_browser_capi.h +++ b/include/capi/cef_browser_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=d23df6f606a96b432905c5c80f29ab72915b8e01$ +// $hash=e7f9480661f77931890085d6c5bf23d9842212e2$ // #ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ @@ -165,15 +165,16 @@ typedef struct _cef_browser_t { /// /// Returns the frame with the specified identifier, or NULL if not found. /// - struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)( + struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_identifier)( struct _cef_browser_t* self, - int64_t identifier); + const cef_string_t* identifier); /// /// Returns the frame with the specified name, or NULL if not found. /// - struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self, - const cef_string_t* name); + struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_name)( + struct _cef_browser_t* self, + const cef_string_t* name); /// /// Returns the number of frames that currently exist. @@ -184,8 +185,7 @@ typedef struct _cef_browser_t { /// Returns the identifiers of all existing frames. /// void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self, - size_t* identifiersCount, - int64_t* identifiers); + cef_string_list_t identifiers); /// /// Returns the names of all existing frames. diff --git a/include/capi/cef_cookie_capi.h b/include/capi/cef_cookie_capi.h index 737dca3d4..2c0d7993a 100644 --- a/include/capi/cef_cookie_capi.h +++ b/include/capi/cef_cookie_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=50e59e2d7038a1be0d3a2451c9b7073aee5156ef$ +// $hash=76ba2e59636aa71c8c6286093198a1e64d012c62$ // #ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ @@ -126,8 +126,8 @@ typedef struct _cef_cookie_manager_t { /// cef_settings_t.cache_path if specified or in memory otherwise. If |callback| /// is non-NULL it will be executed asnychronously on the UI thread after the /// manager's storage has been initialized. Using this function is equivalent to -/// calling cef_request_context_t::cef_request_context_get_global_context()->Get -/// DefaultCookieManager(). +/// calling cef_request_context_t::cef_request_context_get_global_context()- +/// >GetDefaultCookieManager(). /// CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager( struct _cef_completion_callback_t* callback); diff --git a/include/capi/cef_frame_capi.h b/include/capi/cef_frame_capi.h index b32bfa3b4..6776631ba 100644 --- a/include/capi/cef_frame_capi.h +++ b/include/capi/cef_frame_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=7294486141b2377198e994048a768db4a7cb9cd0$ +// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$ // #ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ @@ -178,10 +178,12 @@ typedef struct _cef_frame_t { cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self); /// - /// Returns the globally unique identifier for this frame or < 0 if the + /// Returns the globally unique identifier for this frame or NULL if the /// underlying frame does not yet exist. /// - int64_t(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self); + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t(CEF_CALLBACK* get_identifier)( + struct _cef_frame_t* self); /// /// Returns the parent of this frame or NULL if this is the main (top-level) diff --git a/include/capi/cef_media_router_capi.h b/include/capi/cef_media_router_capi.h index d97827de2..b48731e13 100644 --- a/include/capi/cef_media_router_capi.h +++ b/include/capi/cef_media_router_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=62e7e781f3fef0d332b6a921d48a192fd0115295$ +// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$ // #ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_ @@ -114,8 +114,8 @@ typedef struct _cef_media_router_t { /// Returns the MediaRouter object associated with the global request context. /// If |callback| is non-NULL it will be executed asnychronously on the UI /// thread after the manager's storage has been initialized. Equivalent to -/// calling cef_request_context_t::cef_request_context_get_global_context()->get -/// _media_router(). +/// calling cef_request_context_t::cef_request_context_get_global_context()- +/// >get_media_router(). /// CEF_EXPORT cef_media_router_t* cef_media_router_get_global( struct _cef_completion_callback_t* callback); diff --git a/include/capi/cef_scheme_capi.h b/include/capi/cef_scheme_capi.h index 01b0fc0dc..c806abd53 100644 --- a/include/capi/cef_scheme_capi.h +++ b/include/capi/cef_scheme_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=ba8011bd357e466a94acfd86597f44af00f096a3$ +// $hash=dd3f6003f9a8f59c2eb4320c382651a441086aee$ // #ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ @@ -116,8 +116,8 @@ typedef struct _cef_scheme_handler_factory_t { /// matches the specified |scheme_name| and optional |domain_name|. Returns /// false (0) if an error occurs. This function may be called on any thread in /// the browser process. Using this function is equivalent to calling cef_reques -/// t_context_t::cef_request_context_get_global_context()->register_scheme_handl -/// er_factory(). +/// t_context_t::cef_request_context_get_global_context()- +/// >register_scheme_handler_factory(). /// CEF_EXPORT int cef_register_scheme_handler_factory( const cef_string_t* scheme_name, @@ -128,8 +128,8 @@ CEF_EXPORT int cef_register_scheme_handler_factory( /// Clear all scheme handler factories registered with the global request /// context. Returns false (0) on error. This function may be called on any /// thread in the browser process. Using this function is equivalent to calling -/// cef_request_context_t::cef_request_context_get_global_context()->clear_schem -/// e_handler_factories(). +/// cef_request_context_t::cef_request_context_get_global_context()- +/// >clear_scheme_handler_factories(). /// CEF_EXPORT int cef_clear_scheme_handler_factories(void); diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 880bcab14..a652cd7fe 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 "d14f0a1044fad3677f4e3541ad4becc55e3e1a21" +#define CEF_API_HASH_UNIVERSAL "26455bea1da0a2592502ac7a3889bbb7c7c41652" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "74ea462bd443de49ae328d73dcbd1e4fde5d6cc5" +#define CEF_API_HASH_PLATFORM "e29ebe81ef26bdbf93ee46ca2f6437ffbb91bb36" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "8716cddadbd9316af1313f3cb8f8a42acdad369c" +#define CEF_API_HASH_PLATFORM "36f2affe168d233f9864b0c2d23144f01a737bac" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "12843112055d55c94bb2ea66f62b4935962d5c7e" +#define CEF_API_HASH_PLATFORM "cb887a91b5128574e18ff99b03798a8aed936561" #endif #ifdef __cplusplus diff --git a/include/cef_browser.h b/include/cef_browser.h index 7ba498580..4082b96c4 100644 --- a/include/cef_browser.h +++ b/include/cef_browser.h @@ -169,14 +169,15 @@ class CefBrowser : public virtual CefBaseRefCounted { /// /// Returns the frame with the specified identifier, or NULL if not found. /// - /*--cef(capi_name=get_frame_byident)--*/ - virtual CefRefPtr GetFrame(int64_t identifier) = 0; + /*--cef()--*/ + virtual CefRefPtr GetFrameByIdentifier( + const CefString& identifier) = 0; /// /// Returns the frame with the specified name, or NULL if not found. /// /*--cef(optional_param=name)--*/ - virtual CefRefPtr GetFrame(const CefString& name) = 0; + virtual CefRefPtr GetFrameByName(const CefString& name) = 0; /// /// Returns the number of frames that currently exist. @@ -188,7 +189,7 @@ class CefBrowser : public virtual CefBaseRefCounted { /// Returns the identifiers of all existing frames. /// /*--cef(count_func=identifiers:GetFrameCount)--*/ - virtual void GetFrameIdentifiers(std::vector& identifiers) = 0; + virtual void GetFrameIdentifiers(std::vector& identifiers) = 0; /// /// Returns the names of all existing frames. diff --git a/include/cef_frame.h b/include/cef_frame.h index ab11dee68..4c8d414ba 100644 --- a/include/cef_frame.h +++ b/include/cef_frame.h @@ -180,11 +180,11 @@ class CefFrame : public virtual CefBaseRefCounted { virtual CefString GetName() = 0; /// - /// Returns the globally unique identifier for this frame or < 0 if the + /// Returns the globally unique identifier for this frame or empty if the /// underlying frame does not yet exist. /// /*--cef()--*/ - virtual int64_t GetIdentifier() = 0; + virtual CefString GetIdentifier() = 0; /// /// Returns the parent of this frame or NULL if this is the main (top-level) diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 705c33705..a4ddbe52a 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -3545,23 +3545,24 @@ typedef enum { CEF_PERMISSION_TYPE_AR_SESSION = 1 << 1, CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2, CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3, - CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 4, - CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 5, - CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 6, - CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 7, - CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 8, - CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 9, - CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 10, - CEF_PERMISSION_TYPE_MIDI = 1 << 11, - CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 12, - CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 13, - CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 14, - CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 15, - CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 16, - CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 17, - CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18, - CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 19, - CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 20, + CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL = 1 << 4, + CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 5, + CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 6, + CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7, + CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8, + CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9, + CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 10, + CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 11, + CEF_PERMISSION_TYPE_MIDI = 1 << 12, + CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13, + CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14, + CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15, + CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 16, + CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 17, + CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 18, + CEF_PERMISSION_TYPE_VR_SESSION = 1 << 19, + CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 20, + CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 21, } cef_permission_request_types_t; /// diff --git a/include/internal/cef_types_content_settings.h b/include/internal/cef_types_content_settings.h index d709db895..cdb24567c 100644 --- a/include/internal/cef_types_content_settings.h +++ b/include/internal/cef_types_content_settings.h @@ -362,32 +362,51 @@ typedef enum { /// Stores per origin metadata for cookie controls. CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA, - /// Content Setting for 3PC accesses granted via 3PC deprecation trial. - CEF_CONTENT_SETTING_TYPE_TPCD_SUPPORT, - - /// Content setting used to indicate whether entering picture-in-picture - /// automatically should be enabled. - CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE, + /// Content Setting for temporary 3PC accesses granted by user behavior + /// heuristics. + CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS, /// Content Setting for 3PC accesses granted by metadata delivered via the /// component updater service. This type will only be used when /// `net::features::kTpcdMetadataGrants` is enabled. CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS, + /// Content Setting for 3PC accesses granted via 3PC deprecation trial. + CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL, + + /// Content Setting for 3PC accesses granted via top-level 3PC deprecation + /// trial. Similar to TPCD_TRIAL, but applicable at the page-level for the + /// lifetime of the page that served the token, rather than being specific to + /// a requesting-origin/top-level-site combination and persistent. + CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL, + + /// Content setting used to indicate whether entering picture-in-picture + /// automatically should be enabled. + CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE, + /// Whether user has opted into keeping file/directory permissions persistent /// between visits for a given origin. When enabled, permission metadata /// stored under |FILE_SYSTEM_ACCESS_CHOOSER_DATA| can auto-grant incoming /// permission request. CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION, - /// Content Setting for temporary 3PC accesses granted by user behavior - /// heuristics. - CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS, - /// Whether the FSA Persistent Permissions restore prompt is eligible to be /// shown to the user, for a given origin. CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION, + /// Whether an application capturing another tab, may scroll and zoom + /// the captured tab. + CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL, + + /// Content setting for access to smart card readers. + /// The "guard" content setting stores whether to allow sites to access the + /// Smart Card API. + CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD, + CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA, + + /// Content settings for access to printers for the Web Printing API. + CEF_CONTENT_SETTING_TYPE_WEB_PRINTING, + CEF_CONTENT_SETTING_TYPE_NUM_TYPES, } cef_content_setting_types_t; diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index c0a025713..53bdff9d5 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -113,12 +113,7 @@ AlloyBrowserContext::AlloyBrowserContext( const CefRequestContextSettings& settings) : CefBrowserContext(settings) {} -AlloyBrowserContext::~AlloyBrowserContext() { - if (resource_context_) { - content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE, - resource_context_.release()); - } -} +AlloyBrowserContext::~AlloyBrowserContext() = default; bool AlloyBrowserContext::IsInitialized() const { CEF_REQUIRE_UIT(); @@ -311,13 +306,6 @@ bool AlloyBrowserContext::IsPrintPreviewSupported() const { return !GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled); } -content::ResourceContext* AlloyBrowserContext::GetResourceContext() { - if (!resource_context_) { - resource_context_ = std::make_unique(); - } - return resource_context_.get(); -} - content::ClientHintsControllerDelegate* AlloyBrowserContext::GetClientHintsControllerDelegate() { return nullptr; diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index 2a9c83576..0ef94eaca 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -59,7 +59,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy, bool IsPrintPreviewSupported() const override; // content::BrowserContext overrides. - content::ResourceContext* GetResourceContext() override; content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate() override; base::FilePath GetPath() override; @@ -142,8 +141,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy, std::unique_ptr key_; std::unique_ptr download_prefs_; - - std::unique_ptr resource_context_; }; #endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_ diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index 4ea948ada..67fc21caa 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -50,8 +50,8 @@ #include "ui/native_theme/native_theme.h" #if BUILDFLAG(IS_LINUX) -#include "ui/ozone/buildflags.h" -#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11) +#include "ui/base/ozone_buildflags.h" +#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11) #include "ui/events/devices/x11/touch_factory_x11.h" #endif #endif @@ -252,7 +252,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() { void AlloyBrowserMainParts::PreCreateMainMessageLoop() { #if BUILDFLAG(IS_LINUX) -#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11) +#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11) ui::TouchFactory::SetTouchDeviceListFromCommandLine(); #endif #endif diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 0a7778d0c..d812a72c8 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -70,6 +70,7 @@ #include "chrome/browser/profiles/renderer_updater.h" #include "chrome/browser/profiles/renderer_updater_factory.h" #include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h" +#include "chrome/browser/spellchecker/spell_check_initialization_host_impl.h" #include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/browser/ui/pdf/chrome_pdf_document_helper_client.h" #include "chrome/common/chrome_content_client.h" @@ -541,7 +542,7 @@ bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) { return CefAppManager::Get()->HasCustomScheme(scheme); } -void AlloyContentBrowserClient::SiteInstanceGotProcess( +void AlloyContentBrowserClient::SiteInstanceGotProcessAndSite( content::SiteInstance* site_instance) { if (!extensions::ExtensionsEnabled()) { return; @@ -570,9 +571,10 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess( void AlloyContentBrowserClient::BindHostReceiverForRenderer( content::RenderProcessHost* render_process_host, mojo::GenericPendingReceiver receiver) { - if (auto host_receiver = receiver.As()) { - SpellCheckHostChromeImpl::Create(render_process_host->GetID(), - std::move(host_receiver)); + if (auto host_receiver = + receiver.As()) { + SpellCheckInitializationHostImpl::Create(render_process_host->GetID(), + std::move(host_receiver)); return; } @@ -1019,7 +1021,8 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles( content::BrowserContext* browser_context, const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, - int frame_tree_node_id) { + int frame_tree_node_id, + absl::optional navigation_id) { std::vector> result; // Used to substitute View ID for PDF contents when using the PDF plugin. @@ -1108,6 +1111,7 @@ std::unique_ptr AlloyContentBrowserClient::CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, + content::BrowserContext* browser_context, const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, @@ -1138,7 +1142,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, - const absl::optional& request_initiator_origin, + const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) { if (!extensions::ExtensionsEnabled()) { return; @@ -1346,6 +1350,13 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame( map->Add( base::BindRepeating(&BindNetworkHintsHandler)); + map->Add(base::BindRepeating( + [](content::RenderFrameHost* frame_host, + mojo::PendingReceiver receiver) { + SpellCheckHostChromeImpl::Create(frame_host->GetProcess()->GetID(), + std::move(receiver)); + })); + if (!extensions::ExtensionsEnabled()) { return; } diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index ccb7bc8d2..4b43f4858 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -64,7 +64,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { std::vector* additional_allowed_schemes) override; bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override; bool IsHandledURL(const GURL& url) override; - void SiteInstanceGotProcess(content::SiteInstance* site_instance) override; + void SiteInstanceGotProcessAndSite( + content::SiteInstance* site_instance) override; void BindHostReceiverForRenderer( content::RenderProcessHost* render_process_host, mojo::GenericPendingReceiver receiver) override; @@ -135,7 +136,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { content::BrowserContext* browser_context, const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, - int frame_tree_node_id) override; + int frame_tree_node_id, + absl::optional navigation_id) override; std::vector> CreateURLLoaderThrottlesForKeepAlive( const network::ResourceRequest& request, @@ -162,6 +164,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { std::unique_ptr CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, + content::BrowserContext* browser_context, const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, @@ -174,7 +177,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { void RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, int render_frame_id, - const absl::optional& request_initiator_origin, + const std::optional& request_initiator_origin, NonNetworkURLLoaderFactoryMap* factories) override; bool WillCreateURLLoaderFactory( content::BrowserContext* browser_context, diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 012d0da07..c926518aa 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -69,10 +69,10 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents( // Extension resources will fail to load if we don't use a SiteInstance // associated with the extension. - // (AlloyContentBrowserClient::SiteInstanceGotProcess won't find the - // extension to register with InfoMap, and AllowExtensionResourceLoad in - // ExtensionProtocolHandler::MaybeCreateJob will return false resulting in - // ERR_BLOCKED_BY_CLIENT). + // (AlloyContentBrowserClient::SiteInstanceGotProcessAndSite won't find + // the extension to register with InfoMap, and AllowExtensionResourceLoad + // in ExtensionProtocolHandler::MaybeCreateJob will return false resulting + // in ERR_BLOCKED_BY_CLIENT). site_instance = extensions::ProcessManager::Get(browser_context) ->GetSiteInstanceForURL(gurl); DCHECK(site_instance); diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index f40cb2375..d28e73ff6 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -19,6 +19,7 @@ #include "base/command_line.h" #include "base/path_service.h" +#include "chrome/browser/browser_features.h" #include "chrome/browser/component_updater/chrome_component_updater_configurator.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/permissions/chrome_permissions_client.h" @@ -31,6 +32,7 @@ #include "components/component_updater/component_updater_service.h" #include "components/component_updater/timer_update_scheduler.h" #include "components/net_log/chrome_net_log.h" +#include "components/os_crypt/async/browser/os_crypt_async.h" #include "components/prefs/pref_service.h" #include "content/browser/startup_helper.h" #include "content/public/browser/network_service_instance.h" @@ -39,6 +41,10 @@ #include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/shared_url_loader_factory.h" +#if BUILDFLAG(IS_WIN) +#include "components/os_crypt/async/browser/dpapi_key_provider.h" +#endif + ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy() : locale_("en-US") {} ChromeBrowserProcessAlloy::~ChromeBrowserProcessAlloy() { @@ -81,6 +87,30 @@ void ChromeBrowserProcessAlloy::OnContextInitialized() { DCHECK(!context_initialized_); DCHECK(!shutdown_); + // OSCryptAsync provider configuration. If empty, this delegates all + // encryption operations to OSCrypt. + std::vector>> + providers; + +#if BUILDFLAG(IS_WIN) + // TODO(crbug.com/1373092): For Windows, continue to add providers behind + // features, as support for them is added. + if (base::FeatureList::IsEnabled(features::kEnableDPAPIEncryptionProvider)) { + // The DPAPI key provider requires OSCrypt::Init to have already been called + // to initialize the key storage. This happens in + // AlloyBrowserMainParts::PreCreateMainMessageLoop. + providers.emplace_back(std::make_pair( + /*precedence=*/10u, + std::make_unique(local_state()))); + } +#endif // BUILDFLAG(IS_WIN) + + os_crypt_async_ = + std::make_unique(std::move(providers)); + + // Trigger async initialization of OSCrypt key providers. + std::ignore = os_crypt_async_->GetInstance(base::DoNothing()); + // Must be created after the NotificationService. print_job_manager_ = std::make_unique(); profile_manager_ = std::make_unique(); @@ -270,9 +300,9 @@ printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() { printing::PrintPreviewDialogController* ChromeBrowserProcessAlloy::print_preview_dialog_controller() { - if (!print_preview_dialog_controller_.get()) { + if (!print_preview_dialog_controller_) { print_preview_dialog_controller_ = - new printing::PrintPreviewDialogController(); + std::make_unique(); } return print_preview_dialog_controller_.get(); } @@ -405,8 +435,8 @@ ChromeBrowserProcessAlloy::resource_coordinator_parts() { } os_crypt_async::OSCryptAsync* ChromeBrowserProcessAlloy::os_crypt_async() { - DCHECK(false); - return nullptr; + DCHECK(os_crypt_async_); + return os_crypt_async_.get(); } BuildState* ChromeBrowserProcessAlloy::GetBuildState() { diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index e442bb045..4da76d33f 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -125,7 +125,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { std::unique_ptr print_job_manager_; std::unique_ptr profile_manager_; scoped_refptr event_router_forwarder_; - scoped_refptr + std::unique_ptr print_preview_dialog_controller_; std::unique_ptr background_printing_manager_; @@ -137,6 +137,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { std::unique_ptr field_trial_list_; std::unique_ptr component_updater_; + + std::unique_ptr os_crypt_async_; }; #endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_ diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index adaaa405f..5a629c92c 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -114,7 +114,9 @@ content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab( if (auto c = client()) { if (auto handler = c->GetRequestHandler()) { // May return nullptr for omnibox navigations. - auto frame = browser()->GetFrame(params.frame_tree_node_id); + auto frame = browser_info_->browser()->GetFrameForHost( + content::RenderFrameHost::FromID(params.source_render_process_id, + params.source_render_frame_id)); if (!frame) { frame = browser()->GetMainFrame(); } @@ -324,11 +326,9 @@ void CefBrowserContentsDelegate::RenderFrameHostStateChanged( void CefBrowserContentsDelegate::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { - const auto frame_id = - frame_util::MakeFrameId(render_frame_host->GetGlobalId()); browser_info_->RemoveFrame(render_frame_host); - if (focused_frame_ && focused_frame_->GetIdentifier() == frame_id) { + if (focused_frame_ && focused_frame_->IsSameFrame(render_frame_host)) { focused_frame_ = nullptr; OnStateChanged(State::kFocusedFrame); } diff --git a/libcef/browser/browser_host_base.cc b/libcef/browser/browser_host_base.cc index 7bb40109b..308a2ecdb 100644 --- a/libcef/browser/browser_host_base.cc +++ b/libcef/browser/browser_host_base.cc @@ -148,6 +148,39 @@ CefRefPtr CefBrowserHostBase::GetBrowserForGlobalId( } } +// static +CefRefPtr CefBrowserHostBase::GetBrowserForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token) { + if (!frame_util::IsValidGlobalToken(global_token)) { + return nullptr; + } + + if (CEF_CURRENTLY_ON_UIT()) { + // Use the non-thread-safe but potentially faster approach. + content::RenderFrameHost* render_frame_host = + content::RenderFrameHost::FromFrameToken(global_token); + if (!render_frame_host) { + return nullptr; + } + return GetBrowserForHost(render_frame_host); + } else { + // Use the thread-safe approach. + bool is_guest_view = false; + auto info = CefBrowserInfoManager::GetInstance()->GetBrowserInfo( + global_token, &is_guest_view); + if (info && !is_guest_view) { + auto browser = info->browser(); + if (!browser) { + LOG(WARNING) << "Found browser id " << info->browser_id() + << " but no browser object matching frame " + << frame_util::GetFrameDebugString(global_token); + } + return browser; + } + return nullptr; + } +} + // static CefRefPtr CefBrowserHostBase::GetBrowserForTopLevelNativeWindow( @@ -905,32 +938,32 @@ bool CefBrowserHostBase::IsPopup() { } CefRefPtr CefBrowserHostBase::GetMainFrame() { - return GetFrame(CefFrameHostImpl::kMainFrameId); + return browser_info_->GetMainFrame(); } CefRefPtr CefBrowserHostBase::GetFocusedFrame() { - return GetFrame(CefFrameHostImpl::kFocusedFrameId); -} - -CefRefPtr CefBrowserHostBase::GetFrame(int64_t identifier) { - if (identifier == CefFrameHostImpl::kInvalidFrameId) { - return nullptr; - } else if (identifier == CefFrameHostImpl::kMainFrameId) { - return browser_info_->GetMainFrame(); - } else if (identifier == CefFrameHostImpl::kFocusedFrameId) { + { base::AutoLock lock_scope(state_lock_); - if (!focused_frame_) { - // The main frame is focused by default. - return browser_info_->GetMainFrame(); + if (focused_frame_) { + return focused_frame_; } - return focused_frame_; } - return browser_info_->GetFrameForGlobalId( - frame_util::MakeGlobalId(identifier)); + // The main frame is focused by default. + return browser_info_->GetMainFrame(); } -CefRefPtr CefBrowserHostBase::GetFrame(const CefString& name) { +CefRefPtr CefBrowserHostBase::GetFrameByIdentifier( + const CefString& identifier) { + const auto& global_token = frame_util::ParseFrameIdentifier(identifier); + if (!global_token) { + return nullptr; + } + + return browser_info_->GetFrameForGlobalToken(*global_token); +} + +CefRefPtr CefBrowserHostBase::GetFrameByName(const CefString& name) { for (const auto& frame : browser_info_->GetAllFrames()) { if (frame->GetName() == name) { return frame; @@ -944,7 +977,7 @@ size_t CefBrowserHostBase::GetFrameCount() { } void CefBrowserHostBase::GetFrameIdentifiers( - std::vector& identifiers) { + std::vector& identifiers) { if (identifiers.size() > 0) { identifiers.clear(); } @@ -1018,6 +1051,11 @@ CefRefPtr CefBrowserHostBase::GetFrameForGlobalId( return browser_info_->GetFrameForGlobalId(global_id, nullptr); } +CefRefPtr CefBrowserHostBase::GetFrameForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token) { + return browser_info_->GetFrameForGlobalToken(global_token, nullptr); +} + void CefBrowserHostBase::AddObserver(Observer* observer) { CEF_REQUIRE_UIT(); observers_.AddObserver(observer); diff --git a/libcef/browser/browser_host_base.h b/libcef/browser/browser_host_base.h index 9ec11dfb4..d6b1993cd 100644 --- a/libcef/browser/browser_host_base.h +++ b/libcef/browser/browser_host_base.h @@ -147,6 +147,9 @@ class CefBrowserHostBase : public CefBrowserHost, // Returns the browser associated with the specified global ID. static CefRefPtr GetBrowserForGlobalId( const content::GlobalRenderFrameHostId& global_id); + // Returns the browser associated with the specified global token. + static CefRefPtr GetBrowserForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token); // Returns the browser associated with the specified top-level window. static CefRefPtr GetBrowserForTopLevelNativeWindow( gfx::NativeWindow owning_window); @@ -253,10 +256,11 @@ class CefBrowserHostBase : public CefBrowserHost, bool IsPopup() override; CefRefPtr GetMainFrame() override; CefRefPtr GetFocusedFrame() override; - CefRefPtr GetFrame(int64_t identifier) override; - CefRefPtr GetFrame(const CefString& name) override; + CefRefPtr GetFrameByIdentifier( + const CefString& identifier) override; + CefRefPtr GetFrameByName(const CefString& name) override; size_t GetFrameCount() override; - void GetFrameIdentifiers(std::vector& identifiers) override; + void GetFrameIdentifiers(std::vector& identifiers) override; void GetFrameNames(std::vector& names) override; // CefBrowserContentsDelegate::Observer methods: @@ -266,11 +270,13 @@ class CefBrowserHostBase : public CefBrowserHost, // Returns the frame associated with the specified RenderFrameHost. CefRefPtr GetFrameForHost(const content::RenderFrameHost* host); - // Returns the frame associated with the specified global ID. See - // documentation on RenderFrameHost::GetFrameTreeNodeId() for why the global - // ID is preferred. + // Returns the frame associated with the specified global ID/token. See + // documentation on RenderFrameHost::GetFrameTreeNodeId/Token() for why the + // global ID/token is preferred. CefRefPtr GetFrameForGlobalId( const content::GlobalRenderFrameHostId& global_id); + CefRefPtr GetFrameForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token); // Manage observer objects. The observer must either outlive this object or // be removed before destruction. Must be called on the UI thread. diff --git a/libcef/browser/browser_info.cc b/libcef/browser/browser_info.cc index d0d65097f..412b9ca45 100644 --- a/libcef/browser/browser_info.cc +++ b/libcef/browser/browser_info.cc @@ -21,7 +21,7 @@ CefBrowserInfo::FrameInfo::~FrameInfo() { #if DCHECK_IS_ON() if (frame_ && !IsCurrentMainFrame()) { // Should already be Detached. - DCHECK(!frame_->GetRenderFrameHost()); + DCHECK(frame_->IsDetached()); } #endif } @@ -154,8 +154,7 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host, #if DCHECK_IS_ON() // Check that the frame info hasn't changed unexpectedly. - DCHECK_EQ(frame_util::MakeFrameId(global_id), - frame_info->frame_->GetIdentifier()); + DCHECK(host->GetGlobalFrameToken() == *frame_info->frame_->frame_token()); DCHECK_EQ(frame_info->is_main_frame_, frame_info->frame_->IsMain()); #endif } @@ -165,6 +164,8 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host, // Populate the lookup maps. frame_id_map_.insert(std::make_pair(global_id, frame_info)); + frame_token_to_id_map_.insert( + std::make_pair(host->GetGlobalFrameToken(), global_id)); // And finally set the ownership. frame_info_set_.insert(base::WrapUnique(frame_info)); @@ -232,6 +233,12 @@ void CefBrowserInfo::RemoveFrame(content::RenderFrameHost* host) { // Remove from the lookup maps. frame_id_map_.erase(it); + { + auto it2 = frame_token_to_id_map_.find(host->GetGlobalFrameToken()); + DCHECK(it2 != frame_token_to_id_map_.end()); + frame_token_to_id_map_.erase(it2); + } + // And finally delete the frame info. { auto it2 = frame_info_set_.find(frame_info); @@ -267,7 +274,7 @@ CefRefPtr CefBrowserInfo::CreateTempSubFrame( parent = GetMainFrame(); } // Intentionally not notifying for temporary frames. - return new CefFrameHostImpl(this, parent->GetIdentifier()); + return new CefFrameHostImpl(this, parent->frame_token()); } CefRefPtr CefBrowserInfo::GetFrameForHost( @@ -329,6 +336,28 @@ CefRefPtr CefBrowserInfo::GetFrameForGlobalId( return nullptr; } +CefRefPtr CefBrowserInfo::GetFrameForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view, + bool prefer_speculative) const { + if (!frame_util::IsValidGlobalToken(global_token)) { + return nullptr; + } + + content::GlobalRenderFrameHostId global_id; + + { + base::AutoLock lock_scope(lock_); + const auto it = frame_token_to_id_map_.find(global_token); + if (it == frame_token_to_id_map_.end()) { + return nullptr; + } + global_id = it->second; + } + + return GetFrameForGlobalId(global_id, is_guest_view, prefer_speculative); +} + CefBrowserInfo::FrameHostList CefBrowserInfo::GetAllFrames() const { base::AutoLock lock_scope(lock_); FrameHostList frames; @@ -510,6 +539,7 @@ void CefBrowserInfo::RemoveAllFrames( // Clear the lookup maps. frame_id_map_.clear(); + frame_token_to_id_map_.clear(); // Explicitly Detach everything but the current main frame. for (auto& info : frame_info_set_) { diff --git a/libcef/browser/browser_info.h b/libcef/browser/browser_info.h index f94c41e3d..fed015d6f 100644 --- a/libcef/browser/browser_info.h +++ b/libcef/browser/browser_info.h @@ -109,15 +109,19 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { bool* is_guest_view = nullptr, bool prefer_speculative = false) const; - // Returns the frame object matching the specified ID or nullptr if no match - // is found. Nullptr will also be returned if a guest view match is found - // because we don't create frame objects for guest views. If |is_guest_view| - // is non-nullptr it will be set to true in this case. Safe to call from any - // thread. + // Returns the frame object matching the specified ID/token or nullptr if no + // match is found. Nullptr will also be returned if a guest view match is + // found because we don't create frame objects for guest views. If + // |is_guest_view| is non-nullptr it will be set to true in this case. Safe to + // call from any thread. CefRefPtr GetFrameForGlobalId( const content::GlobalRenderFrameHostId& global_id, bool* is_guest_view = nullptr, bool prefer_speculative = false) const; + CefRefPtr GetFrameForGlobalToken( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view = nullptr, + bool prefer_speculative = false) const; // Returns all non-speculative frame objects that currently exist. Guest views // will be excluded because they don't have a frame object. Safe to call from @@ -248,6 +252,11 @@ class CefBrowserInfo : public base::RefCountedThreadSafe { content::GlobalRenderFrameHostIdHasher>; FrameIDMap frame_id_map_; + // Map of global token to global ID. + using FrameTokenToIdMap = std::map; + FrameTokenToIdMap frame_token_to_id_map_; + // The current main frame. CefRefPtr main_frame_; diff --git a/libcef/browser/browser_info_manager.cc b/libcef/browser/browser_info_manager.cc index 39feaaf72..fbf546305 100644 --- a/libcef/browser/browser_info_manager.cc +++ b/libcef/browser/browser_info_manager.cc @@ -89,7 +89,8 @@ scoped_refptr CefBrowserInfoManager::CreatePopupBrowserInfo( browser_info_list_.push_back(browser_info); // Continue any pending NewBrowserInfo request. - auto it = pending_new_browser_info_map_.find(frame_host->GetGlobalId()); + auto it = + pending_new_browser_info_map_.find(frame_host->GetGlobalFrameToken()); if (it != pending_new_browser_info_map_.end()) { SendNewBrowserInfoResponse(browser_info, /*is_guest_view=*/false, std::move(it->second->callback), @@ -289,9 +290,9 @@ bool CefBrowserInfoManager::AddWebContents(content::WebContents* new_contents) { } void CefBrowserInfoManager::OnGetNewBrowserInfo( - const content::GlobalRenderFrameHostId& global_id, + const content::GlobalRenderFrameHostToken& global_token, cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) { - DCHECK(frame_util::IsValidGlobalId(global_id)); + DCHECK(frame_util::IsValidGlobalToken(global_token)); DCHECK(callback); auto callback_runner = base::SequencedTaskRunner::GetCurrentDefault(); @@ -301,7 +302,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo( bool is_guest_view = false; scoped_refptr browser_info = - GetBrowserInfoInternal(global_id, &is_guest_view); + GetBrowserInfoInternal(global_token, &is_guest_view); if (browser_info) { // Send the response immediately. @@ -311,19 +312,19 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo( } // Verify that no request for the same route is currently queued. - DCHECK(pending_new_browser_info_map_.find(global_id) == + DCHECK(pending_new_browser_info_map_.find(global_token) == pending_new_browser_info_map_.end()); const int timeout_id = ++next_timeout_id_; // Queue the request. std::unique_ptr pending(new PendingNewBrowserInfo()); - pending->global_id = global_id; + pending->global_token = global_token; pending->timeout_id = timeout_id; pending->callback = std::move(callback); pending->callback_runner = callback_runner; pending_new_browser_info_map_.insert( - std::make_pair(global_id, std::move(pending))); + std::make_pair(global_token, std::move(pending))); // Register a timeout for the pending response so that the renderer process // doesn't hang forever. With the Chrome runtime, timeouts may occur in cases @@ -334,7 +335,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo( CEF_POST_DELAYED_TASK( CEF_UIT, base::BindOnce(&CefBrowserInfoManager::TimeoutNewBrowserInfoResponse, - global_id, timeout_id), + global_token, timeout_id), kNewBrowserInfoResponseTimeoutMs); } } @@ -391,6 +392,13 @@ scoped_refptr CefBrowserInfoManager::GetBrowserInfo( return GetBrowserInfoInternal(global_id, is_guest_view); } +scoped_refptr CefBrowserInfoManager::GetBrowserInfo( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view) { + base::AutoLock lock_scope(browser_info_lock_); + return GetBrowserInfoInternal(global_token, is_guest_view); +} + bool CefBrowserInfoManager::MaybeAllowNavigation( content::RenderFrameHost* opener, const content::OpenURLParams& params, @@ -451,7 +459,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed( pending_new_browser_info_map_.begin(); while (it != pending_new_browser_info_map_.end()) { const auto& info = it->second; - if (info->global_id.child_id == render_process_id) { + if (info->global_token.child_id == render_process_id) { CancelNewBrowserInfoResponse(info.get()); it = pending_new_browser_info_map_.erase(it); } else { @@ -553,6 +561,34 @@ scoped_refptr CefBrowserInfoManager::GetBrowserInfoInternal( return nullptr; } +scoped_refptr CefBrowserInfoManager::GetBrowserInfoInternal( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view) { + browser_info_lock_.AssertAcquired(); + + if (is_guest_view) { + *is_guest_view = false; + } + + if (!frame_util::IsValidGlobalToken(global_token)) { + return nullptr; + } + + for (const auto& browser_info : browser_info_list_) { + bool is_guest_view_tmp; + auto frame = + browser_info->GetFrameForGlobalToken(global_token, &is_guest_view_tmp); + if (frame || is_guest_view_tmp) { + if (is_guest_view) { + *is_guest_view = is_guest_view_tmp; + } + return browser_info; + } + } + + return nullptr; +} + // static void CefBrowserInfoManager::SendNewBrowserInfoResponse( scoped_refptr browser_info, @@ -601,7 +637,7 @@ void CefBrowserInfoManager::CancelNewBrowserInfoResponse( // static void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse( - const content::GlobalRenderFrameHostId& global_id, + const content::GlobalRenderFrameHostToken& global_token, int timeout_id) { CEF_REQUIRE_UIT(); if (!g_info_manager) { @@ -611,7 +647,7 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse( base::AutoLock lock_scope(g_info_manager->browser_info_lock_); // Continue the NewBrowserInfo request if it's still pending. - auto it = g_info_manager->pending_new_browser_info_map_.find(global_id); + auto it = g_info_manager->pending_new_browser_info_map_.find(global_token); if (it != g_info_manager->pending_new_browser_info_map_.end()) { const auto& pending_info = it->second; // Don't accidentally timeout a new request for the same frame. @@ -622,12 +658,12 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse( #if DCHECK_IS_ON() // This method should never be called for a PDF renderer. content::RenderProcessHost* process = - content::RenderProcessHost::FromID(global_id.child_id); + content::RenderProcessHost::FromID(global_token.child_id); DCHECK(!process || !process->IsPdf()); #endif LOG(ERROR) << "Timeout of new browser info response for frame " - << frame_util::GetFrameDebugString(global_id); + << frame_util::GetFrameDebugString(global_token); CancelNewBrowserInfoResponse(pending_info.get()); g_info_manager->pending_new_browser_info_map_.erase(it); diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index 1ccc4def3..c362ad5fc 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -112,7 +112,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // already exist for traditional popup browsers depending on timing. See // comments on PendingPopup for more information. void OnGetNewBrowserInfo( - const content::GlobalRenderFrameHostId& global_id, + const content::GlobalRenderFrameHostToken& global_token, cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback); // Called from CefBrowserHostBase::DestroyBrowser() when a browser is @@ -122,15 +122,18 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // Called from CefContext::FinishShutdownOnUIThread() to destroy all browsers. void DestroyAllBrowsers(); - // Returns the CefBrowserInfo matching the specified ID or nullptr if no + // Returns the CefBrowserInfo matching the specified ID/token or nullptr if no // match is found. It is allowed to add new callers of this method but - // consider using CefBrowserHostBase::GetBrowserForGlobalId() or + // consider using CefBrowserHostBase::GetBrowserForGlobalId/Token() or // extensions::GetOwnerBrowserForGlobalId() instead. If |is_guest_view| is - // non-nullptr it will be set to true if the ID matches a guest view + // non-nullptr it will be set to true if the ID/token matches a guest view // associated with the returned browser info instead of the browser itself. scoped_refptr GetBrowserInfo( const content::GlobalRenderFrameHostId& global_id, bool* is_guest_view = nullptr); + scoped_refptr GetBrowserInfo( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view = nullptr); // Returns all existing CefBrowserInfo objects. using BrowserInfoList = std::list>; @@ -213,10 +216,13 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { PendingPopup::Step previous_step, content::WebContents* new_contents); - // Retrieves the BrowserInfo matching the specified ID. + // Retrieves the BrowserInfo matching the specified ID/token. scoped_refptr GetBrowserInfoInternal( const content::GlobalRenderFrameHostId& global_id, bool* is_guest_view); + scoped_refptr GetBrowserInfoInternal( + const content::GlobalRenderFrameHostToken& global_token, + bool* is_guest_view); // Send the response for a pending OnGetNewBrowserInfo request. static void SendNewBrowserInfoResponse( @@ -227,7 +233,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // Pending request for OnGetNewBrowserInfo. struct PendingNewBrowserInfo { - content::GlobalRenderFrameHostId global_id; + content::GlobalRenderFrameHostToken global_token; int timeout_id; cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback; scoped_refptr callback_runner; @@ -238,7 +244,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // Time out a response if it's still pending. static void TimeoutNewBrowserInfoResponse( - const content::GlobalRenderFrameHostId& global_id, + const content::GlobalRenderFrameHostToken& global_token, int timeout_id); mutable base::Lock browser_info_lock_; @@ -252,7 +258,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver { // identify a RFH for its complete lifespan. See documentation on // RenderFrameHost::GetFrameTreeNodeId() for background. using PendingNewBrowserInfoMap = - std::map>; PendingNewBrowserInfoMap pending_new_browser_info_map_; diff --git a/libcef/browser/browser_manager.cc b/libcef/browser/browser_manager.cc index 8022e26b6..76afc4ea6 100644 --- a/libcef/browser/browser_manager.cc +++ b/libcef/browser/browser_manager.cc @@ -50,9 +50,10 @@ void CefBrowserManager::GetNewRenderThreadInfo( } void CefBrowserManager::GetNewBrowserInfo( - int32_t render_frame_routing_id, + const blink::LocalFrameToken& render_frame_token, cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) { CefBrowserInfoManager::GetInstance()->OnGetNewBrowserInfo( - frame_util::MakeGlobalId(render_process_id_, render_frame_routing_id), + content::GlobalRenderFrameHostToken(render_process_id_, + render_frame_token), std::move(callback)); } diff --git a/libcef/browser/browser_manager.h b/libcef/browser/browser_manager.h index 3087050ed..cce63c3ca 100644 --- a/libcef/browser/browser_manager.h +++ b/libcef/browser/browser_manager.h @@ -46,7 +46,7 @@ class CefBrowserManager : public cef::mojom::BrowserManager { cef::mojom::BrowserManager::GetNewRenderThreadInfoCallback callback) override; void GetNewBrowserInfo( - int32_t render_frame_routing_id, + const blink::LocalFrameToken& render_frame_token, cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) override; // The process ID of the renderer. diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index 3567b9ec8..107a5ad8a 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -54,7 +54,7 @@ void HandleExternalProtocolHelper( bool is_in_fenced_frame_tree, network::mojom::WebSandboxFlags sandbox_flags, const network::ResourceRequest& resource_request, - const absl::optional& initiating_origin, + const std::optional& initiating_origin, content::WeakDocumentPtr initiator_document) { // May return nullptr if frame has been deleted or a cross-document navigation // has committed in the same RenderFrameHost. @@ -232,7 +232,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory( int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - absl::optional navigation_id, + std::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -325,7 +325,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( network::mojom::WebSandboxFlags sandbox_flags, ui::PageTransition page_transition, bool has_user_gesture, - const absl::optional& initiating_origin, + const std::optional& initiating_origin, content::RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory) { // |out_factory| will be non-nullptr when this method is initially called @@ -353,7 +353,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol( bool is_in_fenced_frame_tree, network::mojom::WebSandboxFlags sandbox_flags, const network::ResourceRequest& resource_request, - const absl::optional& initiating_origin, + const std::optional& initiating_origin, content::RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory) { mojo::PendingReceiver receiver = @@ -418,6 +418,7 @@ std::unique_ptr ChromeContentBrowserClientCef::CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, + content::BrowserContext* browser_context, const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, @@ -434,8 +435,9 @@ ChromeContentBrowserClientCef::CreateLoginDelegate( } return ChromeContentBrowserClient::CreateLoginDelegate( - auth_info, web_contents, request_id, is_request_for_main_frame, url, - response_headers, first_auth_attempt, std::move(auth_required_callback)); + auth_info, web_contents, browser_context, request_id, + is_request_for_main_frame, url, response_headers, first_auth_attempt, + std::move(auth_required_callback)); } void ChromeContentBrowserClientCef::BrowserURLHandlerCreated( diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index 4b3bdd101..91d7575cc 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -61,7 +61,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { int render_process_id, URLLoaderFactoryType type, const url::Origin& request_initiator, - absl::optional navigation_id, + std::optional navigation_id, ukm::SourceIdObj ukm_source_id, mojo::PendingReceiver* factory_receiver, mojo::PendingRemote* @@ -81,7 +81,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { network::mojom::WebSandboxFlags sandbox_flags, ui::PageTransition page_transition, bool has_user_gesture, - const absl::optional& initiating_origin, + const std::optional& initiating_origin, content::RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory) override; @@ -93,7 +93,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { bool is_in_fenced_frame_tree, network::mojom::WebSandboxFlags sandbox_flags, const network::ResourceRequest& request, - const absl::optional& initiating_origin, + const std::optional& initiating_origin, content::RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory) override; @@ -110,6 +110,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { std::unique_ptr CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, + content::BrowserContext* browser_context, const content::GlobalRequestID& request_id, bool is_request_for_main_frame, const GURL& url, diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 236067b64..b5208e3d9 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -41,13 +41,21 @@ CefRefPtr GetDownloadHandler( return nullptr; } +void RunDownloadTargetCallback(download::DownloadTargetCallback callback, + const base::FilePath& path) { + download::DownloadTargetInfo target_info; + target_info.target_path = path; + target_info.intermediate_path = path; + std::move(callback).Run(std::move(target_info)); +} + // CefBeforeDownloadCallback implementation. class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { public: CefBeforeDownloadCallbackImpl(const base::WeakPtr& manager, uint32_t download_id, const base::FilePath& suggested_name, - content::DownloadTargetCallback callback) + download::DownloadTargetCallback callback) : manager_(manager), download_id_(download_id), suggested_name_(suggested_name), @@ -85,7 +93,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { const base::FilePath& suggested_name, const base::FilePath& download_path, bool show_dialog, - content::DownloadTargetCallback callback) { + download::DownloadTargetCallback callback) { CEF_REQUIRE_BLOCKING(); base::FilePath suggested_path = download_path; @@ -120,7 +128,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { uint32_t download_id, const base::FilePath& suggested_path, bool show_dialog, - content::DownloadTargetCallback callback) { + download::DownloadTargetCallback callback) { if (!manager) { return; } @@ -159,17 +167,12 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } if (!handled) { - std::move(callback).Run( - suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - download::DownloadItem::InsecureDownloadStatus::UNKNOWN, - suggested_path, base::FilePath(), std::string() /*mime_type*/, - download::DOWNLOAD_INTERRUPT_REASON_NONE); + RunDownloadTargetCallback(std::move(callback), suggested_path); } } static void ChooseDownloadPathCallback( - content::DownloadTargetCallback callback, + download::DownloadTargetCallback callback, const std::vector& file_paths) { DCHECK_LE(file_paths.size(), (size_t)1); @@ -179,18 +182,13 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { } // The download will be cancelled if |path| is empty. - std::move(callback).Run( - path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - download::DownloadItem::InsecureDownloadStatus::UNKNOWN, path, - base::FilePath(), std::string() /*mime_type*/, - download::DOWNLOAD_INTERRUPT_REASON_NONE); + RunDownloadTargetCallback(std::move(callback), path); } base::WeakPtr manager_; uint32_t download_id_; base::FilePath suggested_name_; - content::DownloadTargetCallback callback_; + download::DownloadTargetCallback callback_; IMPLEMENT_REFCOUNTING(CefBeforeDownloadCallbackImpl); }; @@ -375,14 +373,10 @@ void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) { bool CefDownloadManagerDelegate::DetermineDownloadTarget( DownloadItem* item, - content::DownloadTargetCallback* callback) { - if (!item->GetForcedFilePath().empty()) { - std::move(*callback).Run( - item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, - download::DownloadItem::InsecureDownloadStatus::UNKNOWN, - item->GetForcedFilePath(), base::FilePath(), - std::string() /*mime_type*/, download::DOWNLOAD_INTERRUPT_REASON_NONE); + download::DownloadTargetCallback* callback) { + const auto& forced_path = item->GetForcedFilePath(); + if (!forced_path.empty()) { + RunDownloadTargetCallback(std::move(*callback), forced_path); return true; } diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 46c13bf80..2886f2ac7 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -12,6 +12,7 @@ #include "base/memory/weak_ptr.h" #include "components/download/public/common/download_item.h" +#include "components/download/public/common/download_target_info.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/download_manager_delegate.h" @@ -43,7 +44,7 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer, // DownloadManagerDelegate methods. bool DetermineDownloadTarget( download::DownloadItem* item, - content::DownloadTargetCallback* callback) override; + download::DownloadTargetCallback* callback) override; void GetNextId(content::DownloadIdCallback callback) override; std::string ApplicationClientIdForFileScanning() override; diff --git a/libcef/browser/extensions/extension_function_details.cc b/libcef/browser/extensions/extension_function_details.cc index 0d514e8af..58873373d 100644 --- a/libcef/browser/extensions/extension_function_details.cc +++ b/libcef/browser/extensions/extension_function_details.cc @@ -409,8 +409,7 @@ std::unique_ptr CefExtensionFunctionDetails::OpenTab( auto web_contents = new_browser->web_contents(); auto result = CreateTabObject(new_browser, opener_browser_id, active, index); auto scrub_tab_behavior = ExtensionTabUtil::GetScrubTabBehavior( - extension, extensions::Feature::Context::UNSPECIFIED_CONTEXT, - web_contents); + extension, extensions::mojom::ContextType::kUnspecified, web_contents); ExtensionTabUtil::ScrubTabForExtension(extension, web_contents, &result, scrub_tab_behavior); return base::WrapUnique(new api::tabs::Tab(std::move(result))); diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index 1f89c87d8..1f01acc06 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -246,6 +246,13 @@ ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate() return nullptr; } +mojo::PendingRemote +CefExtensionsBrowserClient::GetControlledFrameEmbedderURLLoader( + int frame_tree_node_id, + content::BrowserContext* browser_context) { + return mojo::PendingRemote(); +} + std::unique_ptr CefExtensionsBrowserClient::CreateExtensionHostDelegate() { // CEF does not use the ExtensionHost constructor that calls this method. diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index 0168c60c6..f527d0e50 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -83,6 +83,10 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context, std::vector* observers) const override; ProcessManagerDelegate* GetProcessManagerDelegate() const override; + mojo::PendingRemote + GetControlledFrameEmbedderURLLoader( + int frame_tree_node_id, + content::BrowserContext* browser_context) override; std::unique_ptr CreateExtensionHostDelegate() override; bool CreateBackgroundExtensionHost(const Extension* extension, content::BrowserContext* browser_context, diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index deae4f787..cf7756114 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -17,6 +17,7 @@ #include "content/public/browser/file_select_listener.h" #include "content/public/browser/render_frame_host.h" #include "ui/shell_dialogs/select_file_policy.h" +#include "ui/shell_dialogs/selected_file_info.h" using blink::mojom::FileChooserParams; @@ -224,25 +225,16 @@ class CefSelectFileDialogListener : public ui::SelectFileDialog::Listener { private: ~CefSelectFileDialogListener() override = default; - void FileSelected(const base::FilePath& path, + void FileSelected(const ui::SelectedFileInfo& file, int index, void* params) override { DCHECK_EQ(params, params_); executing_ = true; - listener_->FileSelected(path, index, params); + listener_->FileSelected(file, index, params); Destroy(); } - void FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file, - int index, - void* params) override { - DCHECK_EQ(params, params_); - executing_ = true; - listener_->FileSelectedWithExtraInfo(file, index, params); - Destroy(); - } - - void MultiFilesSelected(const std::vector& files, + void MultiFilesSelected(const std::vector& files, void* params) override { DCHECK_EQ(params, params_); executing_ = true; @@ -250,15 +242,6 @@ class CefSelectFileDialogListener : public ui::SelectFileDialog::Listener { Destroy(); } - void MultiFilesSelectedWithExtraInfo( - const std::vector& files, - void* params) override { - DCHECK_EQ(params, params_); - executing_ = true; - listener_->MultiFilesSelectedWithExtraInfo(files, params); - Destroy(); - } - void FileSelectionCanceled(void* params) override { DCHECK_EQ(params, params_); executing_ = true; @@ -535,9 +518,10 @@ void CefFileDialogManager::SelectFileDoneByDelegateCallback( if (paths.empty()) { listener->FileSelectionCanceled(params); } else if (paths.size() == 1) { - listener->FileSelected(paths[0], /*index=*/0, params); + listener->FileSelected(ui::SelectedFileInfo(paths[0]), /*index=*/0, params); } else { - listener->MultiFilesSelected(paths, params); + listener->MultiFilesSelected(ui::FilePathListToSelectedFileInfoList(paths), + params); } // |listener| is likely deleted at this point. } diff --git a/libcef/browser/frame_host_impl.cc b/libcef/browser/frame_host_impl.cc index 2401c2f8b..293c3d9b9 100644 --- a/libcef/browser/frame_host_impl.cc +++ b/libcef/browser/frame_host_impl.cc @@ -75,35 +75,31 @@ void ExecWebContentsCommand(CefFrameHostImpl* fh, } // namespace -CefFrameHostImpl::CefFrameHostImpl(scoped_refptr browser_info, - int64_t parent_frame_id) +CefFrameHostImpl::CefFrameHostImpl( + scoped_refptr browser_info, + std::optional parent_frame_token) : is_main_frame_(false), - frame_id_(kInvalidFrameId), browser_info_(browser_info), is_focused_(is_main_frame_), // The main frame always starts focused. - parent_frame_id_(parent_frame_id) { + parent_frame_token_(std::move(parent_frame_token)) { #if DCHECK_IS_ON() DCHECK(browser_info_); - if (is_main_frame_) { - DCHECK_EQ(parent_frame_id_, kInvalidFrameId); - } else { - DCHECK_GT(parent_frame_id_, 0); - } + DCHECK_EQ(is_main_frame_, !parent_frame_token_.has_value()); #endif } CefFrameHostImpl::CefFrameHostImpl(scoped_refptr browser_info, content::RenderFrameHost* render_frame_host) : is_main_frame_(render_frame_host->GetParent() == nullptr), - frame_id_(frame_util::MakeFrameId(render_frame_host->GetGlobalId())), + frame_token_(render_frame_host->GetGlobalFrameToken()), browser_info_(browser_info), is_focused_(is_main_frame_), // The main frame always starts focused. url_(render_frame_host->GetLastCommittedURL().spec()), name_(render_frame_host->GetFrameName()), - parent_frame_id_( - is_main_frame_ ? kInvalidFrameId - : frame_util::MakeFrameId( - render_frame_host->GetParent()->GetGlobalId())), + parent_frame_token_( + is_main_frame_ + ? std::optional() + : render_frame_host->GetParent()->GetGlobalFrameToken()), render_frame_host_(render_frame_host) { DCHECK(browser_info_); } @@ -193,25 +189,30 @@ CefString CefFrameHostImpl::GetName() { return name_; } -int64_t CefFrameHostImpl::GetIdentifier() { - base::AutoLock lock_scope(state_lock_); - return frame_id_; +CefString CefFrameHostImpl::GetIdentifier() { + if (!frame_token_) { + return CefString(); + } + return frame_util::MakeFrameIdentifier(*frame_token_); } CefRefPtr CefFrameHostImpl::GetParent() { - int64_t parent_frame_id; + if (is_main_frame_) { + return nullptr; + } + + content::GlobalRenderFrameHostToken parent_frame_token; { base::AutoLock lock_scope(state_lock_); - if (is_main_frame_ || parent_frame_id_ == kInvalidFrameId) { + if (!parent_frame_token_) { return nullptr; } - parent_frame_id = parent_frame_id_; + parent_frame_token = *parent_frame_token_; } - auto browser = GetBrowserHostBase(); - if (browser) { - return browser->GetFrame(parent_frame_id); + if (auto browser = GetBrowserHostBase()) { + return browser->GetFrameForGlobalToken(parent_frame_token); } return nullptr; @@ -298,6 +299,7 @@ void CefFrameHostImpl::SendProcessMessage( } void CefFrameHostImpl::SetFocused(bool focused) { + CEF_REQUIRE_UIT(); base::AutoLock lock_scope(state_lock_); is_focused_ = focused; } @@ -324,8 +326,8 @@ void CefFrameHostImpl::RefreshAttributes() { } if (!is_main_frame_) { - parent_frame_id_ = - frame_util::MakeFrameId(render_frame_host_->GetParent()->GetGlobalId()); + parent_frame_token_ = + render_frame_host_->GetParent()->GetGlobalFrameToken(); } } @@ -359,16 +361,10 @@ void CefFrameHostImpl::LoadURLWithExtras(const std::string& url, const content::Referrer& referrer, ui::PageTransition transition, const std::string& extra_headers) { - // Only known frame ids or kMainFrameId are supported. - const auto frame_id = GetFrameId(); - if (frame_id < CefFrameHostImpl::kMainFrameId) { - return; - } - // Any necessary fixup will occur in LoadRequest. GURL gurl = url_util::MakeGURL(url, /*fixup=*/false); - if (frame_id == CefFrameHostImpl::kMainFrameId) { + if (is_main_frame_) { // Load via the browser using NavigationController. auto browser = GetBrowserHostBase(); if (browser) { @@ -484,6 +480,22 @@ content::RenderFrameHost* CefFrameHostImpl::GetRenderFrameHost() const { return render_frame_host_; } +bool CefFrameHostImpl::IsSameFrame(content::RenderFrameHost* frame_host) const { + CEF_REQUIRE_UIT(); + // Shortcut in case the RFH objects match. + if (render_frame_host_ == frame_host) { + return true; + } + + // Frame tokens should match even if we're currently detached or the RFH + // object has changed. + return frame_token_ && *frame_token_ == frame_host->GetGlobalFrameToken(); +} + +bool CefFrameHostImpl::IsDetached() const { + return !GetRenderFrameHost(); +} + bool CefFrameHostImpl::Detach(DetachReason reason) { CEF_REQUIRE_UIT(); @@ -549,9 +561,8 @@ void CefFrameHostImpl::MaybeReAttach( CHECK(!render_frame_.is_bound()); CHECK(!render_frame_host_); - // The RFH may change but the GlobalId should remain the same. - CHECK_EQ(frame_id_, - frame_util::MakeFrameId(render_frame_host->GetGlobalId())); + // The RFH may change but the frame token should remain the same. + CHECK(*frame_token_ == render_frame_host->GetGlobalFrameToken()); { base::AutoLock lock_scope(state_lock_); @@ -564,22 +575,11 @@ void CefFrameHostImpl::MaybeReAttach( // We expect a reconnect to be triggered via FrameAttached(). } -// kMainFrameId must be -1 to align with renderer expectations. -const int64_t CefFrameHostImpl::kMainFrameId = -1; -const int64_t CefFrameHostImpl::kFocusedFrameId = -2; -const int64_t CefFrameHostImpl::kUnspecifiedFrameId = -3; -const int64_t CefFrameHostImpl::kInvalidFrameId = -4; - // This equates to (TT_EXPLICIT | TT_DIRECT_LOAD_FLAG). const ui::PageTransition CefFrameHostImpl::kPageTransitionExplicit = static_cast(ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); -int64_t CefFrameHostImpl::GetFrameId() const { - base::AutoLock lock_scope(state_lock_); - return is_main_frame_ ? kMainFrameId : frame_id_; -} - scoped_refptr CefFrameHostImpl::GetBrowserInfo() const { base::AutoLock lock_scope(state_lock_); return browser_info_; @@ -711,12 +711,14 @@ void CefFrameHostImpl::UpdateDraggableRegions( // Delegate to BrowserInfo so that current state is maintained with // cross-origin navigation. - browser_info_->MaybeNotifyDraggableRegionsChanged( + browser->browser_info()->MaybeNotifyDraggableRegionsChanged( browser, this, std::move(draggable_regions)); } std::string CefFrameHostImpl::GetDebugString() const { - return "frame " + frame_util::GetFrameDebugString(frame_id_) + + return "frame " + + (frame_token_ ? frame_util::GetFrameDebugString(*frame_token_) + : "(null)") + (is_main_frame_ ? " (main)" : " (sub)"); } diff --git a/libcef/browser/frame_host_impl.h b/libcef/browser/frame_host_impl.h index c61df87a8..00035512b 100644 --- a/libcef/browser/frame_host_impl.h +++ b/libcef/browser/frame_host_impl.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include @@ -14,6 +15,7 @@ #include "base/synchronization/lock.h" #include "cef/libcef/common/mojom/cef.mojom.h" +#include "content/public/browser/global_routing_id.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" #include "ui/base/page_transition_types.h" @@ -33,8 +35,9 @@ class CefBrowserHostBase; class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { public: // Create a temporary sub-frame. - CefFrameHostImpl(scoped_refptr browser_info, - int64_t parent_frame_id); + CefFrameHostImpl( + scoped_refptr browser_info, + std::optional parent_frame_token); // Create a frame backed by a RFH and owned by CefBrowserInfo. CefFrameHostImpl(scoped_refptr browser_info, @@ -65,7 +68,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { bool IsMain() override; bool IsFocused() override; CefString GetName() override; - int64_t GetIdentifier() override; + CefString GetIdentifier() override; CefRefPtr GetParent() override; CefString GetURL() override; CefRefPtr GetBrowser() override; @@ -77,8 +80,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { void SendProcessMessage(CefProcessId target_process, CefRefPtr message) override; - bool is_temporary() const { return frame_id_ == kInvalidFrameId; } - void SetFocused(bool focused); void RefreshAttributes(); @@ -112,10 +113,21 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { void ExecuteJavaScriptWithUserGestureForTests(const CefString& javascript); - // Returns the RFH associated with this frame. Must be called on the UI - // thread. + // Returns the RFH currently associated with this frame. May return nullptr if + // this frame is currenly detached. Do not directly compare RFH pointers; use + // IsSameFrame() instead. Must be called on the UI thread. content::RenderFrameHost* GetRenderFrameHost() const; + // Returns true if this frame and |frame_host| represent the same frame. + // Frames are considered the same if they share the same frame token value, + // so this method is safe to call even for detached frames. Must be called on + // the UI thread. + bool IsSameFrame(content::RenderFrameHost* frame_host) const; + + // Returns true if this frame is currently detached (e.g. no associated RFH). + // Must be called on the UI thread. + bool IsDetached() const; + enum class DetachReason { RENDER_FRAME_DELETED, NEW_MAIN_FRAME, @@ -145,10 +157,10 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { absl::optional> regions) override; - static const int64_t kMainFrameId; - static const int64_t kFocusedFrameId; - static const int64_t kUnspecifiedFrameId; - static const int64_t kInvalidFrameId; + bool is_temporary() const { return !frame_token_.has_value(); } + std::optional frame_token() const { + return frame_token_; + } // PageTransition type for explicit navigations. This must pass the check in // ContentBrowserClient::IsExplicitNavigation for debug URLs (HandleDebugURL) @@ -156,7 +168,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { static const ui::PageTransition kPageTransitionExplicit; private: - int64_t GetFrameId() const; scoped_refptr GetBrowserInfo() const; CefRefPtr GetBrowserHostBase() const; @@ -172,16 +183,17 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame { std::string GetDebugString() const; const bool is_main_frame_; + const std::optional frame_token_; - // The following members may be read/modified from any thread. All access must - // be protected by |state_lock_|. + // The following members are only modified on the UI thread but may be read + // from any thread. Any modification on the UI thread, or any access from + // non-UI threads, must be protected by |state_lock_|. mutable base::Lock state_lock_; - int64_t frame_id_; scoped_refptr browser_info_; bool is_focused_; CefString url_; CefString name_; - int64_t parent_frame_id_; + std::optional parent_frame_token_; // The following members are only accessed on the UI thread. content::RenderFrameHost* render_frame_host_ = nullptr; diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 70b148bea..f1dc70a44 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -20,7 +20,7 @@ #include "ui/gfx/font_render_params.h" #include "ui/views/widget/widget.h" -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) #include "libcef/browser/native/window_x11.h" #include "ui/events/keycodes/keyboard_code_conversion_x.h" #include "ui/events/keycodes/keyboard_code_conversion_xkb.h" @@ -55,7 +55,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { gfx::Rect rect(window_info_.bounds.x, window_info_.bounds.y, window_info_.bounds.width, window_info_.bounds.height); -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) DCHECK(!window_x11_); x11::Window parent_window = x11::Window::None; @@ -87,7 +87,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { window_widget_->Show(); window_x11_->Show(); -#endif // BUILDFLAG(OZONE_PLATFORM_X11) +#endif // BUILDFLAG(IS_OZONE_X11) // As an additional requirement on Linux, we must set the colors for the // render widgets in webkit. @@ -115,7 +115,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { } void CefBrowserPlatformDelegateNativeLinux::CloseHostWindow() { -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) if (window_x11_) { window_x11_->Close(); } @@ -145,14 +145,14 @@ void CefBrowserPlatformDelegateNativeLinux::SetFocus(bool setFocus) { web_contents_->Focus(); } -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) if (window_x11_) { // Give native focus to the DesktopNativeWidgetAura for the root window. // Needs to be done via the ::Window so that keyboard focus is assigned // correctly. window_x11_->Focus(); } -#endif // BUILDFLAG(OZONE_PLATFORM_X11) +#endif // BUILDFLAG(IS_OZONE_X11) } void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() { @@ -163,7 +163,7 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() { return; } -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) if (!window_x11_) { return; } @@ -183,16 +183,16 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() { content::RenderWidgetHostImpl::From( web_contents_->GetRenderViewHost()->GetWidget()) ->SendScreenRects(); -#endif // BUILDFLAG(OZONE_PLATFORM_X11) +#endif // BUILDFLAG(IS_OZONE_X11) } void CefBrowserPlatformDelegateNativeLinux::SizeTo(int width, int height) { -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) if (window_x11_) { window_x11_->SetBounds( gfx::Rect(window_x11_->bounds().origin(), gfx::Size(width, height))); } -#endif // BUILDFLAG(OZONE_PLATFORM_X11) +#endif // BUILDFLAG(IS_OZONE_X11) } void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) { @@ -249,7 +249,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent( ui::DomCode dom_code = ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.native_key_code); -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) int keysym = ui::XKeysymForWindowsKeyCode( key_code, !!(key_event.modifiers & EVENTFLAG_SHIFT_DOWN)); char16_t character = ui::GetUnicodeCharacterFromXKeySym(keysym); @@ -277,7 +277,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent( DCHECK(false); } -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) ui::DomKey dom_key = ui::XKeySymToDomKey(keysym, character); #else ui::DomKey dom_key = ui::DomKey::NONE; diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.h b/libcef/browser/native/browser_platform_delegate_native_linux.h index 0da0cc830..72b9e57fd 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.h +++ b/libcef/browser/native/browser_platform_delegate_native_linux.h @@ -7,9 +7,9 @@ #include "libcef/browser/native/browser_platform_delegate_native_aura.h" -#include "ui/ozone/buildflags.h" +#include "ui/base/ozone_buildflags.h" -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) class CefWindowX11; #endif @@ -44,7 +44,7 @@ class CefBrowserPlatformDelegateNativeLinux // True if the host window has been created. bool host_window_created_ = false; -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) CefWindowX11* window_x11_ = nullptr; #endif }; diff --git a/libcef/browser/native/cursor_util_aura.cc b/libcef/browser/native/cursor_util_aura.cc index 894f7bdf8..7b3580d92 100644 --- a/libcef/browser/native/cursor_util_aura.cc +++ b/libcef/browser/native/cursor_util_aura.cc @@ -16,8 +16,8 @@ #include "ui/wm/core/cursor_loader.h" #if BUILDFLAG(IS_LINUX) -#include "ui/ozone/buildflags.h" -#if BUILDFLAG(OZONE_PLATFORM_X11) +#include "ui/base/ozone_buildflags.h" +#if BUILDFLAG(IS_OZONE_X11) #include "ui/base/x/x11_cursor.h" #elif BUILDFLAG(IS_OZONE) #include "ui/ozone/common/bitmap_cursor.h" @@ -107,7 +107,7 @@ using CursorType = ui::WinCursor; inline cef_cursor_handle_t GetCursorHandleImpl(CursorType* cursor) { return cursor->hcursor(); } -#elif BUILDFLAG(OZONE_PLATFORM_X11) +#elif BUILDFLAG(IS_OZONE_X11) // See https://crbug.com/1029142 for background. using CursorType = ui::X11Cursor; inline cef_cursor_handle_t GetCursorHandleImpl(CursorType* cursor) { diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 0bfead72b..4905eaece 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -232,7 +232,8 @@ class CefBrowserURLRequest::Context url_loader_network_observer = static_cast( browser_context->GetDefaultStoragePartition()) - ->CreateAuthCertObserverForServiceWorker(); + ->CreateAuthCertObserverForServiceWorker( + content::ChildProcessHost::kInvalidUniqueID); } task_runner->PostTask( diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index f000df98d..e643ffb4b 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -457,7 +457,8 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { url_loader_network_observer = static_cast( browser_context->GetDefaultStoragePartition()) - ->CreateAuthCertObserverForServiceWorker(); + ->CreateAuthCertObserverForServiceWorker( + content::ChildProcessHost::kInvalidUniqueID); } } diff --git a/libcef/browser/osr/motion_event_osr.h b/libcef/browser/osr/motion_event_osr.h index ffc2402b0..63887bfeb 100644 --- a/libcef/browser/osr/motion_event_osr.h +++ b/libcef/browser/osr/motion_event_osr.h @@ -10,7 +10,7 @@ #include "include/cef_base.h" #include "third_party/blink/public/common/input/web_touch_event.h" -#include "ui/events/gesture_detection/motion_event_generic.h" +#include "ui/events/velocity_tracker/motion_event_generic.h" // Implementation of MotionEvent which takes a stream of CefTouchEvents. // This class is based on ui::MotionEventAura. diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 59148eeea..fb6981570 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -49,7 +49,7 @@ #include "ui/compositor/compositor.h" #include "ui/events/blink/blink_event_util.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" -#include "ui/events/gesture_detection/motion_event.h" +#include "ui/events/velocity_tracker/motion_event.h" #include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/touch_selection/touch_selection_controller.h" @@ -446,7 +446,7 @@ bool CefRenderWidgetHostViewOSR::IsShowing() { void CefRenderWidgetHostViewOSR::EnsureSurfaceSynchronizedForWebTest() { ++latest_capture_sequence_number_; SynchronizeVisualProperties(cc::DeadlinePolicy::UseInfiniteDeadline(), - absl::nullopt); + std::nullopt); } content::TouchSelectionControllerClientManager* @@ -472,15 +472,15 @@ void CefRenderWidgetHostViewOSR::SetBackgroundColor(SkColor color) { content::RenderWidgetHostViewBase::SetBackgroundColor(color); } -absl::optional CefRenderWidgetHostViewOSR::GetBackgroundColor() { +std::optional CefRenderWidgetHostViewOSR::GetBackgroundColor() { return background_color_; } void CefRenderWidgetHostViewOSR::UpdateBackgroundColor() {} -absl::optional +std::optional CefRenderWidgetHostViewOSR::GetDisplayFeature() { - return absl::nullopt; + return std::nullopt; } void CefRenderWidgetHostViewOSR::SetDisplayFeatureForTesting( @@ -543,7 +543,7 @@ CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceId() const { } void CefRenderWidgetHostViewOSR::UpdateLocalSurfaceIdFromEmbeddedClient( - const absl::optional& + const std::optional& embedded_client_local_surface_id) { if (embedded_client_local_surface_id) { parent_local_surface_id_allocator_->UpdateFromChild( @@ -969,7 +969,7 @@ void CefRenderWidgetHostViewOSR::DidNavigate() { GetLocalSurfaceId()); } else { SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), - absl::nullopt); + std::nullopt); } } if (delegated_frame_host_) { @@ -1053,12 +1053,12 @@ void CefRenderWidgetHostViewOSR::WasResized() { } SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(), - absl::nullopt); + std::nullopt); } void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const absl::optional& child_local_surface_id) { + const std::optional& child_local_surface_id) { SetFrameRate(); const bool resized = ResizeRootLayer(); @@ -1099,7 +1099,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { } SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(), - absl::nullopt); + std::nullopt); if (render_widget_host_->delegate()) { render_widget_host_->delegate()->SendScreenRects(); @@ -1810,8 +1810,8 @@ void CefRenderWidgetHostViewOSR::RequestImeCompositionUpdate( void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged( const gfx::Range& range, - const absl::optional>& character_bounds, - const absl::optional>& line_bounds) { + const std::optional>& character_bounds, + const std::optional>& line_bounds) { if (browser_impl_.get()) { CefRange cef_range(range.start(), range.end()); CefRenderHandler::RectList rcList; diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index faf8ffe2e..17b0e6955 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -37,7 +37,7 @@ #include "ui/events/base_event_utils.h" #include "ui/events/gesture_detection/filtered_gesture_provider.h" #include "ui/events/gesture_detection/gesture_configuration.h" -#include "ui/events/gesture_detection/motion_event_generic.h" +#include "ui/events/velocity_tracker/motion_event_generic.h" #include "ui/gfx/geometry/rect.h" #if BUILDFLAG(IS_MAC) @@ -128,9 +128,9 @@ class CefRenderWidgetHostViewOSR GetTouchSelectionControllerClientManager() override; gfx::Rect GetViewBounds() override; void SetBackgroundColor(SkColor color) override; - absl::optional GetBackgroundColor() override; + std::optional GetBackgroundColor() override; void UpdateBackgroundColor() override; - absl::optional GetDisplayFeature() override; + std::optional GetDisplayFeature() override; void SetDisplayFeatureForTesting( const content::DisplayFeature* display_feature) override; blink::mojom::PointerLockResult LockMouse( @@ -183,8 +183,8 @@ class CefRenderWidgetHostViewOSR viz::SurfaceId GetCurrentSurfaceId() const override; void ImeCompositionRangeChanged( const gfx::Range& range, - const absl::optional>& character_bounds, - const absl::optional>& line_bounds) override; + const std::optional>& character_bounds, + const std::optional>& line_bounds) override; std::unique_ptr CreateSyntheticGestureTarget() override; bool TransformPointToCoordSpaceForView( @@ -238,7 +238,7 @@ class CefRenderWidgetHostViewOSR void WasResized(); void SynchronizeVisualProperties( const cc::DeadlinePolicy& deadline_policy, - const absl::optional& child_local_surface_id); + const std::optional& child_local_surface_id); void OnScreenInfoChanged(); void Invalidate(CefBrowserHost::PaintElementType type); void SendExternalBeginFrame(); @@ -359,7 +359,7 @@ class CefRenderWidgetHostViewOSR // has allocated one. Also sets child sequence number component of the // viz::LocalSurfaceId allocator. void UpdateLocalSurfaceIdFromEmbeddedClient( - const absl::optional& local_surface_id); + const std::optional& local_surface_id); // Returns the current viz::LocalSurfaceIdAllocation. const viz::LocalSurfaceId& GetOrCreateLocalSurfaceId(); diff --git a/libcef/browser/permission_prompt.cc b/libcef/browser/permission_prompt.cc index a5379b497..4ef5584f3 100644 --- a/libcef/browser/permission_prompt.cc +++ b/libcef/browser/permission_prompt.cc @@ -191,6 +191,8 @@ cef_permission_request_types_t GetCefRequestType( return CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM; case permissions::RequestType::kCameraStream: return CEF_PERMISSION_TYPE_CAMERA_STREAM; + case permissions::RequestType::kCapturedSurfaceControl: + return CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL; case permissions::RequestType::kClipboard: return CEF_PERMISSION_TYPE_CLIPBOARD; case permissions::RequestType::kDiskQuota: @@ -236,7 +238,7 @@ cef_permission_request_types_t GetCefRequestType( uint32_t GetRequestedPermissions( permissions::PermissionPrompt::Delegate* delegate) { uint32_t permissions = CEF_PERMISSION_TYPE_NONE; - for (const auto* request : delegate->Requests()) { + for (const auto& request : delegate->Requests()) { permissions |= GetCefRequestType(request->request_type()); } return permissions; diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index eb7e0fd64..5be82f5d8 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -7,8 +7,8 @@ #include #if BUILDFLAG(IS_LINUX) -#include "ui/ozone/buildflags.h" -#if BUILDFLAG(OZONE_PLATFORM_X11) +#include "ui/base/ozone_buildflags.h" +#if BUILDFLAG(IS_OZONE_X11) // Include first due to redefinition of x11::EventMask. #include "ui/base/x/x11_util.h" #endif @@ -26,7 +26,7 @@ #include "ui/views/window/native_frame_view.h" #if BUILDFLAG(IS_LINUX) -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) #include "ui/gfx/x/atom_cache.h" #include "ui/linux/linux_ui_delegate.h" #endif @@ -536,7 +536,7 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) { } #if BUILDFLAG(IS_LINUX) -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) auto x11window = static_cast(view_util::GetWindowHandle(widget)); CHECK(x11window != x11::Window::None); @@ -642,7 +642,7 @@ ui::ImageModel CefWindowView::GetWindowAppIcon() { void CefWindowView::WindowClosing() { #if BUILDFLAG(IS_LINUX) -#if BUILDFLAG(OZONE_PLATFORM_X11) +#if BUILDFLAG(IS_OZONE_X11) if (host_widget()) { auto parent = static_cast( view_util::GetWindowHandle(host_widget())); diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index 99d72f7b1..cbcf115a3 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -124,10 +124,10 @@ std::u16string AlloyContentClient::GetLocalizedString( return value; } -base::StringPiece AlloyContentClient::GetDataResource( +std::string_view AlloyContentClient::GetDataResource( int resource_id, ui::ResourceScaleFactor scale_factor) { - base::StringPiece value = + auto value = ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); if (value.empty()) { diff --git a/libcef/common/alloy/alloy_content_client.h b/libcef/common/alloy/alloy_content_client.h index 968bb32c1..302ec2ba1 100644 --- a/libcef/common/alloy/alloy_content_client.h +++ b/libcef/common/alloy/alloy_content_client.h @@ -23,7 +23,7 @@ class AlloyContentClient : public content::ContentClient { std::u16string GetLocalizedString(int message_id) override; std::u16string GetLocalizedString(int message_id, const std::u16string& replacement) override; - base::StringPiece GetDataResource( + std::string_view GetDataResource( int resource_id, ui::ResourceScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index 9f397b94a..bdab512f1 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -428,23 +428,23 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { log_settings.lock_log = logging::DONT_LOCK_LOG_FILE; log_settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE; - logging::LogSeverity log_severity = logging::LOG_INFO; + logging::LogSeverity log_severity = logging::LOGGING_INFO; std::string log_severity_str = command_line->GetSwitchValueASCII(switches::kLogSeverity); if (!log_severity_str.empty()) { if (base::EqualsCaseInsensitiveASCII(log_severity_str, switches::kLogSeverity_Verbose)) { - log_severity = logging::LOG_VERBOSE; + log_severity = logging::LOGGING_VERBOSE; } else if (base::EqualsCaseInsensitiveASCII( log_severity_str, switches::kLogSeverity_Warning)) { - log_severity = logging::LOG_WARNING; + log_severity = logging::LOGGING_WARNING; } else if (base::EqualsCaseInsensitiveASCII(log_severity_str, switches::kLogSeverity_Error)) { - log_severity = logging::LOG_ERROR; + log_severity = logging::LOGGING_ERROR; } else if (base::EqualsCaseInsensitiveASCII(log_severity_str, switches::kLogSeverity_Fatal)) { - log_severity = logging::LOG_FATAL; + log_severity = logging::LOGGING_FATAL; } else if (base::EqualsCaseInsensitiveASCII( log_severity_str, switches::kLogSeverity_Disable)) { log_severity = LOGSEVERITY_DISABLE; @@ -456,7 +456,7 @@ std::optional AlloyMainDelegate::BasicStartupComplete() { // By default, ERROR and FATAL messages will always be output to stderr due // to the kAlwaysPrintErrorLevel value in base/logging.cc. We change the log // level here so that only FATAL messages are output. - logging::SetMinLogLevel(logging::LOG_FATAL); + logging::SetMinLogLevel(logging::LOGGING_FATAL); } else { log_settings.logging_dest = logging::LOG_TO_ALL; logging::SetMinLogLevel(log_severity); diff --git a/libcef/common/extensions/extensions_api_provider.cc b/libcef/common/extensions/extensions_api_provider.cc index f977dbf4c..249c81a92 100644 --- a/libcef/common/extensions/extensions_api_provider.cc +++ b/libcef/common/extensions/extensions_api_provider.cc @@ -59,7 +59,7 @@ bool CefExtensionsAPIProvider::IsAPISchemaGenerated(const std::string& name) { return false; } -base::StringPiece CefExtensionsAPIProvider::GetAPISchema( +std::string_view CefExtensionsAPIProvider::GetAPISchema( const std::string& name) { // Schema for CEF-only APIs. // TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See @@ -72,7 +72,7 @@ base::StringPiece CefExtensionsAPIProvider::GetAPISchema( return api::cef::ChromeGeneratedSchemas::Get(name); } - return base::StringPiece(); + return std::string_view(); } void CefExtensionsAPIProvider::RegisterPermissions( diff --git a/libcef/common/extensions/extensions_api_provider.h b/libcef/common/extensions/extensions_api_provider.h index 106b3cc21..cd7c53fa9 100644 --- a/libcef/common/extensions/extensions_api_provider.h +++ b/libcef/common/extensions/extensions_api_provider.h @@ -23,7 +23,7 @@ class CefExtensionsAPIProvider : public ExtensionsAPIProvider { void AddBehaviorFeatures(FeatureProvider* provider) override; void AddAPIJSONSources(JSONFeatureProviderSource* json_source) override; bool IsAPISchemaGenerated(const std::string& name) override; - base::StringPiece GetAPISchema(const std::string& name) override; + std::string_view GetAPISchema(const std::string& name) override; void RegisterPermissions(PermissionsInfo* permissions_info) override; void RegisterManifestHandlers() override; }; diff --git a/libcef/common/frame_util.cc b/libcef/common/frame_util.cc index 0ed3d03cd..aa819148d 100644 --- a/libcef/common/frame_util.cc +++ b/libcef/common/frame_util.cc @@ -6,9 +6,8 @@ #include "libcef/browser/thread_util.h" -#include -#include - +#include "base/strings/string_number_conversions.h" +#include "base/strings/stringprintf.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" @@ -22,18 +21,59 @@ content::GlobalRenderFrameHostId GetGlobalId( : navigation_handle->GetPreviousRenderFrameHostId(); } -std::string GetFrameDebugString(int64_t frame_id) { - uint32_t process_id = frame_id >> 32; - uint32_t routing_id = std::numeric_limits::max() & frame_id; +std::optional ParseFrameIdentifier( + const std::string& identifier) { + if (identifier.size() < 3) { + return std::nullopt; + } - std::stringstream ss; - ss << frame_id << " [" << process_id << "," << routing_id << "]"; - return ss.str(); + const size_t pos = identifier.find('-'); + if (pos == std::string::npos || pos == 0 || pos == identifier.size() - 1) { + return std::nullopt; + } + + std::string_view process_id_str(identifier.c_str(), pos); + int process_id; + if (!base::HexStringToInt(process_id_str, &process_id) || + !IsValidChildId(process_id)) { + return std::nullopt; + } + + std::string_view frame_token_str(identifier.c_str() + pos + 1, + identifier.size() - pos - 1); + auto token = base::Token::FromString(frame_token_str); + if (token) { + auto unguessable_token = + base::UnguessableToken::Deserialize(token->high(), token->low()); + if (unguessable_token) { + return content::GlobalRenderFrameHostToken( + process_id, blink::LocalFrameToken(unguessable_token.value())); + } + } + + return std::nullopt; +} + +std::string MakeFrameIdentifier( + const content::GlobalRenderFrameHostToken& global_token) { + if (!IsValidGlobalToken(global_token)) { + return std::string(); + } + + // All upper-case hex values. + return base::StringPrintf("%X-%s", global_token.child_id, + global_token.frame_token.ToString().c_str()); } std::string GetFrameDebugString( const content::GlobalRenderFrameHostId& global_id) { - return GetFrameDebugString(MakeFrameId(global_id)); + return base::StringPrintf("[%d,%d]", global_id.child_id, + global_id.frame_routing_id); +} + +std::string GetFrameDebugString( + const content::GlobalRenderFrameHostToken& global_token) { + return MakeFrameIdentifier(global_token); } } // namespace frame_util diff --git a/libcef/common/frame_util.h b/libcef/common/frame_util.h index 7aeedbf0e..cb860f43e 100644 --- a/libcef/common/frame_util.h +++ b/libcef/common/frame_util.h @@ -6,6 +6,7 @@ #define CEF_LIBCEF_COMMON_FRAME_UTIL_H_ #include +#include #include #include "base/logging.h" @@ -18,17 +19,6 @@ class NavigationHandle; namespace frame_util { -// Create a frame ID in the format exposed by the CEF API. -inline int64_t MakeFrameId(int child_id, int frame_routing_id) { - return (static_cast(child_id) << 32) | - static_cast(frame_routing_id); -} - -// Create a frame ID in the format exposed by the CEF API. -inline int64_t MakeFrameId(const content::GlobalRenderFrameHostId& global_id) { - return MakeFrameId(global_id.child_id, global_id.frame_routing_id); -} - // Returns true if |child_id| is valid. inline bool IsValidChildId(int child_id) { // See comments in ChildProcessHostImpl::GenerateChildProcessUniqueId(). @@ -57,13 +47,6 @@ inline content::GlobalRenderFrameHostId MakeGlobalId( return content::GlobalRenderFrameHostId(child_id, frame_routing_id); } -// Create a global ID from a frame ID. -inline content::GlobalRenderFrameHostId MakeGlobalId(int64_t frame_id) { - uint32_t child_id = frame_id >> 32; - uint32_t frame_routing_id = std::numeric_limits::max() & frame_id; - return MakeGlobalId(child_id, frame_routing_id); -} - // Returns an invalid global ID value. inline content::GlobalRenderFrameHostId InvalidGlobalId() { return content::GlobalRenderFrameHostId(); @@ -74,10 +57,33 @@ inline content::GlobalRenderFrameHostId InvalidGlobalId() { content::GlobalRenderFrameHostId GetGlobalId( content::NavigationHandle* navigation_handle); -// Returns a human-readable version of the ID. -std::string GetFrameDebugString(int64_t frame_id); +// Returns true if |frame_token| is valid. +inline bool IsValidFrameToken(const blink::LocalFrameToken& frame_token) { + return !frame_token->is_empty(); +} + +// Returns true if |global_token| is valid. +inline bool IsValidGlobalToken( + const content::GlobalRenderFrameHostToken& global_token) { + return IsValidChildId(global_token.child_id) && + IsValidFrameToken(global_token.frame_token); +} + +// Create a global token from a frame identifier. Returns std::nullopt if +// |identifier| is invalid. +std::optional ParseFrameIdentifier( + const std::string& identifier); + +// Return the frame identifier for a global token. Returns empty if +// |global_token| is invalid. +std::string MakeFrameIdentifier( + const content::GlobalRenderFrameHostToken& global_token); + +// Returns a human-readable version of the ID/token. std::string GetFrameDebugString( const content::GlobalRenderFrameHostId& global_id); +std::string GetFrameDebugString( + const content::GlobalRenderFrameHostToken& global_token); } // namespace frame_util diff --git a/libcef/common/mojom/cef.mojom b/libcef/common/mojom/cef.mojom index fa2d0d481..283d29216 100644 --- a/libcef/common/mojom/cef.mojom +++ b/libcef/common/mojom/cef.mojom @@ -10,6 +10,7 @@ import "mojo/public/mojom/base/values.mojom"; import "services/network/public/mojom/site_for_cookies.mojom"; import "services/network/public/mojom/url_request.mojom"; import "third_party/blink/public/mojom/loader/referrer.mojom"; +import "third_party/blink/public/mojom/tokens/tokens.mojom"; import "ui/gfx/geometry/mojom/geometry.mojom"; import "url/mojom/url.mojom"; @@ -128,7 +129,8 @@ interface BrowserManager { // Retrieve info for a new CefBrowser. [Sync] - GetNewBrowserInfo(int32 render_frame_routing_id) => (NewBrowserInfo info); + GetNewBrowserInfo(blink.mojom.LocalFrameToken render_frame_token) => + (NewBrowserInfo info); }; // Interface for communicating with browser management to the render process. diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index c04c085a8..babbb34b5 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -290,7 +290,7 @@ void AlloyContentRendererClient::RenderFrameCreated( const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kDisableSpellChecking)) { - new SpellCheckProvider(render_frame, spellcheck_.get(), this); + new SpellCheckProvider(render_frame, spellcheck_.get()); } bool browser_created; @@ -412,9 +412,9 @@ void AlloyContentRendererClient::WillSendRequest( } } -uint64_t AlloyContentRendererClient::VisitedLinkHash(const char* canonical_url, - size_t length) { - return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); +uint64_t AlloyContentRendererClient::VisitedLinkHash( + std::string_view canonical_url) { + return visited_link_slave_->ComputeURLFingerprint(canonical_url); } bool AlloyContentRendererClient::IsLinkVisited(uint64_t link_hash) { diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index 74c9a692e..fdfdd0b85 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -97,7 +97,7 @@ class AlloyContentRendererClient const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url) override; - uint64_t VisitedLinkHash(const char* canonical_url, size_t length) override; + uint64_t VisitedLinkHash(std::string_view canonical_url) override; bool IsLinkVisited(uint64_t link_hash) override; bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override; diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc index 7577cf85a..e3e9a86fa 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc @@ -47,18 +47,15 @@ CefURLLoaderThrottleProviderImpl::Clone() { blink::WebVector> CefURLLoaderThrottleProviderImpl::CreateThrottles( base::optional_ref local_frame_token, - const blink::WebURLRequest& request) { + const network::ResourceRequest& request) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); blink::WebVector> throttles; - const network::mojom::RequestDestination request_destination = - request.GetRequestDestination(); - // Some throttles have already been added in the browser for frame resources. // Don't add them for frame requests. bool is_frame_resource = - blink::IsRequestDestinationFrame(request_destination); + blink::IsRequestDestinationFrame(request.destination); DCHECK(!is_frame_resource || type_ == blink::URLLoaderThrottleProviderType::kFrame); diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h index 9f14b6786..66b3fd63a 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.h +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.h @@ -31,7 +31,7 @@ class CefURLLoaderThrottleProviderImpl std::unique_ptr Clone() override; blink::WebVector> CreateThrottles( base::optional_ref local_frame_token, - const blink::WebURLRequest& request) override; + const network::ResourceRequest& request) override; void SetOnline(bool is_online) override; private: diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index 85dd25540..b56893ebc 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -56,8 +56,6 @@ blink::ExecutionContext* GetExecutionContext(v8::Local context) { } // namespace -const int64_t kInvalidFrameId = -1; - bool CanGoBack(blink::WebView* view) { if (!view) { return false; diff --git a/libcef/renderer/blink_glue.h b/libcef/renderer/blink_glue.h index 95d7df37c..8aae6186b 100644 --- a/libcef/renderer/blink_glue.h +++ b/libcef/renderer/blink_glue.h @@ -29,8 +29,6 @@ class WebView; namespace blink_glue { -BLINK_EXPORT extern const int64_t kInvalidFrameId; - BLINK_EXPORT bool CanGoBack(blink::WebView* view); BLINK_EXPORT bool CanGoForward(blink::WebView* view); BLINK_EXPORT void GoBack(blink::WebView* view); diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index c393391db..e940fb5a4 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -181,13 +181,14 @@ CefRefPtr CefBrowserImpl::GetFocusedFrame() { return nullptr; } -CefRefPtr CefBrowserImpl::GetFrame(int64_t identifier) { +CefRefPtr CefBrowserImpl::GetFrameByIdentifier( + const CefString& identifier) { CEF_REQUIRE_RT_RETURN(nullptr); return GetWebFrameImpl(identifier).get(); } -CefRefPtr CefBrowserImpl::GetFrame(const CefString& name) { +CefRefPtr CefBrowserImpl::GetFrameByName(const CefString& name) { CEF_REQUIRE_RT_RETURN(nullptr); blink::WebView* web_view = GetWebView(); @@ -235,7 +236,7 @@ size_t CefBrowserImpl::GetFrameCount() { return count; } -void CefBrowserImpl::GetFrameIdentifiers(std::vector& identifiers) { +void CefBrowserImpl::GetFrameIdentifiers(std::vector& identifiers) { CEF_REQUIRE_RT_RETURN_VOID(); if (identifiers.size() > 0) { @@ -287,71 +288,45 @@ CefBrowserImpl::~CefBrowserImpl() = default; CefRefPtr CefBrowserImpl::GetWebFrameImpl( blink::WebLocalFrame* frame) { DCHECK(frame); - int64_t frame_id = render_frame_util::GetIdentifier(frame); + const auto& frame_token = frame->GetLocalFrameToken(); // Frames are re-used between page loads. Only add the frame to the map once. - FrameMap::const_iterator it = frames_.find(frame_id); + FrameMap::const_iterator it = frames_.find(frame_token); if (it != frames_.end()) { return it->second; } - CefRefPtr framePtr(new CefFrameImpl(this, frame, frame_id)); - frames_.insert(std::make_pair(frame_id, framePtr)); + CefRefPtr framePtr(new CefFrameImpl(this, frame)); + frames_.insert(std::make_pair(frame_token, framePtr)); return framePtr; } -CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) { - if (frame_id == blink_glue::kInvalidFrameId) { - if (GetWebView()) { - blink::WebFrame* main_frame = GetWebView()->MainFrame(); - if (main_frame && main_frame->IsWebLocalFrame()) { - return GetWebFrameImpl(main_frame->ToWebLocalFrame()); - } - } +CefRefPtr CefBrowserImpl::GetWebFrameImpl( + const std::string& identifier) { + const auto& frame_token = + render_frame_util::ParseFrameTokenFromIdentifier(identifier); + if (!frame_token) { return nullptr; } // Check if we already know about the frame. - FrameMap::const_iterator it = frames_.find(frame_id); + FrameMap::const_iterator it = frames_.find(*frame_token); if (it != frames_.end()) { return it->second; } if (GetWebView()) { // Check if the frame exists but we don't know about it yet. - for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame; - frame = frame->TraverseNext()) { - if (frame->IsWebLocalFrame() && - render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) == - frame_id) { - return GetWebFrameImpl(frame->ToWebLocalFrame()); - } + if (auto* local_frame = + blink::WebLocalFrame::FromFrameToken(*frame_token)) { + return GetWebFrameImpl(local_frame); } } return nullptr; } -void CefBrowserImpl::AddFrameObject(int64_t frame_id, - CefTrackNode* tracked_object) { - CefRefPtr manager; - - if (!frame_objects_.empty()) { - FrameObjectMap::const_iterator it = frame_objects_.find(frame_id); - if (it != frame_objects_.end()) { - manager = it->second; - } - } - - if (!manager.get()) { - manager = new CefTrackManager(); - frame_objects_.insert(std::make_pair(frame_id, manager)); - } - - manager->Add(tracked_object); -} - // RenderViewObserver methods. // ----------------------------------------------------------------------------- @@ -368,22 +343,8 @@ void CefBrowserImpl::OnDestruct() { CefRenderManager::Get()->OnBrowserDestroyed(this); } -void CefBrowserImpl::FrameDetached(int64_t frame_id) { - if (!frames_.empty()) { - // Remove the frame from the map. - FrameMap::iterator it = frames_.find(frame_id); - if (it != frames_.end()) { - frames_.erase(it); - } - } - - if (!frame_objects_.empty()) { - // Remove any tracked objects associated with the frame. - FrameObjectMap::iterator it = frame_objects_.find(frame_id); - if (it != frame_objects_.end()) { - frame_objects_.erase(it); - } - } +void CefBrowserImpl::FrameDetached(blink::WebLocalFrame* frame) { + frames_.erase(frame->GetLocalFrameToken()); } void CefBrowserImpl::OnLoadingStateChange(bool isLoading) { diff --git a/libcef/renderer/browser_impl.h b/libcef/renderer/browser_impl.h index b0da154e4..c2aef4f91 100644 --- a/libcef/renderer/browser_impl.h +++ b/libcef/renderer/browser_impl.h @@ -16,9 +16,9 @@ #include "include/cef_browser.h" #include "include/cef_client.h" -#include "libcef/common/tracker.h" #include "libcef/renderer/frame_impl.h" +#include "third_party/blink/public/common/tokens/tokens.h" #include "third_party/blink/public/web/web_view_observer.h" namespace blink { @@ -57,10 +57,11 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { bool HasDocument() override; CefRefPtr GetMainFrame() override; CefRefPtr GetFocusedFrame() override; - CefRefPtr GetFrame(int64_t identifier) override; - CefRefPtr GetFrame(const CefString& name) override; + CefRefPtr GetFrameByIdentifier( + const CefString& identifier) override; + CefRefPtr GetFrameByName(const CefString& name) override; size_t GetFrameCount() override; - void GetFrameIdentifiers(std::vector& identifiers) override; + void GetFrameIdentifiers(std::vector& identifiers) override; void GetFrameNames(std::vector& names) override; CefBrowserImpl(blink::WebView* web_view, @@ -75,10 +76,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { // Returns the matching CefFrameImpl reference or creates a new one. CefRefPtr GetWebFrameImpl(blink::WebLocalFrame* frame); - CefRefPtr GetWebFrameImpl(int64_t frame_id); - - // Frame objects will be deleted immediately before the frame is closed. - void AddFrameObject(int64_t frame_id, CefTrackNode* tracked_object); + CefRefPtr GetWebFrameImpl(const std::string& identifier); int browser_id() const { return browser_id_; } bool is_popup() const { return is_popup_; } @@ -86,7 +84,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { // blink::WebViewObserver methods. void OnDestruct() override; - void FrameDetached(int64_t frame_id); + void FrameDetached(blink::WebLocalFrame* frame); void OnLoadingStateChange(bool isLoading); void OnEnterBFCache(); @@ -99,18 +97,13 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { bool is_popup_; bool is_windowless_; - // Map of unique frame ids to CefFrameImpl references. - using FrameMap = std::map>; + // Map of unique frame tokens to CefFrameImpl references. + using FrameMap = std::map>; FrameMap frames_; // True if the browser was in the BFCache. bool was_in_bfcache_ = false; - // Map of unique frame ids to CefTrackManager objects that need to be cleaned - // up when the frame is deleted. - using FrameObjectMap = std::map>; - FrameObjectMap frame_objects_; - struct LoadingState { LoadingState(bool is_loading, bool can_go_back, bool can_go_forward) : is_loading_(is_loading), diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index ec36d3ffa..2d3bb49fb 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -19,6 +19,7 @@ #include "extensions/renderer/dispatcher.h" #include "extensions/renderer/extension_frame_helper.h" #include "extensions/renderer/extensions_render_frame_observer.h" +#include "extensions/renderer/extensions_renderer_api_provider.h" #include "extensions/renderer/renderer_extension_registry.h" #include "extensions/renderer/script_context.h" #include "third_party/blink/public/web/web_document.h" @@ -82,7 +83,9 @@ void CefExtensionsRendererClient::RenderThreadStarted() { content::RenderThread* thread = content::RenderThread::Get(); extension_dispatcher_ = std::make_unique( - std::make_unique()); + std::make_unique(), + std::vector< + std::unique_ptr>()); extension_dispatcher_->OnRenderThreadStarted(thread); resource_request_policy_ = std::make_unique( diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 6f1d2ded0..d0191d747 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -61,12 +61,16 @@ constexpr auto kConnectionRetryDelay = base::Seconds(1); // Length of time to wait for the browser connection ACK before timing out. constexpr auto kConnectionTimeout = base::Seconds(10); +std::string GetDebugString(blink::WebLocalFrame* frame) { + return "frame " + render_frame_util::GetIdentifier(frame); +} + } // namespace -CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, - blink::WebLocalFrame* frame, - int64_t frame_id) - : browser_(browser), frame_(frame), frame_id_(frame_id) {} +CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame) + : browser_(browser), + frame_(frame), + frame_debug_str_(GetDebugString(frame)) {} CefFrameImpl::~CefFrameImpl() = default; @@ -185,10 +189,14 @@ CefString CefFrameImpl::GetName() { return name; } -int64_t CefFrameImpl::GetIdentifier() { - CEF_REQUIRE_RT_RETURN(0); +CefString CefFrameImpl::GetIdentifier() { + CefString identifier; + CEF_REQUIRE_RT_RETURN(identifier); - return frame_id_; + if (frame_) { + identifier = render_frame_util::GetIdentifier(frame_); + } + return identifier; } CefRefPtr CefFrameImpl::GetParent() { @@ -406,10 +414,9 @@ void CefFrameImpl::OnDetached() { // keep |this| alive until after this method returns. CefRefPtr self = this; + browser_->FrameDetached(frame_); frame_ = nullptr; - browser_->FrameDetached(frame_id_); - OnDisconnect(DisconnectReason::DETACHED); browser_ = nullptr; @@ -417,7 +424,7 @@ void CefFrameImpl::OnDetached() { // In case we never attached. while (!queued_browser_actions_.empty()) { auto& action = queued_browser_actions_.front(); - LOG(WARNING) << action.first << " sent to detached " << GetDebugString() + LOG(WARNING) << action.first << " sent to detached " << frame_debug_str_ << " will be ignored"; queued_browser_actions_.pop(); } @@ -425,7 +432,7 @@ void CefFrameImpl::OnDetached() { // In case we're destroyed without the context being created. while (!queued_context_actions_.empty()) { auto& action = queued_context_actions_.front(); - LOG(WARNING) << action.first << " sent to detached " << GetDebugString() + LOG(WARNING) << action.first << " sent to detached " << frame_debug_str_ << " will be ignored"; queued_context_actions_.pop(); } @@ -444,7 +451,7 @@ void CefFrameImpl::ExecuteOnLocalFrame(const std::string& function_name, if (frame_) { std::move(action).Run(frame_); } else { - LOG(WARNING) << function_name << " sent to detached " << GetDebugString() + LOG(WARNING) << function_name << " sent to detached " << frame_debug_str_ << " will be ignored"; } } @@ -467,7 +474,7 @@ void CefFrameImpl::ConnectBrowserFrame(ConnectReason reason) { "RETRY %zu/%zu", browser_connect_retry_ct_, kConnectionRetryMaxCt); break; } - VLOG(1) << GetDebugString() << " connection request (reason=" << reason_str + VLOG(1) << frame_debug_str_ << " connection request (reason=" << reason_str << ")"; } @@ -477,7 +484,7 @@ void CefFrameImpl::ConnectBrowserFrame(ConnectReason reason) { if (!frame_ || blink_glue::IsInBackForwardCache(frame_)) { browser_connection_state_ = ConnectionState::DISCONNECTED; browser_connect_timer_.Stop(); - VLOG(1) << GetDebugString() << " connection retry canceled (reason=" + VLOG(1) << frame_debug_str_ << " connection retry canceled (reason=" << (frame_ ? "BFCACHED" : "INVALID") << ")"; return; } @@ -524,7 +531,7 @@ const mojo::Remote& CefFrameImpl::GetBrowserFrame( } void CefFrameImpl::OnBrowserFrameTimeout() { - LOG(ERROR) << GetDebugString() << " connection timeout"; + LOG(ERROR) << frame_debug_str_ << " connection timeout"; OnDisconnect(DisconnectReason::CONNECT_TIMEOUT); } @@ -577,7 +584,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) { state_str += ", FRAME_INVALID"; } - VLOG(1) << GetDebugString() << " disconnected (reason=" << reason_str + VLOG(1) << frame_debug_str_ << " disconnected (reason=" << reason_str << ", current_state=" << state_str << ")"; } @@ -590,7 +597,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) { // intentionally detached. if (frame_ && reason != DisconnectReason::BROWSER_FRAME_DETACHED) { if (browser_connect_retry_ct_++ < kConnectionRetryMaxCt) { - VLOG(1) << GetDebugString() << " connection retry scheduled"; + VLOG(1) << frame_debug_str_ << " connection retry scheduled"; // Retry after a delay in case the frame is currently navigating, being // destroyed, or entering the bfcache. In the navigation case the retry @@ -605,7 +612,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) { ConnectReason::RETRY)); } else { // Trigger a crash in official builds. - LOG(FATAL) << GetDebugString() << " connection retry failed"; + LOG(FATAL) << frame_debug_str_ << " connection retry failed"; } } } @@ -614,7 +621,7 @@ void CefFrameImpl::SendToBrowserFrame(const std::string& function_name, BrowserFrameAction action) { if (!frame_) { // We've been detached. - LOG(WARNING) << function_name << " sent to detached " << GetDebugString() + LOG(WARNING) << function_name << " sent to detached " << frame_debug_str_ << " will be ignored"; return; } @@ -798,10 +805,6 @@ void CefFrameImpl::ContextLifecycleStateChanged( } } -std::string CefFrameImpl::GetDebugString() const { - return "frame " + frame_util::GetFrameDebugString(frame_id_); -} - // Enable deprecation warnings on Windows. See http://crbug.com/585142. #if BUILDFLAG(IS_WIN) #if defined(__clang__) diff --git a/libcef/renderer/frame_impl.h b/libcef/renderer/frame_impl.h index 1251e2d36..c4d4a2f55 100644 --- a/libcef/renderer/frame_impl.h +++ b/libcef/renderer/frame_impl.h @@ -41,9 +41,7 @@ class CefFrameImpl public cef::mojom::RenderFrame, public blink_glue::CefExecutionContextLifecycleStateObserver { public: - CefFrameImpl(CefBrowserImpl* browser, - blink::WebLocalFrame* frame, - int64_t frame_id); + CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame); CefFrameImpl(const CefFrameImpl&) = delete; CefFrameImpl& operator=(const CefFrameImpl&) = delete; @@ -70,7 +68,7 @@ class CefFrameImpl bool IsMain() override; bool IsFocused() override; CefString GetName() override; - int64_t GetIdentifier() override; + CefString GetIdentifier() override; CefRefPtr GetParent() override; CefString GetURL() override; CefRefPtr GetBrowser() override; @@ -162,11 +160,9 @@ class CefFrameImpl void ContextLifecycleStateChanged( blink::mojom::blink::FrameLifecycleState state) override; - std::string GetDebugString() const; - CefBrowserImpl* browser_; blink::WebLocalFrame* frame_; - const int64_t frame_id_; + const std::string frame_debug_str_; bool did_commit_provisional_load_ = false; bool did_initialize_script_context_ = false; diff --git a/libcef/renderer/render_frame_util.cc b/libcef/renderer/render_frame_util.cc index 62d954969..1eaa3beb6 100644 --- a/libcef/renderer/render_frame_util.cc +++ b/libcef/renderer/render_frame_util.cc @@ -15,13 +15,12 @@ namespace render_frame_util { -int64_t GetIdentifier(blink::WebLocalFrame* frame) { +std::string GetIdentifier(blink::WebLocalFrame* frame) { // Each WebFrame will have an associated RenderFrame. The RenderFrame // routing IDs are unique within a given renderer process. - content::RenderFrame* render_frame = - content::RenderFrame::FromWebFrame(frame); - return frame_util::MakeFrameId(content::RenderThread::Get()->GetClientId(), - render_frame->GetRoutingID()); + return frame_util::MakeFrameIdentifier(content::GlobalRenderFrameHostToken( + content::RenderThread::Get()->GetClientId(), + frame->GetLocalFrameToken())); } std::string GetName(blink::WebLocalFrame* frame) { @@ -42,4 +41,14 @@ std::string GetName(blink::WebLocalFrame* frame) { return std::string(); } +std::optional ParseFrameTokenFromIdentifier( + const std::string& identifier) { + const auto& global_token = frame_util::ParseFrameIdentifier(identifier); + if (!global_token || + global_token->child_id != content::RenderThread::Get()->GetClientId()) { + return std::nullopt; + } + return global_token->frame_token; +} + } // namespace render_frame_util diff --git a/libcef/renderer/render_frame_util.h b/libcef/renderer/render_frame_util.h index ee451e514..933aaa1f9 100644 --- a/libcef/renderer/render_frame_util.h +++ b/libcef/renderer/render_frame_util.h @@ -6,19 +6,25 @@ #ifndef CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_ #define CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_ -#include - +#include #include +#include "third_party/blink/public/common/tokens/tokens.h" + namespace blink { class WebLocalFrame; -} +} // namespace blink namespace render_frame_util { -int64_t GetIdentifier(blink::WebLocalFrame* frame); +std::string GetIdentifier(blink::WebLocalFrame* frame); std::string GetName(blink::WebLocalFrame* frame); +// Parses |identifier| and returns a frame token appropriate to this renderer +// process, or std::nullopt. +std::optional ParseFrameTokenFromIdentifier( + const std::string& identifier); + } // namespace render_frame_util #endif // CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_ diff --git a/libcef/renderer/render_manager.cc b/libcef/renderer/render_manager.cc index 771d75e18..83e619e2f 100644 --- a/libcef/renderer/render_manager.cc +++ b/libcef/renderer/render_manager.cc @@ -41,6 +41,7 @@ #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url.h" #include "third_party/blink/public/web/web_frame.h" +#include "third_party/blink/public/web/web_local_frame.h" #include "third_party/blink/public/web/web_security_policy.h" #include "third_party/blink/public/web/web_view.h" #include "third_party/blink/public/web/web_view_observer.h" @@ -112,6 +113,11 @@ void CefRenderManager::RenderFrameCreated( render_frame_observer->AttachFrame( browser->GetWebFrameImpl(render_frame->GetWebFrame()).get()); } + + // Enable support for draggable regions. + // TODO: This has performance consequences so consider making it configurable + // (e.g. only enabled for frameless windows). See issue #3636. + render_frame->GetWebView()->SetSupportsAppRegion(true); } void CefRenderManager::WebViewCreated(blink::WebView* web_view, @@ -317,8 +323,8 @@ CefRefPtr CefRenderManager::MaybeCreateBrowser( auto params = cef::mojom::NewBrowserInfo::New(); if (!is_pdf) { // Retrieve browser information synchronously. - GetBrowserManager()->GetNewBrowserInfo(render_frame->GetRoutingID(), - ¶ms); + GetBrowserManager()->GetNewBrowserInfo( + render_frame->GetWebFrame()->GetLocalFrameToken(), ¶ms); if (params->browser_id == 0) { // The popup may have been canceled during creation. return nullptr; diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index eed3f8f0f..a7e232448 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -985,7 +985,7 @@ CefRefPtr CefV8ContextImpl::GetFrame() { CefRefPtr browser = CefBrowserImpl::GetBrowserForMainFrame(webframe->Top()); if (browser) { - frame = browser->GetFrame(render_frame_util::GetIdentifier(webframe)); + frame = browser->GetWebFrameImpl(webframe).get(); } } diff --git a/libcef_dll/cpptoc/browser_cpptoc.cc b/libcef_dll/cpptoc/browser_cpptoc.cc index d543f8eed..f940d1329 100644 --- a/libcef_dll/cpptoc/browser_cpptoc.cc +++ b/libcef_dll/cpptoc/browser_cpptoc.cc @@ -9,11 +9,10 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=67e150f09374ecec24e0f326e9a1705446da9e44$ +// $hash=470bf9226f66658509ba704953b84f443ed77642$ // #include "libcef_dll/cpptoc/browser_cpptoc.h" -#include #include "libcef_dll/cpptoc/browser_host_cpptoc.h" #include "libcef_dll/cpptoc/frame_cpptoc.h" #include "libcef_dll/shutdown_checker.h" @@ -291,7 +290,8 @@ browser_get_focused_frame(struct _cef_browser_t* self) { } struct _cef_frame_t* CEF_CALLBACK -browser_get_frame_byident(struct _cef_browser_t* self, int64_t identifier) { +browser_get_frame_by_identifier(struct _cef_browser_t* self, + const cef_string_t* identifier) { shutdown_checker::AssertNotShutdown(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -300,17 +300,23 @@ browser_get_frame_byident(struct _cef_browser_t* self, int64_t identifier) { if (!self) { return NULL; } + // Verify param: identifier; type: string_byref_const + DCHECK(identifier); + if (!identifier) { + return NULL; + } // Execute CefRefPtr _retval = - CefBrowserCppToC::Get(self)->GetFrame(identifier); + CefBrowserCppToC::Get(self)->GetFrameByIdentifier(CefString(identifier)); // Return type: refptr_same return CefFrameCppToC::Wrap(_retval); } -struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, - const cef_string_t* name) { +struct _cef_frame_t* CEF_CALLBACK +browser_get_frame_by_name(struct _cef_browser_t* self, + const cef_string_t* name) { shutdown_checker::AssertNotShutdown(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -323,7 +329,7 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self, // Execute CefRefPtr _retval = - CefBrowserCppToC::Get(self)->GetFrame(CefString(name)); + CefBrowserCppToC::Get(self)->GetFrameByName(CefString(name)); // Return type: refptr_same return CefFrameCppToC::Wrap(_retval); @@ -347,8 +353,7 @@ size_t CEF_CALLBACK browser_get_frame_count(struct _cef_browser_t* self) { } void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, - size_t* identifiersCount, - int64_t* identifiers) { + cef_string_list_t identifiers) { shutdown_checker::AssertNotShutdown(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING @@ -357,32 +362,22 @@ void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self, if (!self) { return; } - // Verify param: identifiers; type: simple_vec_byref - DCHECK(identifiersCount && (*identifiersCount == 0 || identifiers)); - if (!identifiersCount || (*identifiersCount > 0 && !identifiers)) { + // Verify param: identifiers; type: string_vec_byref + DCHECK(identifiers); + if (!identifiers) { return; } - // Translate param: identifiers; type: simple_vec_byref - std::vector identifiersList; - if (identifiersCount && *identifiersCount > 0 && identifiers) { - for (size_t i = 0; i < *identifiersCount; ++i) { - identifiersList.push_back(identifiers[i]); - } - } + // Translate param: identifiers; type: string_vec_byref + std::vector identifiersList; + transfer_string_list_contents(identifiers, identifiersList); // Execute CefBrowserCppToC::Get(self)->GetFrameIdentifiers(identifiersList); - // Restore param: identifiers; type: simple_vec_byref - if (identifiersCount && identifiers) { - *identifiersCount = std::min(identifiersList.size(), *identifiersCount); - if (*identifiersCount > 0) { - for (size_t i = 0; i < *identifiersCount; ++i) { - identifiers[i] = identifiersList[i]; - } - } - } + // Restore param: identifiers; type: string_vec_byref + cef_string_list_clear(identifiers); + transfer_string_list_contents(identifiersList, identifiers); } void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self, @@ -434,8 +429,8 @@ CefBrowserCppToC::CefBrowserCppToC() { GetStruct()->has_document = browser_has_document; GetStruct()->get_main_frame = browser_get_main_frame; GetStruct()->get_focused_frame = browser_get_focused_frame; - GetStruct()->get_frame_byident = browser_get_frame_byident; - GetStruct()->get_frame = browser_get_frame; + GetStruct()->get_frame_by_identifier = browser_get_frame_by_identifier; + GetStruct()->get_frame_by_name = browser_get_frame_by_name; GetStruct()->get_frame_count = browser_get_frame_count; GetStruct()->get_frame_identifiers = browser_get_frame_identifiers; GetStruct()->get_frame_names = browser_get_frame_names; diff --git a/libcef_dll/cpptoc/frame_cpptoc.cc b/libcef_dll/cpptoc/frame_cpptoc.cc index 7e57c2826..f0a7668c0 100644 --- a/libcef_dll/cpptoc/frame_cpptoc.cc +++ b/libcef_dll/cpptoc/frame_cpptoc.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=2ae26d9398bc7ed5b997aa5dae4811c74395808e$ +// $hash=1edf2a7d9f2dc18f4422c9651554577735b83b66$ // #include "libcef_dll/cpptoc/frame_cpptoc.h" @@ -311,21 +311,22 @@ cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) { return _retval.DetachToUserFree(); } -int64_t CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) { +cef_string_userfree_t CEF_CALLBACK +frame_get_identifier(struct _cef_frame_t* self) { shutdown_checker::AssertNotShutdown(); // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING DCHECK(self); if (!self) { - return 0; + return NULL; } // Execute - int64_t _retval = CefFrameCppToC::Get(self)->GetIdentifier(); + CefString _retval = CefFrameCppToC::Get(self)->GetIdentifier(); - // Return type: simple - return _retval; + // Return type: string + return _retval.DetachToUserFree(); } struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) { diff --git a/libcef_dll/ctocpp/browser_ctocpp.cc b/libcef_dll/ctocpp/browser_ctocpp.cc index ac78d279e..1c97bdd96 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.cc +++ b/libcef_dll/ctocpp/browser_ctocpp.cc @@ -9,11 +9,10 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=cb5630935d8f587b6942f6fba59faecaddd05fd9$ +// $hash=e70f513f9c68725d789b0343d9484802217e60ba$ // #include "libcef_dll/ctocpp/browser_ctocpp.h" -#include #include "libcef_dll/ctocpp/browser_host_ctocpp.h" #include "libcef_dll/ctocpp/frame_ctocpp.h" #include "libcef_dll/shutdown_checker.h" @@ -287,29 +286,37 @@ CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { } NO_SANITIZE("cfi-icall") -CefRefPtr CefBrowserCToCpp::GetFrame(int64_t identifier) { +CefRefPtr CefBrowserCToCpp::GetFrameByIdentifier( + const CefString& identifier) { shutdown_checker::AssertNotShutdown(); cef_browser_t* _struct = GetStruct(); - if (CEF_MEMBER_MISSING(_struct, get_frame_byident)) { + if (CEF_MEMBER_MISSING(_struct, get_frame_by_identifier)) { return nullptr; } // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + // Verify param: identifier; type: string_byref_const + DCHECK(!identifier.empty()); + if (identifier.empty()) { + return nullptr; + } + // Execute - cef_frame_t* _retval = _struct->get_frame_byident(_struct, identifier); + cef_frame_t* _retval = + _struct->get_frame_by_identifier(_struct, identifier.GetStruct()); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); } NO_SANITIZE("cfi-icall") -CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { +CefRefPtr CefBrowserCToCpp::GetFrameByName(const CefString& name) { shutdown_checker::AssertNotShutdown(); cef_browser_t* _struct = GetStruct(); - if (CEF_MEMBER_MISSING(_struct, get_frame)) { + if (CEF_MEMBER_MISSING(_struct, get_frame_by_name)) { return nullptr; } @@ -318,7 +325,7 @@ CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { // Unverified params: name // Execute - cef_frame_t* _retval = _struct->get_frame(_struct, name.GetStruct()); + cef_frame_t* _retval = _struct->get_frame_by_name(_struct, name.GetStruct()); // Return type: refptr_same return CefFrameCToCpp::Wrap(_retval); @@ -342,7 +349,8 @@ NO_SANITIZE("cfi-icall") size_t CefBrowserCToCpp::GetFrameCount() { } NO_SANITIZE("cfi-icall") -void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { +void CefBrowserCToCpp::GetFrameIdentifiers( + std::vector& identifiers) { shutdown_checker::AssertNotShutdown(); cef_browser_t* _struct = GetStruct(); @@ -352,33 +360,21 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - // Translate param: identifiers; type: simple_vec_byref - size_t identifiersSize = identifiers.size(); - size_t identifiersCount = std::max(GetFrameCount(), identifiersSize); - int64_t* identifiersList = NULL; - if (identifiersCount > 0) { - identifiersList = new int64_t[identifiersCount]; - DCHECK(identifiersList); - if (identifiersList) { - memset(identifiersList, 0, sizeof(int64_t) * identifiersCount); - } - if (identifiersList && identifiersSize > 0) { - for (size_t i = 0; i < identifiersSize; ++i) { - identifiersList[i] = identifiers[i]; - } - } + // Translate param: identifiers; type: string_vec_byref + cef_string_list_t identifiersList = cef_string_list_alloc(); + DCHECK(identifiersList); + if (identifiersList) { + transfer_string_list_contents(identifiers, identifiersList); } // Execute - _struct->get_frame_identifiers(_struct, &identifiersCount, identifiersList); + _struct->get_frame_identifiers(_struct, identifiersList); - // Restore param:identifiers; type: simple_vec_byref - identifiers.clear(); - if (identifiersCount > 0 && identifiersList) { - for (size_t i = 0; i < identifiersCount; ++i) { - identifiers.push_back(identifiersList[i]); - } - delete[] identifiersList; + // Restore param:identifiers; type: string_vec_byref + if (identifiersList) { + identifiers.clear(); + transfer_string_list_contents(identifiersList, identifiers); + cef_string_list_free(identifiersList); } } diff --git a/libcef_dll/ctocpp/browser_ctocpp.h b/libcef_dll/ctocpp/browser_ctocpp.h index e6ffd854f..49853efd0 100644 --- a/libcef_dll/ctocpp/browser_ctocpp.h +++ b/libcef_dll/ctocpp/browser_ctocpp.h @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=b8ff91ffe36573571248eadc6ab8d4761f186625$ +// $hash=0c9aa4c628bb305301c74720a07145c4d2ef7cde$ // #ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ @@ -52,10 +52,11 @@ class CefBrowserCToCpp bool HasDocument() override; CefRefPtr GetMainFrame() override; CefRefPtr GetFocusedFrame() override; - CefRefPtr GetFrame(int64_t identifier) override; - CefRefPtr GetFrame(const CefString& name) override; + CefRefPtr GetFrameByIdentifier( + const CefString& identifier) override; + CefRefPtr GetFrameByName(const CefString& name) override; size_t GetFrameCount() override; - void GetFrameIdentifiers(std::vector& identifiers) override; + void GetFrameIdentifiers(std::vector& identifiers) override; void GetFrameNames(std::vector& names) override; }; diff --git a/libcef_dll/ctocpp/frame_ctocpp.cc b/libcef_dll/ctocpp/frame_ctocpp.cc index 6061968e2..7c46100ae 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.cc +++ b/libcef_dll/ctocpp/frame_ctocpp.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=602eca1cab570fe366f37038f73cef59ec5412bc$ +// $hash=2422c489d40f44ad21b8f80d284ec6375ae93689$ // #include "libcef_dll/ctocpp/frame_ctocpp.h" @@ -315,21 +315,23 @@ NO_SANITIZE("cfi-icall") CefString CefFrameCToCpp::GetName() { return _retvalStr; } -NO_SANITIZE("cfi-icall") int64_t CefFrameCToCpp::GetIdentifier() { +NO_SANITIZE("cfi-icall") CefString CefFrameCToCpp::GetIdentifier() { shutdown_checker::AssertNotShutdown(); cef_frame_t* _struct = GetStruct(); if (CEF_MEMBER_MISSING(_struct, get_identifier)) { - return 0; + return CefString(); } // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING // Execute - int64_t _retval = _struct->get_identifier(_struct); + cef_string_userfree_t _retval = _struct->get_identifier(_struct); - // Return type: simple - return _retval; + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; } NO_SANITIZE("cfi-icall") CefRefPtr CefFrameCToCpp::GetParent() { diff --git a/libcef_dll/ctocpp/frame_ctocpp.h b/libcef_dll/ctocpp/frame_ctocpp.h index 0238b8d7f..db5643385 100644 --- a/libcef_dll/ctocpp/frame_ctocpp.h +++ b/libcef_dll/ctocpp/frame_ctocpp.h @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=29692748ec447062f17a3cc634179fe3d3ebb4e0$ +// $hash=c70637482d64cbe5fd1bea33bf18950594a50dac$ // #ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ @@ -58,7 +58,7 @@ class CefFrameCToCpp bool IsMain() override; bool IsFocused() override; CefString GetName() override; - int64_t GetIdentifier() override; + CefString GetIdentifier() override; CefRefPtr GetParent() override; CefString GetURL() override; CefRefPtr GetBrowser() override; diff --git a/patch/patch.cfg b/patch/patch.cfg index b89c3d48d..6feda6bd1 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -696,27 +696,6 @@ patches = [ # https://github.com/chromiumembedded/cef/issues/3606 'name': 'win_app_icon_3606' }, - { - # linux: Disable compiler TLS in libxml2. - # https://github.com/chromiumembedded/cef/issues/3616 - 'name': 'linux_libxml_tls_3616' - }, - { - # linux: Fix crash after x11::Connection destruction with - # multi-threaded-message-loop. - # https://chromium-review.googlesource.com/c/chromium/src/+/5115482 - 'name': 'linux_connection_5115482' - }, - { - # windows: Fix implicit conversion error when building cef_sandbox. - # https://chromium-review.googlesource.com/c/chromium/src/+/5120035 - 'name': 'base_allocator_5120035' - }, - { - # Fix mojom_ts_generator.py error with Python 3.11. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1422178 - 'name': 'mojo_generator_1422178' - }, { # chrome: mac: Support locale configuration. # https://github.com/chromiumembedded/cef/issues/3623 diff --git a/patch/patches/base_allocator_5120035.patch b/patch/patches/base_allocator_5120035.patch deleted file mode 100644 index 515d5f09a..000000000 --- a/patch/patches/base_allocator_5120035.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git base/allocator/partition_allocator/src/partition_alloc/thread_cache.h base/allocator/partition_allocator/src/partition_alloc/thread_cache.h -index 381245c374382..c98aed1663517 100644 ---- base/allocator/partition_allocator/src/partition_alloc/thread_cache.h -+++ base/allocator/partition_allocator/src/partition_alloc/thread_cache.h -@@ -184,7 +184,7 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) ThreadCacheRegistry { - internal::base::TimeDelta periodic_purge_next_interval_; - bool is_purging_configured_ = false; - -- uint8_t largest_active_bucket_index_ = internal::BucketIndexLookup::GetIndex( -+ uint16_t largest_active_bucket_index_ = internal::BucketIndexLookup::GetIndex( - ThreadCacheLimits::kDefaultSizeThreshold); - }; - diff --git a/patch/patches/base_command_line_1872.patch b/patch/patches/base_command_line_1872.patch index 40a7b12b4..9cf76af1f 100644 --- a/patch/patches/base_command_line_1872.patch +++ b/patch/patches/base_command_line_1872.patch @@ -1,8 +1,8 @@ diff --git base/command_line.cc base/command_line.cc -index d762b168a9ccf..f58b4f783df16 100644 +index 69e4303165259..682e8d2bfa6ce 100644 --- base/command_line.cc +++ base/command_line.cc -@@ -346,11 +346,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, +@@ -355,11 +355,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string, #if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS) sequence_checker_.Check(); #endif diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 54f8911f6..764f6a89e 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,16 +1,16 @@ diff --git base/BUILD.gn base/BUILD.gn -index 3d538b3370caa..5a4ba79e0af64 100644 +index c00c41bc2c7fd..166b3e74fd3bd 100644 --- base/BUILD.gn +++ base/BUILD.gn -@@ -40,6 +40,7 @@ import("//build/config/ui.gni") - import("//build/nocompile.gni") +@@ -41,6 +41,7 @@ import("//build/nocompile.gni") import("//build/timestamp.gni") + import("//build/util/process_version.gni") import("//build_overrides/build.gni") +import("//cef/libcef/features/features.gni") import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") -@@ -1483,7 +1484,11 @@ component("base") { +@@ -1494,7 +1495,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 3d538b3370caa..5a4ba79e0af64 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1907,6 +1912,12 @@ component("base") { +@@ -1918,6 +1923,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -88,11 +88,11 @@ index 29626e5853c6e..2fb1c61504c5d 100644 #else #include "base/hash/sha1_boringssl.h" diff --git base/rand_util.h base/rand_util.h -index 8387bc9596ad7..c3dafe80e33b7 100644 +index 00e901a3262ca..88ce372eb0a1a 100644 --- base/rand_util.h +++ base/rand_util.h -@@ -16,8 +16,9 @@ - #include "base/compiler_specific.h" +@@ -17,8 +17,9 @@ + #include "base/containers/span.h" #include "base/gtest_prod_util.h" #include "build/build_config.h" +#include "cef/libcef/features/features.h" @@ -102,7 +102,7 @@ index 8387bc9596ad7..c3dafe80e33b7 100644 #include "third_party/boringssl/src/include/openssl/rand.h" #endif -@@ -122,7 +123,7 @@ class RandomBitGenerator { +@@ -125,7 +126,7 @@ class RandomBitGenerator { ~RandomBitGenerator() = default; }; @@ -112,7 +112,7 @@ index 8387bc9596ad7..c3dafe80e33b7 100644 public: using result_type = uint64_t; diff --git base/rand_util_win.cc base/rand_util_win.cc -index 549f4362af8b6..f08b1b2e7f061 100644 +index 6aae763d98715..7f55cb70e94d2 100644 --- base/rand_util_win.cc +++ base/rand_util_win.cc @@ -15,8 +15,12 @@ @@ -150,21 +150,21 @@ index 549f4362af8b6..f08b1b2e7f061 100644 @@ -66,6 +75,7 @@ decltype(&ProcessPrng) GetProcessPrng() { } - void RandBytes(void* output, size_t output_length, bool avoid_allocation) { + void RandBytes(span output, bool avoid_allocation) { +#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD) if (!avoid_allocation && internal::UseBoringSSLForRandBytes()) { // Ensure BoringSSL is initialized so it can use things like RDRAND. CRYPTO_library_init(); -@@ -73,6 +83,7 @@ void RandBytes(void* output, size_t output_length, bool avoid_allocation) { - (void)RAND_bytes(static_cast(output), output_length); +@@ -73,6 +83,7 @@ void RandBytes(span output, bool avoid_allocation) { + (void)RAND_bytes(output.data(), output.size()); return; } +#endif // !BUILDFLAG(IS_CEF_SANDBOX_BUILD) static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng(); - BOOL success = process_prng_fn(static_cast(output), output_length); + BOOL success = diff --git base/unguessable_token.cc base/unguessable_token.cc -index 44bfc3e2624d5..cccb306a383ce 100644 +index da65502f75c3a..8b9d6eec4a1e2 100644 --- base/unguessable_token.cc +++ base/unguessable_token.cc @@ -10,8 +10,9 @@ @@ -178,7 +178,7 @@ index 44bfc3e2624d5..cccb306a383ce 100644 #include "third_party/boringssl/src/include/openssl/mem.h" #endif -@@ -46,7 +47,7 @@ absl::optional UnguessableToken::Deserialize(uint64_t high, +@@ -57,7 +58,7 @@ absl::optional UnguessableToken::DeserializeFromString( } bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) { diff --git a/patch/patches/base_sandbox_3519.patch b/patch/patches/base_sandbox_3519.patch index e5f9cb9e2..df319d812 100644 --- a/patch/patches/base_sandbox_3519.patch +++ b/patch/patches/base_sandbox_3519.patch @@ -1,5 +1,5 @@ diff --git base/ranges/ranges.h base/ranges/ranges.h -index 641bbaf2c7576..afdd641e38452 100644 +index 27eac4f3a4c39..2cb63bec79e63 100644 --- base/ranges/ranges.h +++ base/ranges/ranges.h @@ -30,12 +30,14 @@ constexpr T* begin(std::array& array, priority_tag<2> tag) { diff --git a/patch/patches/base_test_4396276.patch b/patch/patches/base_test_4396276.patch index c8885c2c5..a9fd5ce43 100644 --- a/patch/patches/base_test_4396276.patch +++ b/patch/patches/base_test_4396276.patch @@ -1,5 +1,5 @@ diff --git base/test/BUILD.gn base/test/BUILD.gn -index f2026e17e6638..aec8bd2743f3a 100644 +index bffe24a080a34..9191487142995 100644 --- base/test/BUILD.gn +++ base/test/BUILD.gn @@ -189,11 +189,6 @@ static_library("test_support") { @@ -14,7 +14,7 @@ index f2026e17e6638..aec8bd2743f3a 100644 deps += [ ":amalgamated_perfetto_sql_stdlib", ":gen_cc_chrome_track_event_descriptor", -@@ -559,7 +554,7 @@ if (enable_base_tracing) { +@@ -560,7 +555,7 @@ if (enable_base_tracing) { # processor depends on dev_sqlite. The two share the same symbols but have # different implementations, so we need to hide dev_sqlite in this shared # library even in non-component builds to prevent duplicate symbols. @@ -23,7 +23,7 @@ index f2026e17e6638..aec8bd2743f3a 100644 if (is_ios) { _target_type = "ios_framework_bundle" } -@@ -568,6 +563,8 @@ if (enable_base_tracing) { +@@ -569,6 +564,8 @@ if (enable_base_tracing) { defines = [ "TEST_TRACE_PROCESSOR_IMPL" ] testonly = true sources = [ @@ -32,7 +32,7 @@ index f2026e17e6638..aec8bd2743f3a 100644 "test_trace_processor_export.h", "test_trace_processor_impl.cc", "test_trace_processor_impl.h", -@@ -585,33 +582,6 @@ if (enable_base_tracing) { +@@ -586,33 +583,6 @@ if (enable_base_tracing) { output_name = "TestTraceProcessor" bundle_deps_filter = [ "//third_party/icu:icudata" ] } diff --git a/patch/patches/blink_web_element_4200240.patch b/patch/patches/blink_web_element_4200240.patch index f3b80114a..1839bd44c 100644 --- a/patch/patches/blink_web_element_4200240.patch +++ b/patch/patches/blink_web_element_4200240.patch @@ -1,10 +1,10 @@ diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h -index 02fa305524694..29e77bafa710c 100644 +index 9cd08e8b26410..d2dca33bdc62e 100644 --- third_party/blink/public/web/web_element.h +++ third_party/blink/public/web/web_element.h -@@ -81,6 +81,9 @@ class BLINK_EXPORT WebElement : public WebNode { - void SetAttribute(const WebString& name, const WebString& value); +@@ -82,6 +82,9 @@ class BLINK_EXPORT WebElement : public WebNode { WebString TextContent() const; + WebString TextContentAbridged(unsigned int max_length) const; WebString InnerHTML() const; + WebString AttributeLocalName(unsigned index) const; + WebString AttributeValue(unsigned index) const; @@ -13,7 +13,7 @@ index 02fa305524694..29e77bafa710c 100644 // Returns true if the element's contenteditable attribute is in the true // state or in the plaintext-only state: diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc -index e8c7cb3cdb29f..1cf10e52779e1 100644 +index 0c2400696ecbc..3dd6e5574eb39 100644 --- third_party/blink/renderer/core/exported/web_element.cc +++ third_party/blink/renderer/core/exported/web_element.cc @@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name, diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 7f0806081..6009cfc63 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 307d5b7ffca63..9a8f0a4d3d7bd 100644 +index 24f9538d6fd0d..0d57d47d70d38 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc @@ -209,7 +209,7 @@ BrowserTaskExecutor::OnUserInputStart() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 69a11d6cc..87b7a96c5 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,5 +1,5 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index 0f781fe1c2b2e..6456de7ad1c39 100644 +index 72b1e46a91e78..2aea3ca80157e 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc @@ -1878,6 +1878,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin( @@ -20,10 +20,10 @@ index 0f781fe1c2b2e..6456de7ad1c39 100644 // Make an exception to allow most visited tiles to commit in diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 64248db4bfc64..ea5037256498f 100644 +index dead84566f239..9fffaa0c20c97 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -7610,10 +7610,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( +@@ -7772,10 +7772,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo( bool use_opaque_origin = (sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) == network::mojom::WebSandboxFlags::kOrigin; @@ -47,7 +47,7 @@ index 64248db4bfc64..ea5037256498f 100644 } return origin_and_debug_info; -@@ -7721,6 +7733,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7883,6 +7895,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { DetermineInitiatorRelationship(initiator_rfh, frame_tree_node_->current_frame_host())); diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 548f2c071..8b70ffa1b 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index de1cd6efc67b4..956d45892f31c 100644 +index 89b4755ac8b39..453a1758fa253 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -2160,8 +2160,6 @@ config("thin_archive") { +@@ -2162,8 +2162,6 @@ config("thin_archive") { # confuses lldb. if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 0529d5689..ef3219954 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 6572022524828..f39800b4a7da2 100644 +index 81dceec0b449c..ca76a507bb657 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni") @@ -10,7 +10,7 @@ index 6572022524828..f39800b4a7da2 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -2043,6 +2044,7 @@ static_library("browser") { +@@ -2025,6 +2026,7 @@ static_library("browser") { "//build/config/chromebox_for_meetings:buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index 6572022524828..f39800b4a7da2 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2700,6 +2702,10 @@ static_library("browser") { +@@ -2679,6 +2681,10 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 34e31b0b0..fcfb3ad48 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/browser_process.h chrome/browser/browser_process.h -index e50822a2c8d5f..b44dd9191ed08 100644 +index 3e7de43022a41..21354d14d11c3 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h @@ -207,9 +207,9 @@ class BrowserProcess { @@ -14,10 +14,10 @@ index e50822a2c8d5f..b44dd9191ed08 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 15e4fdcda89d2..66d26abb33af5 100644 +index 57cb42c63eb6a..b8df2da97a7a1 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -1063,18 +1063,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -1072,18 +1072,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -38,10 +38,10 @@ index 15e4fdcda89d2..66d26abb33af5 100644 std::unique_ptr manager) { background_mode_manager_ = std::move(manager); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index af96779d25b87..4ef9f7945136c 100644 +index e569e2d1a0dd0..fc5703af98b58 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -191,8 +191,8 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; @@ -52,10 +52,10 @@ index af96779d25b87..4ef9f7945136c 100644 std::unique_ptr manager) override; #endif diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index 1fbc225de7b84..55847e48ed0c2 100644 +index bfffa272e6458..460a35e0c708f 100644 --- chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc -@@ -157,12 +157,14 @@ void BrowserCloseManager::CloseBrowsers() { +@@ -158,12 +158,14 @@ void BrowserCloseManager::CloseBrowsers() { // exit can restore all browsers open before exiting. ProfileManager::ShutdownSessionServices(); #endif diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index f88506d59..1031f7889 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,7 +13,7 @@ index 2480282a19d12..dbd1fbf8a15b5 100644 return false; } diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc -index d64ccdc765368..5e8f892ff793d 100644 +index ec31f050c1abb..ec30fd71f536d 100644 --- chrome/browser/devtools/devtools_window.cc +++ chrome/browser/devtools/devtools_window.cc @@ -31,6 +31,7 @@ @@ -24,7 +24,7 @@ index d64ccdc765368..5e8f892ff793d 100644 #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_tabstrip.h" #include "chrome/browser/ui/browser_window.h" -@@ -1189,6 +1190,13 @@ DevToolsWindow* DevToolsWindow::Create( +@@ -1193,6 +1194,13 @@ DevToolsWindow* DevToolsWindow::Create( !browser->is_type_normal()) { can_dock = false; } @@ -38,7 +38,7 @@ index d64ccdc765368..5e8f892ff793d 100644 } // Create WebContents with devtools. -@@ -1760,12 +1768,29 @@ void DevToolsWindow::CreateDevToolsBrowser() { +@@ -1800,12 +1808,29 @@ void DevToolsWindow::CreateDevToolsBrowser() { Browser::CreationStatus::kOk) { return; } @@ -75,10 +75,10 @@ index d64ccdc765368..5e8f892ff793d 100644 } diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index fc880e0dd1eb8..d8b3e4e21d092 100644 +index b0146268b3384..742d5b50d054f 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni") +@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni") import("//build/config/features.gni") import("//build/config/ozone.gni") import("//build/config/ui.gni") @@ -86,7 +86,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/ash/components/assistant/assistant.gni") -@@ -382,6 +383,10 @@ static_library("ui") { +@@ -395,6 +396,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -97,7 +97,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 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 -@@ -407,6 +412,7 @@ static_library("ui") { +@@ -420,6 +425,7 @@ static_library("ui") { "//build:chromeos_buildflags", "//build/config/chromebox_for_meetings:buildflags", "//cc/paint", @@ -105,7 +105,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644 "//chrome:resources", "//chrome:strings", "//chrome/app:chrome_dll_resources", -@@ -2863,6 +2869,8 @@ static_library("ui") { +@@ -2918,6 +2924,8 @@ static_library("ui") { "views/apps/app_dialog/app_block_dialog_view.h", "views/apps/app_dialog/app_pause_dialog_view.cc", "views/apps/app_dialog/app_pause_dialog_view.h", @@ -114,7 +114,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644 "views/apps/app_info_dialog/arc_app_info_links_panel.cc", "views/apps/app_info_dialog/arc_app_info_links_panel.h", "views/apps/chrome_app_window_client_views_chromeos.cc", -@@ -4874,8 +4882,6 @@ static_library("ui") { +@@ -4956,8 +4964,6 @@ static_library("ui") { "views/accessibility/theme_tracking_non_accessible_image_view.h", "views/apps/app_dialog/app_dialog_view.cc", "views/apps/app_dialog/app_dialog_view.h", @@ -123,7 +123,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644 "views/apps/app_info_dialog/app_info_dialog_container.cc", "views/apps/app_info_dialog/app_info_dialog_container.h", "views/apps/app_info_dialog/app_info_dialog_views.cc", -@@ -6605,6 +6611,7 @@ static_library("ui") { +@@ -6725,6 +6731,7 @@ static_library("ui") { if (enable_printing) { deps += [ "//components/printing/browser", @@ -132,10 +132,10 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644 ] } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index aa28c2ec1efb2..7ad06de961e9d 100644 +index a001626c9f470..52d803a867172 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -262,6 +262,25 @@ +@@ -263,6 +263,25 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -161,7 +161,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -458,6 +477,10 @@ Browser::Browser(const CreateParams& params) +@@ -459,6 +478,10 @@ Browser::Browser(const CreateParams& params) type_(params.type), profile_(params.profile), window_(nullptr), @@ -185,7 +185,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } /////////////////////////////////////////////////////////////////////////////// -@@ -1061,6 +1090,8 @@ void Browser::WindowFullscreenStateChanged() { +@@ -1076,6 +1105,8 @@ void Browser::WindowFullscreenStateChanged() { ->WindowFullscreenStateChanged(); command_controller_->FullscreenStateChanged(); UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); @@ -194,7 +194,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } void Browser::FullscreenTopUIStateChanged() { -@@ -1400,6 +1431,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1415,6 +1446,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -209,7 +209,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1407,8 +1446,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1422,8 +1461,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -229,8 +229,8 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 + return window()->HandleKeyboardEvent(event); } - bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1610,6 +1659,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, + bool Browser::TabsNeedBeforeUnloadFired() const { +@@ -1625,6 +1674,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -245,7 +245,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1767,6 +1824,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1782,6 +1839,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool should_show_loading_ui) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, should_show_loading_ui); @@ -254,7 +254,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1795,6 +1854,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1810,6 +1869,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -263,7 +263,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 if (!GetStatusBubble()) return; -@@ -1802,6 +1863,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1817,6 +1878,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -281,7 +281,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1826,6 +1898,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { +@@ -1841,6 +1913,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) { return false; } @@ -301,7 +301,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 void Browser::BeforeUnloadFired(WebContents* web_contents, bool proceed, bool* proceed_to_fire_unload) { -@@ -1925,6 +2010,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1940,6 +2025,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -312,7 +312,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } void Browser::RendererUnresponsive( -@@ -2069,11 +2158,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -2084,11 +2173,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -328,7 +328,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2266,6 +2359,15 @@ void Browser::RequestMediaAccessPermission( +@@ -2281,6 +2374,15 @@ void Browser::RequestMediaAccessPermission( content::WebContents* web_contents, const content::MediaStreamRequest& request, content::MediaResponseCallback callback) { @@ -344,7 +344,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 const extensions::Extension* extension = GetExtensionForOrigin(profile_, request.security_origin); MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( -@@ -2808,9 +2910,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { +@@ -2817,9 +2919,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) { // Browser, Getters for UI (private): StatusBubble* Browser::GetStatusBubble() { @@ -357,7 +357,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } // We hide the status bar for web apps windows as this matches native -@@ -2818,6 +2922,12 @@ StatusBubble* Browser::GetStatusBubble() { +@@ -2827,6 +2931,12 @@ StatusBubble* Browser::GetStatusBubble() { // mode, as the minimal browser UI includes the status bar. if (web_app::AppBrowserController::IsWebApp(this) && !app_controller()->HasMinimalUiButtons()) { @@ -370,7 +370,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 return nullptr; } -@@ -2954,6 +3064,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2963,6 +3073,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); web_contents_collection_.StopObserving(web_contents); } @@ -379,7 +379,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 } void Browser::TabDetachedAtImpl(content::WebContents* contents, -@@ -3108,6 +3220,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( +@@ -3117,6 +3229,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature( bool Browser::SupportsWindowFeatureImpl(WindowFeature feature, bool check_can_support) const { @@ -395,7 +395,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644 case TYPE_NORMAL: return NormalBrowserSupportsWindowFeature(feature, check_can_support); diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 91ff945f74fd3..bdf661d7fdfc9 100644 +index f1f279121056f..5758d8543d69e 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -22,6 +22,7 @@ @@ -417,9 +417,9 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 #if BUILDFLAG(IS_ANDROID) #error This file should only be included on desktop. #endif -@@ -331,6 +336,15 @@ class Browser : public TabStripModelObserver, +@@ -347,6 +352,15 @@ class Browser : public TabStripModelObserver, // Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE. - absl::optional pip_options; + std::optional pip_options; +#if BUILDFLAG(ENABLE_CEF) + // Opaque CEF-specific configuration. Will be propagated to new Browsers. @@ -433,7 +433,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -412,6 +426,13 @@ class Browser : public TabStripModelObserver, +@@ -428,6 +442,13 @@ class Browser : public TabStripModelObserver, update_ui_immediately_for_testing_ = true; } @@ -447,7 +447,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -486,6 +507,12 @@ class Browser : public TabStripModelObserver, +@@ -502,6 +523,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); base::WeakPtr AsWeakPtr() const; @@ -460,7 +460,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -875,11 +902,19 @@ class Browser : public TabStripModelObserver, +@@ -906,11 +933,19 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -480,7 +480,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 void BeforeUnloadFired(content::WebContents* source, bool proceed, bool* proceed_to_fire_unload) override; -@@ -1220,6 +1255,10 @@ class Browser : public TabStripModelObserver, +@@ -1248,6 +1283,10 @@ class Browser : public TabStripModelObserver, // This Browser's window. raw_ptr window_; @@ -491,7 +491,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 std::unique_ptr const tab_strip_model_delegate_; std::unique_ptr const tab_strip_model_; -@@ -1289,6 +1328,8 @@ class Browser : public TabStripModelObserver, +@@ -1314,6 +1353,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -501,10 +501,10 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644 UnloadController unload_controller_; diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 3e4f480c35ea3..7dd7609b36367 100644 +index e805d59f87b45..21e7d5fb70a7d 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -296,6 +296,10 @@ std::pair GetBrowserAndTabForDisposition( +@@ -293,6 +293,10 @@ std::pair GetBrowserAndTabForDisposition( : 1.0; browser_params.pip_options = pip_options; @@ -515,7 +515,7 @@ index 3e4f480c35ea3..7dd7609b36367 100644 const BrowserWindow* const browser_window = params.browser->window(); const gfx::NativeWindow native_window = browser_window ? browser_window->GetNativeWindow() -@@ -581,6 +585,13 @@ std::unique_ptr CreateTargetContents( +@@ -578,6 +582,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); @@ -530,7 +530,7 @@ index 3e4f480c35ea3..7dd7609b36367 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 8154aaa9c2aff..1e88bfed111ee 100644 +index 435851d0f6f11..43a70f915a22c 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc @@ -33,9 +33,13 @@ content::WebContents* AddAndReturnTabAt( diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 82b6f64bd..29a9001fc 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 6f842a7535a56..faaee032e82bd 100644 +index 36335ba63ee83..e14005d6a4e86 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -9,6 +9,7 @@ @@ -10,7 +10,7 @@ index 6f842a7535a56..faaee032e82bd 100644 #include "chrome/browser/content_settings/one_time_permission_provider.h" #include "chrome/browser/permissions/one_time_permissions_tracker_factory.h" #include "chrome/browser/profiles/off_the_record_profile_impl.h" -@@ -23,6 +24,10 @@ +@@ -24,6 +25,10 @@ #include "extensions/buildflags/buildflags.h" #include "ui/webui/webui_allowlist_provider.h" @@ -21,9 +21,9 @@ index 6f842a7535a56..faaee032e82bd 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/trace_event/trace_event.h" #include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h" -@@ -68,7 +73,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() - DependsOn(OneTimePermissionsTrackerFactory::GetInstance()); +@@ -64,7 +69,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() #endif + DependsOn(OneTimePermissionsTrackerFactory::GetInstance()); #if BUILDFLAG(ENABLE_EXTENSIONS) +#if BUILDFLAG(ENABLE_CEF) + if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) { @@ -35,7 +35,7 @@ index 6f842a7535a56..faaee032e82bd 100644 #endif // Used by way of ShouldRestoreOldSessionCookies(). #if BUILDFLAG(ENABLE_SESSION_SERVICE) -@@ -132,6 +143,9 @@ scoped_refptr +@@ -118,6 +129,9 @@ scoped_refptr std::move(allowlist_provider)); #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -45,7 +45,7 @@ index 6f842a7535a56..faaee032e82bd 100644 // These must be registered before before the HostSettings are passed over to // the IOThread. Simplest to do this on construction. settings_map->RegisterProvider( -@@ -144,6 +158,9 @@ scoped_refptr +@@ -130,6 +144,9 @@ scoped_refptr // the case where profile->IsOffTheRecord() is true? And what is the // interaction with profile->IsGuestSession()? false)); @@ -56,10 +56,10 @@ index 6f842a7535a56..faaee032e82bd 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) supervised_user::SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index c62382c00a48b..a560eafc3ec80 100644 +index 54c18d58aea64..66d3721a392ec 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc -@@ -145,7 +145,7 @@ ContentSetting GetContentSettingFromRules( +@@ -143,7 +143,7 @@ ContentSetting GetContentSettingFromRules( return rule.GetContentSetting(); } } diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index c45c4a8cb..e2f4b0f08 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc -index 331f5dc64de39..803b471e9764a 100644 +index 5ebec17f77393..f94c18f8de78e 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -355,6 +355,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -360,6 +360,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 331f5dc64de39..803b471e9764a 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -609,6 +616,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -616,6 +623,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index 331f5dc64de39..803b471e9764a 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -833,6 +844,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -857,6 +868,14 @@ RenderViewContextMenu::RenderViewContextMenu( pdf_ocr_submenu_model_ = std::make_unique(this); #endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE) @@ -42,7 +42,7 @@ index 331f5dc64de39..803b471e9764a 100644 observers_.AddObserver(&autofill_context_menu_manager_); } -@@ -1300,6 +1319,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1331,6 +1350,12 @@ void RenderViewContextMenu::InitMenu() { autofill::PopupHidingReason::kContextMenuOpened); } } @@ -55,7 +55,7 @@ index 331f5dc64de39..803b471e9764a 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -3452,6 +3477,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( +@@ -3515,6 +3540,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting( execute_plugin_action_callback_ = std::move(cb); } @@ -69,10 +69,10 @@ index 331f5dc64de39..803b471e9764a 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index efd9049faacfd..8a75cdb0dfcfa 100644 +index d8f1b10c18771..00702b672353d 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -157,6 +157,12 @@ class RenderViewContextMenu +@@ -159,6 +159,12 @@ class RenderViewContextMenu } #endif @@ -85,7 +85,7 @@ index efd9049faacfd..8a75cdb0dfcfa 100644 protected: Profile* GetProfile() const; -@@ -465,6 +471,9 @@ class RenderViewContextMenu +@@ -471,6 +477,9 @@ class RenderViewContextMenu // built. bool is_protocol_submenu_valid_ = false; @@ -96,7 +96,7 @@ index efd9049faacfd..8a75cdb0dfcfa 100644 // "Use enhanced spell check" items. std::unique_ptr spelling_suggestions_menu_observer_; diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc -index 18283c801689e..9838c25d6e584 100644 +index c88a77a0b49e2..785ded198741e 100644 --- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc @@ -149,6 +149,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent, @@ -110,10 +110,10 @@ index 18283c801689e..9838c25d6e584 100644 // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index ffe4002bc8ca3..b179f39ebdd59 100644 +index ad4f00959e98b..54368373a6a99 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc -@@ -382,6 +382,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { +@@ -374,6 +374,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { return false; } @@ -132,7 +132,7 @@ index ffe4002bc8ca3..b179f39ebdd59 100644 command_executed_ = true; RecordUsedItem(id); diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h -index ce17ade37f154..89bbd8609e815 100644 +index 6249528399f44..9c4dd0d8f0100 100644 --- components/renderer_context_menu/render_view_context_menu_base.h +++ components/renderer_context_menu/render_view_context_menu_base.h @@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate, diff --git a/patch/patches/chrome_browser_dialogs_native.patch b/patch/patches/chrome_browser_dialogs_native.patch index 9d24f40ba..de5c2d3bb 100644 --- a/patch/patches/chrome_browser_dialogs_native.patch +++ b/patch/patches/chrome_browser_dialogs_native.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc -index 391482bbfa815..0dbd682dd35a3 100644 +index 25ccc6c633df5..7d439c4d9cc3c 100644 --- chrome/browser/file_select_helper.cc +++ chrome/browser/file_select_helper.cc @@ -20,6 +20,7 @@ @@ -10,7 +10,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/common.h" #include "chrome/browser/platform_util.h" -@@ -258,6 +259,13 @@ void FileSelectHelper::OnListFile( +@@ -242,6 +243,13 @@ void FileSelectHelper::OnListFile( void FileSelectHelper::LaunchConfirmationDialog( const base::FilePath& path, std::vector selected_files) { @@ -24,7 +24,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 ShowFolderUploadConfirmationDialog( path, base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this), -@@ -342,6 +350,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( +@@ -326,6 +334,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded( if (AbortIfWebContentsDestroyed()) return; @@ -37,7 +37,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 #if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS) enterprise_connectors::ContentAnalysisDelegate::Data data; if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled( -@@ -472,7 +486,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { +@@ -456,7 +470,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() { std::unique_ptr FileSelectHelper::GetFileTypesFromAcceptType( @@ -47,7 +47,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 auto base_file_type = std::make_unique(); if (accept_types.empty()) return base_file_type; -@@ -485,17 +500,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -469,17 +484,24 @@ FileSelectHelper::GetFileTypesFromAcceptType( std::vector* extensions = &file_type->extensions.back(); @@ -73,7 +73,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 } else { if (!base::IsStringASCII(accept_type)) continue; -@@ -506,10 +528,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -490,10 +512,18 @@ FileSelectHelper::GetFileTypesFromAcceptType( description_id = IDS_AUDIO_FILES; else if (ascii_type == "video/*") description_id = IDS_VIDEO_FILES; @@ -94,7 +94,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 if (extensions->size() > old_extension_size) valid_type_count++; } -@@ -534,6 +564,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -518,6 +548,15 @@ FileSelectHelper::GetFileTypesFromAcceptType( l10n_util::GetStringUTF16(description_id)); } @@ -110,7 +110,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 return file_type; } -@@ -541,7 +580,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( +@@ -525,7 +564,8 @@ FileSelectHelper::GetFileTypesFromAcceptType( void FileSelectHelper::RunFileChooser( content::RenderFrameHost* render_frame_host, scoped_refptr listener, @@ -120,7 +120,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 Profile* profile = Profile::FromBrowserContext( render_frame_host->GetProcess()->GetBrowserContext()); -@@ -560,6 +600,7 @@ void FileSelectHelper::RunFileChooser( +@@ -544,6 +584,7 @@ void FileSelectHelper::RunFileChooser( // message. scoped_refptr file_select_helper( new FileSelectHelper(profile)); @@ -128,7 +128,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 file_select_helper->RunFileChooser(render_frame_host, std::move(listener), params.Clone()); } -@@ -611,7 +652,8 @@ void FileSelectHelper::RunFileChooser( +@@ -595,7 +636,8 @@ void FileSelectHelper::RunFileChooser( } void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) { @@ -139,7 +139,7 @@ index 391482bbfa815..0dbd682dd35a3 100644 params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH : ui::SelectFileDialog::FileTypeInfo::ANY_PATH; diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h -index 57dae0b3670ae..85eeda4cbaa5b 100644 +index bd975f96585b8..abf0a24222ded 100644 --- chrome/browser/file_select_helper.h +++ chrome/browser/file_select_helper.h @@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< @@ -152,7 +152,7 @@ index 57dae0b3670ae..85eeda4cbaa5b 100644 // Enumerates all the files in directory. static void EnumerateDirectory( -@@ -268,7 +269,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -262,7 +263,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe< // |accept_types| contains only valid lowercased MIME types or file extensions // beginning with a period (.). static std::unique_ptr @@ -162,7 +162,7 @@ index 57dae0b3670ae..85eeda4cbaa5b 100644 // Check the accept type is valid. It is expected to be all lower case with // no whitespace. -@@ -329,6 +331,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< +@@ -323,6 +325,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe< // Set to false in unit tests since there is no WebContents. bool abort_on_missing_web_contents_in_tests_ = true; @@ -238,10 +238,10 @@ index 9361287ac3411..59567b485bf99 100644 paths.push_back(std::move(path)); } diff --git ui/shell_dialogs/select_file_dialog.cc ui/shell_dialogs/select_file_dialog.cc -index e2c00b2ec1532..a2e8753766597 100644 +index 68dd62159b686..e94831cd44a2d 100644 --- ui/shell_dialogs/select_file_dialog.cc +++ ui/shell_dialogs/select_file_dialog.cc -@@ -88,8 +88,10 @@ void SelectFileDialog::SetFactory( +@@ -73,8 +73,10 @@ void SelectFileDialog::SetFactory( // static scoped_refptr SelectFileDialog::Create( Listener* listener, @@ -255,10 +255,10 @@ index e2c00b2ec1532..a2e8753766597 100644 return CreateSelectFileDialog(listener, std::move(policy)); } diff --git ui/shell_dialogs/select_file_dialog.h ui/shell_dialogs/select_file_dialog.h -index 65f0342389117..c4b79bc0dab91 100644 +index 9b12fae59c3cc..dfb534a6f06e6 100644 --- ui/shell_dialogs/select_file_dialog.h +++ ui/shell_dialogs/select_file_dialog.h -@@ -116,7 +116,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -102,7 +102,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog // is refcounted and uses a background thread. static scoped_refptr Create( Listener* listener, @@ -268,7 +268,7 @@ index 65f0342389117..c4b79bc0dab91 100644 SelectFileDialog(const SelectFileDialog&) = delete; SelectFileDialog& operator=(const SelectFileDialog&) = delete; -@@ -213,6 +214,19 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -199,6 +200,19 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog const GURL* caller = nullptr); bool HasMultipleFileTypeChoices(); @@ -288,7 +288,7 @@ index 65f0342389117..c4b79bc0dab91 100644 protected: friend class base::RefCountedThreadSafe; -@@ -238,6 +252,11 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -224,6 +238,11 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog // The listener to be notified of selection completion. raw_ptr listener_; @@ -300,7 +300,7 @@ index 65f0342389117..c4b79bc0dab91 100644 private: // Tests if the file selection dialog can be displayed by // testing if the AllowFileSelectionDialogs-Policy is -@@ -250,8 +269,6 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog +@@ -236,8 +255,6 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog // Returns true if the dialog has multiple file type choices. virtual bool HasMultipleFileTypeChoicesImpl() = 0; @@ -323,10 +323,10 @@ index c7acd9b05fbb8..3e95e4125fa24 100644 } // namespace ui diff --git ui/shell_dialogs/select_file_dialog_mac.mm ui/shell_dialogs/select_file_dialog_mac.mm -index 0b8aaa3c0e4f0..fe01d3db2eabe 100644 +index bf99047fa53cf..0efdb76233331 100644 --- ui/shell_dialogs/select_file_dialog_mac.mm +++ ui/shell_dialogs/select_file_dialog_mac.mm -@@ -102,6 +102,10 @@ void SelectFileDialogImpl::SelectFileImpl( +@@ -107,6 +107,10 @@ void SelectFileDialogImpl::SelectFileImpl( mojo_window->CreateSelectFileDialog(std::move(receiver)); } else { NSWindow* ns_window = gfx_window.GetNativeNSWindow(); @@ -338,10 +338,10 @@ index 0b8aaa3c0e4f0..fe01d3db2eabe 100644 std::make_unique(ns_window), std::move(receiver)); diff --git ui/shell_dialogs/select_file_dialog_win.cc ui/shell_dialogs/select_file_dialog_win.cc -index 04aa920d91675..93ea4988839cf 100644 +index cb1a0d203b448..307158e8117fe 100644 --- ui/shell_dialogs/select_file_dialog_win.cc +++ ui/shell_dialogs/select_file_dialog_win.cc -@@ -252,6 +252,8 @@ void SelectFileDialogImpl::SelectFileImpl( +@@ -253,6 +253,8 @@ void SelectFileDialogImpl::SelectFileImpl( HWND owner = owning_window && owning_window->GetRootWindow() ? owning_window->GetHost()->GetAcceleratedWidget() : nullptr; diff --git a/patch/patches/chrome_browser_dialogs_widget.patch b/patch/patches/chrome_browser_dialogs_widget.patch index df7ee91e4..42662997e 100644 --- a/patch/patches/chrome_browser_dialogs_widget.patch +++ b/patch/patches/chrome_browser_dialogs_widget.patch @@ -12,7 +12,7 @@ index b169371e4d42f..509e4bda85b47 100644 // on the screen, we can't actually attach to it. parent_window = nullptr; diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc -index 9e07412327ce9..3ac78725eba18 100644 +index 3daf40d463e32..dc3712bf6dc89 100644 --- components/constrained_window/constrained_window_views.cc +++ components/constrained_window/constrained_window_views.cc @@ -105,15 +105,24 @@ void UpdateModalDialogPosition(views::Widget* widget, @@ -91,7 +91,7 @@ index 9e07412327ce9..3ac78725eba18 100644 } } // namespace -@@ -224,7 +219,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, +@@ -234,7 +229,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog, views::Widget* widget = views::DialogDelegate::CreateDialogWidget( dialog, nullptr, @@ -101,7 +101,7 @@ index 9e07412327ce9..3ac78725eba18 100644 widget->SetNativeWindowProperty( views::kWidgetIdentifierKey, const_cast(kConstrainedWindowWidgetIdentifier)); -@@ -246,8 +242,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, +@@ -256,8 +252,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, gfx::NativeView parent_view = parent ? CurrentClient()->GetDialogHostView(parent) : nullptr; @@ -116,7 +116,7 @@ index 9e07412327ce9..3ac78725eba18 100644 widget->SetNativeWindowProperty( views::kWidgetIdentifierKey, const_cast(kConstrainedWindowWidgetIdentifier)); -@@ -263,8 +264,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, +@@ -273,8 +274,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog, if (!requires_positioning) return widget; @@ -170,7 +170,7 @@ index 51ed6bcf6b540..c6e1161140655 100644 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; // Returns whether a dialog currently about to be shown should be activated. diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc -index 89942cb82dee4..ce30f3bb93fc0 100644 +index ed132b017f10e..590ab9760c36a 100644 --- ui/views/window/dialog_delegate.cc +++ ui/views/window/dialog_delegate.cc @@ -60,10 +60,12 @@ DialogDelegate::DialogDelegate() { @@ -239,7 +239,7 @@ index 89942cb82dee4..ce30f3bb93fc0 100644 // Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child // widgets to prevent top-level window behavior (independent movement, etc). diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h -index 083874eb3f0bc..2ccacfca7d413 100644 +index d0bd746875ed9..1643e6d841108 100644 --- ui/views/window/dialog_delegate.h +++ ui/views/window/dialog_delegate.h @@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate { diff --git a/patch/patches/chrome_browser_frame_mac.patch b/patch/patches/chrome_browser_frame_mac.patch index e5ed44a2a..b64b9cc29 100644 --- a/patch/patches/chrome_browser_frame_mac.patch +++ b/patch/patches/chrome_browser_frame_mac.patch @@ -33,7 +33,7 @@ index a5ee05ae5f5e9..97fd2e8da450e 100644 ~BrowserFrameMac() override; diff --git chrome/browser/ui/views/frame/browser_frame_mac.mm chrome/browser/ui/views/frame/browser_frame_mac.mm -index 1473ed154f906..bf861087fe292 100644 +index 24b68406431ce..5d58296a7a7f4 100644 --- chrome/browser/ui/views/frame/browser_frame_mac.mm +++ chrome/browser/ui/views/frame/browser_frame_mac.mm @@ -182,7 +182,14 @@ void BrowserFrameMac::OnWindowFullscreenTransitionComplete() { diff --git a/patch/patches/chrome_browser_permission_prompt.patch b/patch/patches/chrome_browser_permission_prompt.patch index 84e4ae6d4..fe4fab468 100644 --- a/patch/patches/chrome_browser_permission_prompt.patch +++ b/patch/patches/chrome_browser_permission_prompt.patch @@ -44,7 +44,7 @@ index ea1467d09700d..5537a99500e7f 100644 base::FeatureList::IsEnabled( features::kPeriodicSyncPermissionForDefaultSearchEngine) && diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc -index c26bff9382b26..8c93b7b8351c7 100644 +index 58b162e099e70..2dcfe0cda550a 100644 --- chrome/browser/permissions/chrome_permissions_client.cc +++ chrome/browser/permissions/chrome_permissions_client.cc @@ -14,6 +14,7 @@ @@ -55,7 +55,7 @@ index c26bff9382b26..8c93b7b8351c7 100644 #include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -186,6 +187,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker( +@@ -187,6 +188,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker( double ChromePermissionsClient::GetSiteEngagementScore( content::BrowserContext* browser_context, const GURL& origin) { @@ -65,7 +65,7 @@ index c26bff9382b26..8c93b7b8351c7 100644 return site_engagement::SiteEngagementService::Get( Profile::FromBrowserContext(browser_context)) ->GetScore(origin); -@@ -350,8 +354,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors( +@@ -358,8 +362,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors( std::make_unique()); selectors.emplace_back(std::make_unique( Profile::FromBrowserContext(browser_context))); @@ -77,7 +77,7 @@ index c26bff9382b26..8c93b7b8351c7 100644 } diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc -index b0374f3adafea..faf9e7102f571 100644 +index f020355c1969d..ff3c3e26b14bf 100644 --- chrome/browser/permissions/permission_manager_factory.cc +++ chrome/browser/permissions/permission_manager_factory.cc @@ -6,6 +6,7 @@ @@ -88,7 +88,7 @@ index b0374f3adafea..faf9e7102f571 100644 #include "chrome/browser/background_fetch/background_fetch_permission_context.h" #include "chrome/browser/background_sync/periodic_background_sync_permission_context.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -56,8 +57,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( +@@ -61,8 +62,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts( std::make_unique(profile); #endif // BUILDFLAG(IS_ANDROID) #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -142,10 +142,10 @@ index fbce13c16ad10..0512b2f09937e 100644 std::unique_ptr CreatePermissionPrompt( content::WebContents* web_contents, diff --git chrome/browser/ui/views/permissions/permission_prompt_factory.cc chrome/browser/ui/views/permissions/permission_prompt_factory.cc -index 3a4d21b89411f..75673d62f5738 100644 +index 3a1224da26b6c..24735fe79498d 100644 --- chrome/browser/ui/views/permissions/permission_prompt_factory.cc +++ chrome/browser/ui/views/permissions/permission_prompt_factory.cc -@@ -173,11 +173,28 @@ std::unique_ptr CreateQuietPrompt( +@@ -181,11 +181,28 @@ std::unique_ptr CreateQuietPrompt( } } @@ -175,7 +175,7 @@ index 3a4d21b89411f..75673d62f5738 100644 if (!browser) { DLOG(WARNING) << "Permission prompt suppressed because the WebContents is " diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc -index 07f3c7c86b22d..110e48d59a75a 100644 +index 402fe1588c459..091625f54b340 100644 --- components/embedder_support/permission_context_utils.cc +++ components/embedder_support/permission_context_utils.cc @@ -5,6 +5,7 @@ @@ -186,7 +186,7 @@ index 07f3c7c86b22d..110e48d59a75a 100644 #include "components/background_sync/background_sync_permission_context.h" #include "components/permissions/contexts/accessibility_permission_context.h" #include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h" -@@ -77,12 +78,19 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, +@@ -77,10 +78,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context, std::move(delegates.geolocation_permission_context_delegate), is_regular_profile); #elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS) @@ -196,12 +196,10 @@ index 07f3c7c86b22d..110e48d59a75a 100644 + browser_context, + std::move(delegates.geolocation_permission_context_delegate)); + } else { - DCHECK(delegates.geolocation_manager); permission_contexts[ContentSettingsType::GEOLOCATION] = std::make_unique( browser_context, - std::move(delegates.geolocation_permission_context_delegate), - delegates.geolocation_manager); + std::move(delegates.geolocation_permission_context_delegate)); + } #else permission_contexts[ContentSettingsType::GEOLOCATION] = diff --git a/patch/patches/chrome_browser_policy.patch b/patch/patches/chrome_browser_policy.patch index aaabb064c..f97d7c610 100644 --- a/patch/patches/chrome_browser_policy.patch +++ b/patch/patches/chrome_browser_policy.patch @@ -33,18 +33,18 @@ index 10085136f52ce..ec1be9babecc2 100644 } diff --git chrome/browser/policy/browser_dm_token_storage_mac.mm chrome/browser/policy/browser_dm_token_storage_mac.mm -index 5cb3cff75871c..51333ff7d85e2 100644 +index 27af6ec08f593..6dfab7c74e8da 100644 --- chrome/browser/policy/browser_dm_token_storage_mac.mm +++ chrome/browser/policy/browser_dm_token_storage_mac.mm -@@ -26,6 +26,7 @@ +@@ -27,6 +27,7 @@ #include "base/syslog_logging.h" #include "base/task/thread_pool.h" #include "base/threading/scoped_blocking_call.h" +#include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "chrome/common/chrome_paths.h" - #include "third_party/abseil-cpp/absl/types/optional.h" -@@ -47,11 +48,6 @@ + namespace policy { +@@ -47,11 +48,6 @@ const char kEnrollmentOptionsFilePath[] = FILE_PATH_LITERAL( "/Library/Google/Chrome/CloudManagementEnrollmentOptions"); const char kEnrollmentMandatoryOption[] = "Mandatory"; @@ -85,7 +85,7 @@ index 5cb3cff75871c..51333ff7d85e2 100644 @@ -138,12 +141,19 @@ bool GetEnrollmentTokenFromFile(std::string* enrollment_token) { } - absl::optional IsEnrollmentMandatoryByPolicy() { + std::optional IsEnrollmentMandatoryByPolicy() { + base::apple::ScopedCFTypeRef bundle_id_scoper( + ChromeBrowserPolicyConnector::GetBundleId()); + CFStringRef bundle_id = bundle_id_scoper.get(); @@ -101,11 +101,11 @@ index 5cb3cff75871c..51333ff7d85e2 100644 if (!value || !CFPreferencesAppValueIsForced( - kEnrollmentMandatoryOptionPolicyName, kBundleId)) { + kEnrollmentMandatoryOptionPolicyName, bundle_id)) { - return absl::optional(); + return std::optional(); } diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc -index c012642290973..3f4d1be7f2092 100644 +index c2ecd1b63f0d7..c83704788a803 100644 --- chrome/browser/policy/chrome_browser_policy_connector.cc +++ chrome/browser/policy/chrome_browser_policy_connector.cc @@ -13,11 +13,14 @@ @@ -135,7 +135,7 @@ index c012642290973..3f4d1be7f2092 100644 } // namespace ChromeBrowserPolicyConnector::ChromeBrowserPolicyConnector() -@@ -265,6 +273,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { +@@ -270,6 +278,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() { g_command_line_enabled_for_testing = true; } @@ -209,7 +209,7 @@ index c012642290973..3f4d1be7f2092 100644 base::flat_set ChromeBrowserPolicyConnector::device_affiliation_ids() const { #if BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -336,23 +411,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { +@@ -341,23 +416,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() { std::unique_ptr ChromeBrowserPolicyConnector::CreatePlatformProvider() { #if BUILDFLAG(IS_WIN) @@ -242,7 +242,7 @@ index c012642290973..3f4d1be7f2092 100644 auto loader = std::make_unique( base::ThreadPool::CreateSequencedTaskRunner( {base::MayBlock(), base::TaskPriority::BEST_EFFORT}), -@@ -362,7 +436,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { +@@ -367,7 +441,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() { std::move(loader)); #elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID) base::FilePath config_dir_path; @@ -252,7 +252,7 @@ index c012642290973..3f4d1be7f2092 100644 // If the folder containing the policy files doesn't exist, there's no need // to have a provider for them. Note that in verified boot, the folder diff --git chrome/browser/policy/chrome_browser_policy_connector.h chrome/browser/policy/chrome_browser_policy_connector.h -index daa1a4cf0820d..c33db32822fbf 100644 +index f6147bc3c59a6..78b1170dd52bb 100644 --- chrome/browser/policy/chrome_browser_policy_connector.h +++ chrome/browser/policy/chrome_browser_policy_connector.h @@ -28,6 +28,10 @@ @@ -266,7 +266,7 @@ index daa1a4cf0820d..c33db32822fbf 100644 class PrefService; namespace policy { -@@ -122,6 +126,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { +@@ -125,6 +129,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector { static void EnableCommandLineSupportForTesting(); @@ -304,7 +304,7 @@ index 1a2e78c3472ec..5d1bd95a15113 100644 #include "components/policy/policy_constants.h" namespace policy::path_parser { -@@ -97,16 +98,12 @@ +@@ -97,16 +98,12 @@ base::FilePath::StringType ExpandPathVariables( void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { // Since the configuration management infrastructure is not initialized when // this code runs, read the policy preference directly. @@ -355,10 +355,10 @@ index 8dbf958c189dd..6eaccc6688eca 100644 *dir = base::FilePath(policy::path_parser::ExpandPathVariables(value)); return true; diff --git chrome/common/chrome_paths.cc chrome/common/chrome_paths.cc -index 89678edacdadf..821c4448a8188 100644 +index 94843ce782e80..0e3cc5bdb0bd5 100644 --- chrome/common/chrome_paths.cc +++ chrome/common/chrome_paths.cc -@@ -523,7 +523,8 @@ bool PathProvider(int key, base::FilePath* result) { +@@ -539,7 +539,8 @@ bool PathProvider(int key, base::FilePath* result) { return false; } break; @@ -369,7 +369,7 @@ index 89678edacdadf..821c4448a8188 100644 cur = base::FilePath(policy::kPolicyPath); break; diff --git chrome/common/chrome_paths.h chrome/common/chrome_paths.h -index 03387b9680834..76191ba98e80b 100644 +index 4cde94111918e..aaf8245abd9a6 100644 --- chrome/common/chrome_paths.h +++ chrome/common/chrome_paths.h @@ -8,6 +8,7 @@ @@ -380,7 +380,7 @@ index 03387b9680834..76191ba98e80b 100644 #include "extensions/buildflags/buildflags.h" #include "third_party/widevine/cdm/buildflags.h" -@@ -47,7 +48,7 @@ enum { +@@ -48,7 +49,7 @@ enum { DIR_INTERNAL_PLUGINS, // Directory where internal plugins reside. DIR_COMPONENTS, // Directory where built-in implementations of // component-updated libraries or data reside. @@ -390,10 +390,10 @@ index 03387b9680834..76191ba98e80b 100644 // policy files that allow sys-admins // to set policies for chrome. This directory diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py -index a17b30c37e07a..adcdf25e38ed1 100755 +index d225da88a04fb..191bb6b56df40 100755 --- components/policy/tools/generate_policy_source.py +++ components/policy/tools/generate_policy_source.py -@@ -486,6 +486,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, +@@ -448,6 +448,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups, #include #include @@ -401,7 +401,7 @@ index a17b30c37e07a..adcdf25e38ed1 100755 #include "components/policy/core/common/policy_details.h" #include "components/policy/core/common/policy_map.h" -@@ -508,9 +509,11 @@ struct SchemaData; +@@ -470,9 +471,11 @@ struct SchemaData; ''') if target_platform == 'win': @@ -415,7 +415,7 @@ index a17b30c37e07a..adcdf25e38ed1 100755 f.write('''#if BUILDFLAG(IS_CHROMEOS) // Sets default profile policies values for enterprise users. -@@ -1153,12 +1156,14 @@ namespace policy { +@@ -1115,12 +1118,14 @@ namespace policy { f.write('} // namespace\n\n') if target_platform == 'win': diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index 42f97446f..bbbd93128 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -14,7 +14,7 @@ index 7ae18c5a960b0..d48ba838efe6f 100644 ? profile_metrics::BrowserProfileType::kRegular : profile_metrics::BrowserProfileType::kIncognito; diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc -index 9f1cb38d90303..986ac5ed9bdaf 100644 +index 826fa20afbb56..f08891c4aaa0d 100644 --- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc +++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc @@ -31,7 +31,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog( @@ -44,7 +44,7 @@ index caa20ec03434a..2a3ca921445c1 100644 avatar_toolbar_button, GetBrowser().profile(), type); DCHECK_EQ(nullptr, bubble_tracker_.view()); diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc -index f5f266328283d..672609d94d1b7 100644 +index 3e46e2ce50219..ce905695bfe18 100644 --- chrome/browser/ui/views/profiles/incognito_menu_view.cc +++ chrome/browser/ui/views/profiles/incognito_menu_view.cc @@ -36,7 +36,9 @@ @@ -59,7 +59,7 @@ index f5f266328283d..672609d94d1b7 100644 base::RecordAction(base::UserMetricsAction("IncognitoMenu_Show")); diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc -index 9945ca59efde6..1a071f42bb538 100644 +index 38e38d6eabc85..0856ae8d5f5ff 100644 --- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc +++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc @@ -56,7 +56,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) { diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index b52dec384..06ae1a4c6 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -14,10 +14,10 @@ index 9bba6cea235e0..9dc5b40559207 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 94f17d4c532c4..e9605b415a5aa 100644 +index 28b166f4f499c..5892638bb43c8 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc -@@ -88,6 +88,7 @@ base::LazyInstance>::Leaky +@@ -87,6 +87,7 @@ base::LazyInstance>::Leaky namespace { @@ -25,7 +25,7 @@ index 94f17d4c532c4..e9605b415a5aa 100644 const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext"; const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation"; const char kTestOTRProfileIDPrefix[] = "Test::OTR"; -@@ -108,6 +109,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { +@@ -107,6 +108,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const { // DevTools::BrowserContext, MediaRouter::Presentation, and // CaptivePortal::Signin are exceptions to this ban. if (*this == PrimaryID() || @@ -34,7 +34,7 @@ index 94f17d4c532c4..e9605b415a5aa 100644 base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix, base::CompareCase::SENSITIVE) || base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix, -@@ -145,6 +148,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( +@@ -144,6 +147,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique( base::Uuid::GenerateRandomV4().AsLowercaseString().c_str())); } @@ -52,10 +52,10 @@ index 94f17d4c532c4..e9605b415a5aa 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 52eb459e9deba..11a92e9e5cfdc 100644 +index 4bf4b36f01890..b8a966db377db 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -104,6 +104,10 @@ class Profile : public content::BrowserContext { +@@ -103,6 +103,10 @@ class Profile : public content::BrowserContext { // be applicable to run. Please see crbug.com/1098697#c3 for more details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,7 +66,7 @@ index 52eb459e9deba..11a92e9e5cfdc 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -521,6 +525,8 @@ class Profile : public content::BrowserContext { +@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext { return instant_service_; } @@ -75,7 +75,7 @@ index 52eb459e9deba..11a92e9e5cfdc 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -532,7 +538,6 @@ class Profile : public content::BrowserContext { +@@ -533,7 +539,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -84,10 +84,10 @@ index 52eb459e9deba..11a92e9e5cfdc 100644 // Returns whether the user has signed in this profile to an account. diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 52a5f08810e85..ce21b2ea52f06 100644 +index c70593cc14b9d..df5ba6a9432da 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -1034,7 +1034,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -1020,7 +1020,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -99,10 +99,10 @@ index 52a5f08810e85..ce21b2ea52f06 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 861f7d92b35c3..996ae52dcdaab 100644 +index 2b7782afe7506..ed52e68ebdc91 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -438,7 +438,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -439,7 +439,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) profile_manager_android_ = std::make_unique(this); #endif @@ -112,7 +112,7 @@ index 861f7d92b35c3..996ae52dcdaab 100644 zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this, diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index f1530f47eebf0..a41dcf65d9f11 100644 +index 3d5fd0d5ca858..965ab69b3fe8f 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h @@ -134,7 +134,7 @@ class ProfileManager : public Profile::Delegate { diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 58b60e9b2..ab6f39fd7 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index e317e16a513ab..570b5ed114b62 100644 +index 4a67fbf1512e0..8491024a30bf2 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -32,6 +32,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_startup.patch b/patch/patches/chrome_browser_startup.patch index 500c73817..4e81e4a94 100644 --- a/patch/patches/chrome_browser_startup.patch +++ b/patch/patches/chrome_browser_startup.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/startup/startup_browser_creator.cc chrome/browser/ui/startup/startup_browser_creator.cc -index d830d64348d63..a4a84c1214163 100644 +index ef53c8296d9af..659e077436bbe 100644 --- chrome/browser/ui/startup/startup_browser_creator.cc +++ chrome/browser/ui/startup/startup_browser_creator.cc @@ -580,6 +580,14 @@ void OpenNewWindowForFirstRun( @@ -17,7 +17,7 @@ index d830d64348d63..a4a84c1214163 100644 } // namespace StartupProfileMode StartupProfileModeFromReason( -@@ -1450,6 +1458,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( +@@ -1452,6 +1460,12 @@ void StartupBrowserCreator::ProcessCommandLineWithProfile( {profile, mode}, last_opened_profiles); } @@ -30,7 +30,7 @@ index d830d64348d63..a4a84c1214163 100644 // static void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( const base::CommandLine& command_line, -@@ -1459,6 +1473,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( +@@ -1461,6 +1475,11 @@ void StartupBrowserCreator::ProcessCommandLineAlreadyRunning( return; } diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index aed6e6570..d8937d6b5 100644 --- a/patch/patches/chrome_browser_themes.patch +++ b/patch/patches/chrome_browser_themes.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc -index c1ff8fe7df4f4..86d9b53f39360 100644 +index ae7735b2bee81..fc3ba3599db28 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc -@@ -29,6 +29,7 @@ +@@ -30,6 +30,7 @@ #include "base/task/thread_pool.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 318f91132..39906600c 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -42,10 +42,10 @@ index 438276b719c2f..69635e429be78 100644 const extensions::Extension* extension = registry->enabled_extensions().GetByID(extension_id); diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index d99e0959551ce..5d69ddac55ab4 100644 +index 1521706e2be6b..08f77de0886dd 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -980,6 +980,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -999,6 +999,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -53,7 +53,7 @@ index d99e0959551ce..5d69ddac55ab4 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1142,7 +1143,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1161,7 +1162,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -63,7 +63,7 @@ index d99e0959551ce..5d69ddac55ab4 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1151,7 +1153,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1170,7 +1172,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -73,7 +73,7 @@ index d99e0959551ce..5d69ddac55ab4 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1161,7 +1164,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1180,7 +1183,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index cd97ffc30..b5de3e758 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 9cc63fbd174db..4ed6c1b0f1af3 100644 +index da32ae82101ed..87342245c746f 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -18,7 +18,7 @@ index 9cc63fbd174db..4ed6c1b0f1af3 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -239,6 +241,10 @@ static_library("renderer") { +@@ -242,6 +244,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 af4dd5370..e724baa2c 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 af3bbf41a347d..f055dce3ae036 100644 +index 227843d1197b0..eba67645bb16b 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -41,6 +41,7 @@ @@ -10,7 +10,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #include "chrome/browser/buildflags.h" #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" -@@ -571,6 +572,9 @@ struct MainFunction { +@@ -608,6 +609,9 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -20,7 +20,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) // In debug builds of Lacros, we keep track of when the user data dir // is initialized, to ensure the cryptohome is not accessed before login -@@ -749,6 +753,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { +@@ -823,6 +827,10 @@ ChromeMainDelegate::~ChromeMainDelegate() { ChromeMainDelegate::~ChromeMainDelegate() = default; #endif // !BUILDFLAG(IS_ANDROID) @@ -28,10 +28,10 @@ index af3bbf41a347d..f055dce3ae036 100644 + memory_system_.reset(); +} + - absl::optional ChromeMainDelegate::PostEarlyInitialization( + std::optional ChromeMainDelegate::PostEarlyInitialization( InvokedIn invoked_in) { DUMP_WILL_BE_CHECK(base::ThreadPoolInstance::Get()); -@@ -783,7 +791,7 @@ absl::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -857,7 +865,7 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( // future session's metrics. DeferBrowserMetrics(user_data_dir); @@ -40,7 +40,7 @@ index af3bbf41a347d..f055dce3ae036 100644 // In the case the process is not the singleton process, the uninstall tasks // need to be executed here. A window will be displayed asking to close all // running instances. -@@ -950,7 +958,8 @@ absl::optional ChromeMainDelegate::PostEarlyInitialization( +@@ -1032,7 +1040,8 @@ std::optional ChromeMainDelegate::PostEarlyInitialization( if (base::FeatureList::IsEnabled( features::kWriteBasicSystemProfileToPersistentHistogramsFile)) { @@ -50,7 +50,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #if BUILDFLAG(IS_ANDROID) record = base::FeatureList::IsEnabled(chrome::android::kUmaBackgroundSessions); -@@ -1399,6 +1408,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1487,6 +1496,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -58,7 +58,7 @@ index af3bbf41a347d..f055dce3ae036 100644 crash_reporter::InitializeCrashKeys(); #if BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -1429,6 +1439,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1505,6 +1515,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -66,7 +66,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #if BUILDFLAG(IS_WIN) child_process_logging::Init(); -@@ -1641,6 +1652,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1717,6 +1728,7 @@ void ChromeMainDelegate::PreSandboxStartup() { CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; } @@ -74,7 +74,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1684,6 +1696,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1760,6 +1772,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -82,7 +82,7 @@ index af3bbf41a347d..f055dce3ae036 100644 #if BUILDFLAG(ENABLE_PDF) MaybePatchGdiGetFontData(); -@@ -1809,6 +1822,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1885,6 +1898,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -90,7 +90,7 @@ index af3bbf41a347d..f055dce3ae036 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 = -@@ -1831,6 +1845,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1907,6 +1921,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -98,7 +98,7 @@ index af3bbf41a347d..f055dce3ae036 100644 } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -@@ -1931,6 +1946,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -2006,6 +2021,7 @@ void ChromeMainDelegate::InitializeMemorySystem() { channel == version_info::Channel::DEV); const bool gwp_asan_boost_sampling = is_canary_dev || is_browser_process; @@ -106,7 +106,7 @@ index af3bbf41a347d..f055dce3ae036 100644 memory_system::Initializer() .SetGwpAsanParameters(gwp_asan_boost_sampling, process_type) .SetProfilingClientParameters(channel, -@@ -1940,5 +1956,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { +@@ -2015,5 +2031,5 @@ void ChromeMainDelegate::InitializeMemorySystem() { memory_system::DispatcherParameters:: AllocationTraceRecorderInclusion::kDynamic, process_type) @@ -114,7 +114,7 @@ index af3bbf41a347d..f055dce3ae036 100644 + .Initialize(*memory_system_); } diff --git chrome/app/chrome_main_delegate.h chrome/app/chrome_main_delegate.h -index 176b6248f18e8..1360e8c209eba 100644 +index 3553377e96017..5207128b768f2 100644 --- chrome/app/chrome_main_delegate.h +++ chrome/app/chrome_main_delegate.h @@ -49,6 +49,8 @@ class ChromeMainDelegate : public content::ContentMainDelegate { @@ -125,7 +125,7 @@ index 176b6248f18e8..1360e8c209eba 100644 + protected: // content::ContentMainDelegate: - absl::optional BasicStartupComplete() override; + std::optional BasicStartupComplete() override; @@ -98,7 +100,7 @@ class ChromeMainDelegate : public content::ContentMainDelegate { ChromeContentClient chrome_content_client_; @@ -136,7 +136,7 @@ index 176b6248f18e8..1360e8c209eba 100644 #if BUILDFLAG(IS_CHROMEOS_LACROS) std::unique_ptr lacros_service_; diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 5a2adb9fcc983..a3ce0913825d1 100644 +index b5859c06d56e9..3a702aad4f453 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -52,6 +52,7 @@ @@ -147,7 +147,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -506,7 +507,7 @@ void ProcessSingletonNotificationCallbackImpl( +@@ -503,7 +504,7 @@ void ProcessSingletonNotificationCallbackImpl( return; } @@ -156,7 +156,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // The uninstall command-line switch is handled by the origin process; see // ChromeMainDelegate::PostEarlyInitialization(...). The other process won't // be able to become the singleton process and will display a window asking -@@ -800,7 +801,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { +@@ -799,7 +800,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { return content::RESULT_CODE_NORMAL_EXIT; } @@ -165,7 +165,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // If we are running stale binaries then relaunch and exit immediately. if (upgrade_util::IsRunningOldChrome()) { if (!upgrade_util::RelaunchChromeBrowser( -@@ -813,7 +814,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { +@@ -812,7 +813,7 @@ int ChromeBrowserMainParts::PreEarlyInitialization() { // result in browser startup bailing. return chrome::RESULT_CODE_NORMAL_EXIT_UPGRADE_RELAUNCHED; } @@ -174,7 +174,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 return load_local_state_result; } -@@ -915,7 +916,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( +@@ -914,7 +915,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( browser_process_->local_state()); platform_management_service->RefreshCache(base::NullCallback()); @@ -183,7 +183,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 if (first_run::IsChromeFirstRun()) { bool stats_default; if (GoogleUpdateSettings::GetCollectStatsConsentDefault(&stats_default)) { -@@ -928,7 +929,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( +@@ -927,7 +928,7 @@ int ChromeBrowserMainParts::OnLocalStateLoaded( : metrics::EnableMetricsDefault::OPT_IN); } } @@ -192,7 +192,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 std::string locale = startup_data_->chrome_feature_list_creator()->actual_locale(); -@@ -961,6 +962,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -960,6 +961,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) master_prefs_ = std::make_unique(); @@ -200,7 +200,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 std::unique_ptr installer_initial_prefs = startup_data_->chrome_feature_list_creator()->TakeInitialPrefs(); if (!installer_initial_prefs) -@@ -994,6 +996,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { +@@ -993,6 +995,7 @@ int ChromeBrowserMainParts::ApplyFirstRunPrefs() { master_prefs_->confirm_to_quit); } #endif // BUILDFLAG(IS_MAC) @@ -208,7 +208,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) return content::RESULT_CODE_NORMAL_EXIT; } -@@ -1060,6 +1063,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1059,6 +1062,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { browser_process_->browser_policy_connector()->OnResourceBundleCreated(); @@ -216,7 +216,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // Android does first run in Java instead of native. // Chrome OS has its own out-of-box-experience code. #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) -@@ -1081,6 +1085,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -1080,6 +1084,7 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #endif // BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) @@ -224,7 +224,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #if BUILDFLAG(IS_CHROMEOS) // Set the product channel for crash reports. -@@ -1457,6 +1462,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1458,6 +1463,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->PreMainMessageLoopRun(); #if BUILDFLAG(IS_WIN) @@ -232,7 +232,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // If the command line specifies 'uninstall' then we need to work here // unless we detect another chrome browser running. if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUninstall)) { -@@ -1468,6 +1474,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1469,6 +1475,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { return ChromeBrowserMainPartsWin::HandleIconsCommands( *base::CommandLine::ForCurrentProcess()); } @@ -240,7 +240,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 ui::SelectFileDialog::SetFactory( std::make_unique()); -@@ -1485,6 +1492,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1486,6 +1493,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) @@ -248,7 +248,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMakeDefaultBrowser)) { bool is_managed = g_browser_process->local_state()->IsManagedPreference( -@@ -1498,18 +1506,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1499,18 +1507,22 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { ? static_cast(content::RESULT_CODE_NORMAL_EXIT) : static_cast(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); } @@ -271,7 +271,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #if !BUILDFLAG(IS_ANDROID) && BUILDFLAG(ENABLE_DOWNGRADE_PROCESSING) // Begin relaunch processing immediately if User Data migration is required -@@ -1548,7 +1560,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1549,7 +1561,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { } #endif // !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) @@ -280,7 +280,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // Check if there is any machine level Chrome installed on the current // machine. If yes and the current Chrome process is user level, we do not // allow the user level Chrome to run. So we notify the user and uninstall -@@ -1557,7 +1569,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1558,7 +1570,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // obtained but before potentially creating the first run sentinel). if (ChromeBrowserMainPartsWin::CheckMachineLevelInstall()) return chrome::RESULT_CODE_MACHINE_LEVEL_INSTALL_EXISTS; @@ -289,7 +289,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // Desktop construction occurs here, (required before profile creation). PreProfileInit(); -@@ -1600,12 +1612,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1601,12 +1613,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { browser_process_->local_state()); } @@ -304,7 +304,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #if BUILDFLAG(IS_ANDROID) page_info::SetPageInfoClient(new ChromePageInfoClient()); -@@ -1632,6 +1646,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1633,6 +1647,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Call `PostProfileInit()`and set it up for profiles created later. profile_init_manager_ = std::make_unique(this, profile); @@ -312,7 +312,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) // Execute first run specific code after the PrefService has been initialized // and preferences have been registered since some of the import code depends -@@ -1671,6 +1686,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1672,6 +1687,7 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { *base::CommandLine::ForCurrentProcess()); } #endif // BUILDFLAG(IS_WIN) @@ -320,7 +320,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // Configure modules that need access to resources. net::NetModule::SetResourceProvider(ChromeNetResourceProvider); -@@ -1750,6 +1766,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1751,6 +1767,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { g_browser_process->profile_manager()->GetLastOpenedProfiles(); } #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -332,7 +332,7 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 // This step is costly. if (browser_creator_->Start(*base::CommandLine::ForCurrentProcess(), base::FilePath(), profile_info, -@@ -1782,11 +1803,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1783,11 +1804,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // Create the RunLoop for MainMessageLoopRun() to use and transfer // ownership of the browser's lifetime to the BrowserProcess. @@ -348,10 +348,10 @@ index 5a2adb9fcc983..a3ce0913825d1 100644 #endif // !BUILDFLAG(IS_ANDROID) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index fce89997a3a60..2c1228e740216 100644 +index 7c438a75e086c..f3088e0e6d564 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm -@@ -17,6 +17,7 @@ +@@ -16,6 +16,7 @@ #include "base/path_service.h" #include "base/strings/sys_string_conversions.h" #include "build/branding_buildflags.h" @@ -359,7 +359,7 @@ index fce89997a3a60..2c1228e740216 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -100,6 +101,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { } #endif // !BUILDFLAG(CHROME_FOR_TESTING) @@ -367,7 +367,7 @@ index fce89997a3a60..2c1228e740216 100644 // Create the app delegate by requesting the shared AppController. CHECK_EQ(nil, NSApp.delegate); AppController* app_controller = AppController.sharedController; -@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { +@@ -108,6 +110,7 @@ void ChromeBrowserMainPartsMac::PreCreateMainMessageLoop() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -375,7 +375,7 @@ index fce89997a3a60..2c1228e740216 100644 ui::WarmScreenCapture(); -@@ -167,5 +170,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, +@@ -145,5 +148,7 @@ void ChromeBrowserMainPartsMac::PostProfileInit(Profile* profile, } void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { @@ -384,7 +384,7 @@ index fce89997a3a60..2c1228e740216 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index a9b87ac2fcd74..c3469d0bded81 100644 +index c8f705069d25b..aa9e0fd6efd0e 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc @@ -46,6 +46,7 @@ @@ -395,7 +395,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -1512,6 +1513,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { +@@ -1409,6 +1410,8 @@ ChromeContentBrowserClient::GetPopupNavigationDelegateFactoryForTesting() { } ChromeContentBrowserClient::ChromeContentBrowserClient() { @@ -404,7 +404,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 #if BUILDFLAG(ENABLE_PLUGINS) extra_parts_.push_back( std::make_unique()); -@@ -1544,6 +1547,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { +@@ -1441,6 +1444,11 @@ ChromeContentBrowserClient::~ChromeContentBrowserClient() { } } @@ -416,7 +416,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 // static void ChromeContentBrowserClient::RegisterLocalStatePrefs( PrefRegistrySimple* registry) { -@@ -4442,9 +4450,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -4299,9 +4307,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // BUILDFLAG(IS_ANDROID) @@ -428,7 +428,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -@@ -6546,7 +6556,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( +@@ -6373,7 +6383,7 @@ void ChromeContentBrowserClient::OnNetworkServiceCreated( #endif } @@ -437,7 +437,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -6564,6 +6574,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( +@@ -6391,6 +6401,8 @@ void ChromeContentBrowserClient::ConfigureNetworkContextParams( network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = GetApplicationLocale(); } @@ -446,7 +446,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 } std::vector -@@ -7721,10 +7733,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( +@@ -7535,10 +7547,10 @@ void ChromeContentBrowserClient::OnKeepaliveRequestStarted( const auto now = base::TimeTicks::Now(); const auto timeout = GetKeepaliveTimerTimeout(context); keepalive_deadline_ = std::max(keepalive_deadline_, now + timeout); @@ -459,7 +459,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 FROM_HERE, keepalive_deadline_ - now, base::BindOnce( &ChromeContentBrowserClient::OnKeepaliveTimerFired, -@@ -7743,7 +7755,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { +@@ -7557,7 +7569,8 @@ void ChromeContentBrowserClient::OnKeepaliveRequestFinished() { --num_keepalive_requests_; if (num_keepalive_requests_ == 0) { DVLOG(1) << "Stopping the keepalive timer"; @@ -469,7 +469,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 // This deletes the keep alive handle attached to the timer function and // unblock the shutdown sequence. } -@@ -7885,7 +7898,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( +@@ -7699,7 +7712,7 @@ void ChromeContentBrowserClient::OnKeepaliveTimerFired( const auto now = base::TimeTicks::Now(); const auto then = keepalive_deadline_; if (now < then) { @@ -479,7 +479,7 @@ index a9b87ac2fcd74..c3469d0bded81 100644 base::BindOnce(&ChromeContentBrowserClient::OnKeepaliveTimerFired, weak_factory_.GetWeakPtr(), diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index efc041c50771c..51d187aa9d39a 100644 +index 8ac74856217e4..e7632e1e08e96 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h @@ -142,6 +142,8 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { @@ -491,7 +491,7 @@ index efc041c50771c..51d187aa9d39a 100644 // TODO(https://crbug.com/787567): This file is about calls from content/ out // to chrome/ to get values or notify about events, but both of these // functions are from chrome/ to chrome/ and don't involve content/ at all. -@@ -672,7 +674,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -667,7 +669,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; @@ -500,7 +500,7 @@ index efc041c50771c..51d187aa9d39a 100644 content::BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1149,7 +1151,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { +@@ -1160,7 +1162,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient { #if !BUILDFLAG(IS_ANDROID) uint64_t num_keepalive_requests_ = 0; @@ -510,10 +510,10 @@ index efc041c50771c..51d187aa9d39a 100644 #endif diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 2c9e95b07c762..c70fdab5e0bcc 100644 +index 94a93ca5c715c..17cc9e515d99c 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc -@@ -14,6 +14,7 @@ +@@ -15,6 +15,7 @@ #include "build/build_config.h" #include "build/chromecast_buildflags.h" #include "build/chromeos_buildflags.h" @@ -521,7 +521,7 @@ index 2c9e95b07c762..c70fdab5e0bcc 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_ui.h" -@@ -195,6 +196,10 @@ +@@ -194,6 +195,10 @@ #include "chrome/browser/background/background_mode_manager.h" #endif @@ -532,7 +532,7 @@ index 2c9e95b07c762..c70fdab5e0bcc 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1664,7 +1669,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1626,7 +1631,9 @@ void RegisterLocalState(PrefRegistrySimple* registry) { #if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH) RegisterDefaultBrowserPromptPrefs(registry); @@ -542,7 +542,7 @@ index 2c9e95b07c762..c70fdab5e0bcc 100644 DeviceOAuth2TokenStoreDesktop::RegisterPrefs(registry); #endif -@@ -1692,6 +1699,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { +@@ -1649,6 +1656,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) { // This is intentionally last. RegisterLocalStatePrefsForMigration(registry); @@ -554,7 +554,7 @@ index 2c9e95b07c762..c70fdab5e0bcc 100644 } // Register prefs applicable to all profiles. -@@ -2128,6 +2140,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -2085,6 +2097,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry, const std::string& locale) { RegisterProfilePrefs(registry, locale); diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index b817cba0e..290757895 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index 7d57988659286..576550dd75111 100644 +index 5664d44624283..e025126ed235f 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -400,6 +400,7 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -41,10 +41,10 @@ index 7d57988659286..576550dd75111 100644 bool BrowserCommandController::IsWebAppOrCustomTab() const { diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc -index 6ce427cb564af..8a59dc84c75ec 100644 +index bb41ecd06518b..ab7d617e419ad 100644 --- chrome/browser/ui/toolbar/app_menu_model.cc +++ chrome/browser/ui/toolbar/app_menu_model.cc -@@ -596,6 +596,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( +@@ -604,6 +604,57 @@ SaveAndShareSubMenuModel::SaveAndShareSubMenuModel( } } @@ -102,7 +102,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 } // namespace //////////////////////////////////////////////////////////////////////////////// -@@ -1481,7 +1532,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { +@@ -1470,7 +1521,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const { return false; } @@ -111,7 +111,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 GlobalError* error = GlobalErrorServiceFactory::GetForProfile(browser_->profile()) ->GetGlobalErrorByMenuItemCommandID(command_id); -@@ -1496,6 +1547,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { +@@ -1485,6 +1536,30 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const { } } @@ -142,7 +142,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 bool AppMenuModel::IsCommandIdAlerted(int command_id) const { if (command_id == IDC_VIEW_PASSWORDS || command_id == IDC_SHOW_PASSWORD_MANAGER) { -@@ -1689,11 +1764,15 @@ void AppMenuModel::Build() { +@@ -1652,11 +1727,15 @@ void AppMenuModel::Build() { kDefaultIconSize)); } @@ -163,7 +163,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 AddItemWithStringId(IDC_PRINT, IDS_PRINT); -@@ -1799,9 +1878,13 @@ void AppMenuModel::Build() { +@@ -1762,9 +1841,13 @@ void AppMenuModel::Build() { kMoreToolsMenuItem); if (!features::IsChromeRefresh2023()) { @@ -180,7 +180,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 } if (!features::IsChromeRefresh2023()) { -@@ -1889,6 +1972,11 @@ void AppMenuModel::Build() { +@@ -1853,6 +1936,11 @@ void AppMenuModel::Build() { SetCommandIcon(this, IDC_EXIT, kExitMenuIcon); } @@ -193,7 +193,7 @@ index 6ce427cb564af..8a59dc84c75ec 100644 } diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h -index 55425f15d49fa..06cb8ed2acaa1 100644 +index d7c9df2e12df2..5dd6080454806 100644 --- chrome/browser/ui/toolbar/app_menu_model.h +++ chrome/browser/ui/toolbar/app_menu_model.h @@ -215,6 +215,7 @@ class AppMenuModel : public ui::SimpleMenuModel, @@ -205,8 +205,8 @@ index 55425f15d49fa..06cb8ed2acaa1 100644 bool IsElementIdAlerted(ui::ElementIdentifier element_id) const override; bool GetAcceleratorForCommandId(int command_id, @@ -256,6 +257,8 @@ class AppMenuModel : public ui::SimpleMenuModel, - absl::optional expected_module = - absl::nullopt); + safety_hub::SafetyHubModuleType sh_module, + int event_flags); + bool IsCommandIdEnabledInternal(int command_id) const; + @@ -231,7 +231,7 @@ index 59024587ef6b7..0c30aa71768cf 100644 void FindBarHost::RegisterAccelerators() { diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index bb4b3821bcfda..4014f61a7057f 100644 +index a52bb8913d37f..dd5030f9bfb74 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc @@ -114,15 +114,23 @@ ui::ColorProviderKey::SchemeVariant GetSchemeVariant( @@ -330,7 +330,7 @@ index bb4b3821bcfda..4014f61a7057f 100644 chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); chrome::SaveWindowVisibleOnAllWorkspaces(browser_view_->browser(), IsVisibleOnAllWorkspaces()); -@@ -478,6 +510,8 @@ void BrowserFrame::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) { +@@ -483,6 +515,8 @@ void BrowserFrame::OnNativeThemeUpdated(ui::NativeTheme* observed_theme) { ui::ColorProviderKey BrowserFrame::GetColorProviderKey() const { auto key = Widget::GetColorProviderKey(); @@ -339,7 +339,7 @@ index bb4b3821bcfda..4014f61a7057f 100644 key.app_controller = browser_view_->browser()->app_controller(); -@@ -632,5 +666,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( +@@ -637,5 +671,8 @@ bool BrowserFrame::RegenerateFrameOnThemeChange( } bool BrowserFrame::IsIncognitoBrowser() const { @@ -349,10 +349,10 @@ index bb4b3821bcfda..4014f61a7057f 100644 return browser_view_->browser()->profile()->IsIncognitoProfile(); } diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h -index 0c231b6ac5b01..6b5af98e18e42 100644 +index 2e973c9e279b0..12b62efb8071f 100644 --- chrome/browser/ui/views/frame/browser_frame.h +++ chrome/browser/ui/views/frame/browser_frame.h -@@ -61,7 +61,9 @@ enum class TabDragKind { +@@ -58,7 +58,9 @@ enum class TabDragKind { // This is a virtual interface that allows system specific browser frames. class BrowserFrame : public views::Widget, public views::ContextMenuController { public: @@ -363,10 +363,10 @@ index 0c231b6ac5b01..6b5af98e18e42 100644 BrowserFrame(const BrowserFrame&) = delete; BrowserFrame& operator=(const BrowserFrame&) = delete; diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index c74a820ce00ad..0c3b3bd49e5b7 100644 +index e2827eb98518f..3e33205a91f1b 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -342,11 +342,10 @@ using content::NativeWebKeyboardEvent; +@@ -346,11 +346,10 @@ using content::NativeWebKeyboardEvent; using content::WebContents; using web_modal::WebContentsModalDialogHost; @@ -381,7 +381,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 #if BUILDFLAG(IS_CHROMEOS_ASH) // UMA histograms that record animation smoothness for tab loading animation. -@@ -700,6 +699,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { +@@ -677,6 +676,14 @@ class BrowserViewLayoutDelegateImpl : public BrowserViewLayoutDelegate { return browser_view_->frame()->GetTopInset() - browser_view_->y(); } @@ -396,7 +396,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 bool IsToolbarVisible() const override { return browser_view_->IsToolbarVisible(); } -@@ -861,11 +868,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -835,11 +842,21 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -417,9 +417,9 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 + browser_ = std::move(browser); + // Store the actions so that the access is available for other classes. - if (base::FeatureList::IsEnabled(features::kSidePanelPinning)) { + if (features::IsSidePanelPinningEnabled()) { browser_->SetUserData(BrowserActions::UserDataKey(), -@@ -962,8 +979,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -933,8 +950,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -437,7 +437,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1037,7 +1061,9 @@ BrowserView::~BrowserView() { +@@ -1008,7 +1032,9 @@ BrowserView::~BrowserView() { // All the tabs should have been destroyed already. If we were closed by the // OS with some tabs than the NativeBrowserFrame should have destroyed them. @@ -447,7 +447,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 // Stop the animation timer explicitly here to avoid running it in a nested // message loop, which may run by Browser destructor. -@@ -1051,12 +1077,14 @@ BrowserView::~BrowserView() { +@@ -1022,12 +1048,14 @@ BrowserView::~BrowserView() { // child views and it is an observer for avatar toolbar button if any. autofill_bubble_handler_.reset(); @@ -462,7 +462,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 // The TabStrip attaches a listener to the model. Make sure we shut down the // TabStrip first so that it can cleanly remove the listener. -@@ -1074,7 +1102,9 @@ BrowserView::~BrowserView() { +@@ -1045,7 +1073,9 @@ BrowserView::~BrowserView() { // `SidePanelUI::RemoveSidePanelUIForBrowser()` deletes the // SidePanelCoordinator. @@ -472,7 +472,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 } // static -@@ -1949,9 +1979,14 @@ void BrowserView::OnExclusiveAccessUserInput() { +@@ -1966,9 +1996,14 @@ void BrowserView::OnExclusiveAccessUserInput() { bool BrowserView::ShouldHideUIForFullscreen() const { // Immersive mode needs UI for the slide-down top panel. @@ -488,7 +488,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -3060,7 +3095,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { +@@ -3083,7 +3118,8 @@ DownloadShelf* BrowserView::GetDownloadShelf() { } DownloadBubbleUIController* BrowserView::GetDownloadBubbleUIController() { @@ -498,7 +498,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 if (auto* download_button = toolbar_button_provider_->GetDownloadButton()) return download_button->bubble_controller(); return nullptr; -@@ -3611,7 +3647,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { +@@ -3642,7 +3678,8 @@ void BrowserView::ReparentTopContainerForEndOfImmersive() { if (top_container()->parent() == this) return; @@ -508,7 +508,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -4073,11 +4110,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { +@@ -4123,11 +4160,38 @@ void BrowserView::GetAccessiblePanes(std::vector* panes) { bool BrowserView::ShouldDescendIntoChildForEventHandling( gfx::NativeView child, const gfx::Point& location) { @@ -549,7 +549,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 // Draggable regions are defined relative to the web contents. gfx::Point point_in_contents_web_view_coords(location); views::View::ConvertPointToTarget(GetWidget()->GetRootView(), -@@ -4086,7 +4150,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( +@@ -4136,7 +4200,7 @@ bool BrowserView::ShouldDescendIntoChildForEventHandling( // Draggable regions should be ignored for clicks into any browser view's // owned widgets, for example alerts, permission prompts or find bar. @@ -558,7 +558,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 point_in_contents_web_view_coords.x(), point_in_contents_web_view_coords.y()) || WidgetOwnedByAnchorContainsPoint(point_in_contents_web_view_coords); -@@ -4194,8 +4258,10 @@ void BrowserView::Layout() { +@@ -4247,8 +4311,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -569,9 +569,9 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 + if (frame()->GetFrameView()) + frame()->GetFrameView()->UpdateMinimumSize(); - #if BUILDFLAG(IS_CHROMEOS_ASH) - // In chromeOS ash we round the bottom two corners of the browser frame by -@@ -4273,6 +4339,11 @@ void BrowserView::AddedToWidget() { + // Some of the situations when the BrowserView is laid out are: + // - Enter/exit immersive fullscreen mode. +@@ -4314,6 +4380,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -583,7 +583,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 toolbar_->Init(); // TODO(pbos): Investigate whether the side panels should be creatable when -@@ -4321,13 +4392,9 @@ void BrowserView::AddedToWidget() { +@@ -4362,13 +4433,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -599,7 +599,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 using_native_frame_ = frame_->ShouldUseNativeFrame(); MaybeInitializeWebUITabStrip(); -@@ -4744,7 +4811,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, +@@ -4793,7 +4860,8 @@ void BrowserView::ProcessFullscreen(bool fullscreen, // Undo our anti-jankiness hacks and force a re-layout. in_process_fullscreen_ = false; ToolbarSizeChanged(false); @@ -609,7 +609,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 } bool BrowserView::ShouldUseImmersiveFullscreenForUrl(const GURL& url) const { -@@ -5133,6 +5201,8 @@ Profile* BrowserView::GetProfile() { +@@ -5191,6 +5259,8 @@ Profile* BrowserView::GetProfile() { } void BrowserView::UpdateUIForTabFullscreen() { @@ -618,7 +618,7 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 frame()->GetFrameView()->UpdateFullscreenTopUI(); } -@@ -5155,6 +5225,8 @@ void BrowserView::HideDownloadShelf() { +@@ -5213,6 +5283,8 @@ void BrowserView::HideDownloadShelf() { } bool BrowserView::CanUserExitFullscreen() const { @@ -628,13 +628,13 @@ index c74a820ce00ad..0c3b3bd49e5b7 100644 } diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 2e4054890db75..1a518ba936fd1 100644 +index f3f5944785e5e..ec369e0fb2fe1 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -138,11 +138,16 @@ class BrowserView : public BrowserWindow, - kUnknown - }; +@@ -127,11 +127,16 @@ class BrowserView : public BrowserWindow, + METADATA_HEADER(BrowserView, views::ClientView) + public: + BrowserView(); explicit BrowserView(std::unique_ptr browser); + void InitBrowser(std::unique_ptr browser); @@ -648,9 +648,9 @@ index 2e4054890db75..1a518ba936fd1 100644 void set_frame(BrowserFrame* frame) { frame_ = frame; paint_as_active_subscription_ = -@@ -832,6 +837,9 @@ class BrowserView : public BrowserWindow, - // TopContainerBackground::PaintThemeCustomImage for details. - gfx::Point GetThemeOffsetFromBrowserView() const; +@@ -839,6 +844,9 @@ class BrowserView : public BrowserWindow, + const gfx::Rect& contents_webview_bounds, + const gfx::Rect& local_webview_container_bounds); + protected: + virtual ToolbarView* OverrideCreateToolbar() { return nullptr; } @@ -659,7 +659,7 @@ index 2e4054890db75..1a518ba936fd1 100644 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate // interface to keep these two classes decoupled and testable. diff --git chrome/browser/ui/views/frame/browser_view_layout.cc chrome/browser/ui/views/frame/browser_view_layout.cc -index 5e39a622e391e..1d4504370305f 100644 +index 0991a57cccfe8..3ed3d43497460 100644 --- chrome/browser/ui/views/frame/browser_view_layout.cc +++ chrome/browser/ui/views/frame/browser_view_layout.cc @@ -48,6 +48,10 @@ @@ -760,13 +760,14 @@ index 29ad5517bd3c9..b0fe093467abc 100644 virtual bool IsBookmarkBarVisible() const = 0; virtual bool IsContentsSeparatorEnabled() const = 0; diff --git chrome/browser/ui/views/frame/contents_web_view.cc chrome/browser/ui/views/frame/contents_web_view.cc -index 8267a265a8e10..ee08f18e96a34 100644 +index 71445bfab1824..c77750ea2a820 100644 --- chrome/browser/ui/views/frame/contents_web_view.cc +++ chrome/browser/ui/views/frame/contents_web_view.cc -@@ -23,6 +23,11 @@ - ContentsWebView::ContentsWebView(content::BrowserContext* browser_context) +@@ -28,6 +28,12 @@ ContentsWebView::ContentsWebView(content::BrowserContext* browser_context) : views::WebView(browser_context), status_bubble_(nullptr) { + SetProperty(views::kElementIdentifierKey, kContentsWebViewElementId); ++ + // Mouse events on draggable regions will not be handled by the WebView. + // Avoid the resulting DCHECK in NativeViewHost::OnMousePressed by + // configuring the NativeViewHost not to process events via the view @@ -776,10 +777,10 @@ index 8267a265a8e10..ee08f18e96a34 100644 ContentsWebView::~ContentsWebView() { diff --git chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc -index 84e2a84c15907..3f010beb931b6 100644 +index 8f8eae2b243b3..288d584c61548 100644 --- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc +++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc -@@ -585,6 +585,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( +@@ -590,6 +590,11 @@ PictureInPictureBrowserFrameView::PictureInPictureBrowserFrameView( frame->GetNativeWindow()->SetEventTargeter( std::make_unique()); #endif @@ -791,7 +792,7 @@ index 84e2a84c15907..3f010beb931b6 100644 } PictureInPictureBrowserFrameView::~PictureInPictureBrowserFrameView() { -@@ -681,18 +686,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( +@@ -686,18 +691,42 @@ gfx::Rect PictureInPictureBrowserFrameView::GetWindowBoundsForClientBounds( int PictureInPictureBrowserFrameView::NonClientHitTest( const gfx::Point& point) { @@ -842,7 +843,7 @@ index 84e2a84c15907..3f010beb931b6 100644 // Allow dragging and resizing the window. int window_component = GetHTComponentForFrame( -@@ -759,7 +788,8 @@ void PictureInPictureBrowserFrameView::Layout() { +@@ -764,7 +793,8 @@ void PictureInPictureBrowserFrameView::Layout() { gfx::Rect content_area = GetLocalBounds(); content_area.Inset(FrameBorderInsets()); gfx::Rect top_bar = content_area; @@ -852,7 +853,7 @@ index 84e2a84c15907..3f010beb931b6 100644 top_bar_container_view_->SetBoundsRect(top_bar); #if !BUILDFLAG(IS_ANDROID) if (auto_pip_setting_overlay_) { -@@ -1234,7 +1264,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const { +@@ -1236,7 +1266,8 @@ gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const { } int PictureInPictureBrowserFrameView::GetTopAreaHeight() const { @@ -877,7 +878,7 @@ index b862ceac7225d..9575440a77d67 100644 LocationBarView* location_bar_view = browser_view_->GetLocationBarView(); CHECK(location_bar_view); diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc -index 0e24efef68ace..f1cda2809f398 100644 +index b6e4a01ae450d..14b7fd84ed7df 100644 --- chrome/browser/ui/views/page_action/page_action_icon_controller.cc +++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc @@ -98,6 +98,12 @@ void PageActionIconController::Init(const PageActionIconParams& params, @@ -894,7 +895,7 @@ index 0e24efef68ace..f1cda2809f398 100644 case PageActionIconType::kPaymentsOfferNotification: add_page_action_icon( diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index 9536b049aeb9d..30f3091939675 100644 +index c592f23b0c972..adca2e8db1cc6 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -558,29 +558,41 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( @@ -932,18 +933,18 @@ index 9536b049aeb9d..30f3091939675 100644 return GetFrameView()->GetFrameColor(active_state); } - absl::optional BrowserTabStripController::GetCustomBackgroundId( + std::optional BrowserTabStripController::GetCustomBackgroundId( BrowserFrameActiveState active_state) const { + if (!GetFrameView()) -+ return absl::nullopt; ++ return std::nullopt; return GetFrameView()->GetCustomBackgroundId(active_state); } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index f7f763cac17f4..788185cc57cae 100644 +index 0cf2fbd962501..ccdc0a92ccde1 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -190,7 +190,7 @@ class TabstripLikeBackground : public views::Background { +@@ -191,7 +191,7 @@ class TabstripLikeBackground : public views::Background { void Paint(gfx::Canvas* canvas, views::View* view) const override { bool painted = TopContainerBackground::PaintThemeCustomImage(canvas, view, browser_view_); @@ -952,7 +953,7 @@ index f7f763cac17f4..788185cc57cae 100644 SkColor frame_color = browser_view_->frame()->GetFrameView()->GetFrameColor( BrowserFrameActiveState::kUseCurrent); -@@ -219,12 +219,13 @@ END_METADATA +@@ -220,12 +220,13 @@ END_METADATA //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: @@ -968,7 +969,7 @@ index f7f763cac17f4..788185cc57cae 100644 SetID(VIEW_ID_TOOLBAR); container_view_ = AddChildView(std::make_unique()); -@@ -249,6 +250,19 @@ ToolbarView::~ToolbarView() { +@@ -250,6 +251,19 @@ ToolbarView::~ToolbarView() { } void ToolbarView::Init() { @@ -988,7 +989,7 @@ index f7f763cac17f4..788185cc57cae 100644 #if defined(USE_AURA) // Avoid generating too many occlusion tracking calculation events before this // function returns. The occlusion status will be computed only once once this -@@ -273,12 +287,12 @@ void ToolbarView::Init() { +@@ -274,12 +288,12 @@ void ToolbarView::Init() { auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, @@ -1003,7 +1004,7 @@ index f7f763cac17f4..788185cc57cae 100644 download_button = std::make_unique(browser_view_); } -@@ -360,8 +374,10 @@ void ToolbarView::Init() { +@@ -361,8 +375,10 @@ void ToolbarView::Init() { } } std::unique_ptr cast; @@ -1015,7 +1016,7 @@ index f7f763cac17f4..788185cc57cae 100644 std::unique_ptr media_button; if (base::FeatureList::IsEnabled(media::kGlobalMediaControls)) { -@@ -371,7 +387,8 @@ void ToolbarView::Init() { +@@ -372,7 +388,8 @@ void ToolbarView::Init() { std::unique_ptr send_tab_to_self_button; @@ -1025,21 +1026,20 @@ index f7f763cac17f4..788185cc57cae 100644 send_tab_to_self_button = std::make_unique( browser_view_); -@@ -443,7 +460,8 @@ void ToolbarView::Init() { +@@ -451,7 +468,7 @@ void ToolbarView::Init() { send_tab_to_self_button_ = container_view_->AddChildView(std::move(send_tab_to_self_button)); -- if (!base::FeatureList::IsEnabled(features::kSidePanelPinning)) { -+ if (!base::FeatureList::IsEnabled(features::kSidePanelPinning) && -+ BUTTON_VISIBLE(kSidePanel)) { +- if (!features::IsSidePanelPinningEnabled()) { ++ if (!features::IsSidePanelPinningEnabled() && BUTTON_VISIBLE(kSidePanel)) { if (companion::IsCompanionFeatureEnabled()) { side_panel_container_ = container_view_->AddChildView( std::make_unique(browser_view_)); diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h -index 3bfe52cff3511..11373de4c2a3a 100644 +index ec3e34a86f4c5..c10866a7b1ace 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.h +++ chrome/browser/ui/views/toolbar/toolbar_view.h -@@ -92,7 +92,8 @@ class ToolbarView : public views::AccessiblePaneView, +@@ -93,7 +93,8 @@ class ToolbarView : public views::AccessiblePaneView, // needs to be displayed. }; diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index f9ed2fd68..55ceffaa3 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,10 +1,10 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 4300a5d94e04a..7ff40d52d3ec5 100644 +index 67b7e7ca509e1..de84b8f7ecde9 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h -@@ -108,7 +108,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -110,7 +110,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, - absl::optional* override_out); + std::optional* override_out); -bool WillCreateURLLoaderFactory( +CONTENT_EXPORT bool WillCreateURLLoaderFactory( @@ -55,12 +55,12 @@ index 1a1a07dad71dd..42048c360e797 100644 explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host); diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h -index 97c7dc7c25000..63c42610bfd9c 100644 +index 6af484f35f576..2462700b6d1fb 100644 --- content/common/content_switches_internal.h +++ content/common/content_switches_internal.h -@@ -17,7 +17,7 @@ namespace content { +@@ -15,7 +15,7 @@ class CommandLine; - extern const char kFirstRendererProcess[]; + namespace content { -bool IsPinchToZoomEnabled(); +CONTENT_EXPORT bool IsPinchToZoomEnabled(); @@ -68,7 +68,7 @@ index 97c7dc7c25000..63c42610bfd9c 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index af07b543f8a96..ff537ffb32224 100644 +index ee83c6167eb18..44ed50b19bd70 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -35,6 +35,7 @@ component("controller") { diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 4931d0c24..5802e3bfc 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 34cacda8ef225..e0465b8ac1185 100644 +index b7430b7d7027f..721144dde86d8 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -588,7 +588,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -589,7 +589,7 @@ void DevToolsHttpHandler::OnJsonRequest( base::Value::Dict version; version.Set("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.Set("WebKit-Version", GetWebKitVersion()); @@ -12,7 +12,7 @@ index 34cacda8ef225..e0465b8ac1185 100644 version.Set("V8-Version", V8_VERSION_STRING); std::string host = info.GetHeaderValue("host"); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 16b5afde04752..01561da6aee2d 100644 +index 5da07b9eff248..72fc63ba456c5 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc @@ -751,6 +751,22 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest() { @@ -39,10 +39,10 @@ index 16b5afde04752..01561da6aee2d 100644 factory = base::MakeRefCounted( std::move(loader_factory)); diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index ed845bfab9e73..fc694c9d62f4d 100644 +index d004abc6fe3da..3aeb9ab07d2a6 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc -@@ -1084,7 +1084,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( +@@ -1070,7 +1070,7 @@ ContentBrowserClient::CreateURLLoaderHandlerForServiceWorkerNavigationPreload( void ContentBrowserClient::OnNetworkServiceCreated( network::mojom::NetworkService* network_service) {} @@ -51,7 +51,7 @@ index ed845bfab9e73..fc694c9d62f4d 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -1093,6 +1093,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( +@@ -1079,6 +1079,7 @@ void ContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { network_context_params->user_agent = GetUserAgentBasedOnPolicy(context); network_context_params->accept_language = "en-us,en"; @@ -60,10 +60,10 @@ index ed845bfab9e73..fc694c9d62f4d 100644 std::vector diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 966f79ab782fa..9b820f69835b8 100644 +index d0a5dbc454670..0814479cf64e1 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -42,6 +42,7 @@ +@@ -43,6 +43,7 @@ #include "content/public/browser/mojo_binder_policy_map.h" #include "content/public/browser/privacy_sandbox_invoking_api.h" #include "content/public/browser/storage_partition_config.h" @@ -71,7 +71,7 @@ index 966f79ab782fa..9b820f69835b8 100644 #include "content/public/common/alternative_error_page_override_info.mojom-forward.h" #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" -@@ -2008,7 +2009,7 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1989,7 +1990,7 @@ class CONTENT_EXPORT ContentBrowserClient { // // If |relative_partition_path| is the empty string, it means this needs to // create the default NetworkContext for the BrowserContext. @@ -80,7 +80,7 @@ index 966f79ab782fa..9b820f69835b8 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -2229,6 +2230,19 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2210,6 +2211,19 @@ class CONTENT_EXPORT ContentBrowserClient { RenderFrameHost* initiator_document, mojo::PendingRemote* out_factory); @@ -100,7 +100,7 @@ index 966f79ab782fa..9b820f69835b8 100644 // Creates an OverlayWindow to be used for video or Picture-in-Picture. // This window will house the content shown when in Picture-in-Picture mode. // This will return a new OverlayWindow. -@@ -2286,6 +2300,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -2267,6 +2281,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -112,10 +112,10 @@ index 966f79ab782fa..9b820f69835b8 100644 // on blink::features::kUserAgentReduction. Content may cache this value. virtual std::string GetUserAgent(); diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 72f72e2c6627d..f5ca688e5d9f4 100644 +index ff20508d76a60..03a83b28fd678 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -100,6 +100,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -101,6 +101,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -125,7 +125,7 @@ index 72f72e2c6627d..f5ca688e5d9f4 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -323,6 +326,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -324,6 +327,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -137,10 +137,10 @@ index 72f72e2c6627d..f5ca688e5d9f4 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index e72f99daf2fea..d3b5bd5565da0 100644 +index b67ee7e79eea7..13ac29a392b6e 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -584,6 +584,8 @@ void RenderThreadImpl::Init() { +@@ -545,6 +545,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -150,10 +150,10 @@ index e72f99daf2fea..d3b5bd5565da0 100644 base::BindRepeating(&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 5790d6ed3e4d9..d7519f9032c78 100644 +index 619323f485c6a..324017a67e989 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -984,6 +984,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -994,6 +994,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -170,10 +170,10 @@ index 5790d6ed3e4d9..d7519f9032c78 100644 RendererBlinkPlatformImpl::CreateWebV8ValueConverter() { return std::make_unique(); diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 328a108d2bd1c..f44846ddc2c9e 100644 +index ecbcf12493f77..2c529b2f07a14 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -234,6 +234,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -236,6 +236,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { InertAndMinimumIntervalOfUserLevelMemoryPressureSignal() override; #endif // BUILDFLAG(IS_ANDROID) @@ -184,10 +184,10 @@ index 328a108d2bd1c..f44846ddc2c9e 100644 // plus eTLD+1, such as https://google.com), or to a more specific origin. void SetIsLockedToSite(); diff --git content/shell/browser/shell_content_browser_client.cc content/shell/browser/shell_content_browser_client.cc -index 84da983df907b..7a9390e069df5 100644 +index 3e0b86f6834c5..624610b39a399 100644 --- content/shell/browser/shell_content_browser_client.cc +++ content/shell/browser/shell_content_browser_client.cc -@@ -701,7 +701,7 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( +@@ -703,7 +703,7 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || // BUILDFLAG(IS_ANDROID) @@ -196,7 +196,7 @@ index 84da983df907b..7a9390e069df5 100644 BrowserContext* context, bool in_memory, const base::FilePath& relative_partition_path, -@@ -710,6 +710,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( +@@ -712,6 +712,7 @@ void ShellContentBrowserClient::ConfigureNetworkContextParams( cert_verifier_creation_params) { ConfigureNetworkContextParamsForShell(context, network_context_params, cert_verifier_creation_params); @@ -205,10 +205,10 @@ index 84da983df907b..7a9390e069df5 100644 std::vector diff --git content/shell/browser/shell_content_browser_client.h content/shell/browser/shell_content_browser_client.h -index 950e82cd59ab4..1f8b23da6fec5 100644 +index 83253e9feb3eb..ca0fd605ee613 100644 --- content/shell/browser/shell_content_browser_client.h +++ content/shell/browser/shell_content_browser_client.h -@@ -138,7 +138,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { +@@ -140,7 +140,7 @@ class ShellContentBrowserClient : public ContentBrowserClient { #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || // BUILDFLAG(IS_ANDROID) device::GeolocationManager* GetGeolocationManager() override; diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 33bbf17a4..5b72cfff7 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,8 +1,8 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index 4320694e7f691..bb9b6629bc384 100644 +index aebbccad2a503..2537281b0e872 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -174,11 +174,8 @@ ContentMainParams::~ContentMainParams() = default; +@@ -175,11 +175,8 @@ ContentMainParams::~ContentMainParams() = default; ContentMainParams::ContentMainParams(ContentMainParams&&) = default; ContentMainParams& ContentMainParams::operator=(ContentMainParams&&) = default; @@ -16,7 +16,7 @@ index 4320694e7f691..bb9b6629bc384 100644 base::FeatureList::FailOnFeatureAccessWithoutFeatureList(); #if BUILDFLAG(IS_CHROMEOS_LACROS) // Lacros is launched with inherited priority. Revert to normal priority -@@ -186,9 +183,6 @@ RunContentProcess(ContentMainParams params, +@@ -187,9 +184,6 @@ RunContentProcess(ContentMainParams params, base::PlatformThread::SetCurrentThreadType(base::ThreadType::kDefault); #endif int exit_code = -1; @@ -26,7 +26,7 @@ index 4320694e7f691..bb9b6629bc384 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -274,14 +268,6 @@ RunContentProcess(ContentMainParams params, +@@ -275,14 +269,6 @@ RunContentProcess(ContentMainParams params, #endif #if BUILDFLAG(IS_MAC) @@ -41,7 +41,7 @@ index 4320694e7f691..bb9b6629bc384 100644 InitializeMac(); #endif -@@ -331,12 +317,46 @@ RunContentProcess(ContentMainParams params, +@@ -332,12 +318,46 @@ RunContentProcess(ContentMainParams params, if (IsSubprocess()) CommonSubprocessInit(); @@ -90,7 +90,7 @@ index 4320694e7f691..bb9b6629bc384 100644 } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index f3988a35b1df7..8dd8c652b105e 100644 +index 0e6cd686e0b05..a26433ccb9307 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -46,6 +46,7 @@ @@ -101,7 +101,7 @@ index f3988a35b1df7..8dd8c652b105e 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1334,6 +1335,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1335,6 +1336,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -114,7 +114,7 @@ index f3988a35b1df7..8dd8c652b105e 100644 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 da60e9346b283..c36effdd7e5ee 100644 +index cbbc2f3ec12fa..f097b3cdded2f 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h @@ -27,7 +27,7 @@ class DiscardableSharedMemoryManager; @@ -149,10 +149,10 @@ index 283161145d792..9f3f635abdd1c 100644 if (main_argv) setproctitle_init(main_argv); diff --git content/public/app/content_main.h content/public/app/content_main.h -index 44d9aa44ae430..47f916f566696 100644 +index 7f9b515297357..89b52e34fa31a 100644 --- content/public/app/content_main.h +++ content/public/app/content_main.h -@@ -96,6 +96,13 @@ struct CONTENT_EXPORT ContentMainParams { +@@ -94,6 +94,13 @@ struct CONTENT_EXPORT ContentMainParams { } }; diff --git a/patch/patches/content_renderer_host_3617.patch b/patch/patches/content_renderer_host_3617.patch index 9db4f9a9d..ffef17495 100644 --- a/patch/patches/content_renderer_host_3617.patch +++ b/patch/patches/content_renderer_host_3617.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index 67b608870e591..f8f47a606ea51 100644 +index b656054d342f5..7889656173b0e 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -1614,7 +1614,8 @@ bool RenderProcessHostImpl::Init() { +@@ -1629,7 +1629,8 @@ bool RenderProcessHostImpl::Init() { // initialized because in tests the factory may never have been initialized. if (!GetBrowserContext()->IsOffTheRecord() && !base::CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 862be8bc3..5fe352c63 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -454,7 +454,7 @@ index eb5bcfe0234c3..8963b26806922 100644 handler_path, *database_path, metrics_path, url, GetProcessSimpleAnnotations(), arguments, true, false); diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc -index 9ab5fb1c82275..740014c1119bd 100644 +index 15addd5c5e663..f30027b9b6f3c 100644 --- components/crash/core/app/crashpad_win.cc +++ components/crash/core/app/crashpad_win.cc @@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations( @@ -525,7 +525,7 @@ index 9ab5fb1c82275..740014c1119bd 100644 start_arguments.push_back(std::string("--user-data-dir=") + user_data_dir); @@ -124,9 +131,12 @@ bool PlatformCrashpadInitialization( - start_arguments.push_back("/prefetch:7"); + start_arguments.push_back("/prefetch:4"); } else { base::FilePath exe_dir = exe_file.DirName(); - exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 694043f85..35a2c309a 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -60,10 +60,10 @@ index 8cea5bf4591cd..c5fca9dd1a9e8 100644 std::unique_ptr stream_container( new StreamContainer(tab_id, embedded, handler_url, extension_id, diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 55f83aa0e801a..e111e3273796e 100644 +index 52e6a29f65a91..8e8f92a45526c 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc -@@ -62,12 +62,13 @@ ExtensionHost::ExtensionHost(const Extension* extension, +@@ -105,12 +105,13 @@ ExtensionHost::ExtensionHost(const Extension* extension, host_type == mojom::ViewType::kOffscreenDocument || host_type == mojom::ViewType::kExtensionPopup || host_type == mojom::ViewType::kExtensionSidePanel); @@ -80,7 +80,7 @@ index 55f83aa0e801a..e111e3273796e 100644 main_frame_host_ = host_contents_->GetPrimaryMainFrame(); // Listen for when an extension is unloaded from the same profile, as it may -@@ -83,11 +84,49 @@ ExtensionHost::ExtensionHost(const Extension* extension, +@@ -126,11 +127,49 @@ ExtensionHost::ExtensionHost(const Extension* extension, // Create password reuse detection manager when new extension web contents are // created. ExtensionsBrowserClient::Get()->CreatePasswordReuseDetectionManager( @@ -132,7 +132,7 @@ index 55f83aa0e801a..e111e3273796e 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index c0398bdd68648..93fc2409ab3d7 100644 +index 94b02bca9b70b..5e3dacc34452a 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -62,6 +62,12 @@ class ExtensionHost : public DeferredStartRenderHost, @@ -157,7 +157,7 @@ index c0398bdd68648..93fc2409ab3d7 100644 content::RenderFrameHost* main_frame_host() const { return main_frame_host_; } content::RenderProcessHost* render_process_host() const; bool has_loaded_once() const { return has_loaded_once_; } -@@ -238,7 +244,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -248,7 +254,8 @@ class ExtensionHost : public DeferredStartRenderHost, raw_ptr browser_context_; // The host for our HTML content. @@ -199,10 +199,10 @@ index c3197eb4790fa..1e7ae767b0582 100644 } diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index bded50cb03354..4df474bd3c7bb 100644 +index 5da1cae2970c6..4e193c09c54b1 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h -@@ -31,6 +31,7 @@ +@@ -34,6 +34,7 @@ #include "url/gurl.h" class ExtensionFunctionRegistry; @@ -210,7 +210,7 @@ index bded50cb03354..4df474bd3c7bb 100644 class PrefService; namespace base { -@@ -79,6 +80,7 @@ class ComponentExtensionResourceManager; +@@ -82,6 +83,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -218,7 +218,7 @@ index bded50cb03354..4df474bd3c7bb 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -264,6 +266,14 @@ class ExtensionsBrowserClient { +@@ -272,6 +274,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; @@ -234,7 +234,7 @@ index bded50cb03354..4df474bd3c7bb 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 fcfb4635bfc23..619f210c7240e 100644 +index 399eba92dc627..60ad5d7dd3831 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc @@ -379,9 +379,17 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, @@ -257,10 +257,10 @@ index fcfb4635bfc23..619f210c7240e 100644 base::BindOnce(&ProcessManager::HandleCloseExtensionHost, weak_ptr_factory_.GetWeakPtr())); diff --git extensions/common/extensions_client.cc extensions/common/extensions_client.cc -index 713e66b05abcf..de97074586d0f 100644 +index 5142f341b8392..d3242aae96ece 100644 --- extensions/common/extensions_client.cc +++ extensions/common/extensions_client.cc -@@ -23,7 +23,7 @@ ExtensionsClient* g_client = nullptr; +@@ -25,7 +25,7 @@ ExtensionsClient* g_client = nullptr; } // namespace ExtensionsClient* ExtensionsClient::Get() { diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index c7557c4f2..38cd2d254 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,5 +1,5 @@ diff --git .gn .gn -index 321877844bd21..f7f00a99d6244 100644 +index afe0b3e90fafb..daae3b0e0e8d3 100644 --- .gn +++ .gn @@ -153,6 +153,8 @@ exec_script_whitelist = @@ -12,7 +12,7 @@ index 321877844bd21..f7f00a99d6244 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 678989ac85db1..b05b5aac2fc64 100644 +index 067b08552d5fc..bbb280ef9e307 100644 --- BUILD.gn +++ BUILD.gn @@ -19,6 +19,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -21,9 +21,9 @@ index 678989ac85db1..b05b5aac2fc64 100644 import("//build/util/generate_wrapper.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") + import("//components/enterprise/buildflags/buildflags.gni") import("//components/nacl/features.gni") - import("//device/vr/buildflags/buildflags.gni") -@@ -273,6 +274,10 @@ group("gn_all") { +@@ -277,6 +278,10 @@ group("gn_all") { deps += root_extra_deps @@ -76,18 +76,18 @@ index 1da479dd5eebc..ff9c7e467997c 100644 - visual_studio_runtime_dirs = [] } diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 5a4ddf12a9db3..6c255f9db2433 100644 +index 95d82be2f9050..191232294b59f 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni -@@ -6,6 +6,7 @@ import("//ash/ambient/resources/resources.gni") - import("//build/config/chromebox_for_meetings/buildflags.gni") +@@ -5,6 +5,7 @@ + import("//ash/ambient/resources/resources.gni") import("//build/config/chromeos/ui_mode.gni") import("//build/config/locales.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//components/compose/features.gni") -@@ -82,6 +83,10 @@ template("chrome_repack_percent") { +@@ -80,6 +81,10 @@ template("chrome_repack_percent") { "//ui/chromeos/resources", ] } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index fe68b7399..0c8cdfc2a 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 cdce083b1bea8..f59c624b3c7c0 100644 +index df93fa972dff6..3228d8377f597 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -1266,6 +1266,15 @@ +@@ -1269,6 +1269,15 @@ # END "everything else" section. # Everything but chrome/, components/, content/, and ios/ diff --git a/patch/patches/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index 4d75a822c..7e678413b 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 aab483d6b00ce..ed3c1e10a7fe7 100644 +index 1621a215784c9..5a13a75cea0dd 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn @@ -140,6 +140,7 @@ static_library("libxml") { diff --git a/patch/patches/light_mode_3534.patch b/patch/patches/light_mode_3534.patch index dd044f691..f6f6fc6f7 100644 --- a/patch/patches/light_mode_3534.patch +++ b/patch/patches/light_mode_3534.patch @@ -32,7 +32,7 @@ index 6b9d2c180c904..3570ef071ba07 100644 return (dark_mode_support.allow_dark_mode_for_app || dark_mode_support.set_preferred_app_mode) && diff --git ui/native_theme/native_theme_mac.mm ui/native_theme/native_theme_mac.mm -index b9feac1c87c51..bb63c6d350bfe 100644 +index be2f769afe2d1..51bcf353b8797 100644 --- ui/native_theme/native_theme_mac.mm +++ ui/native_theme/native_theme_mac.mm @@ -50,6 +50,13 @@ bool InvertedColors() { @@ -49,7 +49,7 @@ index b9feac1c87c51..bb63c6d350bfe 100644 } // namespace // Helper object to respond to light mode/dark mode changeovers. -@@ -577,11 +584,15 @@ void NativeThemeMac::PaintSelectedMenuItem( +@@ -594,11 +601,15 @@ void NativeThemeMac::PaintSelectedMenuItem( void NativeThemeMac::InitializeDarkModeStateAndObserver() { __block auto theme = this; @@ -67,22 +67,11 @@ index b9feac1c87c51..bb63c6d350bfe 100644 theme->set_preferred_color_scheme(CalculatePreferredColorScheme()); theme->NotifyOnNativeThemeUpdated(); }]; -@@ -590,7 +601,9 @@ void NativeThemeMac::InitializeDarkModeStateAndObserver() { - void NativeThemeMac::ConfigureWebInstance() { - // NativeThemeAura is used as web instance so we need to initialize its state. - NativeTheme* web_instance = NativeTheme::GetInstanceForWeb(); -- web_instance->set_use_dark_colors(IsDarkMode()); -+ if (!IsForcedLightMode()) { -+ web_instance->set_use_dark_colors(IsForcedDarkMode() || IsDarkMode()); -+ } - web_instance->set_preferred_color_scheme(CalculatePreferredColorScheme()); - web_instance->SetPreferredContrast(CalculatePreferredContrast()); - web_instance->set_prefers_reduced_transparency(PrefersReducedTransparency()); diff --git ui/native_theme/native_theme_win.cc ui/native_theme/native_theme_win.cc -index 50647269ec84f..c947bd2717d04 100644 +index 6af4df92820d5..c2ae96510d011 100644 --- ui/native_theme/native_theme_win.cc +++ ui/native_theme/native_theme_win.cc -@@ -662,14 +662,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -653,14 +653,17 @@ bool NativeThemeWin::ShouldUseDarkColors() const { // Windows high contrast modes are entirely different themes, // so let them take priority over dark mode. // ...unless --force-dark-mode was specified in which case caveat emptor. @@ -102,7 +91,7 @@ index 50647269ec84f..c947bd2717d04 100644 return NativeTheme::CalculatePreferredColorScheme(); // According to the spec, the preferred color scheme for web content is 'dark' -@@ -1660,8 +1663,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { +@@ -1651,8 +1654,9 @@ void NativeThemeWin::RegisterColorFilteringRegkeyObserver() { } void NativeThemeWin::UpdateDarkModeStatus() { diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 2aa7366d8..759bd48fc 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 321faab043958..7586dc52e50ca 100644 +index e21cd3f9c447d..3e366eab65155 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -188,7 +188,7 @@ ZygoteCommunication* ChildProcessLauncherHelper::GetZygoteForLaunch() { diff --git a/patch/patches/linux_blink_thread_local.patch b/patch/patches/linux_blink_thread_local.patch index 1516ff0ac..b2a91eaf7 100644 --- a/patch/patches/linux_blink_thread_local.patch +++ b/patch/patches/linux_blink_thread_local.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/renderer/platform/heap/thread_local.h third_party/blink/renderer/platform/heap/thread_local.h -index e0519b0982e43..40637ce5952e3 100644 +index a672ba785ac06..13d794dc15c16 100644 --- third_party/blink/renderer/platform/heap/thread_local.h +++ third_party/blink/renderer/platform/heap/thread_local.h -@@ -36,7 +36,7 @@ +@@ -37,7 +37,7 @@ #if BLINK_HEAP_HIDE_THREAD_LOCAL_IN_LIBRARY #define BLINK_HEAP_THREAD_LOCAL_MODEL "local-dynamic" #else diff --git a/patch/patches/linux_bluetooth_1319006.patch b/patch/patches/linux_bluetooth_1319006.patch index ac4312539..e54846e56 100644 --- a/patch/patches/linux_bluetooth_1319006.patch +++ b/patch/patches/linux_bluetooth_1319006.patch @@ -1,5 +1,5 @@ diff --git device/bluetooth/BUILD.gn device/bluetooth/BUILD.gn -index 6a662873b042a..5d0eb2347513e 100644 +index e09b425de7f7c..d2f0993eac5cb 100644 --- device/bluetooth/BUILD.gn +++ device/bluetooth/BUILD.gn @@ -47,10 +47,12 @@ source_set("deprecated_experimental_mojo") { diff --git a/patch/patches/linux_connection_5115482.patch b/patch/patches/linux_connection_5115482.patch deleted file mode 100644 index ea2738344..000000000 --- a/patch/patches/linux_connection_5115482.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git ui/gfx/x/connection.cc ui/gfx/x/connection.cc -index e9034ec7dea3e..b11df74c1d9dd 100644 ---- ui/gfx/x/connection.cc -+++ ui/gfx/x/connection.cc -@@ -183,6 +183,7 @@ Connection::Connection(const std::string& address) - Connection::~Connection() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - -+ window_event_manager_.Reset(); - platform_event_source.reset(); - } - -diff --git ui/gfx/x/window_event_manager.cc ui/gfx/x/window_event_manager.cc -index 7aee20ec3d2b7..9b5b320402ff8 100644 ---- ui/gfx/x/window_event_manager.cc -+++ ui/gfx/x/window_event_manager.cc -@@ -113,10 +113,18 @@ WindowEventManager::WindowEventManager(Connection* connection) - : connection_(connection) {} - - WindowEventManager::~WindowEventManager() { -+ Reset(); -+} -+ -+void WindowEventManager::Reset() { -+ if (!connection_) { -+ return; -+ } - // Clear events still requested by not-yet-deleted ScopedEventSelectors. - for (const auto& mask_pair : mask_map_) { - SetEventMask(connection_, mask_pair.first, EventMask::NoEvent); - } -+ connection_ = nullptr; - } - - void WindowEventManager::SelectEvents(Window window, EventMask event_mask) { -@@ -143,7 +151,9 @@ void WindowEventManager::AfterMaskChanged(Window window, EventMask old_mask) { - return; - } - -- SetEventMask(connection_, window, new_mask); -+ if (connection_) { -+ SetEventMask(connection_, window, new_mask); -+ } - - if (new_mask == EventMask::NoEvent) { - mask_map_.erase(window); -diff --git ui/gfx/x/window_event_manager.h ui/gfx/x/window_event_manager.h -index 4b85f49d3b2cc..c0158edd6901b 100644 ---- ui/gfx/x/window_event_manager.h -+++ ui/gfx/x/window_event_manager.h -@@ -53,6 +53,8 @@ class WindowEventManager { - - ~WindowEventManager(); - -+ void Reset(); -+ - private: - friend class ScopedEventSelector; - -@@ -70,7 +72,7 @@ class WindowEventManager { - // necessary. - void AfterMaskChanged(Window window, EventMask old_mask); - -- const raw_ptr connection_; -+ raw_ptr connection_; - - std::map> mask_map_; - }; diff --git a/patch/patches/linux_glib_deprecated_volatile.patch b/patch/patches/linux_glib_deprecated_volatile.patch index 8b3685c6b..d635f6e74 100644 --- a/patch/patches/linux_glib_deprecated_volatile.patch +++ b/patch/patches/linux_glib_deprecated_volatile.patch @@ -1,8 +1,8 @@ diff --git ui/accessibility/platform/BUILD.gn ui/accessibility/platform/BUILD.gn -index 4e23c38763184..162f8b453f4ac 100644 +index 181b77f7ca411..79461dc7690ae 100644 --- ui/accessibility/platform/BUILD.gn +++ ui/accessibility/platform/BUILD.gn -@@ -287,6 +287,10 @@ component("platform") { +@@ -290,6 +290,10 @@ component("platform") { if (use_gio) { configs += [ "//build/linux:gio_config" ] } @@ -14,10 +14,10 @@ index 4e23c38763184..162f8b453f4ac 100644 } } diff --git ui/gtk/BUILD.gn ui/gtk/BUILD.gn -index f4c5a2bcebbb7..5faf19980b1bd 100644 +index 24f32893160ad..3315d46b4a910 100644 --- ui/gtk/BUILD.gn +++ ui/gtk/BUILD.gn -@@ -174,4 +174,8 @@ component("gtk") { +@@ -175,4 +175,8 @@ component("gtk") { # TODO: This should be removed. deps += [ "//ui/ozone" ] diff --git a/patch/patches/linux_libxml_tls_3616.patch b/patch/patches/linux_libxml_tls_3616.patch deleted file mode 100644 index 2e405617b..000000000 --- a/patch/patches/linux_libxml_tls_3616.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git third_party/libxml/linux/config.h third_party/libxml/linux/config.h -index c064071ce1545..65110af9a78f5 100644 ---- third_party/libxml/linux/config.h -+++ third_party/libxml/linux/config.h -@@ -171,7 +171,7 @@ - /* #undef XML_SOCKLEN_T */ - - /* TLS specifier */ --#define XML_THREAD_LOCAL _Thread_local -+/* #undef XML_THREAD_LOCAL */ - - /* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the diff --git a/patch/patches/linux_printing_context.patch b/patch/patches/linux_printing_context.patch index 6a61f3dac..e84e8e8ae 100644 --- a/patch/patches/linux_printing_context.patch +++ b/patch/patches/linux_printing_context.patch @@ -76,7 +76,7 @@ index 29db798e8b171..f8b9546b90321 100644 } diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h -index 9cc65cf571346..275b548fcc2cf 100644 +index 69f678a91012f..d518b476002b3 100644 --- ui/linux/linux_ui.h +++ ui/linux/linux_ui.h @@ -19,6 +19,10 @@ diff --git a/patch/patches/mac_platform_style_bubble_893292.patch b/patch/patches/mac_platform_style_bubble_893292.patch index 24b44bac1..63925dd0d 100644 --- a/patch/patches/mac_platform_style_bubble_893292.patch +++ b/patch/patches/mac_platform_style_bubble_893292.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index 7de5f5de28091..b2bccf7d9e3d9 100644 +index 1ea1910a5bfe1..c73433d1ad893 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc -@@ -1038,8 +1038,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { +@@ -1042,8 +1042,8 @@ int ProfileMenuViewBase::GetMaxHeight() const { ->GetDisplayNearestPoint(anchor_rect.CenterPoint()) .work_area(); int available_space = screen_space.bottom() - anchor_rect.bottom(); diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index f6998590c..8bf834098 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -30,10 +30,10 @@ index c30066f515f63..450c67882ea91 100644 } if (has_msg) diff --git base/task/current_thread.cc base/task/current_thread.cc -index 96b2fd7cad015..2fa7f4016fe5a 100644 +index 200d6692664e9..62dce72284b83 100644 --- base/task/current_thread.cc +++ base/task/current_thread.cc -@@ -48,6 +48,8 @@ void CurrentThread::AddDestructionObserver( +@@ -51,6 +51,8 @@ void CurrentThread::AddDestructionObserver( void CurrentThread::RemoveDestructionObserver( DestructionObserver* destruction_observer) { @@ -43,12 +43,12 @@ index 96b2fd7cad015..2fa7f4016fe5a 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/task/current_thread.h base/task/current_thread.h -index 33e320fd647cb..5f67ef65d4392 100644 +index f572b46819262..06b0a15e359ae 100644 --- base/task/current_thread.h +++ base/task/current_thread.h -@@ -133,6 +133,12 @@ class BASE_EXPORT CurrentThread { - // with a null callback to clear any potentially pending callbacks. - void RegisterOnNextIdleCallback(OnceClosure on_next_idle_callback); +@@ -163,6 +163,12 @@ class BASE_EXPORT CurrentThread { + RegisterOnNextIdleCallbackPasskey, + OnceClosure on_next_idle_callback); +#if BUILDFLAG(IS_WIN) + void set_os_modal_loop(bool os_modal_loop) { os_modal_loop_ = os_modal_loop; } @@ -59,7 +59,7 @@ index 33e320fd647cb..5f67ef65d4392 100644 // Enables nested task processing in scope of an upcoming native message loop. // Some unwanted message loops may occur when using common controls or printer // functions. Hence, nested task processing is disabled by default to avoid -@@ -197,6 +203,13 @@ class BASE_EXPORT CurrentThread { +@@ -227,6 +233,13 @@ class BASE_EXPORT CurrentThread { friend class web::WebTaskEnvironment; raw_ptr current_; diff --git a/patch/patches/mojo_generator_1422178.patch b/patch/patches/mojo_generator_1422178.patch deleted file mode 100644 index a00f5cd2c..000000000 --- a/patch/patches/mojo_generator_1422178.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git mojo/public/tools/bindings/generators/mojom_ts_generator.py mojo/public/tools/bindings/generators/mojom_ts_generator.py -index 98516f03276e4..a1bda9c021c52 100644 ---- mojo/public/tools/bindings/generators/mojom_ts_generator.py -+++ mojo/public/tools/bindings/generators/mojom_ts_generator.py -@@ -177,6 +177,8 @@ def _GetWebUiModulePath(module): - path = module.metadata.get('webui_module_path') - if path is None or path == '/': - return path -+ if path == '': -+ return '/' - if _IsAbsoluteChromeResourcesPath(path): - return path.rstrip('/') + '/' - return '/{}/'.format(path.strip('/')) diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index d550841e6..8abfe3fe4 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -1,8 +1,8 @@ diff --git net/base/load_flags_list.h net/base/load_flags_list.h -index 17b1395583e24..9b41b21f42b1f 100644 +index 0e563dbb253ca..891b2bbc3785c 100644 --- net/base/load_flags_list.h +++ net/base/load_flags_list.h -@@ -114,3 +114,6 @@ LOAD_FLAG(DISABLE_SHARED_DICTIONARY_AFTER_CROSS_ORIGIN_REDIRECT, 1 << 18) +@@ -115,3 +115,6 @@ LOAD_FLAG(DISABLE_SHARED_DICTIONARY_AFTER_CROSS_ORIGIN_REDIRECT, 1 << 18) // This flag is used to bypass HSTS upgrades. This flag must be set for AIA, // CRL, and OCSP requests in order to prevent circular dependencies. LOAD_FLAG(SHOULD_BYPASS_HSTS, 1 << 19) @@ -10,10 +10,10 @@ index 17b1395583e24..9b41b21f42b1f 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 20) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index dd14dce03cc93..eb25e13036d1a 100644 +index 6eeea59318bbc..6e46770ca0f74 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -1812,7 +1812,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { +@@ -1850,7 +1850,8 @@ bool URLRequestHttpJob::ShouldAddCookieHeader() const { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. diff --git a/patch/patches/net_test_server_3798752.patch b/patch/patches/net_test_server_3798752.patch index 6c4c52e2a..bc6633a41 100644 --- a/patch/patches/net_test_server_3798752.patch +++ b/patch/patches/net_test_server_3798752.patch @@ -1,8 +1,8 @@ diff --git net/test/embedded_test_server/embedded_test_server.cc net/test/embedded_test_server/embedded_test_server.cc -index 357b362117d20..b5c7cfe5dd511 100644 +index 3167953b790e5..bc328c0a1cedc 100644 --- net/test/embedded_test_server/embedded_test_server.cc +++ net/test/embedded_test_server/embedded_test_server.cc -@@ -997,7 +997,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) { +@@ -1015,7 +1015,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWait(base::OnceClosure closure) { if (!base::CurrentThread::Get()) temporary_loop = std::make_unique(); @@ -11,7 +11,7 @@ index 357b362117d20..b5c7cfe5dd511 100644 if (!io_thread_->task_runner()->PostTaskAndReply( FROM_HERE, std::move(closure), run_loop.QuitClosure())) { return false; -@@ -1024,7 +1024,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult( +@@ -1042,7 +1042,7 @@ bool EmbeddedTestServer::PostTaskToIOThreadAndWaitWithResult( if (!base::CurrentThread::Get()) temporary_loop = std::make_unique(); diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 283b61cc4..96c379d14 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -13,10 +13,10 @@ index 431df5d50debe..0fcc9ea8fbb1a 100644 return nullptr; } diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index a6c27fe9b7f71..11060758d670f 100644 +index b62442d2213a7..e7275588c01ce 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3272,6 +3272,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3305,6 +3305,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -29,17 +29,17 @@ index a6c27fe9b7f71..11060758d670f 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 28f81135df654..85125c19aaa2f 100644 +index 709246523b417..1245082f6016c 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -807,6 +807,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -808,6 +808,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); + void SetCompositorForFlingScheduler(ui::Compositor* compositor); - // The RenderWidgetHostImpl will keep showing the old page (for a while) after - // navigation until the first frame of the new page arrives. This reduces + RenderWidgetHostViewBase* GetRenderWidgetHostViewBase(); + diff --git content/common/input/fling_scheduler_base.h content/common/input/fling_scheduler_base.h index e8ee63f3abc2e..2d1717082759d 100644 --- content/common/input/fling_scheduler_base.h diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 7659e216b..aaf910606 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc -index 1d30371b0131c..1ba3d15a3c0af 100644 +index dc474d9ca5c3a..764ae7c3ddce2 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -23,6 +23,7 @@ @@ -11,7 +11,7 @@ index 1d30371b0131c..1ba3d15a3c0af 100644 #include "chrome/browser/download/download_core_service_factory.h" #include "chrome/browser/download/download_core_service_impl.h" @@ -63,6 +64,10 @@ - #include "chrome/browser/download/bubble/download_bubble_prefs.h" + #include "chrome/browser/flags/android/chrome_feature_list.h" #endif +#if BUILDFLAG(ENABLE_CEF) @@ -84,7 +84,7 @@ index c85248ab0d0a0..05b3454c0356d 100644 } diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index e13101506295d..4acd84f6c150f 100644 +index ef26355bd31b8..6b00ae03e6ac8 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -25,6 +25,7 @@ @@ -109,7 +109,7 @@ index e13101506295d..4acd84f6c150f 100644 constexpr char kInvalidArgsForDidStartPreview[] = "Invalid arguments for DidStartPreview"; constexpr char kInvalidPageIndexForDidPreviewPage[] = -@@ -301,7 +309,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { +@@ -309,7 +317,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { source->AddLocalizedStrings(kLocalizedStrings); #if !BUILDFLAG(IS_CHROMEOS) diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index 3fe71f5d1..b446b6ebd 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/printer_query.cc chrome/browser/printing/printer_query.cc -index 75fb743f95c37..a79ca84b4ff4c 100644 +index 418f53b0db3a2..4abcc0005eb1d 100644 --- chrome/browser/printing/printer_query.cc +++ chrome/browser/printing/printer_query.cc @@ -124,6 +124,7 @@ PrinterQuery::PrinterQuery(content::GlobalRenderFrameHostId rfh_id) @@ -11,12 +11,12 @@ index 75fb743f95c37..a79ca84b4ff4c 100644 PrinterQuery::~PrinterQuery() { diff --git printing/printing_context.h printing/printing_context.h -index 6db58a9992642..ac57e5c200079 100644 +index 63f170c950504..962e60d23da59 100644 --- printing/printing_context.h +++ printing/printing_context.h -@@ -204,6 +204,13 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { - - int job_id() const { return job_id_; } +@@ -215,6 +215,13 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { + void SetJobId(int job_id); + #endif + void set_render_ids(int render_process_id, int render_frame_id) { + render_process_id_ = render_process_id; @@ -28,9 +28,9 @@ index 6db58a9992642..ac57e5c200079 100644 protected: PrintingContext(Delegate* delegate, ProcessBehavior process_behavior); -@@ -234,6 +241,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { - // The job id for the current job. The value is 0 if no jobs are active. - int job_id_; +@@ -248,6 +255,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { + // management. + int job_id_ = kNoPrintJobId; + // Routing IDs for the frame that owns this object. + int render_process_id_ = 0; diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index f654f971e..45d8b0e6e 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 401a00dba286c..d8b2f261bc6e6 100644 +index caa732b8f72d3..ccddb59643734 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -710,6 +710,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { +@@ -709,6 +709,8 @@ bool RenderViewHostImpl::IsRenderViewLive() const { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/rfh_navigation_4829483.patch b/patch/patches/rfh_navigation_4829483.patch index f646bf2f1..a709d50ca 100644 --- a/patch/patches/rfh_navigation_4829483.patch +++ b/patch/patches/rfh_navigation_4829483.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index 6377dafc2eeac..1e0062bd83343 100644 +index 9b37b8a18c5c0..048e70377224c 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -10082,6 +10082,7 @@ void RenderFrameHostImpl::CommitNavigation( +@@ -10278,6 +10278,7 @@ void RenderFrameHostImpl::CommitNavigation( auto browser_calc_origin_to_commit = navigation_request->GetOriginToCommitWithDebugInfo(); if (!process_lock.is_error_page() && !is_mhtml_subframe && diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 9a6ce51e0..36a496f25 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 268533e5bd0ef..48e2089d95729 100644 +index 7942ee12c003c..a742da36eb1a6 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -6,6 +6,7 @@ @@ -10,7 +10,7 @@ index 268533e5bd0ef..48e2089d95729 100644 #include #include -@@ -747,10 +748,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -725,10 +726,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -27,7 +27,7 @@ index 268533e5bd0ef..48e2089d95729 100644 } #if BUILDFLAG(IS_WIN) -@@ -2381,6 +2384,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2353,6 +2356,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { window_->layer()->SetColor(GetBackgroundColor() ? *GetBackgroundColor() : SK_ColorWHITE); UpdateFrameSinkIdRegistration(); diff --git a/patch/patches/screen_1443650.patch b/patch/patches/screen_1443650.patch index 19c6ba8be..1c576bf04 100644 --- a/patch/patches/screen_1443650.patch +++ b/patch/patches/screen_1443650.patch @@ -19,10 +19,10 @@ index 22747ebcf31c0..8fba5da85a656 100644 bool Screen::GetDisplayWithDisplayId(int64_t display_id, diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc -index 773fbb8e90276..bdbda65c05dd6 100644 +index 6b6189a124e3f..02fc6c885d11d 100644 --- ui/display/win/screen_win.cc +++ ui/display/win/screen_win.cc -@@ -535,7 +535,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { +@@ -534,7 +534,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { gfx::PointF(pixel_bounds.origin()), screen_win_display)); const float scale_factor = 1.0f / screen_win_display.display().device_scale_factor(); @@ -31,7 +31,7 @@ index 773fbb8e90276..bdbda65c05dd6 100644 } // static -@@ -550,7 +550,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { +@@ -549,7 +549,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { const gfx::Point origin = display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display); const float scale_factor = screen_win_display.display().device_scale_factor(); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index 7c0b4ebb4..24c818725 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc -index 7df34f2bc2409..fdc9d91e9d29b 100644 +index 101044d12aa89..795fb5f2d0738 100644 --- chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc +++ chrome/browser/enterprise/connectors/analysis/content_analysis_delegate.cc @@ -23,6 +23,7 @@ @@ -10,7 +10,7 @@ index 7df34f2bc2409..fdc9d91e9d29b 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/enterprise/connectors/analysis/analysis_settings.h" #include "chrome/browser/enterprise/connectors/analysis/content_analysis_dialog.h" -@@ -246,6 +247,9 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile, +@@ -265,6 +266,9 @@ bool ContentAnalysisDelegate::IsEnabled(Profile* profile, GURL url, Data* data, AnalysisConnector connector) { @@ -20,33 +20,11 @@ index 7df34f2bc2409..fdc9d91e9d29b 100644 auto* service = ConnectorsServiceFactory::GetForBrowserContext(profile); // If the corresponding Connector policy isn't set, don't perform scans. if (!service || !service->IsConnectorEnabled(connector)) -diff --git chrome/browser/feedback/system_logs/log_sources/related_website_sets_source.cc chrome/browser/feedback/system_logs/log_sources/related_website_sets_source.cc -index e6f1e81de0eb4..1b2333023320a 100644 ---- chrome/browser/feedback/system_logs/log_sources/related_website_sets_source.cc -+++ chrome/browser/feedback/system_logs/log_sources/related_website_sets_source.cc -@@ -9,6 +9,7 @@ - - #include "base/json/json_writer.h" - #include "base/values.h" -+#include "cef/libcef/features/runtime.h" - #include "chrome/browser/first_party_sets/first_party_sets_policy_service.h" - #include "chrome/browser/first_party_sets/first_party_sets_policy_service_factory.h" - #include "chrome/browser/profiles/profile.h" -@@ -50,6 +51,9 @@ const char* GetSiteType(const net::SiteType type) { - // "PrimarySites": [ "https://example2.com", "https://example2.com.co" ] - // } ] - std::string ComputeRelatedWebsiteSetsInfo() { -+ if (cef::IsAlloyRuntimeEnabled()) { -+ return ""; -+ } - #if BUILDFLAG(IS_CHROMEOS_ASH) - Profile* profile = ProfileManager::GetActiveUserProfile(); - #else diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index 5923117661980..c363f0039d243 100644 +index 62d54608cfe39..b0c5e3970de03 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc -@@ -22,6 +22,7 @@ +@@ -23,6 +23,7 @@ #include "base/trace_event/trace_event.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -54,7 +32,7 @@ index 5923117661980..c363f0039d243 100644 #include "chrome/browser/browser_features.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" -@@ -271,8 +272,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) +@@ -275,8 +276,10 @@ ProfileNetworkContextService::ProfileNetworkContextService(Profile* profile) base::Unretained(this))); cookie_settings_ = CookieSettingsFactory::GetForProfile(profile); cookie_settings_observation_.Observe(cookie_settings_.get()); @@ -67,7 +45,7 @@ index 5923117661980..c363f0039d243 100644 DisableQuicIfNotAllowed(); -@@ -442,6 +445,9 @@ void ProfileNetworkContextService::OnTruncatedCookieBlockingChanged() { +@@ -468,6 +471,9 @@ void ProfileNetworkContextService::OnTruncatedCookieBlockingChanged() { void ProfileNetworkContextService::OnFirstPartySetsEnabledChanged( bool enabled) { @@ -77,7 +55,7 @@ index 5923117661980..c363f0039d243 100644 // Update all FPS Access Delegates on the FPS service to be `enabled`. first_party_sets::FirstPartySetsPolicyServiceFactory::GetForBrowserContext( profile_) -@@ -814,9 +820,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -913,9 +919,26 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->cookie_manager_params = CreateCookieManagerParams(profile_, *cookie_settings_); @@ -105,7 +83,7 @@ index 5923117661980..c363f0039d243 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -825,15 +848,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -924,15 +947,14 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( local_state->GetFilePath(prefs::kDiskCacheDir); if (!disk_cache_dir.empty()) base_cache_path = disk_cache_dir.Append(base_cache_path.BaseName()); @@ -125,7 +103,7 @@ index 5923117661980..c363f0039d243 100644 network_context_params->file_paths->data_directory = path.Append(chrome::kNetworkDataDirname); network_context_params->file_paths->unsandboxed_data_path = path; -@@ -986,6 +1008,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1104,6 +1126,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->block_trust_tokens = anti_abuse_content_setting == CONTENT_SETTING_BLOCK; @@ -133,7 +111,7 @@ index 5923117661980..c363f0039d243 100644 network_context_params->first_party_sets_access_delegate_params = network::mojom::FirstPartySetsAccessDelegateParams::New(); network_context_params->first_party_sets_access_delegate_params->enabled = -@@ -1002,6 +1025,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -1120,6 +1143,7 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( GetForBrowserContext(profile_); DCHECK(fps_service); fps_service->AddRemoteAccessDelegate(std::move(fps_access_delegate_remote)); @@ -186,7 +164,7 @@ index 77522f65b7b6e..51cc2d60d4b8d 100644 GetInstance()->GetServiceForBrowserContext(profile, true)); } diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 0c3ce2e289b59..7ea3744e33b60 100644 +index 643279afbb341..aadd242e17cd0 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc @@ -552,6 +552,25 @@ void CookieMonster::SetCookieableSchemes( @@ -216,7 +194,7 @@ index 0c3ce2e289b59..7ea3744e33b60 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index 40d12ecb55155..b87a1cb86f85c 100644 +index 6871ed30edce4..594c0c5b5f4d5 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h @@ -208,6 +208,8 @@ class NET_EXPORT CookieMonster : public CookieStore { @@ -245,10 +223,10 @@ index 61fd008fc067e..73909be088278 100644 // reset to null. const CookieAccessDelegate* cookie_access_delegate() const { diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc -index 708a4ae904d88..dc63376f7a50e 100644 +index e5e410525d8a6..ca1225642ef64 100644 --- services/network/cookie_manager.cc +++ services/network/cookie_manager.cc -@@ -303,14 +303,9 @@ void CookieManager::AllowFileSchemeCookies( +@@ -310,14 +310,9 @@ void CookieManager::AllowFileSchemeCookies( AllowFileSchemeCookiesCallback callback) { OnSettingsWillChange(); @@ -267,10 +245,10 @@ index 708a4ae904d88..dc63376f7a50e 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 5ac5baaa6a86c..77575748bfacf 100644 +index 4547a0dc69562..d03e771ee52b8 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2506,16 +2506,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2385,16 +2385,20 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -299,10 +277,10 @@ index 5ac5baaa6a86c..77575748bfacf 100644 base::FeatureList::IsEnabled(features::kFledgePst)) { trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 93c755060193d..0ee9441892cda 100644 +index 3096bd7d6719b..1c383acba0207 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -371,6 +371,9 @@ struct NetworkContextParams { +@@ -358,6 +358,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 b194a96a0..04f60a9b5 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,32 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index 9aad7b5bb5ac8..bb31eb35c9aa4 100644 +index a1db5b377647e..3442371165570 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -543,10 +543,6 @@ class LoginHandlerDelegate { - } - - WebContents* web_contents = web_contents_getter_.Run(); -- if (!web_contents) { -- OnAuthCredentials(absl::nullopt); -- return; -- } - - // WeakPtr is not strictly necessary here due to OnRequestCancelled. - creating_login_delegate_ = true; -@@ -598,12 +594,6 @@ void OnAuthRequiredContinuation( - mojo::PendingRemote - auth_challenge_responder, - base::RepeatingCallback web_contents_getter) { -- if (!web_contents_getter || !web_contents_getter.Run()) { -- mojo::Remote -- auth_challenge_responder_remote(std::move(auth_challenge_responder)); -- auth_challenge_responder_remote->OnAuthCredentials(absl::nullopt); -- return; -- } - new LoginHandlerDelegate( - std::move(auth_challenge_responder), std::move(web_contents_getter), - auth_info, is_request_for_primary_main_frame, process_id, request_id, url, -@@ -3349,8 +3339,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -3345,8 +3345,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +16,7 @@ index 9aad7b5bb5ac8..bb31eb35c9aa4 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -3360,9 +3354,12 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -3356,9 +3360,12 @@ void StoragePartitionImpl::InitNetworkContext() { cert_verifier::mojom::CertVerifierCreationParamsPtr cert_verifier_creation_params = cert_verifier::mojom::CertVerifierCreationParams::New(); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index 2009cb239..3a4ca5ba2 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/webview/webview.cc ui/views/controls/webview/webview.cc -index a2459f3137633..ad29bed6db43a 100644 +index 8df4e98500b1e..f649d016e1e5a 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -160,6 +160,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, +@@ -159,6 +159,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, } } @@ -14,10 +14,10 @@ index a2459f3137633..ad29bed6db43a 100644 if (crashed_overlay_view_.view() == crashed_overlay_view) { return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index ff8755f0cfa28..0c7d3e22b863a 100644 +index 3b829d69e4254..6d58b64600c58 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h -@@ -91,6 +91,10 @@ class WEBVIEW_EXPORT WebView : public View, +@@ -93,6 +93,10 @@ class WEBVIEW_EXPORT WebView : public View, void EnableSizingFromWebContents(const gfx::Size& min_size, const gfx::Size& max_size); diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 68801ca34..5608c35be 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -13,7 +13,7 @@ index 01d2a426e2c17..c239a2f6fc786 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 ba0387d5e3c5e..cc8f21ede9967 100644 +index 9f955ab67a071..80f911e8157dd 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc @@ -130,7 +130,7 @@ StoragePartition* BrowserContext::GetStoragePartition( @@ -25,7 +25,7 @@ index ba0387d5e3c5e..cc8f21ede9967 100644 // An off the record profile MUST only use in memory storage partitions. CHECK(storage_partition_config.in_memory()); } -@@ -356,7 +356,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { +@@ -364,7 +364,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { const bool kUseInMemoryDBDefault = false; bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, @@ -36,7 +36,7 @@ index ba0387d5e3c5e..cc8f21ede9967 100644 std::unique_ptr stats_db; if (use_in_memory_db) { diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc -index 81013d6eb993a..89abfbe7fec6c 100644 +index e82cdd66a2d5c..1816b2fe54ff5 100644 --- content/public/browser/storage_partition_config.cc +++ content/public/browser/storage_partition_config.cc @@ -7,6 +7,7 @@ diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index 9024ba0e4..f789a5f7e 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 85e831614b7f0..039db32544b4e 100644 +index f82e41ee24e1d..b0b64ec7c249c 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -65,6 +65,8 @@ diff --git a/patch/patches/views_1749_2102_3330.patch b/patch/patches/views_1749_2102_3330.patch index 8822b62ec..f69c66e39 100644 --- a/patch/patches/views_1749_2102_3330.patch +++ b/patch/patches/views_1749_2102_3330.patch @@ -1,15 +1,15 @@ diff --git chrome/browser/ui/views/toolbar/app_menu.cc chrome/browser/ui/views/toolbar/app_menu.cc -index 4b17c7f0423bd..ea4c5838ec73f 100644 +index bd539436f7204..7fa48b6b3dba0 100644 --- chrome/browser/ui/views/toolbar/app_menu.cc +++ chrome/browser/ui/views/toolbar/app_menu.cc -@@ -993,7 +993,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { +@@ -999,7 +999,9 @@ void AppMenu::RunMenu(views::MenuButtonController* host) { host->button()->GetWidget(), host, host->button()->GetAnchorBoundsInScreen(), views::MenuAnchorPosition::kTopRight, ui::MENU_SOURCE_NONE, -- /*native_view_for_gestures=*/gfx::NativeView(), /*corners=*/absl::nullopt, +- /*native_view_for_gestures=*/gfx::NativeView(), /*corners=*/std::nullopt, + /*native_view_for_gestures=*/gfx::NativeView(), + /*parent_widget=*/gfx::kNullAcceleratedWidget, -+ /*corners=*/absl::nullopt, ++ /*corners=*/std::nullopt, "Chrome.AppMenu.MenuHostInitToNextFramePresented"); } @@ -58,10 +58,10 @@ index a6d70c71a1b3a..1b628f5284409 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 2a0591cd1bc1a..99e1da00e1c75 100644 +index cf08dd7f0a3ad..8366b2e4104d0 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -670,6 +670,14 @@ void RenderText::SetWhitespaceElision(absl::optional whitespace_elision) { +@@ -671,6 +671,14 @@ void RenderText::SetWhitespaceElision(absl::optional whitespace_elision) { } } @@ -76,7 +76,7 @@ index 2a0591cd1bc1a..99e1da00e1c75 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -2070,6 +2078,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2071,6 +2079,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -97,7 +97,7 @@ index 2a0591cd1bc1a..99e1da00e1c75 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 6195f237d49ba..fa566294dcdc7 100644 +index 5b3eda36fa332..d307017905c7d 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h @@ -347,6 +347,10 @@ class GFX_EXPORT RenderText { @@ -134,10 +134,10 @@ index c1c0631071a11..aa2c01ebce43e 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 1fb9b89c56e6c..031221a565e4f 100644 +index 0181ca73b3545..5a36c3b7a0a22 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -577,6 +577,12 @@ void LabelButton::OnThemeChanged() { +@@ -579,6 +579,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -151,24 +151,24 @@ index 1fb9b89c56e6c..031221a565e4f 100644 Button::StateChanged(old_state); ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 518d9d1d8d022..a997b7982bfb0 100644 +index d5f56eb7b0bbf..65c8572b3f6d8 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -164,6 +164,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { - ui::NativeTheme::State GetForegroundThemeState( - ui::NativeTheme::ExtraParams* params) const override; +@@ -173,6 +173,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { + // widget, and the parent of the containing widget. + ButtonState GetVisualState() const; + // Sets the font list used by this button. + void SetFontList(const gfx::FontList& font_list); + protected: - ImageView* image() const { return image_; } - Label* label() const { return label_; } + LabelButtonImageContainer* image_container() { + return image_container_.get(); diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index ac9fcfc932d0b..88b14d92d7278 100644 +index bee3e8a14eb85..6246560284fe8 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -56,12 +56,29 @@ enum LabelPropertyKey { +@@ -51,12 +51,29 @@ enum LabelPropertyKey { kLabelLineHeight, kLabelObscured, kLabelAllowCharacterBreak, @@ -198,7 +198,7 @@ index ac9fcfc932d0b..88b14d92d7278 100644 } // namespace namespace views { -@@ -481,6 +498,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -472,6 +489,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { OnPropertyChanged(&elide_behavior_, kPropertyEffectsPreferredSizeChanged); } @@ -214,7 +214,7 @@ index ac9fcfc932d0b..88b14d92d7278 100644 std::u16string Label::GetTooltipText() const { return tooltip_text_; } -@@ -801,6 +827,16 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -780,6 +806,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } @@ -232,7 +232,7 @@ index ac9fcfc932d0b..88b14d92d7278 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index a2c47313841e2..9123b35b320f9 100644 +index c51219fabae91..7a84f2bb266d8 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h @@ -241,6 +241,10 @@ class VIEWS_EXPORT Label : public View, @@ -246,7 +246,7 @@ index a2c47313841e2..9123b35b320f9 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 -@@ -527,6 +531,7 @@ class VIEWS_EXPORT Label : public View, +@@ -521,6 +525,7 @@ class VIEWS_EXPORT Label : public View, int max_width_ = 0; // This is used in single-line mode. int max_width_single_line_ = 0; @@ -255,7 +255,7 @@ index a2c47313841e2..9123b35b320f9 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 896190761b3b2..66b128ac4ab89 100644 +index 50fd3ae4ff13e..12961bf3e8316 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc @@ -566,7 +566,8 @@ void MenuController::Run(Widget* parent, @@ -284,7 +284,7 @@ index 896190761b3b2..66b128ac4ab89 100644 if (item->GetParentMenuItem()) { params.context = item->GetWidget(); // (crbug.com/1414232) The item to be open is a submenu. Make sure -@@ -2919,8 +2922,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( +@@ -2918,8 +2921,13 @@ MenuItemView* MenuController::FindInitialSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -299,7 +299,7 @@ index 896190761b3b2..66b128ac4ab89 100644 // Show the sub-menu. SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); -@@ -2940,8 +2948,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2939,8 +2947,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -411,10 +411,10 @@ index aafbdb2535951..8a8e78be4a649 100644 explicit MenuHost(SubmenuView* submenu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index f556d3d550f5f..5fc809acc0373 100644 +index 372d0ce15587d..bbb7aec20c5e4 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1055,6 +1055,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1072,6 +1072,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); @@ -430,7 +430,7 @@ index f556d3d550f5f..5fc809acc0373 100644 } else if (paint_as_selected) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1119,6 +1128,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -1136,6 +1145,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool paint_as_selected) const { @@ -692,10 +692,10 @@ index 5db5ddfec3c1f..af0ee5a3ae030 100644 absl::optional show_menu_host_duration_histogram = absl::nullopt) = 0; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 8c093e002326c..3a500adcd39bb 100644 +index 28ec8796ddf48..91e0bb2cbc1d2 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -250,6 +250,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -252,6 +252,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = background_view_->AddChildView( std::make_unique(content_view, false)); @@ -732,7 +732,7 @@ index 616efdce0e7c5..e0e20fdb0f80b 100644 #if !BUILDFLAG(IS_CHROMEOS_LACROS) if (root_location != root_current_location && diff --git ui/views/view.h ui/views/view.h -index b5891ddd8c8ba..a2e494818836a 100644 +index 73b9ef4f25337..aba651e745223 100644 --- ui/views/view.h +++ ui/views/view.h @@ -22,6 +22,7 @@ @@ -743,7 +743,7 @@ index b5891ddd8c8ba..a2e494818836a 100644 #include "build/build_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" #include "third_party/skia/include/core/SkPath.h" -@@ -286,7 +287,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -284,7 +285,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 7ecd38917..50545a2e5 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 84105424b8682..8aa281ca9d7e2 100644 +index 6b51fa563b1b7..4dfac0e609ae6 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -648,6 +648,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { +@@ -651,6 +651,14 @@ float RenderWidgetHostViewBase::GetScaleOverrideForCapture() const { return scale_override_for_capture_; } @@ -18,7 +18,7 @@ index 84105424b8682..8aa281ca9d7e2 100644 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 7c84c4deec00d..3a65053deca93 100644 +index cc3738cade39a..acd61e28af374 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -71,6 +71,7 @@ class CursorManager; @@ -29,7 +29,7 @@ index 7c84c4deec00d..3a65053deca93 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -150,6 +151,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -151,6 +152,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; float GetDeviceScaleFactor() const final; @@ -38,7 +38,7 @@ index 7c84c4deec00d..3a65053deca93 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; ui::mojom::VirtualKeyboardMode GetVirtualKeyboardMode() override; -@@ -186,6 +189,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -190,6 +193,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // Called when screen information or native widget bounds change. virtual void UpdateScreenInfo(); @@ -49,7 +49,7 @@ index 7c84c4deec00d..3a65053deca93 100644 // Called by the TextInputManager to notify the view about being removed from // the list of registered views, i.e., TextInputManager is no longer tracking // TextInputState from this view. The RWHV should reset |text_input_manager_| -@@ -450,6 +457,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -451,6 +458,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, const gfx::Rect& bounds, const gfx::Rect& anchor_rect) = 0; @@ -62,7 +62,7 @@ index 7c84c4deec00d..3a65053deca93 100644 // Sets the cursor for this view to the one specified. virtual void UpdateCursor(const ui::Cursor& cursor) = 0; -@@ -733,6 +746,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -734,6 +747,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // to all displays. gfx::Size system_cursor_size_; @@ -73,7 +73,7 @@ index 7c84c4deec00d..3a65053deca93 100644 private: FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, -@@ -754,10 +771,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -755,10 +772,6 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void SynchronizeVisualProperties(); @@ -85,7 +85,7 @@ index 7c84c4deec00d..3a65053deca93 100644 // renderer process changes. This method is called before notifying // RenderWidgetHostImpl in order to allow the view to allocate a new 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 9ced2dff5d5ff..7f8eba9858726 100644 +index c3648f4e5158e..152f4fbcdac11 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -52,6 +52,10 @@ namespace { @@ -133,7 +133,7 @@ index 9ced2dff5d5ff..7f8eba9858726 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 78d3cac258f65..d87bd0b564062 100644 +index b3acdceb83879..7a2de7e7d0678 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h @@ -259,6 +259,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -152,19 +152,19 @@ index 78d3cac258f65..d87bd0b564062 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/ozone/platform/x11/x11_window.cc ui/ozone/platform/x11/x11_window.cc -index f3a0e657041d8..e9c01e177ea1a 100644 +index 449f721727fb1..ab549b482bc36 100644 --- ui/ozone/platform/x11/x11_window.cc +++ ui/ozone/platform/x11/x11_window.cc -@@ -1868,7 +1868,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1846,7 +1846,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; - bounds_in_pixels_ = SanitizeBounds(bounds); + last_set_bounds_px_ = SanitizeBounds(bounds); - req.parent = x_root_window_; + req.parent = properties.parent_widget == gfx::kNullAcceleratedWidget ? + x_root_window_ : static_cast(properties.parent_widget); - req.x = bounds_in_pixels_.x(); - req.y = bounds_in_pixels_.y(); - req.width = bounds_in_pixels_.width(); + req.x = last_set_bounds_px_.x(); + req.y = last_set_bounds_px_.y(); + req.width = last_set_bounds_px_.width(); diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc index e4e6d3104da9e..bb372b0cd2960 100644 --- ui/views/widget/desktop_aura/desktop_screen_win.cc @@ -179,7 +179,7 @@ index e4e6d3104da9e..bb372b0cd2960 100644 return host ? host->GetAcceleratedWidget() : nullptr; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -index 237f041a3a350..af978b38eb7e4 100644 +index cb1601bffadd2..072ad958cc90c 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc @@ -175,6 +175,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( @@ -211,10 +211,10 @@ index 237f041a3a350..af978b38eb7e4 100644 properties->x11_extension_delegate = this; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -index ee09e16753ff0..256a24a0c6ebd 100644 +index 3151a2c872f4e..e14caeb1e6645 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -@@ -59,6 +59,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -58,6 +58,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux // Disables event listening to make |dialog| modal. base::OnceClosure DisableEventListening(); @@ -223,7 +223,7 @@ index ee09e16753ff0..256a24a0c6ebd 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override; -@@ -68,6 +70,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -67,6 +69,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux const gfx::Vector2d& drag_offset, Widget::MoveLoopSource source, Widget::MoveLoopEscapeBehavior escape_behavior) override; @@ -232,7 +232,7 @@ index ee09e16753ff0..256a24a0c6ebd 100644 // PlatformWindowDelegate: void DispatchEvent(ui::Event* event) override; -@@ -116,6 +120,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -115,6 +119,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux uint32_t modal_dialog_counter_ = 0; @@ -243,10 +243,10 @@ index ee09e16753ff0..256a24a0c6ebd 100644 base::WeakPtrFactory weak_factory_{this}; }; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -index 23e321bf8ae39..2611612b2d3ed 100644 +index f841bc5750537..aa2d4720c8152 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_platform.cc -@@ -286,8 +286,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { +@@ -287,8 +287,8 @@ void DesktopWindowTreeHostPlatform::Init(const Widget::InitParams& params) { if (properties.parent_widget) { window_parent_ = DesktopWindowTreeHostPlatform::GetHostForWidget( properties.parent_widget); @@ -258,7 +258,7 @@ index 23e321bf8ae39..2611612b2d3ed 100644 // Calculate initial bounds. diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index e4ab78b55cf4a..246f34a3fb471 100644 +index d877d237b2c16..95ee3dd3253fd 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -181,16 +181,29 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -345,10 +345,10 @@ index e4ab78b55cf4a..246f34a3fb471 100644 } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index 013f571b52168..508054726fb7d 100644 +index e963c861f7099..6bc0ac23db5e9 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -323,6 +323,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -322,6 +322,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -360,10 +360,10 @@ index 013f571b52168..508054726fb7d 100644 // the implementation of ::ShowCursor() is based on a counter, so making this // member static ensures that ::ShowCursor() is always called exactly once diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 93b17a67f9541..320f7452d3567 100644 +index 5093dee22b9da..3f29234369599 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -384,7 +384,8 @@ void Widget::Init(InitParams params) { +@@ -399,7 +399,8 @@ void Widget::Init(InitParams params) { } params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -373,7 +373,7 @@ index 93b17a67f9541..320f7452d3567 100644 is_headless_ = params.ShouldInitAsHeadless(); if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && -@@ -494,14 +495,22 @@ void Widget::Init(InitParams params) { +@@ -497,14 +498,22 @@ void Widget::Init(InitParams params) { if (show_state == ui::SHOW_STATE_MAXIMIZED) { Maximize(); @@ -397,7 +397,7 @@ index 93b17a67f9541..320f7452d3567 100644 } } -@@ -1656,10 +1665,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { +@@ -1646,10 +1655,16 @@ void Widget::OnNativeWidgetParentChanged(gfx::NativeView parent) { } gfx::Size Widget::GetMinimumSize() const { @@ -415,10 +415,10 @@ index 93b17a67f9541..320f7452d3567 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index c7ba1a40a7e46..81a37e6ab2a87 100644 +index 1939476d29da5..895df61324a2e 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -357,6 +357,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -356,6 +356,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = gfx::NativeView(); @@ -427,7 +427,7 @@ index c7ba1a40a7e46..81a37e6ab2a87 100644 // Specifies the initial bounds of the Widget. Default is empty, which means // 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 -@@ -751,7 +753,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -752,7 +754,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, void ShowInactive(); // Activates the widget, assuming it already exists and is visible. @@ -437,10 +437,10 @@ index c7ba1a40a7e46..81a37e6ab2a87 100644 // Deactivates the widget, making the next window in the Z order the active // window. diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index 5fa4c9c0d4635..eadf9808c90ed 100644 +index 30dfd721cceef..30831b22580a4 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -380,6 +380,10 @@ class VIEWS_EXPORT WidgetDelegate +@@ -375,6 +375,10 @@ class VIEWS_EXPORT WidgetDelegate // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -466,7 +466,7 @@ index 3b9b00b7d79ae..e759e3c1a9f34 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 8044dca7ed9de..8db07e39c6822 100644 +index 36a6e980495ea..24d75fb85a65f 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc @@ -767,7 +767,11 @@ bool HWNDMessageHandler::IsVisible() const { diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 96a0035de..463e97f08 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,13 +80,13 @@ index 8af69cac78b74..9f74e511c263d 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 2dddd66f9326f..6d1979c993f10 100644 +index 5a5791600d1aa..43cbd8abe4a75 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -228,6 +228,8 @@ viz_component("service") { +@@ -249,6 +249,8 @@ viz_component("service") { + "transitions/surface_animation_manager.h", "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", - "viz_service_export.h", + "//cef/libcef/browser/osr/software_output_device_proxy.cc", + "//cef/libcef/browser/osr/software_output_device_proxy.h", ] @@ -150,7 +150,7 @@ index 796ae2688436e..37a3406790210 100644 TRACE_EVENT_ASYNC_BEGIN0("viz", "SoftwareOutputDeviceWinProxy::Draw", this); diff --git content/browser/compositor/viz_process_transport_factory.cc content/browser/compositor/viz_process_transport_factory.cc -index d149ead2520ed..a81dca282b8ae 100644 +index 516c7f65097f1..49e0fdc6b4109 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc @@ -408,8 +408,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( @@ -223,7 +223,7 @@ index 2f462f0deb5fc..695869b83cefa 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index d2d3757f75a6b..a69f9af6c2c08 100644 +index 86d021ca68674..26f6096b99c1f 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -33,7 +33,9 @@ @@ -236,7 +236,7 @@ index d2d3757f75a6b..a69f9af6c2c08 100644 #include "mojo/public/cpp/bindings/associated_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/display_private.mojom.h" -@@ -149,6 +151,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -146,6 +148,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -251,7 +251,7 @@ index d2d3757f75a6b..a69f9af6c2c08 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -192,6 +202,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -189,6 +199,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -261,7 +261,7 @@ index d2d3757f75a6b..a69f9af6c2c08 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 -@@ -543,6 +556,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, +@@ -539,6 +552,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index a87e7697d..11db05f35 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index be3b154fa5155..9887b0e3d0419 100644 +index 21815a78d2429..bcad76251473b 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -3450,6 +3450,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3471,6 +3471,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, params.main_frame_name, GetOpener(), primary_main_frame_policy, base::UnguessableToken::Create()); @@ -15,7 +15,7 @@ index be3b154fa5155..9887b0e3d0419 100644 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3460,6 +3466,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3481,6 +3487,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } @@ -23,7 +23,7 @@ index be3b154fa5155..9887b0e3d0419 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3655,6 +3662,9 @@ void WebContentsImpl::RenderWidgetCreated( +@@ -3676,6 +3683,9 @@ void WebContentsImpl::RenderWidgetCreated( OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated", "render_widget_host", render_widget_host); created_widgets_.insert(render_widget_host); @@ -33,7 +33,7 @@ index be3b154fa5155..9887b0e3d0419 100644 } void WebContentsImpl::RenderWidgetDeleted( -@@ -4455,6 +4465,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4480,6 +4490,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( create_params.picture_in_picture_options = *(params.pip_options); } @@ -49,7 +49,7 @@ index be3b154fa5155..9887b0e3d0419 100644 // Check whether there is an available prerendered page for this navigation if // this is not for guest. If it exists, take WebContents pre-created for // hosting the prerendered page instead of creating new WebContents. -@@ -8613,6 +8632,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -8679,6 +8698,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, } CloseListenerManager::DidChangeFocusedFrame(this); @@ -60,10 +60,10 @@ index be3b154fa5155..9887b0e3d0419 100644 void WebContentsImpl::DidCallFocus() { diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 668d0802d8d9f..8fc7836524f42 100644 +index 943d2c2a16821..976c257189bda 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -99,10 +99,12 @@ class BrowserContext; +@@ -101,10 +101,12 @@ class BrowserContext; class BrowserPluginGuestDelegate; class RenderFrameHost; class RenderViewHost; @@ -76,7 +76,7 @@ index 668d0802d8d9f..8fc7836524f42 100644 class WebUI; struct DropData; struct MHTMLGenerationParams; -@@ -249,6 +251,10 @@ class WebContents : public PageNavigator, +@@ -251,6 +253,10 @@ class WebContents : public PageNavigator, network::mojom::WebSandboxFlags starting_sandbox_flags = network::mojom::WebSandboxFlags::kNone; @@ -88,7 +88,7 @@ index 668d0802d8d9f..8fc7836524f42 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 4b32bf8ccc4ed..a0c43926070aa 100644 +index 0a80169aa10cf..8165b00da16c2 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -60,9 +60,11 @@ class EyeDropperListener; @@ -119,10 +119,10 @@ index 4b32bf8ccc4ed..a0c43926070aa 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 a3b5e3b1ad2df..c85cb62b01cc2 100644 +index 839fa5e82f140..891784b2f3e5a 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -225,6 +225,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -227,6 +227,9 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { virtual void OnCaptureHandleConfigUpdate( const blink::mojom::CaptureHandleConfig& config) {} @@ -132,7 +132,7 @@ index a3b5e3b1ad2df..c85cb62b01cc2 100644 // This method is invoked when the `blink::WebView` of the current // RenderViewHost is ready, e.g. because we recreated it after a crash. virtual void RenderViewReady() {} -@@ -840,6 +843,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { +@@ -846,6 +849,10 @@ class CONTENT_EXPORT WebContentsObserver : public base::CheckedObserver { // 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 ae19f857b..aaab561da 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index df350be109056..f55ab1705ecc0 100644 +index 52829e870d30a..bf87e1750cd3f 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -780,6 +780,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -781,6 +781,11 @@ class BLINK_PLATFORM_EXPORT Platform { } #endif @@ -15,7 +15,7 @@ index df350be109056..f55ab1705ecc0 100644 static void InitializeMainThreadCommon( Platform* platform, diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index b9a32cced2024..39982bd04f736 100644 +index ae0907dfd95ec..63620f0aadc14 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -10,6 +10,7 @@ diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 02002791c..30a8141cd 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index 6219eadefa976..ff0c649c46af1 100644 +index 2ba868f0efb2e..4ec2a9ca69cab 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h @@ -345,6 +345,7 @@ class BLINK_EXPORT WebView { @@ -11,7 +11,7 @@ index 6219eadefa976..ff0c649c46af1 100644 // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index adb1c7ca2fcdf..4cc86141a88bf 100644 +index aafdfd4fffd0b..4215f48d15284 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -251,8 +251,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { @@ -39,7 +39,7 @@ index adb1c7ca2fcdf..4cc86141a88bf 100644 fullscreen_controller_(std::make_unique(this)), page_base_background_color_( diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 5a9992141dbbf..ce030e2b02ff0 100644 +index 25566d1e5a367..6ad48660a42ee 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h @@ -139,7 +139,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, @@ -52,7 +52,7 @@ index 5a9992141dbbf..ce030e2b02ff0 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -861,6 +862,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -871,6 +872,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -62,10 +62,10 @@ index 5a9992141dbbf..ce030e2b02ff0 100644 gfx::Transform device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index 4d1c8dcd1fca7..f8de0cf7498aa 100644 +index e8c40f756f746..d3738d1388c96 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -928,7 +928,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, +@@ -981,7 +981,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 990f3ffec..4ebcf879f 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 44d34bbffa88f..39ca99524dda6 100644 +index 6f6a3c9c374f7..00caa794fdd26 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -19,10 +19,12 @@ @@ -15,7 +15,7 @@ index 44d34bbffa88f..39ca99524dda6 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h" #include "chrome/browser/google/google_brand.h" -@@ -425,7 +427,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -421,7 +423,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -28,7 +28,7 @@ index 44d34bbffa88f..39ca99524dda6 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); #if BUILDFLAG(IS_WIN) -@@ -513,8 +519,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -509,8 +515,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -41,7 +41,7 @@ index 44d34bbffa88f..39ca99524dda6 100644 std::string extensions_list; for (const scoped_refptr& extension : extension_registry->enabled_extensions()) { -@@ -615,6 +625,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -611,6 +621,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if BUILDFLAG(IS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/win_sandbox_3210.patch b/patch/patches/win_sandbox_3210.patch index a3f7aaad4..01f910992 100644 --- a/patch/patches/win_sandbox_3210.patch +++ b/patch/patches/win_sandbox_3210.patch @@ -1,8 +1,8 @@ diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index 322f0e4b0f944..5e2a99dc27a25 100644 +index 714422bd2d088..3aa2e830e6148 100644 --- sandbox/policy/win/sandbox_win.cc +++ sandbox/policy/win/sandbox_win.cc -@@ -1003,6 +1003,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -993,6 +993,13 @@ ResultCode SandboxWin::StartSandboxedProcess( const base::HandlesToInheritVector& handles_to_inherit, SandboxDelegate* delegate, base::Process* process) { diff --git a/patch/patches/win_sandbox_policy.patch b/patch/patches/win_sandbox_policy.patch index 523b925ce..e908e3696 100644 --- a/patch/patches/win_sandbox_policy.patch +++ b/patch/patches/win_sandbox_policy.patch @@ -12,7 +12,7 @@ index 57409176ff044..58bb027580bbb 100644 } // namespace sandbox diff --git sandbox/win/src/sandbox_policy_base.cc sandbox/win/src/sandbox_policy_base.cc -index f54b6c9d83627..3a513f05e851e 100644 +index 1d5c93a0792b1..46600d1ae70cc 100644 --- sandbox/win/src/sandbox_policy_base.cc +++ sandbox/win/src/sandbox_policy_base.cc @@ -189,12 +189,12 @@ PolicyGlobal* ConfigBase::policy() { @@ -31,7 +31,7 @@ index f54b6c9d83627..3a513f05e851e 100644 } return std::nullopt; } -@@ -751,19 +751,19 @@ bool PolicyBase::SetupHandleCloser(TargetProcess& target) { +@@ -756,19 +756,19 @@ bool PolicyBase::SetupHandleCloser(TargetProcess& target) { return handle_closer->InitializeTargetHandles(target); } diff --git a/tests/ceftests/frame_handler_unittest.cc b/tests/ceftests/frame_handler_unittest.cc index f3c53d36c..222d31c53 100644 --- a/tests/ceftests/frame_handler_unittest.cc +++ b/tests/ceftests/frame_handler_unittest.cc @@ -21,9 +21,6 @@ namespace { -// Must match CefFrameHostImpl::kInvalidFrameId. -const int kInvalidFrameId = -4; - // Tracks callback status for a single frame object. struct FrameStatus { // Callbacks in expected order. Not all callbacks are executed in all cases @@ -84,15 +81,9 @@ struct FrameStatus { static std::string GetFrameDebugString(CefRefPtr frame) { // Match the logic in frame_util::GetFrameDebugString. // Specific formulation of the frame ID is an implementation detail that - // should generally not be relied upon, but this decomposed format makes the + // should generally not be relied upon, but a consistent format makes the // debug logging easier to follow. - uint64_t frame_id = frame->GetIdentifier(); - uint32_t process_id = frame_id >> 32; - uint32_t routing_id = std::numeric_limits::max() & frame_id; - std::stringstream ss; - ss << (frame->IsMain() ? "main" : " sub") << "[" << process_id << "," - << routing_id << "]"; - return ss.str(); + return frame->GetIdentifier(); } explicit FrameStatus(CefRefPtr frame) @@ -100,7 +91,7 @@ struct FrameStatus { is_main_(frame->IsMain()), ident_str_(GetFrameDebugString(frame)) {} - int64_t frame_id() const { return frame_id_; } + std::string frame_id() const { return frame_id_; } bool is_main() const { return is_main_; } bool AllQueriesDelivered(std::string* msg = nullptr) const { @@ -122,7 +113,7 @@ struct FrameStatus { } bool IsSame(CefRefPtr frame) const { - return frame->GetIdentifier() == frame_id(); + return frame->GetIdentifier().ToString() == frame_id(); } bool IsLoaded(std::string* msg = nullptr) const { @@ -225,7 +216,8 @@ struct FrameStatus { bool got_match = false; if (old_frame && new_frame) { - EXPECT_NE(old_frame->GetIdentifier(), new_frame->GetIdentifier()); + EXPECT_STRNE(old_frame->GetIdentifier().ToString().c_str(), + new_frame->GetIdentifier().ToString().c_str()); } if (old_frame && IsSame(old_frame)) { @@ -486,7 +478,7 @@ struct FrameStatus { } } - const int64_t frame_id_; + const std::string frame_id_; const bool is_main_; const std::string ident_str_; @@ -901,8 +893,8 @@ class FrameStatusMap { EXPECT_LT(size(), expected_frame_ct_); - const int64_t id = frame->GetIdentifier(); - EXPECT_NE(kInvalidFrameId, id); + const std::string& id = frame->GetIdentifier(); + EXPECT_TRUE(!id.empty()); EXPECT_EQ(frame_map_.find(id), frame_map_.end()); FrameStatus* status = new FrameStatus(frame); @@ -913,15 +905,15 @@ class FrameStatusMap { FrameStatus* GetFrameStatus(CefRefPtr frame) const { EXPECT_UI_THREAD(); - const int64_t id = frame->GetIdentifier(); - EXPECT_NE(kInvalidFrameId, id); + const std::string& id = frame->GetIdentifier(); + EXPECT_TRUE(!id.empty()); Map::const_iterator it = frame_map_.find(id); EXPECT_NE(it, frame_map_.end()); return it->second; } void RemoveFrameStatus(CefRefPtr frame) { - const int64_t id = frame->GetIdentifier(); + const std::string& id = frame->GetIdentifier(); Map::iterator it = frame_map_.find(id); EXPECT_NE(it, frame_map_.end()); frame_map_.erase(it); @@ -1018,7 +1010,8 @@ class FrameStatusMap { size_t size() const { return frame_map_.size(); } private: - using Map = std::map; + // Map of frame ID to status object. + using Map = std::map; Map frame_map_; // The expected number of sub-frames. diff --git a/tests/ceftests/frame_unittest.cc b/tests/ceftests/frame_unittest.cc index a5833c955..c954b1b3b 100644 --- a/tests/ceftests/frame_unittest.cc +++ b/tests/ceftests/frame_unittest.cc @@ -350,9 +350,7 @@ class FrameNavRendererTest : public ClientAppRenderer::Delegate, EXPECT_TRUE(args->SetInt(0, nav_)); EXPECT_TRUE(args->SetBool(1, result)); - const int64_t frame_id = frame->GetIdentifier(); - EXPECT_TRUE(args->SetInt(2, CefInt64GetLow(frame_id))); - EXPECT_TRUE(args->SetInt(3, CefInt64GetHigh(frame_id))); + EXPECT_TRUE(args->SetString(2, frame->GetIdentifier())); frame->SendProcessMessage(PID_BROWSER, return_msg); @@ -487,8 +485,8 @@ class FrameNavTestHandler : public TestHandler { << "nav = " << nav_; // Test that browser and render process frame IDs match. - const int64_t frame_id = CefInt64Set(args->GetInt(2), args->GetInt(3)); - EXPECT_EQ(frame->GetIdentifier(), frame_id); + const std::string& frame_id = args->GetString(2); + EXPECT_STREQ(frame->GetIdentifier().ToString().c_str(), frame_id.c_str()); return true; } @@ -838,8 +836,8 @@ bool VerifySingleBrowserFrame(CefRefPtr browser, V_DECLARE(); V_EXPECT_TRUE(frame.get()); V_EXPECT_TRUE(frame->IsValid()); - const int64_t frame_id = frame->GetIdentifier(); - V_EXPECT_TRUE(frame_id > 0) << frame_id; + const std::string& frame_id = frame->GetIdentifier(); + V_EXPECT_TRUE(!frame_id.empty()) << frame_id; V_EXPECT_TRUE(frame->IsValid()); V_EXPECT_TRUE(frame->IsMain()); V_EXPECT_TRUE(frame->IsFocused()); @@ -875,7 +873,7 @@ bool VerifySingleBrowserFrames(CefRefPtr browser, size_t frame_count = browser->GetFrameCount(); V_EXPECT_TRUE(frame_count == 1U); - std::vector identifiers; + std::vector identifiers; browser->GetFrameIdentifiers(identifiers); V_EXPECT_TRUE(identifiers.size() == 1U); if (identifiers.size() == 1U) { @@ -1621,7 +1619,7 @@ bool VerifyBrowserIframe(CefRefPtr browser, // frame0 contains frame1 contains frame2, contains frame3. CefRefPtr frame0, frame1, frame2, frame3; CefRefPtr frame0b, frame1b, frame2b, frame3b; - int64_t frame0id, frame1id, frame2id, frame3id; + std::string frame0id, frame1id, frame2id, frame3id; std::string frame0url, frame1url, frame2url, frame3url; // Verify the GetFrameNames result. @@ -1648,13 +1646,13 @@ bool VerifyBrowserIframe(CefRefPtr browser, } // Find frames by name. - frame0 = browser->GetFrame(kFrame0Name); + frame0 = browser->GetFrameByName(kFrame0Name); V_EXPECT_TRUE(frame0.get()); - frame1 = browser->GetFrame(kFrame1Name); + frame1 = browser->GetFrameByName(kFrame1Name); V_EXPECT_TRUE(frame1.get()); - frame2 = browser->GetFrame(kFrame2Name); + frame2 = browser->GetFrameByName(kFrame2Name); V_EXPECT_TRUE(frame2.get()); - frame3 = browser->GetFrame(kFrame3Name); + frame3 = browser->GetFrameByName(kFrame3Name); V_EXPECT_TRUE(frame3.get()); if (!frame0 || !frame1 || !frame2 || !frame3) { @@ -1695,13 +1693,13 @@ bool VerifyBrowserIframe(CefRefPtr browser, // Verify that the frame id is valid. frame0id = frame0->GetIdentifier(); - V_EXPECT_TRUE(frame0id > 0) << "actual: " << frame0id; + V_EXPECT_TRUE(!frame0id.empty()) << "actual: " << frame0id; frame1id = frame1->GetIdentifier(); - V_EXPECT_TRUE(frame1id > 0) << "actual: " << frame1id; + V_EXPECT_TRUE(!frame1id.empty()) << "actual: " << frame1id; frame2id = frame2->GetIdentifier(); - V_EXPECT_TRUE(frame2id > 0) << "actual: " << frame2id; + V_EXPECT_TRUE(!frame2id.empty()) << "actual: " << frame2id; frame3id = frame3->GetIdentifier(); - V_EXPECT_TRUE(frame3id > 0) << "actual: " << frame3id; + V_EXPECT_TRUE(!frame3id.empty()) << "actual: " << frame3id; // Verify that the current frame has the correct id. if (frame_number == 0) { @@ -1719,14 +1717,14 @@ bool VerifyBrowserIframe(CefRefPtr browser, } // Find frames by id. - frame0b = browser->GetFrame(frame0->GetIdentifier()); - V_EXPECT_TRUE(frame0b.get()); - frame1b = browser->GetFrame(frame1->GetIdentifier()); - V_EXPECT_TRUE(frame1b.get()); - frame2b = browser->GetFrame(frame2->GetIdentifier()); - V_EXPECT_TRUE(frame2b.get()); - frame3b = browser->GetFrame(frame3->GetIdentifier()); - V_EXPECT_TRUE(frame3b.get()); + frame0b = browser->GetFrameByIdentifier(frame0id); + V_EXPECT_TRUE(frame0b.get()) << "expected: " << frame0id; + frame1b = browser->GetFrameByIdentifier(frame1id); + V_EXPECT_TRUE(frame1b.get()) << "expected: " << frame1id; + frame2b = browser->GetFrameByIdentifier(frame2id); + V_EXPECT_TRUE(frame2b.get()) << "expected: " << frame2id; + frame3b = browser->GetFrameByIdentifier(frame3id); + V_EXPECT_TRUE(frame3b.get()) << "expected: " << frame3id; if (!frame0b || !frame1b || !frame2b || !frame3b) { V_RETURN(); @@ -1746,9 +1744,10 @@ bool VerifyBrowserIframe(CefRefPtr browser, V_EXPECT_TRUE(frame_count == 4U) << " actual: " << frame_count; // Verify the GetFrameIdentifiers result. - std::set expected_idents = {frame0id, frame1id, frame2id, frame3id}; + std::set expected_idents = {frame0id, frame1id, frame2id, + frame3id}; - std::vector idents; + std::vector idents; browser->GetFrameIdentifiers(idents); V_EXPECT_TRUE(idents.size() == expected_idents.size()) << "expected: " << expected_idents.size() << " actual: " << idents.size(); @@ -1769,13 +1768,13 @@ bool VerifyBrowserIframe(CefRefPtr browser, V_EXPECT_FALSE(frame0->GetParent().get()); V_EXPECT_TRUE(frame1->GetParent()->GetIdentifier() == frame0id) << "expected: " << frame0id - << " actual: " << frame1->GetParent()->GetIdentifier(); + << " actual: " << frame1->GetParent()->GetIdentifier().ToString(); V_EXPECT_TRUE(frame2->GetParent()->GetIdentifier() == frame1id) << "expected: " << frame1id - << " actual: " << frame2->GetParent()->GetIdentifier(); + << " actual: " << frame2->GetParent()->GetIdentifier().ToString(); V_EXPECT_TRUE(frame3->GetParent()->GetIdentifier() == frame2id) << "expected: " << frame2id - << " actual: " << frame3->GetParent()->GetIdentifier(); + << " actual: " << frame3->GetParent()->GetIdentifier().ToString(); V_RETURN(); } diff --git a/tests/ceftests/message_router_multi_query_unittest.cc b/tests/ceftests/message_router_multi_query_unittest.cc index 60e4f957b..9e2b04784 100644 --- a/tests/ceftests/message_router_multi_query_unittest.cc +++ b/tests/ceftests/message_router_multi_query_unittest.cc @@ -243,7 +243,9 @@ class MultiQueryManager { // Verify that browser and frame are the same. EXPECT_EQ(query.browser_id, browser->GetIdentifier()) << index; - EXPECT_EQ(query.frame_id, frame->GetIdentifier()) << index; + EXPECT_STREQ(query.frame_id.c_str(), + frame->GetIdentifier().ToString().c_str()) + << index; // Verify a successful/expected result. if (will_cancel_by_removing_handler_) { @@ -399,7 +401,9 @@ class MultiQueryManager { EXPECT_TRUE(frame->IsMain()) << i; } else { EXPECT_FALSE(frame->IsMain()) << i; - EXPECT_EQ(query.frame_id, frame->GetIdentifier()) << i; + EXPECT_STREQ(query.frame_id.c_str(), + frame->GetIdentifier().ToString().c_str()) + << i; } // Verify a successful/expected result. @@ -503,7 +507,7 @@ class MultiQueryManager { // Set in OnQuery and verified in OnNotify or OnQueryCanceled. int browser_id = 0; - int64_t frame_id = 0; + std::string frame_id; bool is_main_frame = false; // Used when a query is canceled. @@ -1590,9 +1594,11 @@ class MultiQueryManagerMap : public MultiQueryManager::Observer { const int browser_id = browser->GetIdentifier(); // Always use the same ID for the main frame. - const int64_t frame_id = frame->IsMain() ? -1 : frame->GetIdentifier(); + const std::string frame_id = + frame->IsMain() ? std::string() : frame->GetIdentifier().ToString(); - const std::pair& id = std::make_pair(browser_id, frame_id); + const std::pair& id = + std::make_pair(browser_id, frame_id); // Remove the currently active manager, if any. ManagerMap::iterator it2 = manager_map_.find(id); @@ -1608,7 +1614,8 @@ class MultiQueryManagerMap : public MultiQueryManager::Observer { CefRefPtr frame) const { const int browser_id = browser->GetIdentifier(); // Always use the same ID for the main frame. - const int64_t frame_id = frame->IsMain() ? -1 : frame->GetIdentifier(); + const std::string frame_id = + frame->IsMain() ? std::string() : frame->GetIdentifier().ToString(); // Find the manager in the active map. ManagerMap::const_iterator it = @@ -1642,7 +1649,7 @@ class MultiQueryManagerMap : public MultiQueryManager::Observer { private: typedef std::vector ManagerList; // Map of (browser ID, frame ID) to manager. - typedef std::map, MultiQueryManager*> ManagerMap; + typedef std::map, MultiQueryManager*> ManagerMap; // All managers that have been created. ManagerList all_managers_; diff --git a/tests/ceftests/os_rendering_unittest.cc b/tests/ceftests/os_rendering_unittest.cc index d915517f4..82ff2914c 100644 --- a/tests/ceftests/os_rendering_unittest.cc +++ b/tests/ceftests/os_rendering_unittest.cc @@ -1263,8 +1263,9 @@ class OSRTestHandler : public RoutingTestHandler, auto current_browser = GetBrowser(); EXPECT_TRUE(current_browser->IsSame(browser)); - EXPECT_EQ(current_browser->GetFocusedFrame()->GetIdentifier(), - frame->GetIdentifier()); + EXPECT_STREQ( + current_browser->GetFocusedFrame()->GetIdentifier().ToString().c_str(), + frame->GetIdentifier().ToString().c_str()); if (test_type_ == OSR_TEST_QUICK_MENU) { EXPECT_EQ(2U, got_touch_handle_enabled_ct_); @@ -1302,8 +1303,9 @@ class OSRTestHandler : public RoutingTestHandler, auto current_browser = GetBrowser(); EXPECT_TRUE(current_browser->IsSame(browser)); - EXPECT_EQ(current_browser->GetFocusedFrame()->GetIdentifier(), - frame->GetIdentifier()); + EXPECT_STREQ( + current_browser->GetFocusedFrame()->GetIdentifier().ToString().c_str(), + frame->GetIdentifier().ToString().c_str()); EXPECT_EQ(OSR_TEST_QUICK_MENU, test_type_); @@ -1340,8 +1342,9 @@ class OSRTestHandler : public RoutingTestHandler, auto current_browser = GetBrowser(); EXPECT_TRUE(current_browser->IsSame(browser)); - EXPECT_EQ(current_browser->GetFocusedFrame()->GetIdentifier(), - frame->GetIdentifier()); + EXPECT_STREQ( + current_browser->GetFocusedFrame()->GetIdentifier().ToString().c_str(), + frame->GetIdentifier().ToString().c_str()); EXPECT_EQ(OSR_TEST_QUICK_MENU, test_type_); @@ -1369,8 +1372,9 @@ class OSRTestHandler : public RoutingTestHandler, auto current_browser = GetBrowser(); EXPECT_TRUE(current_browser->IsSame(browser)); - EXPECT_EQ(current_browser->GetFocusedFrame()->GetIdentifier(), - frame->GetIdentifier()); + EXPECT_STREQ( + current_browser->GetFocusedFrame()->GetIdentifier().ToString().c_str(), + frame->GetIdentifier().ToString().c_str()); EXPECT_EQ(OSR_TEST_QUICK_MENU, test_type_); diff --git a/tests/ceftests/resource_request_handler_unittest.cc b/tests/ceftests/resource_request_handler_unittest.cc index e83a995a0..a7acf6722 100644 --- a/tests/ceftests/resource_request_handler_unittest.cc +++ b/tests/ceftests/resource_request_handler_unittest.cc @@ -1601,7 +1601,7 @@ class SubresourceResponseTest : public RoutingTestHandler { // Track the frame ID that we'll expect for resource callbacks. // Do this here instead of OnBeforeBrowse because OnBeforeBrowse may // return -4 (kInvalidFrameId) for the initial navigation. - if (frame_id_ == 0) { + if (frame_id_.empty()) { if (subframe_) { if (is_sub_url) { frame_id_ = frame->GetIdentifier(); @@ -2406,13 +2406,9 @@ class SubresourceResponseTest : public RoutingTestHandler { void VerifyFrame(Callback callback, CefRefPtr frame) const { EXPECT_TRUE(frame); - if (subframe_) { - EXPECT_FALSE(frame->IsMain()) << callback; - } else { - EXPECT_TRUE(frame->IsMain()) << callback; - } - - EXPECT_EQ(frame_id_, frame->GetIdentifier()) << callback; + EXPECT_NE(subframe_, frame->IsMain()) << callback; + EXPECT_STREQ(frame_id_.c_str(), frame->GetIdentifier().ToString().c_str()) + << callback; } void VerifyState(Callback callback, @@ -2591,7 +2587,7 @@ class SubresourceResponseTest : public RoutingTestHandler { const bool subframe_; int browser_id_ = 0; - int64_t frame_id_ = 0; + std::string frame_id_; uint64_t request_id_ = 0U; int resource_handler_created_ct_ = 0; diff --git a/tests/ceftests/urlrequest_unittest.cc b/tests/ceftests/urlrequest_unittest.cc index e9855e470..4bb39f1f8 100644 --- a/tests/ceftests/urlrequest_unittest.cc +++ b/tests/ceftests/urlrequest_unittest.cc @@ -2718,7 +2718,8 @@ class RequestTestHandler : public TestHandler { CefRefPtr callback) override { if (test_running_ && test_frame_method_) { EXPECT_TRUE(frame); - EXPECT_EQ(test_frame_->GetIdentifier(), frame->GetIdentifier()); + EXPECT_STREQ(test_frame_->GetIdentifier().ToString().c_str(), + frame->GetIdentifier().ToString().c_str()); test_frame_resource_load_ct_++; }