From 24c2f2fa3816c61e6996473e7cc5bc18b155f17c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 28 Aug 2020 18:39:23 -0400 Subject: [PATCH] Update to Chromium version 86.0.4240.0 (#800218) - CefURLRequest::Create is no longer supported in the renderer process (see https://crbug.com/891872). Use CefFrame::CreateURLRequest instead. - Mac platform definitions have been changed from `MACOSX` to `MAC` (see https://crbug.com/1105907) and related CMake macro names have been updated. The old `OS_MACOSX` define is still set in code and CMake for backwards compatibility. - Linux ARM build is currently broken (see https://crbug.com/1123214). --- BUILD.gn | 66 +----- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- CHROMIUM_UPDATE.txt | 2 - cmake/cef_macros.cmake.in | 14 +- cmake/cef_variables.cmake.in | 7 +- include/base/cef_atomicops.h | 4 +- include/base/cef_basictypes.h | 2 +- include/base/cef_build.h | 10 +- include/capi/cef_urlrequest_capi.h | 13 +- include/cef_api_hash.h | 2 +- include/cef_application_mac.h | 4 +- include/cef_base.h | 2 +- include/cef_sandbox_mac.h | 4 +- include/cef_urlrequest.h | 11 +- include/internal/cef_types.h | 2 +- include/internal/cef_types_mac.h | 4 +- include/wrapper/cef_library_loader.h | 4 +- libcef/browser/alloy/alloy_browser_context.h | 4 +- libcef/browser/alloy/alloy_browser_main.cc | 6 +- libcef/browser/alloy/alloy_browser_main.h | 4 +- .../alloy/alloy_content_browser_client.cc | 44 ++-- .../alloy/alloy_content_browser_client.h | 3 +- .../alloy/browser_platform_delegate_alloy.cc | 2 +- .../alloy/browser_platform_delegate_alloy.h | 2 +- libcef/browser/alloy/chrome_profile_alloy.cc | 7 +- libcef/browser/alloy/chrome_profile_alloy.h | 2 +- libcef/browser/browser_host_impl.cc | 14 +- libcef/browser/browser_host_impl.h | 2 +- libcef/browser/browser_info_manager.cc | 2 +- libcef/browser/browser_message_loop.cc | 6 +- libcef/browser/browser_platform_delegate.cc | 2 +- libcef/browser/browser_platform_delegate.h | 2 +- .../browser_platform_delegate_create.cc | 6 +- .../chrome_content_browser_client_cef.cc | 3 +- .../chrome_crash_reporter_client_stub.cc | 4 +- libcef/browser/context.cc | 4 +- libcef/browser/devtools/devtools_frontend.cc | 3 +- libcef/browser/devtools/devtools_util.cc | 11 +- libcef/browser/extensions/extension_system.cc | 2 +- libcef/browser/file_dialog_manager.cc | 21 +- libcef/browser/file_dialog_manager.h | 6 +- libcef/browser/main_runner.cc | 10 +- .../browser_platform_delegate_native_linux.cc | 15 +- libcef/browser/native/menu_runner_mac.mm | 5 +- libcef/browser/native/menu_runner_win.cc | 4 +- libcef/browser/native/window_x11.cc | 181 +++++++--------- libcef/browser/native/window_x11.h | 8 +- libcef/browser/navigate_params.h | 1 + libcef/browser/net/chrome_scheme_handler.cc | 2 +- libcef/browser/net_service/cookie_helper.cc | 8 +- .../net_service/cookie_manager_impl.cc | 14 +- .../net_service/proxy_url_loader_factory.cc | 1 + .../osr/browser_platform_delegate_osr.cc | 4 +- libcef/browser/osr/osr_accessibility_util.cc | 10 +- .../osr/render_widget_host_view_osr.cc | 24 ++- .../browser/osr/render_widget_host_view_osr.h | 21 +- .../osr/render_widget_host_view_osr_linux.cc | 18 +- .../osr/synthetic_gesture_target_osr.cc | 1 - libcef/browser/osr/web_contents_view_osr.cc | 4 +- libcef/browser/osr/web_contents_view_osr.h | 2 +- libcef/browser/prefs/renderer_prefs.cc | 5 +- libcef/browser/print_settings_impl.cc | 2 +- libcef/browser/printing/print_dialog_linux.cc | 2 +- libcef/browser/printing/print_view_manager.cc | 19 +- libcef/browser/printing/print_view_manager.h | 4 +- .../printing/printing_message_filter.cc | 12 +- libcef/browser/views/button_impl.h | 4 +- libcef/browser/views/button_view.h | 2 +- libcef/browser/views/menu_button_view.h | 2 +- libcef/browser/views/window_view.cc | 14 +- libcef/browser/views/window_view.h | 2 +- libcef/common/alloy/alloy_main_delegate.cc | 12 +- libcef/common/app_manager.cc | 9 - libcef/common/app_manager.h | 12 -- libcef/common/cef_switches.cc | 2 +- libcef/common/cef_switches.h | 2 +- .../common/chrome/chrome_main_delegate_cef.cc | 9 +- libcef/common/command_line_impl.cc | 6 +- libcef/common/crash_reporter_client.cc | 20 +- libcef/common/crash_reporter_client.h | 12 +- libcef/common/crash_reporting.cc | 14 +- libcef/common/crash_reporting.h | 2 +- libcef/common/extensions/extensions_client.cc | 14 +- libcef/common/extensions/extensions_client.h | 6 +- libcef/common/extensions/extensions_util.cc | 2 +- libcef/common/file_util_impl.cc | 6 +- libcef/common/net_service/net_service_util.cc | 7 +- libcef/common/request_impl.cc | 5 +- libcef/common/resource_util.cc | 20 +- .../cef_content_browser_overlay_manifest.cc | 34 --- .../cef_content_browser_overlay_manifest.h | 16 -- libcef/common/urlrequest_impl.cc | 8 - libcef/common/widevine_loader.cc | 6 +- .../alloy/alloy_content_renderer_client.cc | 12 +- .../alloy/alloy_content_renderer_client.h | 4 +- libcef/renderer/blink_glue.cc | 49 ++--- libcef/renderer/render_frame_observer.cc | 2 +- libcef/renderer/render_frame_observer.h | 2 +- libcef/renderer/render_urlrequest_impl.cc | 8 +- libcef_dll/CMakeLists.txt.in | 12 +- libcef_dll/sandbox/sandbox_win.cc | 11 + patch/patch.cfg | 35 +-- patch/patches/base_sandbox_2743.patch | 6 +- patch/patches/base_string_piece_1049498.patch | 12 ++ patch/patches/browser_compositor_mac.patch | 4 +- .../browser_security_policy_1081397.patch | 16 +- patch/patches/build.patch | 4 +- patch/patches/chrome_browser.patch | 80 ++++++- ...rome_browser_background_mode_1100085.patch | 24 +-- .../chrome_browser_content_settings.patch | 4 +- patch/patches/chrome_browser_net_export.patch | 21 +- .../chrome_browser_product_override.patch | 8 +- patch/patches/chrome_browser_profiles.patch | 18 +- .../chrome_browser_safe_browsing.patch | 2 +- patch/patches/chrome_browser_themes.patch | 8 +- patch/patches/chrome_plugins.patch | 40 ++-- patch/patches/chrome_renderer.patch | 6 +- patch/patches/chrome_runtime.patch | 34 +-- patch/patches/chrome_widevine.patch | 2 +- patch/patches/component_build.patch | 24 +-- patch/patches/content_2015.patch | 66 +++--- patch/patches/content_app_shutdown_2798.patch | 12 +- patch/patches/content_pepper_flash_1586.patch | 2 +- patch/patches/crashpad_1995.patch | 78 +++---- patch/patches/crashpad_tp_1995.patch | 26 +-- patch/patches/extensions_1947.patch | 22 +- patch/patches/gn_config.patch | 20 +- patch/patches/gritsettings.patch | 4 +- patch/patches/libxml_visibility.patch | 4 +- patch/patches/linux_assets_path_1936.patch | 2 +- patch/patches/linux_poll_2466.patch | 2 +- patch/patches/message_loop.patch | 86 ++++---- .../mime_handler_view_guest_1565_2727.patch | 8 +- patch/patches/osr_fling_2745.patch | 8 +- patch/patches/prefs_content_1161.patch | 20 +- patch/patches/print_preview_123.patch | 55 ++--- patch/patches/printing_context_2196.patch | 16 +- patch/patches/renderer_host_1070713.patch | 4 +- .../renderer_preferences_util_545103.patch | 6 +- patch/patches/resource_bundle_2512.patch | 6 +- patch/patches/runhooks.patch | 12 +- patch/patches/rwh_background_color_1984.patch | 13 +- patch/patches/service_manager_654986.patch | 32 +-- patch/patches/services_network_2622.patch | 28 +-- patch/patches/services_network_2718.patch | 10 +- .../patches/set_resize_background_color.patch | 8 +- patch/patches/storage_incognito_2289.patch | 12 +- patch/patches/trace_event.patch | 2 +- patch/patches/ui_dragdrop_355390.patch | 4 +- patch/patches/ui_gl_utils_1123950.patch | 13 ++ patch/patches/views_1749_2102.patch | 82 +++---- ...views_widget_180_1481_1565_1677_1749.patch | 203 ++++++++---------- patch/patches/viz_osr_2575.patch | 40 ++-- patch/patches/web_contents_1257_1565.patch | 27 +-- patch/patches/webkit_plugin_info_2015.patch | 26 +-- .../patches/webkit_pointer_event_781966.patch | 10 +- patch/patches/webkit_popups.patch | 22 +- patch/patches/webui_2037.patch | 22 +- patch/patches/webview_plugin_2020.patch | 4 +- patch/patches/win_base_msvc_sandbox.patch | 25 --- .../patches/win_cpp17_msvc_sandbox_2819.patch | 4 +- patch/patches/win_rt_2274.patch | 14 +- patch/patches/win_screenlock_1058556.patch | 13 -- tests/cefclient/CMakeLists.txt.in | 16 +- tests/cefclient/browser/client_types.h | 4 +- .../browser/osr_accessibility_node.h | 2 +- tests/cefclient/browser/osr_renderer.cc | 2 +- tests/cefclient/browser/root_window.h | 6 +- tests/cefclient/browser/root_window_create.cc | 4 +- tests/cefclient/browser/temp_window.h | 4 +- tests/cefclient/browser/window_test.cc | 4 +- tests/cefsimple/CMakeLists.txt.in | 12 +- tests/ceftests/CMakeLists.txt.in | 16 +- tests/ceftests/navigation_unittest.cc | 2 +- tests/ceftests/os_rendering_unittest.cc | 26 +-- tests/ceftests/osr_accessibility_unittest.cc | 2 +- tests/ceftests/run_all_unittests.cc | 10 +- tests/ceftests/test_request.cc | 10 +- tests/ceftests/test_server.cc | 2 +- tests/ceftests/urlrequest_unittest.cc | 10 +- tests/ceftests/v8_unittest.cc | 2 +- tests/shared/browser/client_app_browser.cc | 2 +- tools/automate/automate-git.py | 14 +- tools/cef_api_hash.py | 4 +- tools/cefbuilds/cef_html_builder.py | 2 +- tools/gclient_hook.py | 2 +- tools/gn_args.py | 12 +- tools/make_api_hash_header.py | 4 +- tools/make_cmake.py | 2 +- tools/make_distrib.py | 19 +- 190 files changed, 1302 insertions(+), 1354 deletions(-) delete mode 100644 libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc delete mode 100644 libcef/common/service_manifests/cef_content_browser_overlay_manifest.h create mode 100644 patch/patches/base_string_piece_1049498.patch create mode 100644 patch/patches/ui_gl_utils_1123950.patch delete mode 100644 patch/patches/win_base_msvc_sandbox.patch delete mode 100644 patch/patches/win_screenlock_1058556.patch diff --git a/BUILD.gn b/BUILD.gn index cd2024992..e902b904b 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -122,8 +122,8 @@ if (is_linux) { import("//third_party/fontconfig/fontconfig.gni") } if (is_mac) { + import("//build/apple/tweak_info_plist.gni") import("//build/config/mac/rules.gni") - import("//build/mac/tweak_info_plist.gni") import("//build/util/version.gni") import("//media/cdm/library_cdm/cdm_paths.gni") import("//build/config/mac/base_rules.gni") @@ -808,7 +808,6 @@ static_library("libcef_static") { deps = [ ":cef_make_headers", - ":cef_service_manifests", ":libcef_static_unittested", @@ -841,7 +840,7 @@ static_library("libcef_static") { "//components/keyed_service/content:content", "//components/keyed_service/core:core", "//components/navigation_interception", - "//components/network_session_configurator/browser", + "//components/network_session_configurator/common", "//components/pdf/browser", "//components/pdf/renderer", "//components/plugins/renderer", @@ -1167,7 +1166,6 @@ static_library("libcef_static") { sources += [ # Support for UI input events. # Part of //ui/aura:test_support which is testingonly. - "//ui/aura/test/ui_controls_factory_aurax11.cc", "//ui/aura/test/x11_event_sender.cc", "//ui/aura/test/x11_event_sender.h", # Part of //ui/views:test_support which is testingonly. @@ -1252,56 +1250,6 @@ if (is_mac) { } } -# -# Service manifests. -# - -source_set("cef_content_browser_overlay_manifest") { - sources = [ - "libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc", - "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h", - ] - - configs += [ - "libcef/features:config" - ] - - deps = [ - "//base", - "//extensions/buildflags", - "//extensions/common:mojom", - "//extensions/common/api:mojom", - "//services/service_manager/public/cpp", - "//third_party/blink/public/common", - ] -} - -source_set("cef_content_renderer_overlay_manifest") { - sources = [ - "libcef/common/service_manifests/cef_content_renderer_overlay_manifest.h", - ] - - configs += [ - "libcef/features:config" - ] - - deps = [ - "//base", - "//components/subresource_filter/content/mojom", - "//extensions/buildflags", - "//extensions/common:mojom", - "//services/service_manager/public/cpp", - "//third_party/blink/public/common", - ] -} - -source_set("cef_service_manifests") { - public_deps = [ - ":cef_content_browser_overlay_manifest", - ":cef_content_renderer_overlay_manifest", - ] -} - # # Resource grit/pack targets. # @@ -1935,8 +1883,8 @@ if (is_mac) { deps += invoker.deps } - if (defined(invoker.libs)) { - libs = invoker.libs + if (defined(invoker.frameworks)) { + frameworks = invoker.frameworks } if (defined(invoker.defines)) { @@ -2020,7 +1968,7 @@ if (is_mac) { ":cefclient_resources_bundle_data_english", ":cefclient_xibs", ] - libs = [ + frameworks = [ "AppKit.framework", "OpenGL.framework", ] @@ -2084,7 +2032,7 @@ if (is_mac) { ":cefsimple_resources_bundle_data_english", ":cefsimple_xibs", ] - libs = [ + frameworks = [ "AppKit.framework", ] defines = [ @@ -2155,7 +2103,7 @@ if (is_mac) { ":ceftests_xibs", "//testing/gtest", ] - libs = [ + frameworks = [ "AppKit.framework", ] defines = [ diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index f4da2f260..a10710033 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/85.0.4183.0' + 'chromium_checkout': 'refs/tags/86.0.4240.0' } diff --git a/CHROMIUM_UPDATE.txt b/CHROMIUM_UPDATE.txt index 4c31f4e28..6e03b57c3 100644 --- a/CHROMIUM_UPDATE.txt +++ b/CHROMIUM_UPDATE.txt @@ -27,8 +27,6 @@ # Files in the chromium/src directory that should be evaluated for changes. # Similar changes may need to be applied to the CEF source code. 'files': [ - 'chrome/app/chrome_*_manifest.*', - 'chrome/app/chrome_*_manifests.*', 'chrome/browser/browser_process.h', 'chrome/browser/extensions/api/tabs/tabs_api.*', 'chrome/browser/extensions/chrome_component_extension_resource_manager.*', diff --git a/cmake/cef_macros.cmake.in b/cmake/cef_macros.cmake.in index 1b667e1cd..3ff7c1528 100644 --- a/cmake/cef_macros.cmake.in +++ b/cmake/cef_macros.cmake.in @@ -25,7 +25,7 @@ macro(PRINT_CEF_CONFIG) message(STATUS "Binary distribution root: ${_CEF_ROOT}") - if(OS_MACOSX) + if(OS_MAC) message(STATUS "Base SDK: ${CMAKE_OSX_SYSROOT}") message(STATUS "Target SDK: ${CEF_TARGET_SDK}") endif() @@ -75,8 +75,8 @@ macro(APPEND_PLATFORM_SOURCES name_of_list) if(OS_WINDOWS AND ${name_of_list}_WINDOWS) list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS}) endif() - if(OS_MACOSX AND ${name_of_list}_MACOSX) - list(APPEND ${name_of_list} ${${name_of_list}_MACOSX}) + if(OS_MAC AND ${name_of_list}_MAC) + list(APPEND ${name_of_list} ${${name_of_list}_MAC}) endif() endmacro() @@ -184,10 +184,10 @@ endif(OS_LINUX) # Mac OS X macros. # -if(OS_MACOSX) +if(OS_MAC) # Manually process and copy over resource files. -macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path) +macro(COPY_MAC_RESOURCES resource_list prefix_list target source_dir app_path) foreach(FILENAME ${resource_list}) # Remove one or more prefixes from the source paths. set(TARGET_FILENAME "${FILENAME}") @@ -229,7 +229,7 @@ macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path endforeach() endmacro() -endif(OS_MACOSX) +endif(OS_MAC) # @@ -298,7 +298,7 @@ macro(SET_COMMON_TARGET_PROPERTIES target) set_property(TARGET ${target} PROPERTY LINK_FLAGS_RELEASE ${_flags_str}) endif() - if(OS_MACOSX) + if(OS_MAC) # Set Xcode target properties. set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO diff --git a/cmake/cef_variables.cmake.in b/cmake/cef_variables.cmake.in index ba8833d36..6ce498210 100644 --- a/cmake/cef_variables.cmake.in +++ b/cmake/cef_variables.cmake.in @@ -14,7 +14,8 @@ endif() # Determine the platform. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin") - set(OS_MACOSX 1) + set(OS_MAC 1) + set(OS_MACOSX 1) # For backwards compatibility. set(OS_POSIX 1) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") set(OS_LINUX 1) @@ -31,7 +32,7 @@ if(NOT DEFINED PROJECT_ARCH) set(PROJECT_ARCH "x86") endif() - if(OS_MACOSX) + if(OS_MAC) # PROJECT_ARCH should be specified on Mac OS X. message(WARNING "No PROJECT_ARCH value specified, using ${PROJECT_ARCH}") endif() @@ -246,7 +247,7 @@ endif() # Mac OS X configuration. # -if(OS_MACOSX) +if(OS_MAC) # Platform-specific compiler/linker flags. # See also Xcode target properties in cef_macros.cmake. set(CEF_LIBTYPE SHARED) diff --git a/include/base/cef_atomicops.h b/include/base/cef_atomicops.h index a5b645920..93d135ffd 100644 --- a/include/base/cef_atomicops.h +++ b/include/base/cef_atomicops.h @@ -180,7 +180,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); #include "include/base/internal/cef_atomicops_x86_msvc.h" #elif defined(OS_WIN) && (defined(__ARM_ARCH_ISA_A64) || defined(_M_ARM64)) #include "include/base/internal/cef_atomicops_arm64_msvc.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "include/base/internal/cef_atomicops_mac.h" #elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) #include "include/base/internal/cef_atomicops_x86_gcc.h" @@ -194,7 +194,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr); // On some platforms we need additional declarations to make // AtomicWord compatible with our other Atomic* types. -#if defined(OS_MACOSX) || defined(OS_OPENBSD) +#if defined(OS_MAC) || defined(OS_OPENBSD) #include "include/base/internal/cef_atomicops_atomicword_compat.h" #endif diff --git a/include/base/cef_basictypes.h b/include/base/cef_basictypes.h index e38f4f729..fb81b8e55 100644 --- a/include/base/cef_basictypes.h +++ b/include/base/cef_basictypes.h @@ -42,7 +42,7 @@ // // On Mac OS X, |long long| is used for 64-bit types for compatibility with // format macros even in the LP64 model. -#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +#if defined(__LP64__) && !defined(OS_MAC) && !defined(OS_OPENBSD) typedef long int64; typedef unsigned long uint64; #else diff --git a/include/base/cef_build.h b/include/base/cef_build.h index 61dc31779..bb2e54583 100644 --- a/include/base/cef_build.h +++ b/include/base/cef_build.h @@ -44,6 +44,14 @@ #define OS_WIN 1 #endif #elif defined(__APPLE__) +// New platform defines after https://crbug.com/1105907. +#ifndef OS_MAC +#define OS_MAC 1 +#endif +#ifndef OS_APPLE +#define OS_APPLE 1 +#endif +// Old platform defines retained for backwards compatibility. #ifndef OS_MACOSX #define OS_MACOSX 1 #endif @@ -57,7 +65,7 @@ // For access to standard POSIXish features, use OS_POSIX instead of a // more specific macro. -#if defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_MAC) || defined(OS_LINUX) #ifndef OS_POSIX #define OS_POSIX 1 #endif diff --git a/include/capi/cef_urlrequest_capi.h b/include/capi/cef_urlrequest_capi.h index 81eeaa666..3a6cf587d 100644 --- a/include/capi/cef_urlrequest_capi.h +++ b/include/capi/cef_urlrequest_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=63d875f5a922dd2c2e1efaaf0ddaa20475f79ef8$ +// $hash=75f4f7a9ff628a6ae699a697722caa5d49546784$ // #ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ @@ -115,20 +115,13 @@ typedef struct _cef_urlrequest_t { // Create a new URL request that is not associated with a specific browser or // frame. Use cef_frame_t::CreateURLRequest instead if you want the request to // have this association, in which case it may be handled differently (see -// documentation on that function). Requests may originate from the both browser -// process and the render process. -// -// For requests originating from the browser process: +// documentation on that function). A request created with this function may +// only originate from the browser process, and will behave as follows: // - It may be intercepted by the client via CefResourceRequestHandler or // CefSchemeHandlerFactory. // - POST data may only contain only a single element of type PDE_TYPE_FILE // or PDE_TYPE_BYTES. // - If |request_context| is empty the global request context will be used. -// For requests originating from the render process: -// - It cannot be intercepted by the client so only http(s) and blob schemes -// are supported. -// - POST data may only contain a single element of type PDE_TYPE_BYTES. -// - The |request_context| parameter must be NULL. // // The |request| object will be marked as read-only after calling this function. /// diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index 343e1c60c..636b371ae 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -45,7 +45,7 @@ #define CEF_API_HASH_UNIVERSAL "09dba98bcfcdf8a84e6e1bddf9cfbfd02cdb9c41" #if defined(OS_WIN) #define CEF_API_HASH_PLATFORM "52cba70fb6dd7cfa07a64033875f2b9951ab194b" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #define CEF_API_HASH_PLATFORM "40ddb93c4e9b9d0f81b62a61a595307c6ed204e5" #elif defined(OS_LINUX) #define CEF_API_HASH_PLATFORM "e48b0f06a363df82624951e4b85fb638bf0987c0" diff --git a/include/cef_application_mac.h b/include/cef_application_mac.h index e2858c48e..af37668d8 100644 --- a/include/cef_application_mac.h +++ b/include/cef_application_mac.h @@ -35,7 +35,7 @@ #include "include/cef_base.h" #endif // __cplusplus -#if defined(OS_MACOSX) && defined(__OBJC__) +#if defined(OS_MAC) && defined(__OBJC__) #ifdef USING_CHROMIUM_INCLUDES @@ -105,6 +105,6 @@ class CefScopedSendingEvent { #endif // __cplusplus -#endif // defined(OS_MACOSX) && defined(__OBJC__) +#endif // defined(OS_MAC) && defined(__OBJC__) #endif // CEF_INCLUDE_CEF_APPLICATION_MAC_H_ diff --git a/include/cef_base.h b/include/cef_base.h index 0db0f3a8d..89e9c7a1e 100644 --- a/include/cef_base.h +++ b/include/cef_base.h @@ -40,7 +40,7 @@ #include "include/internal/cef_types_wrappers.h" #if defined(OS_WIN) #include "include/internal/cef_win.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "include/internal/cef_mac.h" #elif defined(OS_LINUX) #include "include/internal/cef_linux.h" diff --git a/include/cef_sandbox_mac.h b/include/cef_sandbox_mac.h index 48886ed0d..9b4ad52cb 100644 --- a/include/cef_sandbox_mac.h +++ b/include/cef_sandbox_mac.h @@ -34,7 +34,7 @@ #include "include/base/cef_build.h" #include "include/internal/cef_export.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #ifdef __cplusplus extern "C" { @@ -83,6 +83,6 @@ class CEF_EXPORT CefScopedSandboxContext { }; #endif // __cplusplus -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) #endif // CEF_INCLUDE_CEF_SANDBOX_MAC_H_ diff --git a/include/cef_urlrequest.h b/include/cef_urlrequest.h index 8966eb8d3..121ddeacd 100644 --- a/include/cef_urlrequest.h +++ b/include/cef_urlrequest.h @@ -63,20 +63,13 @@ class CefURLRequest : public virtual CefBaseRefCounted { // Create a new URL request that is not associated with a specific browser or // frame. Use CefFrame::CreateURLRequest instead if you want the request to // have this association, in which case it may be handled differently (see - // documentation on that method). Requests may originate from the both browser - // process and the render process. - // - // For requests originating from the browser process: + // documentation on that method). A request created with this method may only + // originate from the browser process, and will behave as follows: // - It may be intercepted by the client via CefResourceRequestHandler or // CefSchemeHandlerFactory. // - POST data may only contain only a single element of type PDE_TYPE_FILE // or PDE_TYPE_BYTES. // - If |request_context| is empty the global request context will be used. - // For requests originating from the render process: - // - It cannot be intercepted by the client so only http(s) and blob schemes - // are supported. - // - POST data may only contain a single element of type PDE_TYPE_BYTES. - // - The |request_context| parameter must be NULL. // // The |request| object will be marked as read-only after calling this method. /// diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 622623d9a..c861e041d 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -39,7 +39,7 @@ // Bring in platform-specific definitions. #if defined(OS_WIN) #include "include/internal/cef_types_win.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "include/internal/cef_types_mac.h" #elif defined(OS_LINUX) #include "include/internal/cef_types_linux.h" diff --git a/include/internal/cef_types_mac.h b/include/internal/cef_types_mac.h index 14e61da44..3e48dc40d 100644 --- a/include/internal/cef_types_mac.h +++ b/include/internal/cef_types_mac.h @@ -33,7 +33,7 @@ #include "include/base/cef_build.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "include/internal/cef_string.h" // Handle types. @@ -137,6 +137,6 @@ typedef struct _cef_window_info_t { } #endif -#endif // OS_MACOSX +#endif // OS_MAC #endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_MAC_H_ diff --git a/include/wrapper/cef_library_loader.h b/include/wrapper/cef_library_loader.h index c15b8559d..8477f45fb 100644 --- a/include/wrapper/cef_library_loader.h +++ b/include/wrapper/cef_library_loader.h @@ -56,7 +56,7 @@ int cef_unload_library(); #ifdef __cplusplus } -#if defined(OS_MACOSX) +#if defined(OS_MAC) /// // Scoped helper for loading and unloading the CEF framework library at @@ -122,7 +122,7 @@ class CefScopedLibraryLoader { DISALLOW_COPY_AND_ASSIGN(CefScopedLibraryLoader); }; -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) #endif // __cplusplus #endif // CEF_INCLUDE_WRAPPER_CEF_LIBRARY_LOADER_H_ diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index 1b25cb4ce..5f3b87a8d 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -96,10 +96,10 @@ class AlloyBrowserContext : public ChromeProfileAlloy, // Values checked in ProfileNetworkContextService::CreateNetworkContextParams // when creating the NetworkContext. - bool ShouldRestoreOldSessionCookies() override { + bool ShouldRestoreOldSessionCookies() const override { return ShouldPersistSessionCookies(); } - bool ShouldPersistSessionCookies() override { + bool ShouldPersistSessionCookies() const override { return !!settings_.persist_session_cookies; } base::Optional> GetCookieableSchemes() override { diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index a4c8864f2..38fe33c7e 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -57,7 +57,7 @@ #endif // defined(USE_AURA) #if defined(TOOLKIT_VIEWS) -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "chrome/browser/ui/views/chrome_layout_provider.h" #include "chrome/browser/ui/views/chrome_views_delegate.h" #else @@ -105,7 +105,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() { #endif // defined(USE_AURA) #if defined(TOOLKIT_VIEWS) -#if defined(OS_MACOSX) +#if defined(OS_MAC) views_delegate_ = std::make_unique(); layout_provider_ = ChromeLayoutProvider::CreateLayoutProvider(); #else @@ -230,7 +230,7 @@ void AlloyBrowserMainParts::PostDestroyThreads() { #if defined(TOOLKIT_VIEWS) views_delegate_.reset(); -#if defined(OS_MACOSX) +#if defined(OS_MAC) layout_provider_.reset(); #endif #endif // defined(TOOLKIT_VIEWS) diff --git a/libcef/browser/alloy/alloy_browser_main.h b/libcef/browser/alloy/alloy_browser_main.h index 58048a94e..08b235e59 100644 --- a/libcef/browser/alloy/alloy_browser_main.h +++ b/libcef/browser/alloy/alloy_browser_main.h @@ -32,7 +32,7 @@ class WMState; #if defined(TOOLKIT_VIEWS) namespace views { class ViewsDelegate; -#if defined(OS_MACOSX) +#if defined(OS_MAC) class LayoutProvider; #endif } // namespace views @@ -96,7 +96,7 @@ class AlloyBrowserMainParts : public content::BrowserMainParts { #if defined(TOOLKIT_VIEWS) std::unique_ptr views_delegate_; -#if defined(OS_MACOSX) +#if defined(OS_MAC) std::unique_ptr layout_provider_; #endif #endif // defined(TOOLKIT_VIEWS) diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 6c1664e19..f2e932005 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -40,7 +40,6 @@ #include "libcef/common/extensions/extensions_util.h" #include "libcef/common/net/scheme_registration.h" #include "libcef/common/request_impl.h" -#include "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h" #include "base/base_switches.h" #include "base/command_line.h" @@ -73,7 +72,6 @@ #include "components/navigation_interception/intercept_navigation_throttle.h" #include "components/navigation_interception/navigation_params.h" #include "components/spellcheck/common/spellcheck.mojom.h" -#include "components/variations/variations_http_header_provider.h" #include "components/version_info/version_info.h" #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/plugin_service_impl.h" @@ -104,6 +102,8 @@ #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h" +#include "extensions/browser/info_map.h" +#include "extensions/browser/process_map.h" #include "extensions/browser/url_loader_factory_manager.h" #include "extensions/common/constants.h" #include "extensions/common/switches.h" @@ -112,11 +112,11 @@ #include "net/base/auth.h" #include "net/ssl/ssl_cert_request_info.h" #include "ppapi/host/ppapi_host.h" +#include "sandbox/policy/switches.h" #include "services/network/public/cpp/network_switches.h" #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #include "services/service_manager/embedder/switches.h" #include "services/service_manager/public/mojom/connector.mojom.h" -#include "services/service_manager/sandbox/switches.h" #include "storage/browser/quota/quota_settings.h" #include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" #include "third_party/blink/public/mojom/prerender/prerender.mojom.h" @@ -131,7 +131,7 @@ #include "libcef/common/widevine_loader.h" #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) #include "base/debug/leak_annotations.h" #include "chrome/common/chrome_paths.h" #include "components/crash/content/browser/crash_handler_host_linux.h" @@ -139,7 +139,7 @@ #include "content/public/common/content_descriptors.h" #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "net/ssl/client_cert_store_mac.h" #include "services/video_capture/public/mojom/constants.mojom.h" #endif @@ -381,7 +381,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext { DISALLOW_COPY_AND_ASSIGN(CefQuotaPermissionContext); }; -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( const std::string& process_type) { base::FilePath dumps_path; @@ -436,7 +436,7 @@ int GetCrashSignalFD(const base::CommandLine& command_line) { return -1; } -#endif // defined(OS_POSIX) && !defined(OS_MACOSX) +#endif // defined(OS_POSIX) && !defined(OS_MAC) // TODO(cef): We can't currently trust NavigationParams::is_main_frame() because // it's always set to true in @@ -697,12 +697,6 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess( extensions::ProcessMap::Get(browser_context) ->Insert(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); - - CEF_POST_TASK( - CEF_IOT, base::Bind(&extensions::InfoMap::RegisterExtensionProcess, - browser_context->extension_system()->info_map(), - extension->id(), site_instance->GetProcess()->GetID(), - site_instance->GetId())); } void AlloyContentBrowserClient::SiteInstanceDeleting( @@ -729,12 +723,6 @@ void AlloyContentBrowserClient::SiteInstanceDeleting( extensions::ProcessMap::Get(browser_context) ->Remove(extension->id(), site_instance->GetProcess()->GetID(), site_instance->GetId()); - - CEF_POST_TASK( - CEF_IOT, base::Bind(&extensions::InfoMap::UnregisterExtensionProcess, - browser_context->extension_system()->info_map(), - extension->id(), site_instance->GetProcess()->GetID(), - site_instance->GetId())); } void AlloyContentBrowserClient::BindHostReceiverForRenderer( @@ -756,15 +744,6 @@ void AlloyContentBrowserClient::BindHostReceiverForRenderer( #endif // BUILDFLAG(HAS_SPELLCHECK_PANEL) } -base::Optional -AlloyContentBrowserClient::GetServiceManifestOverlay(base::StringPiece name) { - if (name == content::mojom::kBrowserServiceName) { - return GetCefContentBrowserOverlayManifest(); - } - - return base::nullopt; -} - void AlloyContentBrowserClient::AppendExtraCommandLineSwitches( base::CommandLine* command_line, int child_process_id) { @@ -775,7 +754,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches( // associated values) if present in the browser command line. static const char* const kSwitchNames[] = { switches::kDisablePackLoading, -#if defined(OS_MACOSX) +#if defined(OS_MAC) switches::kFrameworkDirPath, switches::kMainBundlePath, #endif @@ -855,7 +834,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches( base::size(kSwitchNames)); #if BUILDFLAG(ENABLE_WIDEVINE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) - if (!browser_cmd->HasSwitch(service_manager::switches::kNoSandbox)) { + if (!browser_cmd->HasSwitch(sandbox::policy::switches::kNoSandbox)) { // Pass the Widevine CDM path to the Zygote process. See comments in // CefWidevineLoader::AddContentDecryptionModules. const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path(); @@ -1179,7 +1158,7 @@ AlloyContentBrowserClient::CreateClientCertStore( net::ClientCertStoreNSS::PasswordDelegateFactory())); #elif defined(OS_WIN) return std::unique_ptr(new net::ClientCertStoreWin()); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return std::unique_ptr(new net::ClientCertStoreMac()); #else #error Unknown platform. @@ -1203,6 +1182,7 @@ AlloyContentBrowserClient::CreateLoginDelegate( void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( int frame_tree_node_id, + base::UkmSourceId ukm_source_id, NonNetworkURLLoaderFactoryMap* factories) { if (!extensions::ExtensionsEnabled()) return; @@ -1212,7 +1192,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( factories->emplace( extensions::kExtensionScheme, extensions::CreateExtensionNavigationURLLoaderFactory( - web_contents->GetBrowserContext(), + web_contents->GetBrowserContext(), ukm_source_id, !!extensions::WebViewGuest::FromWebContents(web_contents))); } diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 948c4d02a..1e8e4828b 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -61,8 +61,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { void BindHostReceiverForRenderer( content::RenderProcessHost* render_process_host, mojo::GenericPendingReceiver receiver) override; - base::Optional GetServiceManifestOverlay( - base::StringPiece name) override; void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) override; std::string GetApplicationLocale() override; @@ -149,6 +147,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { LoginAuthRequiredCallback auth_required_callback) override; void RegisterNonNetworkNavigationURLLoaderFactories( int frame_tree_node_id, + base::UkmSourceId ukm_source_id, NonNetworkURLLoaderFactoryMap* factories) override; void RegisterNonNetworkSubresourceURLLoaderFactories( int render_process_id, diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 4e73ddc6b..466ee4617 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -222,7 +222,7 @@ void CefBrowserPlatformDelegateAlloy::SendCaptureLostEvent() { widget->LostCapture(); } -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) void CefBrowserPlatformDelegateAlloy::NotifyMoveOrResizeStarted() { if (!web_contents_) return; diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.h b/libcef/browser/alloy/browser_platform_delegate_alloy.h index 7a989538a..f1e6ba0f3 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.h +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.h @@ -36,7 +36,7 @@ class CefBrowserPlatformDelegateAlloy : public CefBrowserPlatformDelegate { extensions::ExtensionHost* GetExtensionHost() const override; void BrowserDestroyed(CefBrowserHostImpl* browser) override; void SendCaptureLostEvent() override; -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) void NotifyMoveOrResizeStarted() override; #endif bool PreHandleGestureEvent(content::WebContents* source, diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index 29dd7e8ed..f55e3c418 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -5,8 +5,9 @@ #include "libcef/browser/alloy/chrome_profile_alloy.h" +#include "base/no_destructor.h" #include "components/variations/variations_client.h" -#include "components/variations/variations_http_header_provider.h" +#include "components/variations/variations_ids_provider.h" #include "net/url_request/url_request_context.h" namespace { @@ -23,7 +24,7 @@ class CefVariationsClient : public variations::VariationsClient { } std::string GetVariationsHeader() const override { - return variations::VariationsHttpHeaderProvider::GetInstance() + return variations::VariationsIdsProvider::GetInstance() ->GetClientDataHeader(false /* is_signed_in */); } @@ -157,7 +158,7 @@ void ChromeProfileAlloy::SetExitType(ExitType exit_type) { NOTREACHED(); } -Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() { +Profile::ExitType ChromeProfileAlloy::GetLastSessionExitType() const { NOTREACHED(); return EXIT_NORMAL; } diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index f62a8665d..32b4d0129 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -47,7 +47,7 @@ class ChromeProfileAlloy : public Profile { GURL GetHomePage() override; bool WasCreatedByVersionOrLater(const std::string& version) override; void SetExitType(ExitType exit_type) override; - ExitType GetLastSessionExitType() override; + ExitType GetLastSessionExitType() const override; base::Time GetCreationTime() const override; void SetCreationTimeForTesting(base::Time creation_time) override; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index de31171b9..de92afa46 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -65,7 +65,7 @@ #include "ui/events/base_event_utils.h" #include "ui/gfx/image/image_skia.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "components/spellcheck/browser/spellcheck_platform.h" #endif @@ -565,7 +565,7 @@ void CefBrowserHostImpl::CloseBrowser(bool force_close) { } content::WebContents* contents = web_contents(); - if (contents && contents->NeedToFireBeforeUnloadOrUnload()) { + if (contents && contents->NeedToFireBeforeUnloadOrUnloadEvents()) { // Will result in a call to BeforeUnloadFired() and, if the close isn't // canceled, CloseContents(). contents->DispatchBeforeUnload(false /* auto_cancel */); @@ -1048,7 +1048,7 @@ void CefBrowserHostImpl::AddWordToDictionary(const CefString& word) { if (spellcheck) spellcheck->GetCustomDictionary()->AddWord(word); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (spellcheck && spellcheck::UseBrowserSpellChecker()) { spellcheck_platform::AddWord(spellcheck->platform_spell_checker(), word); } @@ -1225,7 +1225,7 @@ void CefBrowserHostImpl::SendCaptureLostEvent() { } void CefBrowserHostImpl::NotifyMoveOrResizeStarted() { -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK( CEF_UIT, @@ -2301,10 +2301,10 @@ CefBrowserHostImpl::GetJavaScriptDialogManager(content::WebContents* source) { void CefBrowserHostImpl::RunFileChooser( content::RenderFrameHost* render_frame_host, - std::unique_ptr listener, + scoped_refptr listener, const blink::mojom::FileChooserParams& params) { EnsureFileDialogManager(); - file_dialog_manager_->RunFileChooser(std::move(listener), params); + file_dialog_manager_->RunFileChooser(listener, params); } bool CefBrowserHostImpl::HandleContextMenu( @@ -2320,7 +2320,7 @@ bool CefBrowserHostImpl::HandleContextMenu( void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source, const gfx::Size& pref_size) { -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) CEF_REQUIRE_UIT(); if (platform_delegate_) platform_delegate_->SizeTo(pref_size.width(), pref_size.height()); diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 339075e78..63d940e85 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -430,7 +430,7 @@ class CefBrowserHostImpl : public CefBrowserHost, content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; void RunFileChooser(content::RenderFrameHost* render_frame_host, - std::unique_ptr listener, + scoped_refptr listener, const blink::mojom::FileChooserParams& params) override; bool EmbedsFullscreenWidget() override; void EnterFullscreenModeForTab( diff --git a/libcef/browser/browser_info_manager.cc b/libcef/browser/browser_info_manager.cc index 68c08241f..d67b9b551 100644 --- a/libcef/browser/browser_info_manager.cc +++ b/libcef/browser/browser_info_manager.cc @@ -157,7 +157,7 @@ bool CefBrowserInfoManager::CanCreateWindow( CefPopupFeatures cef_features; TranslatePopupFeatures(features, cef_features); -#if (defined(OS_WIN) || defined(OS_MACOSX)) +#if (defined(OS_WIN) || defined(OS_MAC)) // Default to the size from the popup features. if (cef_features.xSet) window_info->x = cef_features.x; diff --git a/libcef/browser/browser_message_loop.cc b/libcef/browser/browser_message_loop.cc index 9e632c694..0c1d94f88 100644 --- a/libcef/browser/browser_message_loop.cc +++ b/libcef/browser/browser_message_loop.cc @@ -9,7 +9,7 @@ #include "base/message_loop/message_pump.h" #include "base/message_loop/message_pump_for_ui.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "base/mac/scoped_nsautorelease_pool.h" #include "base/message_loop/message_pump_mac.h" #endif @@ -29,7 +29,7 @@ class MessagePumpExternal : public base::MessagePumpForUI { void Run(Delegate* delegate) override { base::TimeTicks start = base::TimeTicks::Now(); while (true) { -#if defined(OS_MACOSX) +#if defined(OS_MAC) base::mac::ScopedNSAutoreleasePool autorelease_pool; #endif @@ -108,7 +108,7 @@ std::unique_ptr MessagePumpFactoryForUI() { return std::make_unique(0.01f, handler); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) return base::MessagePumpMac::Create(); #else return std::make_unique(); diff --git a/libcef/browser/browser_platform_delegate.cc b/libcef/browser/browser_platform_delegate.cc index 1e209d0b3..bb69c48f3 100644 --- a/libcef/browser/browser_platform_delegate.cc +++ b/libcef/browser/browser_platform_delegate.cc @@ -127,7 +127,7 @@ void CefBrowserPlatformDelegate::SendCaptureLostEvent() { NOTIMPLEMENTED(); } -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) void CefBrowserPlatformDelegate::NotifyMoveOrResizeStarted() {} void CefBrowserPlatformDelegate::SizeTo(int width, int height) {} diff --git a/libcef/browser/browser_platform_delegate.h b/libcef/browser/browser_platform_delegate.h index 0e269498c..b5f2741c8 100644 --- a/libcef/browser/browser_platform_delegate.h +++ b/libcef/browser/browser_platform_delegate.h @@ -207,7 +207,7 @@ class CefBrowserPlatformDelegate { // Send capture lost event. virtual void SendCaptureLostEvent(); -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) // The window hosting the browser is about to be moved or resized. Only used // on Windows and Linux. virtual void NotifyMoveOrResizeStarted(); diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc index 954581e91..b3fcf6120 100644 --- a/libcef/browser/browser_platform_delegate_create.cc +++ b/libcef/browser/browser_platform_delegate_create.cc @@ -18,7 +18,7 @@ #if defined(OS_WIN) #include "libcef/browser/native/browser_platform_delegate_native_win.h" #include "libcef/browser/osr/browser_platform_delegate_osr_win.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "libcef/browser/native/browser_platform_delegate_native_mac.h" #include "libcef/browser/osr/browser_platform_delegate_osr_mac.h" #elif defined(OS_LINUX) @@ -40,7 +40,7 @@ std::unique_ptr CreateNativeDelegate( #if defined(OS_WIN) return std::make_unique( window_info, background_color); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return std::make_unique( window_info, background_color); #elif defined(OS_LINUX) @@ -56,7 +56,7 @@ std::unique_ptr CreateOSRDelegate( #if defined(OS_WIN) return std::make_unique( std::move(native_delegate), use_shared_texture, use_external_begin_frame); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return std::make_unique( std::move(native_delegate)); #elif defined(OS_LINUX) diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index cb65a11f4..6ca2a33ff 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -26,7 +26,8 @@ ChromeContentBrowserClientCef::CreateBrowserMainParts( ChromeContentBrowserClient::CreateBrowserMainParts(parameters); browser_main_parts_ = new ChromeBrowserMainExtraPartsCef; static_cast(main_parts.get()) - ->AddParts(browser_main_parts_); + ->AddParts( + base::WrapUnique(browser_main_parts_)); return main_parts; } diff --git a/libcef/browser/chrome_crash_reporter_client_stub.cc b/libcef/browser/chrome_crash_reporter_client_stub.cc index 837db315e..adfbffa16 100644 --- a/libcef/browser/chrome_crash_reporter_client_stub.cc +++ b/libcef/browser/chrome_crash_reporter_client_stub.cc @@ -5,11 +5,11 @@ #include "build/build_config.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "chrome/app/chrome_crash_reporter_client.h" // Required due to https://crrev.com/1c9f89a06f void ChromeCrashReporterClient::Create() {} -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index 3d572dfff..0dac9a1eb 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -11,8 +11,8 @@ #include "base/bind.h" #include "base/files/file_util.h" -#include "base/message_loop/message_loop_current.h" #include "base/run_loop.h" +#include "base/task/current_thread.h" #include "base/threading/thread_restrictions.h" #include "components/network_session_configurator/common/network_switches.h" #include "content/public/browser/notification_service.h" @@ -294,7 +294,7 @@ void CefSetOSModalLoop(bool osModalLoop) { } if (CEF_CURRENTLY_ON_UIT()) - base::MessageLoopCurrent::Get()->set_os_modal_loop(osModalLoop); + base::CurrentThread::Get()->set_os_modal_loop(osModalLoop); else CEF_POST_TASK(CEF_UIT, base::Bind(CefSetOSModalLoop, osModalLoop)); #endif // defined(OS_WIN) diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index ad00c60b8..540ab7435 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -25,6 +25,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" @@ -538,7 +539,7 @@ void CefDevToolsFrontend::DispatchProtocolMessage( if (ProtocolLoggingEnabled()) { // Quick check to avoid parsing the JSON object. Events begin with a // "method" value whereas method results begin with an "id" value. - LogProtocolMessage(str_message.starts_with("{\"method\":") + LogProtocolMessage(base::StartsWith(str_message, "{\"method\":") ? ProtocolMessageType::EVENT : ProtocolMessageType::RESULT, str_message); diff --git a/libcef/browser/devtools/devtools_util.cc b/libcef/browser/devtools/devtools_util.cc index c0200cf38..7b60a5c75 100644 --- a/libcef/browser/devtools/devtools_util.cc +++ b/libcef/browser/devtools/devtools_util.cc @@ -5,6 +5,7 @@ #include "libcef/browser/devtools/devtools_util.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_util.h" namespace devtools_util { @@ -24,7 +25,7 @@ bool ParseEvent(const base::StringPiece& message, static const char kMethodEnd[] = "\""; static const char kParamsStart[] = ",\"params\":"; - if (!message.starts_with(kMethodStart)) + if (!base::StartsWith(message, kMethodStart)) return false; const size_t method_start = sizeof(kMethodStart) - 1; @@ -41,7 +42,7 @@ bool ParseEvent(const base::StringPiece& message, params = base::StringPiece(); } else { const base::StringPiece& remainder = message.substr(remainder_start); - if (remainder.starts_with(kParamsStart)) { + if (base::StartsWith(remainder, kParamsStart)) { // Stop immediately before the message closing bracket. remainder_start += sizeof(kParamsStart) - 1; params = @@ -71,7 +72,7 @@ bool ParseResult(const base::StringPiece& message, static const char kResultStart[] = "\"result\":"; static const char kErrorStart[] = "\"error\":"; - if (!message.starts_with(kIdStart)) + if (!base::StartsWith(message, kIdStart)) return false; const size_t id_start = sizeof(kIdStart) - 1; @@ -84,13 +85,13 @@ bool ParseResult(const base::StringPiece& message, size_t remainder_start = id_end + sizeof(kIdEnd) - 1; const base::StringPiece& remainder = message.substr(remainder_start); - if (remainder.starts_with(kResultStart)) { + if (base::StartsWith(remainder, kResultStart)) { // Stop immediately before the message closing bracket. remainder_start += sizeof(kResultStart) - 1; result = message.substr(remainder_start, message.size() - 1 - remainder_start); success = true; - } else if (remainder.starts_with(kErrorStart)) { + } else if (base::StartsWith(remainder, kErrorStart)) { // Stop immediately before the message closing bracket. remainder_start += sizeof(kErrorStart) - 1; result = diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 446692b5b..cb34f8375 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -487,7 +487,7 @@ void CefExtensionSystem::InstallUpdate( bool install_immediately, InstallUpdateCallback install_update_callback) { NOTREACHED(); - base::DeleteFile(temp_dir, true /* recursive */); + base::DeletePathRecursively(temp_dir); } void CefExtensionSystem::PerformActionBasedOnOmahaAttributes( diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index eb25c9f57..5f7361b0b 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -13,7 +13,6 @@ #include "content/public/browser/file_select_listener.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/common/file_chooser_file_info.h" #include "net/base/directory_lister.h" namespace { @@ -202,7 +201,7 @@ void CefFileDialogManager::RunFileDialog( } void CefFileDialogManager::RunFileChooser( - std::unique_ptr listener, + scoped_refptr listener, const blink::mojom::FileChooserParams& params) { CEF_REQUIRE_UIT(); @@ -213,11 +212,11 @@ void CefFileDialogManager::RunFileChooser( if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) { callback = base::BindOnce( &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener)); + weak_ptr_factory_.GetWeakPtr(), params.mode, listener); } else { - callback = base::BindOnce( - &CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener)); + callback = + base::BindOnce(&CefFileDialogManager::OnRunFileChooserDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), params.mode, listener); } RunFileChooserInternal(cef_params, std::move(callback)); @@ -320,7 +319,7 @@ void CefFileDialogManager::OnRunFileChooserCallback( void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( const blink::mojom::FileChooserParams::Mode mode, - std::unique_ptr listener, + scoped_refptr listener, int selected_accept_filter, const std::vector& file_paths) { CEF_REQUIRE_UIT(); @@ -328,21 +327,21 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( if (file_paths.size() == 0) { // Client canceled the file chooser. - OnRunFileChooserDelegateCallback(mode, std::move(listener), - selected_accept_filter, file_paths); + OnRunFileChooserDelegateCallback(mode, listener, selected_accept_filter, + file_paths); } else { lister_.reset(new net::DirectoryLister( file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE, new UploadFolderHelper(base::BindOnce( &CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), mode, std::move(listener))))); + weak_ptr_factory_.GetWeakPtr(), mode, listener)))); lister_->Start(); } } void CefFileDialogManager::OnRunFileChooserDelegateCallback( blink::mojom::FileChooserParams::Mode mode, - std::unique_ptr listener, + scoped_refptr listener, int selected_accept_filter, const std::vector& file_paths) { CEF_REQUIRE_UIT(); diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index a739c51fc..8bd8bfff8 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -46,7 +46,7 @@ class CefFileDialogManager { // Called from CefBrowserHostImpl::RunFileChooser. // See WebContentsDelegate::RunFileChooser documentation. - void RunFileChooser(std::unique_ptr listener, + void RunFileChooser(scoped_refptr listener, const blink::mojom::FileChooserParams& params); // Run the file chooser dialog specified by |params|. Only a single dialog may @@ -71,7 +71,7 @@ class CefFileDialogManager { // blink::mojom::FileChooserParams::Mode::kUploadFolder. void OnRunFileChooserUploadFolderDelegateCallback( const blink::mojom::FileChooserParams::Mode mode, - std::unique_ptr listener, + scoped_refptr listener, int selected_accept_filter, const std::vector& file_paths); @@ -79,7 +79,7 @@ class CefFileDialogManager { // RenderFrameHost. void OnRunFileChooserDelegateCallback( blink::mojom::FileChooserParams::Mode mode, - std::unique_ptr listener, + scoped_refptr listener, int selected_accept_filter, const std::vector& file_paths); diff --git a/libcef/browser/main_runner.cc b/libcef/browser/main_runner.cc index fcddf9023..5cbf26991 100644 --- a/libcef/browser/main_runner.cc +++ b/libcef/browser/main_runner.cc @@ -34,7 +34,7 @@ #include "sandbox/win/src/sandbox_types.h" #endif -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_MAC) || defined(OS_WIN) #include "components/crash/core/app/crash_switches.h" #include "third_party/crashpad/crashpad/handler/handler_main.h" #endif @@ -64,7 +64,7 @@ std::unique_ptr MakeDelegate( } } -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_MAC) || defined(OS_WIN) // Based on components/crash/core/app/run_as_crashpad_handler_win.cc // Remove the "--type=crashpad-handler" command-line flag that will otherwise @@ -87,7 +87,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) { }), argv.end()); -#if defined(OS_MACOSX) +#if defined(OS_MAC) // HandlerMain on macOS uses the system version of getopt_long which expects // the first argument to be the program name. argv.insert(argv.begin(), command_line.GetProgram().value()); @@ -110,7 +110,7 @@ int RunAsCrashpadHandler(const base::CommandLine& command_line) { argv_as_utf8.get(), nullptr); } -#endif // defined(OS_MACOSX) || defined(OS_WIN) +#endif // defined(OS_MAC) || defined(OS_WIN) } // namespace @@ -325,7 +325,7 @@ int CefMainRunner::RunAsHelperProcess(const CefMainArgs& args, int result; -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_MAC) || defined(OS_WIN) if (process_type == crash_reporter::switches::kCrashpadHandler) { result = RunAsCrashpadHandler(command_line); main_delegate->AfterExecuteProcess(); diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 6ed86840f..ee8adad1b 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -27,7 +27,7 @@ #if defined(USE_X11) #include "libcef/browser/native/window_x11.h" -#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" +#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" #endif namespace { @@ -40,11 +40,6 @@ long GetSystemUptime() { return 0; } -// See https://crbug.com/1066670#c57 for background. -inline x11::Window ToX11Window(::Window window) { - return static_cast(window); -} - } // namespace CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux( @@ -92,8 +87,8 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() { CefWindowDelegateView* delegate_view = new CefWindowDelegateView( GetBackgroundColor(), window_x11_->TopLevelAlwaysOnTop(), GetBoundsChangedCallback()); - delegate_view->Init(ToX11Window(window_info_.window), web_contents_, - gfx::Rect(gfx::Point(), rect.size())); + delegate_view->Init(static_cast(window_info_.window), + web_contents_, gfx::Rect(gfx::Point(), rect.size())); window_widget_ = delegate_view->GetWidget(); window_widget_->Show(); @@ -176,7 +171,7 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() { if (!window_x11_) return; - views::DesktopWindowTreeHostX11* tree_host = window_x11_->GetHost(); + views::DesktopWindowTreeHostLinux* tree_host = window_x11_->GetHost(); if (!tree_host) return; @@ -212,7 +207,7 @@ gfx::Point CefBrowserPlatformDelegateNativeLinux::GetScreenPoint( return view; // We can't use aura::Window::GetBoundsInScreen on Linux because it will - // return bounds from DesktopWindowTreeHostX11 which in our case is relative + // return bounds from DesktopWindowTreeHostLinux which in our case is relative // to the parent window instead of the root window (screen). const gfx::Rect& bounds_in_screen = window_x11_->GetBoundsInScreen(); return gfx::Point(bounds_in_screen.x() + view.x(), diff --git a/libcef/browser/native/menu_runner_mac.mm b/libcef/browser/native/menu_runner_mac.mm index d514e34d2..2abe1ac7c 100644 --- a/libcef/browser/native/menu_runner_mac.mm +++ b/libcef/browser/native/menu_runner_mac.mm @@ -8,7 +8,7 @@ #include "base/compiler_specific.h" #import "base/mac/scoped_sending_event.h" -#include "base/message_loop/message_loop_current.h" +#include "base/task/current_thread.h" #import "ui/base/cocoa/menu_controller.h" #include "ui/gfx/geometry/point.h" @@ -23,6 +23,7 @@ bool CefMenuRunnerMac::RunContextMenu( // Create a menu controller based on the model. menu_controller_.reset([[MenuControllerCocoa alloc] initWithModel:model->model() + delegate:nil useWithPopUpButtonCell:NO]); // Keep the menu controller alive (by adding an additional retain) until after @@ -33,7 +34,7 @@ bool CefMenuRunnerMac::RunContextMenu( menu_controller_); // Make sure events can be pumped while the menu is up. - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::CurrentThread::ScopedNestableTaskAllower allow; // One of the events that could be pumped is |window.close()|. // User-initiated event-tracking loops protect against this by diff --git a/libcef/browser/native/menu_runner_win.cc b/libcef/browser/native/menu_runner_win.cc index 06db58c71..e18c17ff5 100644 --- a/libcef/browser/native/menu_runner_win.cc +++ b/libcef/browser/native/menu_runner_win.cc @@ -7,7 +7,7 @@ #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/native/menu_2.h" -#include "base/message_loop/message_loop_current.h" +#include "base/task/current_thread.h" #include "ui/gfx/geometry/point.h" CefMenuRunnerWin::CefMenuRunnerWin() {} @@ -21,7 +21,7 @@ bool CefMenuRunnerWin::RunContextMenu( menu_->Rebuild(nullptr); // Make sure events can be pumped while the menu is up. - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::CurrentThread::ScopedNestableTaskAllower allow; const gfx::Point& screen_point = browser->GetScreenPoint(gfx::Point(params.x, params.y)); diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index f821b5cda..f78ef1a55 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -4,18 +4,18 @@ // found in the LICENSE file. #include "libcef/browser/native/window_x11.h" +#include +#include +#include +#include + #include "libcef/browser/thread_util.h" #include "ui/base/x/x11_util.h" #include "ui/events/platform/platform_event_source.h" #include "ui/events/x/x11_event_translation.h" #include "ui/platform_window/x11/x11_topmost_window_finder.h" -#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" - -#include -#include -#include -#include +#include "ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h" namespace { @@ -208,7 +208,7 @@ void CefWindowX11::Show() { if (child && toplevel_window) { // Configure the drag&drop proxy property for the top-most window so // that all drag&drop-related messages will be sent to the child - // DesktopWindowTreeHostX11. The proxy property is referenced by + // DesktopWindowTreeHostLinux. The proxy property is referenced by // DesktopDragDropClientAuraX11::FindWindowFor. x11::Window window = x11::Window::None; ui::GetProperty(ToX11Window(toplevel_window), gfx::GetAtom(kXdndProxy), @@ -246,7 +246,7 @@ void CefWindowX11::Focus() { if (browser_.get()) { ::Window child = FindChild(xdisplay_, xwindow_); if (child && ui::IsWindowVisible(ToX11Window(child))) { - // Give focus to the child DesktopWindowTreeHostX11. + // Give focus to the child DesktopWindowTreeHostLinux. XSetInputFocus(xdisplay_, child, RevertToParent, x11::CurrentTime); } } else { @@ -289,13 +289,13 @@ gfx::Rect CefWindowX11::GetBoundsInScreen() { return gfx::Rect(); } -views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() { +views::DesktopWindowTreeHostLinux* CefWindowX11::GetHost() { if (browser_.get()) { ::Window child = FindChild(xdisplay_, xwindow_); if (child) { - return static_cast( + return static_cast( views::DesktopWindowTreeHostLinux::GetHostForWidget( - ToX11Window(child))); + static_cast(child))); } } return nullptr; @@ -318,8 +318,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) { // Called by X11EventSourceLibevent to determine whether this XEventDispatcher // implementation is able to process the next translated event sent by it. void CefWindowX11::CheckCanDispatchNextPlatformEvent(x11::Event* x11_event) { - XEvent* xev = &x11_event->xlib_event(); - current_xevent_ = IsTargetedBy(*x11_event) ? xev : nullptr; + current_xevent_ = IsTargetedBy(*x11_event) ? x11_event : nullptr; } void CefWindowX11::PlatformEventDispatchFinished() { @@ -333,8 +332,7 @@ ui::PlatformEventDispatcher* CefWindowX11::GetPlatformEventDispatcher() { bool CefWindowX11::DispatchXEvent(x11::Event* x11_event) { if (!IsTargetedBy(*x11_event)) return false; - XEvent* xev = &x11_event->xlib_event(); - ProcessXEvent(xev); + ProcessXEvent(x11_event); return true; } @@ -378,77 +376,64 @@ bool CefWindowX11::TopLevelAlwaysOnTop() const { } bool CefWindowX11::IsTargetedBy(const x11::Event& x11_event) const { - const XEvent& xev = x11_event.xlib_event(); - ::Window target_window = - xev.type == x11::GeGenericEvent::opcode - ? static_cast(xev.xcookie.data)->event - : xev.xany.window; - return target_window == xwindow_; + return ToWindow(x11_event.window()) == xwindow_; } -void CefWindowX11::ProcessXEvent(XEvent* xev) { - switch (xev->type) { - case ConfigureNotify: { - DCHECK_EQ(xwindow_, xev->xconfigure.event); - DCHECK_EQ(xwindow_, xev->xconfigure.window); - // It's possible that the X window may be resized by some other means - // than from within Aura (e.g. the X window manager can change the - // size). Make sure the root window size is maintained properly. - gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, - xev->xconfigure.width, xev->xconfigure.height); - bounds_ = bounds; +void CefWindowX11::ProcessXEvent(x11::Event* event) { + if (auto* configure = event->As()) { + DCHECK_EQ(xwindow_, ToWindow(configure->event)); + DCHECK_EQ(xwindow_, ToWindow(configure->window)); + // It's possible that the X window may be resized by some other means + // than from within Aura (e.g. the X window manager can change the + // size). Make sure the root window size is maintained properly. + bounds_ = gfx::Rect(configure->x, configure->y, configure->width, + configure->height); - if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child) { - // Resize the child DesktopWindowTreeHostX11 to match this window. - XWindowChanges changes = {0}; - changes.width = bounds.width(); - changes.height = bounds.height(); - XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes); + if (browser_.get()) { + ::Window child = FindChild(xdisplay_, xwindow_); + if (child) { + // Resize the child DesktopWindowTreeHostLinux to match this window. + XWindowChanges changes = {0}; + changes.width = bounds_.width(); + changes.height = bounds_.height(); + XConfigureWindow(xdisplay_, child, CWHeight | CWWidth, &changes); - browser_->NotifyMoveOrResizeStarted(); - } + browser_->NotifyMoveOrResizeStarted(); } - break; } - case ClientMessage: { - Atom message_type = xev->xclient.message_type; - if (message_type == GetAtom(kWMProtocols)) { - Atom protocol = static_cast(xev->xclient.data.l[0]); - if (protocol == GetAtom(kWMDeleteWindow)) { - // We have received a close message from the window manager. - if (!browser_ || browser_->TryCloseBrowser()) { - // Allow the close. - XDestroyWindow(xdisplay_, xwindow_); + } else if (auto* client = event->As()) { + if (client->type == gfx::GetAtom(kWMProtocols)) { + x11::Atom protocol = static_cast(client->data.data32[0]); + if (protocol == gfx::GetAtom(kWMDeleteWindow)) { + // We have received a close message from the window manager. + if (!browser_ || browser_->TryCloseBrowser()) { + // Allow the close. + XDestroyWindow(xdisplay_, xwindow_); - xwindow_ = x11::None; + xwindow_ = x11::None; - if (browser_.get()) { - // Force the browser to be destroyed and release the reference - // added in PlatformCreateWindow(). - browser_->WindowDestroyed(); - } - - delete this; + if (browser_.get()) { + // Force the browser to be destroyed and release the reference + // added in PlatformCreateWindow(). + browser_->WindowDestroyed(); } - } else if (protocol == GetAtom(kNetWMPing)) { - XEvent reply_event = *xev; - reply_event.xclient.window = parent_xwindow_; - XSendEvent(xdisplay_, reply_event.xclient.window, false, - SubstructureRedirectMask | SubstructureNotifyMask, - &reply_event); - XFlush(xdisplay_); + delete this; } + } else if (protocol == gfx::GetAtom(kNetWMPing)) { + x11::ClientMessageEvent reply_event = *client; + reply_event.window = ToX11Window(parent_xwindow_); + ui::SendEvent(reply_event, reply_event.window, + x11::EventMask::SubstructureNotify | + x11::EventMask::SubstructureRedirect); } - break; } - case x11::FocusIn: + } else if (auto* focus = event->As()) { + if (focus->opcode == x11::FocusEvent::In) { // This message is received first followed by a "_NET_ACTIVE_WINDOW" // message sent to the root window. When X11DesktopHandler handles the // "_NET_ACTIVE_WINDOW" message it will erroneously mark the WebView - // (hosted in a DesktopWindowTreeHostX11) as unfocused. Use a delayed + // (hosted in a DesktopWindowTreeHostLinux) as unfocused. Use a delayed // task here to restore the WebView's focus state. if (!focus_pending_) { focus_pending_ = true; @@ -457,44 +442,40 @@ void CefWindowX11::ProcessXEvent(XEvent* xev) { weak_ptr_factory_.GetWeakPtr()), 100); } - break; - case x11::FocusOut: + } else { // Cancel the pending focus change if some other window has gained focus // while waiting for the async task to run. Otherwise we can get stuck in // a focus change loop. if (focus_pending_) focus_pending_ = false; - break; - case PropertyNotify: { - ::Atom changed_atom = xev->xproperty.atom; - if (changed_atom == GetAtom(kNetWMState)) { - // State change event like minimize/maximize. - if (browser_.get()) { - ::Window child = FindChild(xdisplay_, xwindow_); - if (child) { - // Forward the state change to the child DesktopWindowTreeHostX11 - // window so that resource usage will be reduced while the window is - // minimized. - std::vector atom_list; - if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState, - &atom_list) && - !atom_list.empty()) { - ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM", - atom_list); - } else { - // Set an empty list of property values to pass the check in - // DesktopWindowTreeHostX11::OnWMStateUpdated(). - XChangeProperty(xdisplay_, child, - GetAtom(kNetWMState), // name - GetAtom(kAtom), // type - 32, // size in bits of items in 'value' - PropModeReplace, NULL, - 0); // num items - } + } + } else if (auto* property = event->As()) { + if (property->atom == gfx::GetAtom(kNetWMState)) { + // State change event like minimize/maximize. + if (browser_.get()) { + ::Window child = FindChild(xdisplay_, xwindow_); + if (child) { + // Forward the state change to the child DesktopWindowTreeHostLinux + // window so that resource usage will be reduced while the window is + // minimized. + std::vector atom_list; + if (ui::GetAtomArrayProperty(ToX11Window(xwindow_), kNetWMState, + &atom_list) && + !atom_list.empty()) { + ui::SetAtomArrayProperty(ToX11Window(child), kNetWMState, "ATOM", + atom_list); + } else { + // Set an empty list of property values to pass the check in + // DesktopWindowTreeHostLinux::OnWMStateUpdated(). + XChangeProperty(xdisplay_, child, + GetAtom(kNetWMState), // name + GetAtom(kAtom), // type + 32, // size in bits of items in 'value' + PropModeReplace, NULL, + 0); // num items } } } - break; } } } diff --git a/libcef/browser/native/window_x11.h b/libcef/browser/native/window_x11.h index 30fec5d58..f551abc2a 100644 --- a/libcef/browser/native/window_x11.h +++ b/libcef/browser/native/window_x11.h @@ -21,7 +21,7 @@ typedef struct _XDisplay Display; #include "ui/gfx/x/x11_atom_cache.h" namespace views { -class DesktopWindowTreeHostX11; +class DesktopWindowTreeHostLinux; } // Object wrapper for an X11 Window. @@ -46,7 +46,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, gfx::Rect GetBoundsInScreen(); - views::DesktopWindowTreeHostX11* GetHost(); + views::DesktopWindowTreeHostLinux* GetHost(); // ui::PlatformEventDispatcher methods: bool CanDispatchEvent(const ui::PlatformEvent& event) override; @@ -67,7 +67,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, void ContinueFocus(); bool IsTargetedBy(const x11::Event& x11_event) const; - void ProcessXEvent(XEvent* xev); + void ProcessXEvent(x11::Event* xev); CefRefPtr browser_; @@ -87,7 +87,7 @@ class CefWindowX11 : public ui::PlatformEventDispatcher, // Tells if this dispatcher can process next translated event based on a // previous check in ::CheckCanDispatchNextPlatformEvent based on a XID // target. - XEvent* current_xevent_ = nullptr; + x11::Event* current_xevent_ = nullptr; // Must always be the last member. base::WeakPtrFactory weak_ptr_factory_; diff --git a/libcef/browser/navigate_params.h b/libcef/browser/navigate_params.h index 92b898031..12f82cf32 100644 --- a/libcef/browser/navigate_params.h +++ b/libcef/browser/navigate_params.h @@ -13,6 +13,7 @@ #include "content/public/browser/global_request_id.h" #include "content/public/common/referrer.h" +#include "net/cookies/site_for_cookies.h" #include "ui/base/page_transition_types.h" #include "ui/base/window_open_disposition.h" #include "url/gurl.h" diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index d4956e43c..ba745563d 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -191,7 +191,7 @@ void GetDebugURLs(std::vector* urls) { std::string GetOSType() { #if defined(OS_WIN) return "Windows"; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return "Mac OS X"; #elif defined(OS_CHROMEOS) return "Chromium OS"; diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index 2a9e2a7cc..a5f0b5f83 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -82,10 +82,10 @@ struct SaveCookiesProgress { void SetCanonicalCookieCallback(SaveCookiesProgress* progress, const net::CanonicalCookie& cookie, - net::CookieInclusionStatus status) { + net::CookieAccessResult access_result) { CEF_REQUIRE_UIT(); progress->num_cookie_lines_left_--; - if (status.IsInclude()) { + if (access_result.status.IsInclude()) { progress->allowed_cookies_.push_back(cookie); } @@ -131,8 +131,8 @@ void SaveCookiesOnUIThread(content::BrowserContext* browser_context, SetCanonicalCookieCallback( progress, net::CanonicalCookie(), - net::CookieInclusionStatus( - net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)); + net::CookieAccessResult(net::CookieInclusionStatus( + net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR))); } } // namespace diff --git a/libcef/browser/net_service/cookie_manager_impl.cc b/libcef/browser/net_service/cookie_manager_impl.cc index 033812e81..89dd40f77 100644 --- a/libcef/browser/net_service/cookie_manager_impl.cc +++ b/libcef/browser/net_service/cookie_manager_impl.cc @@ -45,14 +45,16 @@ void RunAsyncCompletionOnUIThread(CefRefPtr callback) { // Always execute the callback asynchronously. void SetCookieCallbackImpl(CefRefPtr callback, - net::CookieInclusionStatus status) { + net::CookieAccessResult access_result) { if (!callback.get()) return; - if (!status.IsInclude()) { - LOG(WARNING) << "SetCookie failed with reason: " << status.GetDebugString(); + const bool is_include = access_result.status.IsInclude(); + if (!is_include) { + LOG(WARNING) << "SetCookie failed with reason: " + << access_result.status.GetDebugString(); } CEF_POST_TASK(CEF_UIT, base::Bind(&CefSetCookieCallback::OnComplete, - callback.get(), status.IsInclude())); + callback.get(), is_include)); } // Always execute the callback asynchronously. @@ -260,8 +262,8 @@ bool CefCookieManagerImpl::SetCookie(const CefString& url, if (!canonical_cookie) { SetCookieCallbackImpl( - callback, net::CookieInclusionStatus( - net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR)); + callback, net::CookieAccessResult(net::CookieInclusionStatus( + net::CookieInclusionStatus::EXCLUDE_UNKNOWN_ERROR))); return true; } diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index bc52039a5..c4e694dbd 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -20,6 +20,7 @@ #include "content/public/browser/web_contents.h" #include "mojo/public/cpp/base/big_buffer.h" #include "net/http/http_status_code.h" +#include "net/url_request/url_request.h" #include "services/network/public/cpp/cors/cors.h" #include "services/network/public/cpp/features.h" diff --git a/libcef/browser/osr/browser_platform_delegate_osr.cc b/libcef/browser/osr/browser_platform_delegate_osr.cc index 0b9ee07d3..b9f6a7906 100644 --- a/libcef/browser/osr/browser_platform_delegate_osr.cc +++ b/libcef/browser/osr/browser_platform_delegate_osr.cc @@ -13,7 +13,7 @@ #include "libcef/browser/osr/web_contents_view_osr.h" #include "libcef/common/drag_data_impl.h" -#include "base/message_loop/message_loop_current.h" +#include "base/task/current_thread.h" #include "content/browser/renderer_host/render_widget_host_input_event_router.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/render_view_host.h" @@ -482,7 +482,7 @@ void CefBrowserPlatformDelegateOsr::StartDragging( CefRefPtr drag_data( new CefDragDataImpl(drop_data, cef_image, cef_image_pos)); drag_data->SetReadOnly(true); - base::MessageLoopCurrent::ScopedNestableTaskAllower allow; + base::CurrentThread::ScopedNestableTaskAllower allow; handled = handler->StartDragging( browser_, drag_data.get(), static_cast(allowed_ops), diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index 8e7d118fd..95221dc2b 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -150,6 +150,12 @@ struct PopulateAxNodeAttributes { attributes->SetString(ToString(attr.first), ToString(state)); } } break; + case ax::mojom::IntAttribute::kTextAlign: { + auto state = static_cast(attr.second); + if (ax::mojom::TextAlign::kNone != state) { + attributes->SetString(ToString(attr.first), ToString(state)); + } + } break; case ax::mojom::IntAttribute::kNameFrom: attributes->SetString( ToString(attr.first), @@ -173,8 +179,8 @@ struct PopulateAxNodeAttributes { } } break; case ax::mojom::IntAttribute::kTextDirection: { - auto state = static_cast(attr.second); - if (ax::mojom::TextDirection::kNone != state) { + auto state = static_cast(attr.second); + if (ax::mojom::WritingDirection::kNone != state) { attributes->SetString(ToString(attr.first), ToString(state)); } } break; diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 596da991b..40c6a7a16 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -55,7 +55,7 @@ #include "ui/gfx/geometry/size_conversions.h" #if defined(USE_X11) -#include "ui/base/x/x11_cursor.h" +#include "ui/base/x/x11_cursor_loader.h" #include "ui/base/x/x11_util.h" #endif @@ -67,8 +67,8 @@ const size_t kMaxDamageRects = 10; const float kDefaultScaleFactor = 1.0; -content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { - content::ScreenInfo screenInfo; +blink::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { + blink::ScreenInfo screenInfo; screenInfo.device_scale_factor = src.device_scale_factor; screenInfo.depth = src.depth; screenInfo.depth_per_component = src.depth_per_component; @@ -101,7 +101,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { // may not match the page's, so use black as the gutter color to avoid // flashes of brighter colors during the transition. if (view_->render_widget_host()->delegate() && - view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) { + view_->render_widget_host()->delegate()->IsFullscreen()) { return SK_ColorBLACK; } return *view_->GetBackgroundColor(); @@ -197,7 +197,8 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle( CefCursorHandle ToCursorHandle(ui::PlatformCursor cursor) { #if defined(USE_X11) // See https://crbug.com/1029142 for background. - return static_cast(cursor)->xcursor(); + return static_cast( + static_cast(cursor)->xcursor()); #else return cursor; #endif @@ -654,7 +655,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor( handler->OnCursorChange(browser_impl_.get(), platform_cursor, cursor_type, custom_cursor_info); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) // |web_cursor| owns the resulting |native_cursor|. content::WebCursor web_cursor(cursor); CefCursorHandle native_cursor = web_cursor.GetNativeCursor(); @@ -741,7 +742,7 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface( } } -void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) { +void CefRenderWidgetHostViewOSR::GetScreenInfo(blink::ScreenInfo* results) { if (!browser_impl_.get()) return; @@ -792,7 +793,7 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() { return GetViewBounds(); } -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) viz::ScopedSurfaceIdAllocator CefRenderWidgetHostViewOSR::DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) { @@ -1443,13 +1444,16 @@ gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() { current_device_scale_factor_); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) void CefRenderWidgetHostViewOSR::SetActive(bool active) {} void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {} void CefRenderWidgetHostViewOSR::SpeakSelection() {} -#endif + +void CefRenderWidgetHostViewOSR::SetWindowFrameInScreen(const gfx::Rect& rect) { +} +#endif // defined(OS_MAC) void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect, const gfx::Size& pixel_size, diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 68d36c28c..a0300bb76 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -36,7 +36,7 @@ #include "ui/events/gesture_detection/motion_event_generic.h" #include "ui/gfx/geometry/rect.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "content/browser/renderer_host/browser_compositor_view_mac.h" #endif @@ -65,8 +65,9 @@ class CefWebContentsViewOSR; #if defined(USE_X11) namespace ui { -class XScopedCursor; -} +class X11Cursor; +class XCursorLoader; +} // namespace ui class CefWindowX11; #endif @@ -88,7 +89,7 @@ class CefWindowX11; // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. /////////////////////////////////////////////////////////////////////////////// -#if defined(OS_MACOSX) +#if defined(OS_MAC) class MacHelper; #endif @@ -129,11 +130,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void UnlockMouse() override; void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override; -#if defined(OS_MACOSX) +#if defined(OS_MAC) void SetActive(bool active) override; void ShowDefinitionForSelection() override; void SpeakSelection() override; -#endif // defined(OS_MACOSX) + void SetWindowFrameInScreen(const gfx::Rect& rect) override; +#endif // defined(OS_MAC) // RenderWidgetHostViewBase implementation. void ResetFallbackToFirstNavigationSurface() override; @@ -152,11 +154,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, const gfx::Rect& src_rect, const gfx::Size& output_size, base::OnceCallback callback) override; - void GetScreenInfo(content::ScreenInfo* results) override; + void GetScreenInfo(blink::ScreenInfo* results) override; void TransformPointToRootSurface(gfx::PointF* point) override; gfx::Rect GetBoundsInRootWindow() override; -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) override; #endif @@ -345,7 +347,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_; #if defined(USE_X11) - std::unique_ptr invisible_cursor_; + std::unique_ptr cursor_loader_; + scoped_refptr invisible_cursor_; #endif std::unique_ptr cursor_manager_; diff --git a/libcef/browser/osr/render_widget_host_view_osr_linux.cc b/libcef/browser/osr/render_widget_host_view_osr_linux.cc index 37e8709cb..b55752e9c 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_linux.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_linux.cc @@ -8,10 +8,11 @@ #if defined(USE_X11) #include #include -#undef Status // Avoid conflicts with url_request_status.h #include "libcef/browser/native/window_x11.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/x/x11_cursor_loader.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/x/x11_types.h" #endif // defined(USE_X11) @@ -176,6 +177,14 @@ XCursorCache* cursor_cache = nullptr; return cursor_cache->GetCursor(cursor_shape); } +// Based on ui/base/x/x11_cursor_factory.cc. +scoped_refptr CreateInvisibleCursor( + ui::XCursorLoader* cursor_loader) { + SkBitmap bitmap; + bitmap.allocN32Pixels(1, 1); + return cursor_loader->CreateCursor(bitmap, gfx::Point(0, 0)); +} + } // namespace #endif // defined(USE_X11) @@ -184,10 +193,11 @@ CefCursorHandle CefRenderWidgetHostViewOSR::GetPlatformCursor( #if defined(USE_X11) if (type == ui::mojom::CursorType::kNone) { if (!invisible_cursor_) { - invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(), - gfx::GetXDisplay())); + cursor_loader_ = + std::make_unique(x11::Connection::Get()); + invisible_cursor_ = CreateInvisibleCursor(cursor_loader_.get()); } - return invisible_cursor_->get(); + return static_cast<::Cursor>(invisible_cursor_->xcursor()); } else { return GetXCursor(ToCursorID(type)); } diff --git a/libcef/browser/osr/synthetic_gesture_target_osr.cc b/libcef/browser/osr/synthetic_gesture_target_osr.cc index 977962f8f..a273fea28 100644 --- a/libcef/browser/osr/synthetic_gesture_target_osr.cc +++ b/libcef/browser/osr/synthetic_gesture_target_osr.cc @@ -5,7 +5,6 @@ #include "libcef/browser/osr/synthetic_gesture_target_osr.h" #include "content/browser/renderer_host/render_widget_host_impl.h" -#include "content/public/common/screen_info.h" #include "ui/events/gesture_detection/gesture_configuration.h" CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR( diff --git a/libcef/browser/osr/web_contents_view_osr.cc b/libcef/browser/osr/web_contents_view_osr.cc index c148b76a0..90bb0e00b 100644 --- a/libcef/browser/osr/web_contents_view_osr.cc +++ b/libcef/browser/osr/web_contents_view_osr.cc @@ -138,11 +138,11 @@ void CefWebContentsViewOSR::RenderViewHostChanged( void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {} -#if defined(OS_MACOSX) +#if defined(OS_MAC) bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() { return false; } -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) void CefWebContentsViewOSR::StartDragging( const content::DropData& drop_data, diff --git a/libcef/browser/osr/web_contents_view_osr.h b/libcef/browser/osr/web_contents_view_osr.h index 8268e6abd..365446d79 100644 --- a/libcef/browser/osr/web_contents_view_osr.h +++ b/libcef/browser/osr/web_contents_view_osr.h @@ -56,7 +56,7 @@ class CefWebContentsViewOSR : public content::WebContentsView, content::RenderViewHost* new_host) override; void SetOverscrollControllerEnabled(bool enabled) override; -#if defined(OS_MACOSX) +#if defined(OS_MAC) bool CloseTabAfterEventTrackingIfNeeded() override; #endif diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 1ea63d756..8af14b802 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -299,10 +299,11 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, PrefsTabHelper::RegisterProfilePrefs(registry, locale); RegisterAnimationPolicyPrefs(registry); - // From chrome::RegisterBrowserUserPrefs. + // From chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs. registry->RegisterBooleanPref( prefs::kEnableDoNotTrack, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false); // TODO(guoweis): Remove next 2 options at M50. registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true); @@ -311,7 +312,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, blink::kWebRTCIPHandlingDefault); registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string()); -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true); #endif diff --git a/libcef/browser/print_settings_impl.cc b/libcef/browser/print_settings_impl.cc index afc1729a6..573c95c96 100644 --- a/libcef/browser/print_settings_impl.cc +++ b/libcef/browser/print_settings_impl.cc @@ -122,7 +122,7 @@ bool CefPrintSettingsImpl::WillCollate() { void CefPrintSettingsImpl::SetColorModel(ColorModel model) { CEF_VALUE_VERIFY_RETURN_VOID(true); - mutable_value()->set_color(static_cast(model)); + mutable_value()->set_color(static_cast(model)); } CefPrintSettings::ColorModel CefPrintSettingsImpl::GetColorModel() { diff --git a/libcef/browser/printing/print_dialog_linux.cc b/libcef/browser/printing/print_dialog_linux.cc index bd0fc967a..c2f3796cd 100644 --- a/libcef/browser/printing/print_dialog_linux.cc +++ b/libcef/browser/printing/print_dialog_linux.cc @@ -224,7 +224,7 @@ void CefPrintDialogLinux::PrintDocument( success = metafile.SaveTo(&file); file.Close(); if (!success) - base::DeleteFile(path_to_pdf_, false); + base::DeleteFile(path_to_pdf_); } if (!success) { diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index a2ad9db0b..05a2094f6 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -60,7 +60,8 @@ void FillInDictionaryFromPdfPrintSettings( // Fixed settings. print_settings.SetIntKey(kSettingPrinterType, static_cast(PrinterType::kPdf)); - print_settings.SetInteger(kSettingColor, GRAY); + print_settings.SetInteger(kSettingColor, + static_cast(mojom::ColorModel::kGray)); print_settings.SetInteger(kSettingDuplexMode, static_cast(mojom::DuplexMode::kSimplex)); print_settings.SetInteger(kSettingCopies, 1); @@ -100,23 +101,23 @@ void FillInDictionaryFromPdfPrintSettings( print_settings.Set(kSettingMediaSize, std::move(dict)); } - int margin_type = DEFAULT_MARGINS; + auto margin_type = printing::mojom::MarginType::kDefaultMargins; switch (pdf_settings.margin_type) { case PDF_PRINT_MARGIN_NONE: - margin_type = NO_MARGINS; + margin_type = printing::mojom::MarginType::kNoMargins; break; case PDF_PRINT_MARGIN_MINIMUM: - margin_type = PRINTABLE_AREA_MARGINS; + margin_type = printing::mojom::MarginType::kPrintableAreaMargins; break; case PDF_PRINT_MARGIN_CUSTOM: - margin_type = CUSTOM_MARGINS; + margin_type = printing::mojom::MarginType::kCustomMargins; break; default: break; } - print_settings.SetInteger(kSettingMarginsType, margin_type); - if (margin_type == CUSTOM_MARGINS) { + print_settings.SetInteger(kSettingMarginsType, static_cast(margin_type)); + if (margin_type == printing::mojom::MarginType::kCustomMargins) { std::unique_ptr dict(new base::DictionaryValue); dict->SetInteger(kSettingMarginTop, pdf_settings.margin_top); dict->SetInteger(kSettingMarginRight, pdf_settings.margin_right); @@ -301,7 +302,7 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf( void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf( content::RenderFrameHost* rfh, - const PrintHostMsg_DidPreviewDocument_Params& params, + const mojom::DidPreviewDocumentParams& params, const PrintHostMsg_PreviewIds& ids) { DCHECK_CURRENTLY_ON(BrowserThread::UI); StopWorker(params.document_cookie); @@ -318,7 +319,7 @@ void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf( print_render_frame_remote->OnPrintPreviewDialogClosed(); auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion( - params.content.metafile_data_region); + params.content->metafile_data_region); if (!shared_buf) { TerminatePdfPrintJob(); return; diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index e341103f9..c3cc8c41b 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -8,6 +8,7 @@ #include "include/internal/cef_types_wrappers.h" #include "base/macros.h" +#include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" @@ -19,7 +20,6 @@ class WebContentsObserver; class CefBrowserInfo; -struct PrintHostMsg_DidPreviewDocument_Params; struct PrintHostMsg_PreviewIds; struct PrintHostMsg_RequestPrintPreview_Params; @@ -85,7 +85,7 @@ class CefPrintViewManager void OnDidShowPrintDialog_PrintToPdf(content::RenderFrameHost* rfh); void OnMetafileReadyForPrinting_PrintToPdf( content::RenderFrameHost* rfh, - const PrintHostMsg_DidPreviewDocument_Params& params, + const mojom::DidPreviewDocumentParams& params, const PrintHostMsg_PreviewIds& ids); void InitializePrintPreview(int frame_tree_node_id); void TerminatePdfPrintJob(); diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 3255b75b5..7be7b9b98 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -25,6 +25,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/child_process_host.h" +#include "printing/mojom/print.mojom.h" #if defined(OS_LINUX) #include "libcef/browser/printing/print_dialog_linux.h" @@ -139,8 +140,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings( // will hang until the settings are retrieved. auto* printer_query_ptr = printer_query.get(); printer_query_ptr->GetSettings( - PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, DEFAULT_MARGINS, - false, false, + PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, + printing::mojom::MarginType::kDefaultMargins, false, false, base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply, this, std::move(printer_query), reply_msg)); } @@ -148,11 +149,8 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings( void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply( std::unique_ptr printer_query, IPC::Message* reply_msg) { - PrintMsg_Print_Params params; - if (!printer_query.get() || - printer_query->last_status() != PrintingContext::OK) { - params.Reset(); - } else { + mojom::PrintParams params; + if (printer_query && printer_query->last_status() == PrintingContext::OK) { RenderParamsFromPrintSettings(printer_query->settings(), ¶ms); params.document_cookie = printer_query->cookie(); } diff --git a/libcef/browser/views/button_impl.h b/libcef/browser/views/button_impl.h index 76456a287..4f4b89f41 100644 --- a/libcef/browser/views/button_impl.h +++ b/libcef/browser/views/button_impl.h @@ -49,7 +49,7 @@ CEF_BUTTON_IMPL_T class CefButtonImpl : public CEF_VIEW_IMPL_D { CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { CEF_REQUIRE_VALID_RETURN_VOID(); - views::Button::ButtonState old_state = ParentClass::root_view()->state(); + views::Button::ButtonState old_state = ParentClass::root_view()->GetState(); views::Button::ButtonState new_state = static_cast(state); @@ -72,7 +72,7 @@ CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetState(cef_button_state_t state) { CEF_BUTTON_IMPL_T cef_button_state_t CEF_BUTTON_IMPL_D::GetState() { CEF_REQUIRE_VALID_RETURN(CEF_BUTTON_STATE_NORMAL); - return static_cast(ParentClass::root_view()->state()); + return static_cast(ParentClass::root_view()->GetState()); } CEF_BUTTON_IMPL_T void CEF_BUTTON_IMPL_D::SetInkDropEnabled(bool enabled) { diff --git a/libcef/browser/views/button_view.h b/libcef/browser/views/button_view.h index 6a112c608..869e379ea 100644 --- a/libcef/browser/views/button_view.h +++ b/libcef/browser/views/button_view.h @@ -61,7 +61,7 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed( ParentClass::cef_delegate()->OnButtonPressed(GetCefButton()); if (ParentClass::ink_drop_mode() != views::Button::InkDropMode::OFF && !ParentClass::IsFocusable() && - ParentClass::state() != views::Button::STATE_PRESSED) { + ParentClass::GetState() != views::Button::STATE_PRESSED) { // Ink drop state does not get reset properly on click when the button is // non-focusable. Reset the ink drop state here if the state has not been // explicitly set to pressed by the OnButtonPressed callback calling diff --git a/libcef/browser/views/menu_button_view.h b/libcef/browser/views/menu_button_view.h index bd66e7e5d..ca488ece3 100644 --- a/libcef/browser/views/menu_button_view.h +++ b/libcef/browser/views/menu_button_view.h @@ -18,7 +18,7 @@ // CefButtonView template. class MenuButtonEx : public views::MenuButton, public views::ButtonListener { public: - MenuButtonEx() : views::MenuButton(base::string16(), this) { + MenuButtonEx() : views::MenuButton(this, base::string16()) { // TODO(cef): MenuButton should not use ButtonListener. See // http://crbug.com/585252 for details. Button::listener_ = this; diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index de8cc3a57..dfcee7d90 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -36,7 +36,11 @@ class ClientViewEx : public views::ClientView { DCHECK(window_delegate_); } - bool CanClose() override { return window_delegate_->CanWidgetClose(); } + views::CloseRequestResult OnWindowCloseRequested() override { + return window_delegate_->CanWidgetClose() + ? views::CloseRequestResult::kCanClose + : views::CloseRequestResult::kCannotClose; + } private: CefWindowView::Delegate* window_delegate_; // Not owned by this object. @@ -404,15 +408,15 @@ views::ClientView* CefWindowView::CreateClientView(views::Widget* widget) { return new ClientViewEx(widget, GetContentsView(), window_delegate_); } -views::NonClientFrameView* CefWindowView::CreateNonClientFrameView( - views::Widget* widget) { +std::unique_ptr +CefWindowView::CreateNonClientFrameView(views::Widget* widget) { if (is_frameless_) { // Custom frame type that doesn't render a caption. - return new CaptionlessFrameView(widget, this); + return std::make_unique(widget, this); } else if (widget->ShouldUseNativeFrame()) { // DesktopNativeWidgetAura::CreateNonClientFrameView() returns // NativeFrameView by default. Extend that type. - return new NativeFrameViewEx(widget, this); + return std::make_unique(widget, this); } // Use Chromium provided CustomFrameView. In case if we would like to diff --git a/libcef/browser/views/window_view.h b/libcef/browser/views/window_view.h index 50093e1d4..c95f3ec82 100644 --- a/libcef/browser/views/window_view.h +++ b/libcef/browser/views/window_view.h @@ -63,7 +63,7 @@ class CefWindowView void WindowClosing() override; views::View* GetContentsView() override; views::ClientView* CreateClientView(views::Widget* widget) override; - views::NonClientFrameView* CreateNonClientFrameView( + std::unique_ptr CreateNonClientFrameView( views::Widget* widget) override; bool ShouldDescendIntoChildForEventHandling( gfx::NativeView child, diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index 23e573927..6e41edc47 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -39,14 +39,14 @@ #include "ipc/ipc_buildflags.h" #include "net/base/features.h" #include "pdf/pdf_ppapi.h" +#include "sandbox/policy/switches.h" #include "services/network/public/cpp/features.h" -#include "services/service_manager/sandbox/switches.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_features.h" #include "ui/base/ui_base_paths.h" #include "ui/base/ui_base_switches.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "libcef/common/util_mac.h" #endif @@ -127,7 +127,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { } } -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (settings_->framework_dir_path.length > 0) { base::FilePath file_path = base::FilePath(CefString(&settings_->framework_dir_path)); @@ -144,7 +144,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { #endif if (no_sandbox) - command_line->AppendSwitch(service_manager::switches::kNoSandbox); + command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox); if (settings_->user_agent.length > 0) { command_line->AppendSwitchASCII(switches::kUserAgent, @@ -355,7 +355,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { content::SetContentClient(&content_client_); -#if defined(OS_MACOSX) +#if defined(OS_MAC) util_mac::BasicStartupComplete(); #endif @@ -370,7 +370,7 @@ void AlloyMainDelegate::PreSandboxStartup() { if (process_type.empty()) { // Only override these paths when executing the main process. -#if defined(OS_MACOSX) +#if defined(OS_MAC) util_mac::PreSandboxStartup(); #endif diff --git a/libcef/common/app_manager.cc b/libcef/common/app_manager.cc index bca198a87..9be649ec0 100644 --- a/libcef/common/app_manager.cc +++ b/libcef/common/app_manager.cc @@ -12,7 +12,6 @@ #include "base/logging.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/common/content_switches.h" -#include "third_party/blink/public/platform/platform.h" #if defined(OS_WIN) #include @@ -108,11 +107,3 @@ const wchar_t* CefAppManager::GetResourceDllName() { return file_path; } #endif // defined(OS_WIN) - -blink::WebURLLoaderFactory* CefAppManager::GetDefaultURLLoaderFactory() { - if (!default_url_loader_factory_) { - default_url_loader_factory_ = - blink::Platform::Current()->CreateDefaultURLLoaderFactory(); - } - return default_url_loader_factory_.get(); -} diff --git a/libcef/common/app_manager.h b/libcef/common/app_manager.h index cf005b65f..ffa8aaa13 100644 --- a/libcef/common/app_manager.h +++ b/libcef/common/app_manager.h @@ -15,10 +15,6 @@ #include "build/build_config.h" #include "content/public/common/content_client.h" -namespace blink { -class WebURLLoaderFactory; -} - class CefBrowserContext; struct CefSchemeInfo; @@ -58,12 +54,6 @@ class CefAppManager { const wchar_t* GetResourceDllName(); #endif - // The following methods are only available in the render process. - - // Returns a factory that only supports unintercepted http(s) and blob - // requests. Used by CefRenderURLRequest. - blink::WebURLLoaderFactory* GetDefaultURLLoaderFactory(); - protected: CefAppManager(); virtual ~CefAppManager(); @@ -73,8 +63,6 @@ class CefAppManager { SchemeInfoList scheme_info_list_; bool scheme_info_list_locked_ = false; - std::unique_ptr default_url_loader_factory_; - DISALLOW_COPY_AND_ASSIGN(CefAppManager); }; diff --git a/libcef/common/cef_switches.cc b/libcef/common/cef_switches.cc index 7fb37b030..76849a01b 100644 --- a/libcef/common/cef_switches.cc +++ b/libcef/common/cef_switches.cc @@ -125,7 +125,7 @@ const char kDevToolsProtocolLogFile[] = "devtools-protocol-log-file"; // Enable use of the Chrome runtime in CEF. See issue #2969 for details. const char kEnableChromeRuntime[] = "enable-chrome-runtime"; -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Path to the framework directory. const char kFrameworkDirPath[] = "framework-dir-path"; const char kMainBundlePath[] = "main-bundle-path"; diff --git a/libcef/common/cef_switches.h b/libcef/common/cef_switches.h index 27f0d81d2..ebc5a1feb 100644 --- a/libcef/common/cef_switches.h +++ b/libcef/common/cef_switches.h @@ -56,7 +56,7 @@ extern const char kDisableNewBrowserInfoTimeout[]; extern const char kDevToolsProtocolLogFile[]; extern const char kEnableChromeRuntime[]; -#if defined(OS_MACOSX) +#if defined(OS_MAC) extern const char kFrameworkDirPath[]; extern const char kMainBundlePath[]; #endif diff --git a/libcef/common/chrome/chrome_main_delegate_cef.cc b/libcef/common/chrome/chrome_main_delegate_cef.cc index a80c0bac9..6682bc021 100644 --- a/libcef/common/chrome/chrome_main_delegate_cef.cc +++ b/libcef/common/chrome/chrome_main_delegate_cef.cc @@ -10,9 +10,10 @@ #include "libcef/common/crash_reporting.h" #include "libcef/common/resource_util.h" +#include "base/command_line.h" #include "content/public/common/content_switches.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "libcef/common/util_mac.h" #endif @@ -42,7 +43,7 @@ bool ChromeMainDelegateCef::BasicStartupComplete(int* exit_code) { base::CommandLine::ForCurrentProcess()); #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) util_mac::BasicStartupComplete(); #endif } @@ -56,11 +57,11 @@ void ChromeMainDelegateCef::PreSandboxStartup() { const std::string& process_type = command_line->GetSwitchValueASCII(switches::kProcessType); -#if defined(OS_MACOSX) +#if defined(OS_MAC) if (process_type.empty()) { util_mac::PreSandboxStartup(); } -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) // Since this may be configured via CefSettings we override the value on // all platforms. We can't use the default implementation on macOS because diff --git a/libcef/common/command_line_impl.cc b/libcef/common/command_line_impl.cc index d44dbda5e..0b5cc48b2 100644 --- a/libcef/common/command_line_impl.cc +++ b/libcef/common/command_line_impl.cc @@ -114,7 +114,11 @@ void CefCommandLineImpl::AppendSwitch(const CefString& name) { void CefCommandLineImpl::AppendSwitchWithValue(const CefString& name, const CefString& value) { CEF_VALUE_VERIFY_RETURN_VOID(true); - mutable_value()->AppendSwitchNative(name, value); +#if defined(OS_WIN) + mutable_value()->AppendSwitchNative(name, value.ToWString()); +#else + mutable_value()->AppendSwitchNative(name, value.ToString()); +#endif } bool CefCommandLineImpl::HasArguments() { diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 55310772f..4f80f9264 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -23,7 +23,7 @@ #include "services/service_manager/embedder/switches.h" #include "third_party/crashpad/crashpad/client/annotation.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "libcef/common/util_mac.h" #endif @@ -39,7 +39,7 @@ #include "chrome/common/chrome_paths.h" #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) #include "content/public/common/content_switches.h" #include "libcef/common/cef_crash_report_utils.h" #endif @@ -79,7 +79,7 @@ PathString GetCrashConfigPath() { #elif defined(OS_POSIX) base::FilePath config_path; -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Start with the path to the main app Resources directory. May be empty if // not running in an app bundle. config_path = util_mac::GetMainResourcesDirectory(); @@ -439,7 +439,7 @@ bool CefCrashReporterClient::ReadCrashConfigFile() { app_name_ = val_str; } } -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) else if (name_str == "BrowserCrashForwardingEnabled") { enable_browser_crash_forwarding_ = ParseBool(val_str); } @@ -617,7 +617,7 @@ void CefCrashReporterClient::GetProductNameAndVersion(std::string* product_name, *version = product_version_; } -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) base::FilePath CefCrashReporterClient::GetReporterLogFilename() { return base::FilePath(FILE_PATH_LITERAL("uploads.log")); @@ -631,7 +631,7 @@ bool CefCrashReporterClient::EnableBreakpadForProcess( process_type == switches::kGpuProcess; } -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) bool CefCrashReporterClient::GetCrashDumpLocation(base::FilePath* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate @@ -656,7 +656,7 @@ bool CefCrashReporterClient::GetCollectStatsInSample() { return true; } -#if defined(OS_WIN) || defined(OS_MACOSX) +#if defined(OS_WIN) || defined(OS_MAC) bool CefCrashReporterClient::ReportingIsEnforcedByPolicy( bool* crashpad_enabled) { *crashpad_enabled = true; @@ -664,7 +664,7 @@ bool CefCrashReporterClient::ReportingIsEnforcedByPolicy( } #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) bool CefCrashReporterClient::IsRunningUnattended() { // Crash upload will only be enabled with Breakpad on Linux if this method // returns false. @@ -717,13 +717,13 @@ bool CefCrashReporterClient::HasCrashExternalHandler() const { #endif // defined(OS_WIN) -#if defined(OS_MACOSX) +#if defined(OS_MAC) bool CefCrashReporterClient::EnableBrowserCrashForwarding() { return enable_browser_crash_forwarding_; } #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) CefCrashReporterClient::ParameterMap CefCrashReporterClient::FilterParameters( const ParameterMap& parameters) { return crash_report_utils::FilterParameters(parameters); diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 673088df2..27141f910 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -57,7 +57,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { void GetProductNameAndVersion(std::string* product_name, std::string* version, std::string* channel) override; -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) base::FilePath GetReporterLogFilename() override; bool EnableBreakpadForProcess(const std::string& process_type) override; #endif @@ -67,11 +67,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { // All of these methods must return true to enable crash report upload. bool GetCollectStatsConsent() override; bool GetCollectStatsInSample() override; -#if defined(OS_WIN) || defined(OS_MACOSX) +#if defined(OS_WIN) || defined(OS_MAC) bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override; #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) bool IsRunningUnattended() override; #endif @@ -84,11 +84,11 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { bool HasCrashExternalHandler() const; #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) bool EnableBrowserCrashForwarding() override; #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) ParameterMap FilterParameters(const ParameterMap& parameters) override; #endif @@ -123,7 +123,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { std::string external_handler_; #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) bool enable_browser_crash_forwarding_ = false; #endif diff --git a/libcef/common/crash_reporting.cc b/libcef/common/crash_reporting.cc index 5661e4466..d5b7c7b39 100644 --- a/libcef/common/crash_reporting.cc +++ b/libcef/common/crash_reporting.cc @@ -21,7 +21,7 @@ #include "content/public/common/content_switches.h" #include "services/service_manager/embedder/switches.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "base/mac/foundation_util.h" #include "components/crash/core/app/crashpad.h" #include "components/crash/core/common/crash_keys.h" @@ -33,7 +33,7 @@ #include "libcef/common/crash_reporter_client.h" #endif -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MAC) #include "components/crash/core/app/breakpad_linux.h" #include "v8/include/v8-wasm-trap-handler-posix.h" #endif @@ -101,7 +101,7 @@ void InitCrashReporter(const base::CommandLine& command_line, crash_reporter::SetCrashReporterClient(crash_client); -#if defined(OS_MACOSX) +#if defined(OS_MAC) // TODO(mark): Right now, InitializeCrashpad() needs to be called after // CommandLine::Init() and configuration of chrome::DIR_CRASH_DUMPS. Ideally, // Crashpad initialization could occur sooner, preferably even before the @@ -131,7 +131,7 @@ void InitCrashReporter(const base::CommandLine& command_line, } g_crash_reporting_enabled = true; -#else // !defined(OS_MACOSX) +#else // !defined(OS_MAC) if (process_type != service_manager::switches::kZygoteProcess) { // Crash reporting for subprocesses created using the zygote will be @@ -140,7 +140,7 @@ void InitCrashReporter(const base::CommandLine& command_line, g_crash_reporting_enabled = true; } -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) } #endif // defined(OS_POSIX) @@ -196,7 +196,7 @@ bool SetCrashKeyValue(const base::StringPiece& key, void BasicStartupComplete(base::CommandLine* command_line) { CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer(); if (crash_client->ReadCrashConfigFile()) { -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) // Breakpad requires this switch. command_line->AppendSwitch(switches::kEnableCrashReporter); @@ -228,7 +228,7 @@ void PreSandboxStartup(const base::CommandLine& command_line, crash_keys::SetSwitchesFromCommandLine(command_line, &IsBoringCEFSwitch); } -#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC) void ZygoteForked(base::CommandLine* command_line, const std::string& process_type) { CefCrashReporterClient* crash_client = g_crash_reporter_client.Pointer(); diff --git a/libcef/common/crash_reporting.h b/libcef/common/crash_reporting.h index 6690fe221..2974f3dc7 100644 --- a/libcef/common/crash_reporting.h +++ b/libcef/common/crash_reporting.h @@ -29,7 +29,7 @@ void BasicStartupComplete(base::CommandLine* command_line); void PreSandboxStartup(const base::CommandLine& command_line, const std::string& process_type); -#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MAC) void ZygoteForked(base::CommandLine* command_line, const std::string& process_type); #endif diff --git a/libcef/common/extensions/extensions_client.cc b/libcef/common/extensions/extensions_client.cc index b62c0d5a9..f002bbbe2 100644 --- a/libcef/common/extensions/extensions_client.cc +++ b/libcef/common/extensions/extensions_client.cc @@ -58,15 +58,15 @@ void CefExtensionsClient::FilterHostPermissions( NOTIMPLEMENTED(); } -void CefExtensionsClient::SetScriptingWhitelist( - const ScriptingWhitelist& whitelist) { - scripting_whitelist_ = whitelist; +void CefExtensionsClient::SetScriptingAllowlist( + const ScriptingAllowlist& allowlist) { + scripting_allowlist_ = allowlist; } -const ExtensionsClient::ScriptingWhitelist& -CefExtensionsClient::GetScriptingWhitelist() const { - // TODO(jamescook): Real whitelist. - return scripting_whitelist_; +const ExtensionsClient::ScriptingAllowlist& +CefExtensionsClient::GetScriptingAllowlist() const { + // TODO(jamescook): Real allowlist. + return scripting_allowlist_; } URLPatternSet CefExtensionsClient::GetPermittedChromeSchemeHosts( diff --git a/libcef/common/extensions/extensions_client.h b/libcef/common/extensions/extensions_client.h index a1fd43876..5ab0b190c 100644 --- a/libcef/common/extensions/extensions_client.h +++ b/libcef/common/extensions/extensions_client.h @@ -29,8 +29,8 @@ class CefExtensionsClient : public ExtensionsClient { void FilterHostPermissions(const URLPatternSet& hosts, URLPatternSet* new_hosts, PermissionIDSet* permissions) const override; - void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override; - const ScriptingWhitelist& GetScriptingWhitelist() const override; + void SetScriptingAllowlist(const ScriptingAllowlist& allowlist) override; + const ScriptingAllowlist& GetScriptingAllowlist() const override; URLPatternSet GetPermittedChromeSchemeHosts( const Extension* extension, const APIPermissionSet& api_permissions) const override; @@ -42,7 +42,7 @@ class CefExtensionsClient : public ExtensionsClient { private: const ChromePermissionMessageProvider permission_message_provider_; - ScriptingWhitelist scripting_whitelist_; + ScriptingAllowlist scripting_allowlist_; // Mutable to allow caching in a const method. const GURL webstore_base_url_; diff --git a/libcef/common/extensions/extensions_util.cc b/libcef/common/extensions/extensions_util.cc index 74f0ad8f0..4780f5bbf 100644 --- a/libcef/common/extensions/extensions_util.cc +++ b/libcef/common/extensions/extensions_util.cc @@ -25,7 +25,7 @@ bool PdfExtensionEnabled() { } bool PrintPreviewEnabled() { -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Not currently supported on macOS. return false; #else diff --git a/libcef/common/file_util_impl.cc b/libcef/common/file_util_impl.cc index 3f97c751a..ee9984ac3 100644 --- a/libcef/common/file_util_impl.cc +++ b/libcef/common/file_util_impl.cc @@ -74,7 +74,11 @@ bool CefDirectoryExists(const CefString& path) { bool CefDeleteFile(const CefString& path, bool recursive) { if (!AllowFileIO()) return false; - return base::DeleteFile(path, recursive); + if (recursive) { + return base::DeletePathRecursively(path); + } else { + return base::DeleteFile(path); + } } bool CefZipDirectory(const CefString& src_dir, diff --git a/libcef/common/net_service/net_service_util.cc b/libcef/common/net_service/net_service_util.cc index 384dc8d12..89ba58a91 100644 --- a/libcef/common/net_service/net_service_util.cc +++ b/libcef/common/net_service/net_service_util.cc @@ -19,6 +19,7 @@ #include "net/http/http_status_code.h" #include "net/url_request/redirect_info.h" #include "net/url_request/redirect_util.h" +#include "net/url_request/referrer_policy.h" #include "net/url_request/url_request.h" #include "services/network/public/cpp/resource_request.h" @@ -180,10 +181,10 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request, } } - net::URLRequest::FirstPartyURLPolicy first_party_url_policy = + auto first_party_url_policy = request.update_first_party_url_on_redirect - ? net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT - : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; + ? net::RedirectInfo::FirstPartyURLPolicy::UPDATE_URL_ON_REDIRECT + : net::RedirectInfo::FirstPartyURLPolicy::NEVER_CHANGE_URL; return net::RedirectInfo::ComputeRedirectInfo( request.method, request.url, request.site_for_cookies, first_party_url_policy, request.referrer_policy, request.referrer.spec(), diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 05f7c5417..bca6b2a62 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -32,6 +32,7 @@ #include "net/http/http_request_headers.h" #include "net/http/http_util.h" #include "net/url_request/redirect_info.h" +#include "net/url_request/referrer_policy.h" #include "services/network/public/cpp/data_element.h" #include "services/network/public/cpp/network_switches.h" #include "services/network/public/cpp/resource_request.h" @@ -241,7 +242,7 @@ CefRefPtr CefRequest::Create() { CefRequestImpl::CefRequestImpl() { // Verify that our enum matches Chromium's values. static_assert(static_cast(REFERRER_POLICY_LAST_VALUE) == - static_cast(net::URLRequest::MAX_REFERRER_POLICY), + static_cast(net::ReferrerPolicy::MAX), "enum mismatch"); base::AutoLock lock_scope(lock_); @@ -498,7 +499,7 @@ void CefRequestImpl::Get(network::ResourceRequest* request, if (ShouldSet(kChangedReferrer, changed_only)) { request->referrer = referrer_url_; request->referrer_policy = - static_cast(referrer_policy_); + static_cast(referrer_policy_); } if (ShouldSet(kChangedHeaderMap, changed_only)) { diff --git a/libcef/common/resource_util.cc b/libcef/common/resource_util.cc index 7d0fe5822..22fa2f026 100644 --- a/libcef/common/resource_util.cc +++ b/libcef/common/resource_util.cc @@ -19,7 +19,7 @@ #include "chrome/common/chrome_switches.h" #include "ui/base/layout.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "base/mac/foundation_util.h" #include "libcef/common/util_mac.h" #endif @@ -55,7 +55,7 @@ bool GetSystemFlashFilename(base::FilePath* out_path) { return true; } -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) const base::FilePath::CharType kPepperFlashSystemBaseDirectory[] = FILE_PATH_LITERAL("Internet Plug-Ins/PepperFlashPlayer"); @@ -78,7 +78,7 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) { return true; } -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) // Based on chrome/common/chrome_paths_mac.mm. bool GetDefaultUserDataDirectory(base::FilePath* result) { @@ -168,7 +168,7 @@ bool GetDefaultDownloadSafeDirectory(base::FilePath* result) { } // namespace -#if defined(OS_MACOSX) +#if defined(OS_MAC) base::FilePath GetResourcesDir() { return util_mac::GetFrameworkResourcesDirectory(); @@ -183,7 +183,7 @@ base::FilePath GetDefaultLogFilePath() { .Append(FILE_PATH_LITERAL(exe_name + "_debug.log")); } -#else // !defined(OS_MACOSX) +#else // !defined(OS_MAC) base::FilePath GetResourcesDir() { base::FilePath pak_dir; @@ -198,26 +198,26 @@ base::FilePath GetDefaultLogFilePath() { return log_path.Append(FILE_PATH_LITERAL("debug.log")); } -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MAC) void OverridePepperFlashSystemPluginPath() { -#if defined(OS_WIN) || defined(OS_MACOSX) +#if defined(OS_WIN) || defined(OS_MAC) base::FilePath plugin_filename; #if defined(OS_WIN) if (!GetSystemFlashFilename(&plugin_filename)) return; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) if (!util_mac::GetLocalLibraryDirectory(&plugin_filename)) return; plugin_filename = plugin_filename.Append(kPepperFlashSystemBaseDirectory) .Append(chrome::kPepperFlashPluginFilename); -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) if (!plugin_filename.empty()) { base::PathService::Override(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, plugin_filename); } -#else // !(defined(OS_WIN) || defined(OS_MACOSX)) +#else // !(defined(OS_WIN) || defined(OS_MAC)) // A system plugin is not available on other platforms. return; #endif diff --git a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc b/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc deleted file mode 100644 index c254c763b..000000000 --- a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "libcef/common/service_manifests/cef_content_browser_overlay_manifest.h" - -#include "base/command_line.h" -#include "base/no_destructor.h" -#include "build/build_config.h" -#include "components/metrics/public/mojom/call_stack_profile_collector.mojom.h" -#include "extensions/buildflags/buildflags.h" -#include "services/service_manager/public/cpp/manifest_builder.h" - -#if defined(OS_WIN) -#include "chrome/common/conflicts/module_event_sink_win.mojom.h" -#endif - -const service_manager::Manifest& GetCefContentBrowserOverlayManifest() { - static base::NoDestructor manifest { - service_manager::ManifestBuilder() - .ExposeCapability("gpu", - service_manager::Manifest::InterfaceList< - metrics::mojom::CallStackProfileCollector>()) - .ExposeCapability("renderer", - service_manager::Manifest::InterfaceList< -#if defined(OS_WIN) - mojom::ModuleEventSink, -#endif - metrics::mojom::CallStackProfileCollector>()) - .RequireCapability("chrome_printing", "converter") - .Build() - }; - return *manifest; -} diff --git a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.h b/libcef/common/service_manifests/cef_content_browser_overlay_manifest.h deleted file mode 100644 index 844a5e84c..000000000 --- a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_ -#define CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_ - -#include "services/service_manager/public/cpp/manifest.h" - -// Returns the Manifest CEF amends to Content's content_browser service -// manifest. This allows CEF to extend the capabilities exposed and/or -// required by content_browser service instances, as well as declaring any -// additional in- and out-of-process per-profile packaged services. -const service_manager::Manifest& GetCefContentBrowserOverlayManifest(); - -#endif // CEF_LIBCEF_COMMON_SERVICE_MANIFESTS_CEF_CONTENT_BROWSER_OVERLAY_MANIFEST_H_ diff --git a/libcef/common/urlrequest_impl.cc b/libcef/common/urlrequest_impl.cc index 039a80dec..655f3bdba 100644 --- a/libcef/common/urlrequest_impl.cc +++ b/libcef/common/urlrequest_impl.cc @@ -7,7 +7,6 @@ #include "libcef/common/app_manager.h" #include "libcef/common/task_runner_impl.h" #include "libcef/features/runtime_checks.h" -#include "libcef/renderer/render_urlrequest_impl.h" #include "base/logging.h" #include "base/notreached.h" @@ -39,13 +38,6 @@ CefRefPtr CefURLRequest::Create( if (impl->Start()) return impl.get(); return nullptr; - } else if (content_client->renderer()) { - // In the render process. - CefRefPtr impl = - new CefRenderURLRequest(nullptr, request, client); - if (impl->Start()) - return impl.get(); - return nullptr; } else { NOTREACHED() << "called in unsupported process"; return nullptr; diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index bad70b4a6..913d55e10 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -25,8 +25,8 @@ #include "content/public/common/content_switches.h" #include "media/cdm/cdm_host_file.h" #include "media/cdm/supported_cdm_versions.h" +#include "sandbox/policy/switches.h" #include "services/service_manager/embedder/switches.h" -#include "services/service_manager/sandbox/switches.h" #include "third_party/widevine/cdm/widevine_cdm_common.h" // nogncheck namespace { @@ -38,7 +38,7 @@ base::LazyInstance::Leaky g_widevine_loader = // Name of the Widevine CDM OS in the component manifest. const char kWidevineCdmOs[] = -#if defined(OS_MACOSX) +#if defined(OS_MAC) "mac"; #elif defined(OS_WIN) "win"; @@ -473,7 +473,7 @@ void CefWidevineLoader::AddContentDecryptionModules( // load all plugins before initializing the sandbox. if (command_line.GetSwitchValueASCII(switches::kProcessType) != service_manager::switches::kZygoteProcess || - command_line.HasSwitch(service_manager::switches::kNoSandbox)) { + command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) { return; } diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index 4711c31d4..9a6b0b3c1 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -109,7 +109,7 @@ #include "third_party/blink/public/web/web_view.h" #include "ui/base/l10n/l10n_util.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "base/mac/mac_util.h" #include "base/strings/sys_string_conversions.h" #endif @@ -359,7 +359,7 @@ void AlloyContentRendererClient::RunSingleProcessCleanup() { } void AlloyContentRendererClient::PostIOThreadCreated( - base::SingleThreadTaskRunner*) { + base::SingleThreadTaskRunner*) { // TODO(cef): Enable these once the implementation supports it. blink::WebRuntimeFeatures::EnableNotifications(false); blink::WebRuntimeFeatures::EnablePushMessaging(false); @@ -390,10 +390,10 @@ void AlloyContentRendererClient::RenderThreadStarted() { if (content::RenderProcessHost::run_renderer_in_process()) { // When running in single-process mode register as a destruction observer // on the render thread's MessageLoop. - base::MessageLoopCurrent::Get()->AddDestructionObserver(this); + base::CurrentThread::Get()->AddDestructionObserver(this); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) { base::ScopedCFTypeRef key( base::SysUTF8ToCFStringRef("NSScrollViewRubberbanding")); @@ -408,7 +408,7 @@ void AlloyContentRendererClient::RenderThreadStarted() { CFPreferencesSetAppValue(key, value, kCFPreferencesCurrentApplication); CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); } -#endif // defined(OS_MACOSX) +#endif // defined(OS_MAC) if (extensions::PdfExtensionEnabled()) { pdf_print_client_.reset(new ChromePDFPrintClient()); @@ -749,7 +749,7 @@ CefRefPtr AlloyContentRendererClient::MaybeCreateBrowser( return nullptr; } -#if defined(OS_MACOSX) +#if defined(OS_MAC) // FIXME: It would be better if this API would be a callback from the // WebKit layer, or if it would be exposed as an WebView instance method; the // current implementation uses a static variable, and WebKit needs to be diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.h b/libcef/renderer/alloy/alloy_content_renderer_client.h index 248450d60..28a2f6150 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.h +++ b/libcef/renderer/alloy/alloy_content_renderer_client.h @@ -16,9 +16,9 @@ #include "libcef/renderer/browser_impl.h" #include "base/compiler_specific.h" -#include "base/message_loop/message_loop_current.h" #include "base/optional.h" #include "base/sequenced_task_runner.h" +#include "base/task/current_thread.h" #include "chrome/common/plugin.mojom.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/render_thread.h" @@ -52,7 +52,7 @@ class SpellCheck; class AlloyContentRendererClient : public content::ContentRendererClient, public service_manager::LocalInterfaceProvider, - public base::MessageLoopCurrent::DestructionObserver { + public base::CurrentThread::DestructionObserver { public: AlloyContentRendererClient(); ~AlloyContentRendererClient() override; diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index d82b7ebff..6d777eb64 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -13,11 +13,8 @@ #include "third_party/blink/public/web/web_node.h" #include "third_party/blink/public/web/web_view_client.h" -#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h" -#include "third_party/blink/renderer/bindings/core/v8/script_controller.h" #include "third_party/blink/renderer/bindings/core/v8/script_source_code.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" -#include "third_party/blink/renderer/bindings/core/v8/v8_code_cache.h" #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/dom/element.h" #include "third_party/blink/renderer/core/dom/node.h" @@ -31,6 +28,7 @@ #include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h" #include "third_party/blink/renderer/platform/bindings/v8_binding.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" +#include "third_party/blink/renderer/platform/loader/fetch/script_fetch_options.h" #include "third_party/blink/renderer/platform/weborigin/scheme_registry.h" #undef LOG @@ -179,13 +177,6 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( if (start_line < 1) start_line = 1; - const blink::ScriptSourceCode ssc = blink::ScriptSourceCode( - source, blink::ScriptSourceLocationType::kInternal, - nullptr, /* cache_handler */ - blink::KURL(source_url), - WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), - WTF::OrdinalNumber::FromZeroBasedInt(0))); - v8::MaybeLocal result; blink::LocalFrame* frame = blink::ToLocalFrameIfNotDetached(context); @@ -193,35 +184,25 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( return result; blink::V8CacheOptions v8CacheOptions(blink::kV8CacheOptionsDefault); - if (frame && frame->GetSettings()) - v8CacheOptions = frame->GetSettings()->GetV8CacheOptions(); + if (const blink::Settings* settings = frame->GetSettings()) + v8CacheOptions = settings->GetV8CacheOptions(); - // Based on V8ScriptRunner::CompileAndRunInternalScript: - v8::ScriptCompiler::CompileOptions compile_options; - blink::V8CodeCache::ProduceCacheOptions produce_cache_options; - v8::ScriptCompiler::NoCacheReason no_cache_reason; - std::tie(compile_options, produce_cache_options, no_cache_reason) = - blink::V8CodeCache::GetCompileOptions(v8CacheOptions, ssc); + const blink::ScriptSourceCode ssc = blink::ScriptSourceCode( + source, blink::ScriptSourceLocationType::kInternal, + nullptr, /* cache_handler */ + blink::KURL(source_url), + WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), + WTF::OrdinalNumber::FromZeroBasedInt(0))); - // Currently internal scripts don't have cache handlers, so we should not - // produce cache for them. - DCHECK_EQ(produce_cache_options, - blink::V8CodeCache::ProduceCacheOptions::kNoProduceCache); - - v8::Local script; - // Use default ReferrerScriptInfo here: - // - nonce: empty for internal script, and - // - parser_state: always "not parser inserted" for internal scripts. - if (!blink::V8ScriptRunner::CompileScript( - blink::ScriptState::From(context), ssc, sanitizeScriptErrors, - compile_options, no_cache_reason, blink::ReferrerScriptInfo()) - .ToLocal(&script)) { + result = blink::V8ScriptRunner::CompileAndRunScript( + isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc, + ssc.Url(), sanitizeScriptErrors, blink::ScriptFetchOptions(), + v8CacheOptions); + if (result.IsEmpty()) { DCHECK(tryCatch.HasCaught()); - return result; } - return blink::V8ScriptRunner::RunCompiledScript( - isolate, script, blink::ToExecutionContext(context)); + return result; } bool IsScriptForbidden() { diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index 0b8435f05..80e30f820 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -76,7 +76,7 @@ void CefRenderFrameObserver::DidFinishLoad() { } } -void CefRenderFrameObserver::FrameDetached() { +void CefRenderFrameObserver::WillDetach() { if (frame_) { frame_->OnDetached(); frame_ = nullptr; diff --git a/libcef/renderer/render_frame_observer.h b/libcef/renderer/render_frame_observer.h index d61fa92aa..e1fbfca88 100644 --- a/libcef/renderer/render_frame_observer.h +++ b/libcef/renderer/render_frame_observer.h @@ -31,7 +31,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver { void DidCommitProvisionalLoad(ui::PageTransition transition) override; void DidFailProvisionalLoad() override; void DidFinishLoad() override; - void FrameDetached() override; + void WillDetach() override; void FocusedElementChanged(const blink::WebElement& element) override; void DraggableRegionsChanged() override; void DidCreateScriptContext(v8::Handle context, diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index 742554d4a..364a68097 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -6,7 +6,6 @@ #include -#include "libcef/common/app_manager.h" #include "libcef/common/request_impl.h" #include "libcef/common/response_impl.h" #include "libcef/common/task_runner_impl.h" @@ -155,8 +154,8 @@ class CefRenderURLRequest::Context factory = static_cast(frame_.get())->GetURLLoaderFactory(); } if (!factory) { - // This factory only supports unintercepted http(s) and blob requests. - factory = CefAppManager::Get()->GetDefaultURLLoaderFactory(); + // Global requests are not supported. + return false; } loader_ = factory->CreateURLLoader( @@ -446,6 +445,9 @@ CefRenderURLRequest::CefRenderURLRequest( CefRefPtr frame, CefRefPtr request, CefRefPtr client) { + DCHECK(frame); + DCHECK(request); + DCHECK(client); context_ = new Context(this, frame, request, client); } diff --git a/libcef_dll/CMakeLists.txt.in b/libcef_dll/CMakeLists.txt.in index a21855379..72a2d99df 100644 --- a/libcef_dll/CMakeLists.txt.in +++ b/libcef_dll/CMakeLists.txt.in @@ -4,8 +4,8 @@ # Append platform specific sources to a list of sources. macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list) - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MACOSX) - list(APPEND ${name_of_list} ${${name_of_list}_MACOSX}) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MAC) + list(APPEND ${name_of_list} ${${name_of_list}_MAC}) endif() if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ${name_of_list}_LINUX) list(APPEND ${name_of_list} ${${name_of_list}_LINUX}) @@ -28,16 +28,16 @@ set(CEF_TARGET libcef_dll_wrapper) 'includes_capi', 'autogen_capi_includes', 'includes_wrapper', - 'includes_wrapper_mac:MACOSX', + 'includes_wrapper_mac:MAC', 'includes_win:WINDOWS', 'includes_win_capi:WINDOWS', - 'includes_mac:MACOSX', - 'includes_mac_capi:MACOSX', + 'includes_mac:MAC', + 'includes_mac_capi:MAC', 'includes_linux:LINUX', 'includes_linux_capi:LINUX', 'libcef_dll_wrapper_sources_base', 'libcef_dll_wrapper_sources_common', - 'libcef_dll_wrapper_sources_mac:MACOSX', + 'libcef_dll_wrapper_sources_mac:MAC', 'autogen_client_side', ], }} diff --git a/libcef_dll/sandbox/sandbox_win.cc b/libcef_dll/sandbox/sandbox_win.cc index f8cdcc91f..0f8482088 100644 --- a/libcef_dll/sandbox/sandbox_win.cc +++ b/libcef_dll/sandbox/sandbox_win.cc @@ -2,6 +2,7 @@ // 2011 the Chromium Authors. All rights reserved. Use of this source code is // governed by a BSD-style license that can be found in the LICENSE file. +#include "base/logging.h" #include "sandbox/win/src/process_mitigations.h" #include "sandbox/win/src/sandbox_factory.h" @@ -37,3 +38,13 @@ void* cef_sandbox_info_create() { void cef_sandbox_info_destroy(void* sandbox_info) { delete static_cast(sandbox_info); } + +// Implementation from third_party/abseil-cpp/absl/types/bad_variant_access.cc +// to avoid bringing in absl dependencies. +namespace absl { +namespace variant_internal { +void ThrowBadVariantAccess() { + LOG(FATAL) << "Bad variant access"; +} +} // namespace variant_internal +} // namespace absl diff --git a/patch/patch.cfg b/patch/patch.cfg index 1a021dade..27fc94d29 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -200,6 +200,12 @@ patches = [ }, { # Support CEF changes in chrome/browser. + # + # Linux: Fix sharesheet-related linker errors. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 + # + # Linux: Fix ShareTarget duplicate symbols errors. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1123395 'name': 'chrome_browser', }, { @@ -235,6 +241,9 @@ patches = [ # Fix fatal error: 'components/printing/common/print.mojom.h' file not found # From chrome/browser/ui/browser_commands.cc via # chrome/browser/printing/print_view_manager_common.h + # + # Linux: Fix sharesheet-related linker errors. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1123388 'name': 'chrome_browser_net_export', }, { @@ -249,6 +258,9 @@ patches = [ }, { # Allow CEF to share Chrome plugin loading code. + # + # Restore the BrowserPluginGuest::GetEmbedderFrame() method removed in + # https://crbug.com/533069#c43. 'name': 'chrome_plugins', }, { @@ -406,13 +418,6 @@ patches = [ # Compute correct default quota when cache_path is unspecified. 'name': 'services_network_2718', }, - { - # Windows: Remove the base::Value is_standard_layout assert which will fail - # for the cef_sandbox build, and which is no longer required. - # https://bugs.chromium.org/p/chromium/issues/detail?id=646113#c173 - # https://chromium.googlesource.com/chromium/src/+/2f28731c17 - 'name': 'win_base_msvc_sandbox', - }, { # Restore WebView::SetResizeBackgroundColor() that was removed. # http://crrev.com/3955c9f9eb @@ -485,11 +490,6 @@ patches = [ # https://chromium-review.googlesource.com/c/chromium/src/+/1884750 'name': 'libxml_visibility', }, - { - # Fix ScreenlockMonitorDeviceSource window creation error. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1058556 - 'name': 'win_screenlock_1058556', - }, { # Fix unbound AssociatedRemote error in SetBackgroundOpaque. # https://bugs.chromium.org/p/chromium/issues/detail?id=1070713 @@ -511,5 +511,16 @@ patches = [ # Fix build errors with enable_background_mode=false. # https://bugs.chromium.org/p/chromium/issues/detail?id=1100085 'name': 'chrome_browser_background_mode_1100085', + }, + { + # Windows: Fix flickering issue with GPU rendering. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1123950 + 'name': 'ui_gl_utils_1123950', + }, + { + # Windows: Fix cef_sandbox compile error due to missing include. + # Fixed by the below change in more recent Chromium versions. + # https://bugs.chromium.org/p/chromium/issues/detail?id=1049498#c14 + 'name': 'base_string_piece_1049498', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 15b9a3662..f763a7d03 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,8 +1,8 @@ diff --git base/BUILD.gn base/BUILD.gn -index fb85807363f1..bdef6c7f64c7 100644 +index b2a25c8c376c..c21bc286abf7 100644 --- base/BUILD.gn +++ base/BUILD.gn -@@ -34,6 +34,7 @@ import("//build/config/ui.gni") +@@ -33,6 +33,7 @@ import("//build/config/ui.gni") import("//build/nocompile.gni") import("//build/timestamp.gni") import("//build_overrides/build.gni") @@ -10,7 +10,7 @@ index fb85807363f1..bdef6c7f64c7 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1634,7 +1635,11 @@ jumbo_component("base") { +@@ -1641,7 +1642,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch new file mode 100644 index 000000000..7f9a6fc8a --- /dev/null +++ b/patch/patches/base_string_piece_1049498.patch @@ -0,0 +1,12 @@ +diff --git base/strings/string_piece.h base/strings/string_piece.h +index c650cfa84d59..0d6ff1ab5684 100644 +--- base/strings/string_piece.h ++++ base/strings/string_piece.h +@@ -24,6 +24,7 @@ + + #include + ++#include + #include + #include + #include diff --git a/patch/patches/browser_compositor_mac.patch b/patch/patches/browser_compositor_mac.patch index 6f4844946..626505376 100644 --- a/patch/patches/browser_compositor_mac.patch +++ b/patch/patches/browser_compositor_mac.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h -index af7b3249d421..1483a48f9074 100644 +index 5d8eae87ed64..427c11ceb549 100644 --- content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h @@ -58,6 +58,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, @@ -12,7 +12,7 @@ index af7b3249d421..1483a48f9074 100644 // Force a new surface id to be allocated. Returns true if the // RenderWidgetHostImpl sent the resulting surface id to the renderer. diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm -index ac9fdebbc87d..ebb2556ad908 100644 +index 07e91e20d4c1..565e98f015eb 100644 --- content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm @@ -85,6 +85,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() { diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index f668cfa52..b0e00cac2 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,21 +1,21 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index ca111c5b80ee..35e734fe6a54 100644 +index 9cd1ff2b9222..2f5264de68c4 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1498,6 +1498,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1548,6 +1548,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. - if (actual_process_lock.SchemeIs(url::kDataScheme)) + if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; + + // Allow other schemes that are non-standard, non-local and WebSafe. -+ if (actual_process_lock.is_valid() && -+ !actual_process_lock.IsStandard() && ++ if (lock_url.is_valid() && ++ !lock_url.IsStandard() && + !base::Contains(url::GetLocalSchemes(), -+ actual_process_lock.scheme_piece()) && ++ lock_url.scheme_piece()) && + base::Contains(schemes_okay_to_request_in_any_process_, -+ actual_process_lock.scheme_piece())) { ++ lock_url.scheme_piece())) { + return true; + } } - failure_reason = "lock_mismatch"; + // TODO(wjmaclean): We should update the ProcessLock comparison API to diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 831dc8d1e..c6b1fc1e2 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 6e219b3994e2..0e14d81370ef 100644 +index 8166e38ceda5..178099b1ac62 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1742,8 +1742,6 @@ config("thin_archive") { +@@ -1767,8 +1767,6 @@ config("thin_archive") { # archive names to 16 characters, which is not what we want). if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index a3a2bb023..49b590db8 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 9fe789540c05..a2646c13e5d5 100644 +index 6cb9ee1f0764..8109a134907e 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/crypto.gni") @@ -10,15 +10,15 @@ index 9fe789540c05..a2646c13e5d5 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1824,6 +1825,7 @@ static_library("browser") { - "//base/util/values:values_util", +@@ -1870,6 +1871,7 @@ static_library("browser") { "//build:branding_buildflags", + "//build:lacros_buildflags", "//cc", + "//cef/libcef/features", "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2156,6 +2158,10 @@ static_library("browser") { +@@ -2221,6 +2223,10 @@ static_library("browser") { ] } @@ -29,3 +29,75 @@ index 9fe789540c05..a2646c13e5d5 100644 if (is_android) { sources += [ "after_startup_task_utils_android.cc", +@@ -3422,8 +3428,6 @@ static_library("browser") { + "nearby_sharing/outgoing_share_target_info.h", + "nearby_sharing/paired_key_verification_runner.cc", + "nearby_sharing/paired_key_verification_runner.h", +- "nearby_sharing/share_target.cc", +- "nearby_sharing/share_target.h", + "nearby_sharing/share_target_discovered_callback.h", + "nearby_sharing/share_target_info.cc", + "nearby_sharing/share_target_info.h", +@@ -3617,13 +3621,6 @@ static_library("browser") { + "serial/serial_chooser_context_factory.cc", + "serial/serial_chooser_context_factory.h", + "serial/serial_chooser_histograms.h", +- "sharesheet/sharesheet_controller.h", +- "sharesheet/sharesheet_service.cc", +- "sharesheet/sharesheet_service.h", +- "sharesheet/sharesheet_service_delegate.cc", +- "sharesheet/sharesheet_service_delegate.h", +- "sharesheet/sharesheet_service_factory.cc", +- "sharesheet/sharesheet_service_factory.h", + "sharing/click_to_call/click_to_call_context_menu_observer.cc", + "sharing/click_to_call/click_to_call_context_menu_observer.h", + "sharing/click_to_call/click_to_call_metrics.cc", +diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc +index 7ccd06a9b0fe..183da2c7238d 100644 +--- chrome/browser/ui/views/toolbar/toolbar_view.cc ++++ chrome/browser/ui/views/toolbar/toolbar_view.cc +@@ -232,8 +232,8 @@ void ToolbarView::Init() { + media_button = std::make_unique(browser_); + } + +- std::unique_ptr sharesheet_button; + #if defined(OS_CHROMEOS) ++ std::unique_ptr sharesheet_button; + if (base::FeatureList::IsEnabled(features::kSharesheet)) { + sharesheet_button = std::make_unique(browser_); + } +@@ -276,8 +276,10 @@ void ToolbarView::Init() { + if (media_button) + media_button_ = AddChildView(std::move(media_button)); + ++#if defined(OS_CHROMEOS) + if (sharesheet_button) + sharesheet_button_ = AddChildView(std::move(sharesheet_button)); ++#endif + + if (toolbar_account_icon_container) { + toolbar_account_icon_container_ = +@@ -966,3 +968,4 @@ void ToolbarView::OnTouchUiChanged() { + PreferredSizeChanged(); + } + } ++ +diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h +index f4af66fa98b3..3c4d171c091e 100644 +--- chrome/browser/ui/views/toolbar/toolbar_view.h ++++ chrome/browser/ui/views/toolbar/toolbar_view.h +@@ -273,7 +273,9 @@ class ToolbarView : public views::AccessiblePaneView, + media_router::CastToolbarButton* cast_ = nullptr; + ToolbarAccountIconContainerView* toolbar_account_icon_container_ = nullptr; + AvatarToolbarButton* avatar_ = nullptr; ++#if defined(OS_CHROMEOS) + SharesheetButton* sharesheet_button_ = nullptr; ++#endif + MediaToolbarButtonView* media_button_ = nullptr; + BrowserAppMenuButton* app_menu_button_ = nullptr; + +@@ -302,3 +304,4 @@ class ToolbarView : public views::AccessiblePaneView, + }; + + #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ ++ diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 17006f406..8725e50a8 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index 559e51776e42..a429421f7c61 100644 +index 8493d1b2233b..69efa5114c6f 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm -@@ -1140,6 +1140,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1141,6 +1141,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // Run a (background) application in a new tab. - (void)executeApplication:(id)sender { @@ -10,7 +10,7 @@ index 559e51776e42..a429421f7c61 100644 NSInteger tag = [sender tag]; Profile* profile = [self lastProfile]; DCHECK(profile); -@@ -1148,6 +1149,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1149,6 +1150,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; tag < static_cast(applications.size())); const extensions::Extension* extension = applications.GetExtension(tag); BackgroundModeManager::LaunchBackgroundApplication(profile, extension); @@ -18,7 +18,7 @@ index 559e51776e42..a429421f7c61 100644 } // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1529,6 +1531,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1530,6 +1532,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit // tests which use the mock in place of the profile-initialized model. @@ -26,7 +26,7 @@ index 559e51776e42..a429421f7c61 100644 // Avoid breaking unit tests which have no profile. if (profile) { BackgroundApplicationListModel applications(profile); -@@ -1555,6 +1558,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; +@@ -1556,6 +1559,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; } } } @@ -52,10 +52,10 @@ index 132f2a8d15fd..1262f31d39db 100644 // Returns the StatusTray, which provides an API for displaying status icons // in the system status tray. Returns NULL if status icons are not supported diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 77faedcc2944..4d06b472dc64 100644 +index 254173b22652..93f0eb216cc7 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -964,24 +964,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -955,24 +955,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } @@ -83,10 +83,10 @@ index 77faedcc2944..4d06b472dc64 100644 StatusTray* BrowserProcessImpl::status_tray() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index 5ac13a0eecee..0bb9262acf1b 100644 +index 124ebbf06ea2..c47e6b6cf24c 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -164,9 +164,11 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -163,9 +163,11 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; @@ -99,7 +99,7 @@ index 5ac13a0eecee..0bb9262acf1b 100644 safe_browsing::SafeBrowsingService* safe_browsing_service() override; subresource_filter::RulesetService* subresource_filter_ruleset_service() diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc -index 2f6bb4a8cd34..d6ba58c228aa 100644 +index d20c93b35f39..badf57a88d90 100644 --- chrome/browser/lifetime/browser_close_manager.cc +++ chrome/browser/lifetime/browser_close_manager.cc @@ -148,12 +148,14 @@ void BrowserCloseManager::CloseBrowsers() { @@ -118,10 +118,10 @@ index 2f6bb4a8cd34..d6ba58c228aa 100644 // Make a copy of the BrowserList to simplify the case where we need to // destroy a Browser during the loop. diff --git chrome/browser/sessions/session_service.cc chrome/browser/sessions/session_service.cc -index f5079f6d2189..a43a981d471b 100644 +index 73d97b1da62a..eec9c645366f 100644 --- chrome/browser/sessions/session_service.cc +++ chrome/browser/sessions/session_service.cc -@@ -942,12 +942,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { +@@ -939,12 +939,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { if (!profile() || profile()->AsTestingProfile()) return; diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 9d8f06825..829998d28 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 e5c0070b722e..987ded2bacfb 100644 +index 3e2d1221d91e..b0572e99c613 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -8,6 +8,7 @@ @@ -36,7 +36,7 @@ index e5c0070b722e..987ded2bacfb 100644 #endif } -@@ -99,10 +110,16 @@ scoped_refptr +@@ -98,10 +109,16 @@ scoped_refptr std::move(allowlist_provider)); #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index f28e196f5..bdadfb2c1 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 7f8d13d8c4c2..ab5688900991 100644 +index c7bd97a32af1..311f2c52af8d 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -9,6 +9,7 @@ import("//build/config/crypto.gni") +@@ -10,6 +10,7 @@ import("//build/config/crypto.gni") import("//build/config/features.gni") import("//build/config/linux/gtk/gtk.gni") import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index 7f8d13d8c4c2..ab5688900991 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -335,6 +336,10 @@ static_library("ui") { +@@ -334,6 +335,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index 7f8d13d8c4c2..ab5688900991 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 -@@ -356,6 +361,7 @@ static_library("ui") { +@@ -355,6 +360,7 @@ static_library("ui") { "//base/allocator:buildflags", "//build:branding_buildflags", "//cc/paint", @@ -29,14 +29,23 @@ index 7f8d13d8c4c2..ab5688900991 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1473,6 +1479,7 @@ static_library("ui") { - "//components/keep_alive_registry", +@@ -1532,6 +1538,7 @@ static_library("ui") { "//components/network_session_configurator/common", "//components/page_load_metrics/browser", + "//components/performance_manager:site_data_proto", + "//components/printing/common:mojo_interfaces", "//components/profile_metrics", "//components/safety_check", "//components/search_provider_logos", +@@ -3905,8 +3912,6 @@ static_library("ui") { + "views/toolbar/home_button.h", + "views/toolbar/reload_button.cc", + "views/toolbar/reload_button.h", +- "views/toolbar/sharesheet_button.cc", +- "views/toolbar/sharesheet_button.h", + "views/toolbar/toolbar_account_icon_container_view.cc", + "views/toolbar/toolbar_account_icon_container_view.h", + "views/toolbar/toolbar_action_view.cc", diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc index f27414c41891..b42478315ac0 100644 --- chrome/browser/ui/webui/net_export_ui.cc diff --git a/patch/patches/chrome_browser_product_override.patch b/patch/patches/chrome_browser_product_override.patch index 7cc17d0ee..a398f3b33 100644 --- a/patch/patches/chrome_browser_product_override.patch +++ b/patch/patches/chrome_browser_product_override.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index d27f4eb65fa9..9bf1bde37e63 100644 +index e520e957ddea..34c402af6d35 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -1021,10 +1021,6 @@ void LaunchURL(const GURL& url, +@@ -1022,10 +1022,6 @@ void LaunchURL(const GURL& url, } } @@ -13,7 +13,7 @@ index d27f4eb65fa9..9bf1bde37e63 100644 void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { // |allowlist| combines pref/policy + cmdline switch in the browser process. // For renderer and utility (e.g. NetworkService) processes the switch is the -@@ -1191,6 +1187,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() { +@@ -1204,6 +1200,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() { return *greased_brand_version_list; } @@ -29,7 +29,7 @@ index d27f4eb65fa9..9bf1bde37e63 100644 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUserAgent)) { diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index dad13f199206..43fbc32b5d83 100644 +index a47818dc2f0f..08148534aeea 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h @@ -91,7 +91,8 @@ class ChromeXrIntegrationClient; diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index e513b12d4..5ce9585a5 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index f81028b5cda7..9b934d020ce6 100644 +index 9b9335369a4f..fea76956bd41 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -377,7 +377,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -374,7 +374,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -12,7 +12,7 @@ index f81028b5cda7..9b934d020ce6 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 3e1e28ea7d0e..b70f718c8e94 100644 +index 93571e419253..bc77bebce943 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h @@ -101,7 +101,7 @@ class ProfileManager : public content::NotificationObserver, @@ -22,9 +22,9 @@ index 3e1e28ea7d0e..b70f718c8e94 100644 - Profile* GetProfile(const base::FilePath& profile_dir); + virtual Profile* GetProfile(const base::FilePath& profile_dir); - // Returns total number of profiles available on this machine. - size_t GetNumberOfProfiles(); -@@ -131,7 +131,7 @@ class ProfileManager : public content::NotificationObserver, + // Returns regular or off-the-record profile given its profile key. + static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); +@@ -134,7 +134,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -33,7 +33,7 @@ index 3e1e28ea7d0e..b70f718c8e94 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -140,7 +140,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -143,7 +143,7 @@ class ProfileManager : public content::NotificationObserver, // Get the Profile last used (the Profile to which owns the most recently // focused window) with this Chrome build. If no signed profile has been // stored in Local State, hand back the Default profile. @@ -43,7 +43,7 @@ index 3e1e28ea7d0e..b70f718c8e94 100644 // Get the path of the last used profile, or if that's undefined, the default // profile. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index c1792eccd997..d7434ff76a88 100644 +index 4eb91c80e57a..02373b149bde 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -7,6 +7,7 @@ @@ -54,7 +54,7 @@ index c1792eccd997..d7434ff76a88 100644 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" -@@ -62,8 +63,12 @@ void GetGuestViewDefaultContentSettingRules( +@@ -57,8 +58,12 @@ void GetGuestViewDefaultContentSettingRules( RendererUpdater::RendererUpdater(Profile* profile) : profile_(profile), identity_manager_observer_(this) { diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 126bcf19d..217aeff30 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 82edacf2604a..01c21d259dda 100644 +index 7f54cacab005..b4f509b766ca 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -251,6 +251,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index 553c4ca12..ec302c4e8 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 2a6df8119a44..dffe87df9c54 100644 +index e49552e272e4..b935ef2d47b9 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc -@@ -25,6 +25,7 @@ +@@ -26,6 +26,7 @@ #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" @@ -10,7 +10,7 @@ index 2a6df8119a44..dffe87df9c54 100644 #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" -@@ -54,6 +55,10 @@ +@@ -55,6 +56,10 @@ #include "extensions/common/extension_set.h" #include "ui/base/layout.h" @@ -21,7 +21,7 @@ index 2a6df8119a44..dffe87df9c54 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/scoped_observer.h" #include "extensions/browser/extension_registry_observer.h" -@@ -270,11 +275,19 @@ void ThemeService::Init() { +@@ -271,11 +276,19 @@ void ThemeService::Init() { // OnExtensionServiceReady. Otherwise, the ThemeObserver won't be // constructed in time to observe the corresponding events. #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index dece2347c..1d2b93670 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index d49a1df73622..9a389e4383f0 100644 +index d789ee040ac5..58b45d5a56f2 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -128,7 +128,7 @@ index d49a1df73622..9a389e4383f0 100644 // If we broke out of the loop, we have found an enabled plugin. bool enabled = i < matching_plugins.size(); diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc -index 4e64db143b8a..3dc127b7b992 100644 +index 1471b8f2a414..a856ce635719 100644 --- chrome/browser/plugins/plugin_utils.cc +++ chrome/browser/plugins/plugin_utils.cc @@ -5,6 +5,7 @@ @@ -150,7 +150,7 @@ index 4e64db143b8a..3dc127b7b992 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" -@@ -182,6 +187,12 @@ base::flat_map +@@ -181,6 +186,12 @@ base::flat_map PluginUtils::GetMimeTypeToExtensionIdMap( content::BrowserContext* browser_context) { base::flat_map mime_type_to_extension_id_map; @@ -162,7 +162,7 @@ index 4e64db143b8a..3dc127b7b992 100644 + #if BUILDFLAG(ENABLE_EXTENSIONS) Profile* profile = Profile::FromBrowserContext(browser_context); - std::vector whitelist = MimeTypesHandler::GetMIMETypeWhitelist(); + const std::vector& allowlist = diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc index c1870b0f56ef..d32b8d54fb3f 100644 --- chrome/common/google_url_loader_throttle.cc @@ -198,10 +198,10 @@ index c1870b0f56ef..d32b8d54fb3f 100644 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); if (response_url.SchemeIsHTTPOrHTTPS() && diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index 03d1e6a07843..2fd040ed87b5 100644 +index eb6e5d353b33..62994a141421 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -842,6 +842,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -823,6 +823,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -209,7 +209,7 @@ index 03d1e6a07843..2fd040ed87b5 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1045,7 +1046,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1026,7 +1027,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -219,7 +219,7 @@ index 03d1e6a07843..2fd040ed87b5 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1054,7 +1056,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1035,7 +1037,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -229,7 +229,7 @@ index 03d1e6a07843..2fd040ed87b5 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1064,7 +1067,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1045,7 +1048,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -239,7 +239,7 @@ index 03d1e6a07843..2fd040ed87b5 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1072,7 +1076,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1053,7 +1057,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -250,10 +250,10 @@ index 03d1e6a07843..2fd040ed87b5 100644 } case chrome::mojom::PluginStatus::kComponentUpdateRequired: { diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc -index d662fe9310c9..c4c406d16b95 100644 +index 4e883820f752..267c6af2af6b 100644 --- chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ chrome/renderer/plugins/chrome_plugin_placeholder.cc -@@ -360,8 +360,11 @@ void ChromePluginPlaceholder::OnBlockedContent( +@@ -364,8 +364,11 @@ void ChromePluginPlaceholder::OnBlockedContent( if (status == content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) { @@ -267,3 +267,19 @@ index d662fe9310c9..c4c406d16b95 100644 } std::string message = base::StringPrintf( +diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h +index c44044339647..3cdb3fb4bb63 100644 +--- content/browser/browser_plugin/browser_plugin_guest.h ++++ content/browser/browser_plugin/browser_plugin_guest.h +@@ -130,6 +130,11 @@ class CONTENT_EXPORT BrowserPluginGuest : public GuestHost, + void EmbedderSystemDragEnded(); + void EndSystemDragIfApplicable(); + ++ // Returns the embedder frame for this guest. ++ RenderFrameHost* GetEmbedderFrame() const { ++ return delegate_->GetEmbedderFrame(); ++ } ++ + protected: + // BrowserPluginGuest is a WebContentsObserver of |web_contents| and + // |web_contents| has to stay valid for the lifetime of BrowserPluginGuest. diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 42904dda4..092cab0cc 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 22e0426b61aa..88d226174831 100644 +index cbf9a60c385e..06146091eb43 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -4,6 +4,7 @@ @@ -10,7 +10,7 @@ index 22e0426b61aa..88d226174831 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -137,6 +138,7 @@ static_library("renderer") { +@@ -134,6 +135,7 @@ static_library("renderer") { public_deps = [ "//components/contextual_search:buildflags" ] deps = [ @@ -18,7 +18,7 @@ index 22e0426b61aa..88d226174831 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -201,6 +203,10 @@ static_library("renderer") { +@@ -199,6 +201,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 5247b8bbf..695e49b38 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,8 +1,8 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 945cee14368b..38c180a6e7e6 100644 +index 313975f42c0d..ee7f27dab6b7 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc -@@ -25,6 +25,7 @@ +@@ -27,6 +27,7 @@ #include "base/time/time.h" #include "base/trace_event/trace_event_impl.h" #include "build/build_config.h" @@ -10,7 +10,7 @@ index 945cee14368b..38c180a6e7e6 100644 #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/defaults.h" -@@ -392,6 +393,8 @@ struct MainFunction { +@@ -379,6 +380,8 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -19,16 +19,16 @@ index 945cee14368b..38c180a6e7e6 100644 #if defined(OS_WIN) // Reach out to chrome_elf for the truth on the user data directory. // Note that in tests, this links to chrome_elf_test_stubs. -@@ -629,7 +632,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -624,7 +627,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) + if (!cef::IsChromeRuntimeEnabled()) { SetUpExtendedCrashReporting(is_browser_process); + } - base::Time::ReadMinTimerIntervalLowResMs(); base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); + #endif @@ -906,6 +911,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -45,15 +45,15 @@ index 945cee14368b..38c180a6e7e6 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1039,6 +1046,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1040,6 +1047,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } + if (!cef::IsChromeRuntimeEnabled()) { - #if defined(OS_POSIX) && !defined(OS_MACOSX) + #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != service_manager::switches::kZygoteProcess) { -@@ -1071,6 +1079,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1072,6 +1080,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -61,7 +61,7 @@ index 945cee14368b..38c180a6e7e6 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1169,6 +1178,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1170,6 +1179,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,27 +69,27 @@ index 945cee14368b..38c180a6e7e6 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 = -@@ -1185,6 +1195,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1186,6 +1196,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); + } // !cef::IsChromeRuntimeEnabled() } - #endif // defined(OS_LINUX) + #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index 5117fe3b5ee3..e8f37fa7066f 100644 +index 68a92d3924f0..280ef9019551 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc -@@ -48,6 +48,7 @@ - #include "build/branding_buildflags.h" +@@ -49,6 +49,7 @@ #include "build/build_config.h" + #include "build/lacros_buildflags.h" #include "cc/base/switches.h" +#include "cef/libcef/features/runtime.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -889,8 +890,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -892,8 +893,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #if !defined(OS_ANDROID) // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // its QuitClosure to the BrowserProcessImpl to call when it is time to exit. @@ -101,7 +101,7 @@ index 5117fe3b5ee3..e8f37fa7066f 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1592,11 +1595,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1608,11 +1611,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. @@ -142,7 +142,7 @@ index ad52e63ed83a..6b16ee3ccc96 100644 base::mac::ScopedMachSendRight exceptionPort( crash_reporter::GetCrashpadClient().GetHandlerMachPort()); diff --git ui/gtk/select_file_dialog_impl_kde.cc ui/gtk/select_file_dialog_impl_kde.cc -index 4eba97d573d8..4697b24f4e34 100644 +index 464aa72e1d47..30a621dea6fc 100644 --- ui/gtk/select_file_dialog_impl_kde.cc +++ ui/gtk/select_file_dialog_impl_kde.cc @@ -6,6 +6,8 @@ diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index c99058eb8..78d2bbcf3 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,5 +1,5 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index 1919784f5f93..6a8d2d5140f2 100644 +index 6225a610f11b..693f75b4bb1f 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn @@ -5,6 +5,7 @@ diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index c01d9055d..cf9cbdd10 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,5 +1,5 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 3746ac12a072..fbc31dd14729 100644 +index a8ad8c8220c8..91ca3ff02fbe 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h @@ -12,6 +12,7 @@ @@ -10,7 +10,7 @@ index 3746ac12a072..fbc31dd14729 100644 #include "content/common/navigation_params.mojom.h" #include "content/public/browser/certificate_request_result_type.h" #include "mojo/public/cpp/bindings/pending_receiver.h" -@@ -75,7 +76,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -74,7 +75,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, base::Optional* override_out); @@ -55,10 +55,10 @@ index 886bdf0edf8f..1d714000cce5 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index ea7f0d6dbdac..d586c2900861 100644 +index 9cfeb73eb397..de5bc486f204 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn -@@ -25,6 +25,7 @@ jumbo_component("controller") { +@@ -25,6 +25,7 @@ component("controller") { configs += [ "//build/config/compiler:wexit_time_destructors", @@ -66,20 +66,20 @@ index ea7f0d6dbdac..d586c2900861 100644 "//third_party/blink/renderer:config", "//third_party/blink/renderer:inside_blink", "//third_party/blink/renderer:non_test_config", -@@ -43,6 +44,8 @@ jumbo_component("controller") { - "dev_tools_frontend_impl.h", - "memory_usage_monitor.cc", +@@ -45,6 +46,8 @@ component("controller") { "memory_usage_monitor.h", -+ "//cef/libcef/renderer/blink_glue.cc", -+ "//cef/libcef/renderer/blink_glue.h", + "performance_manager/renderer_resource_coordinator_impl.cc", + "performance_manager/renderer_resource_coordinator_impl.h", ++ "//cef/libcef/renderer/blink_glue.cc", ++ "//cef/libcef/renderer/blink_glue.h", ] - if (is_linux) { + if (is_linux || is_chromeos) { diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn -index 0068238c9f9f..67c3632e6239 100644 +index 12f3abf92434..d73901dece01 100644 --- ui/events/keycodes/BUILD.gn +++ ui/events/keycodes/BUILD.gn -@@ -17,6 +17,8 @@ jumbo_source_set("xkb") { +@@ -16,6 +16,8 @@ source_set("xkb") { public_deps = [ "//ui/base:buildflags" ] diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 24cb5a47c..f7704706f 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index b5bb5e01d7db..f2e23f9fffef 100644 +index cdeecb35a998..1615185f2a65 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc @@ -660,7 +660,7 @@ void IsHandledBySafePlugin(int render_process_id, @@ -75,7 +75,7 @@ index f66e6bca5e2b..c99998449b6b 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index 75e5dbaa10c9..36f1c1dd5b9f 100644 +index caa2c1d4d0ab..f20dfe7ca7fe 100644 --- content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc @@ -300,6 +300,7 @@ void RenderFrameMessageFilter::OnCreateChildFrame( @@ -111,10 +111,10 @@ index 8d1c932e9f3a..e6a2c525da06 100644 const std::string& mime_type, bool* found, diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 6eb685137044..f0cc9ed2cb92 100644 +index 2b94b8b2839e..36506642484c 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -635,6 +635,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -632,6 +632,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -128,7 +128,7 @@ index 6eb685137044..f0cc9ed2cb92 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -836,7 +843,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -833,7 +840,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -138,10 +138,10 @@ index 6eb685137044..f0cc9ed2cb92 100644 if (stale) { diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 20035324c2ad..76785da413c6 100644 +index e9cb48e03f17..47996036362c 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -340,6 +340,7 @@ bool PluginServiceImpl::GetPluginInfoArray( +@@ -341,6 +341,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -149,7 +149,7 @@ index 20035324c2ad..76785da413c6 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -357,7 +358,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -358,7 +359,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->IsPluginAvailable(render_process_id, render_frame_id, url, @@ -224,10 +224,10 @@ index 632ae86c6fd6..55b749ec1242 100644 const std::vector& all_plugins); diff --git content/common/frame_messages.h content/common/frame_messages.h -index 01c30cb72181..f1caf9b44f44 100644 +index 33db23c32723..acde4d008de3 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -529,9 +529,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -502,9 +502,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -240,31 +240,31 @@ index 01c30cb72181..f1caf9b44f44 100644 std::string /* mime_type */, bool /* found */, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 87375b2ef10c..28a43be9229d 100644 +index e112645811cb..7758de1bf201 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ // declarations instead of including more headers. If that is infeasible, adjust // the limit. For more info, see // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md --#pragma clang max_tokens_here 860000 -+// #pragma clang max_tokens_here 860000 +-#pragma clang max_tokens_here 880000 ++// #pragma clang max_tokens_here 880000 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index edf60410ba57..21da7fc05692 100644 +index 428ec871deba..16ac7abd2f04 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -29,6 +29,7 @@ +@@ -31,6 +31,7 @@ #include "content/public/browser/certificate_request_result_type.h" #include "content/public/browser/generated_code_cache_settings.h" #include "content/public/browser/storage_partition_config.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/page_visibility_state.h" - #include "content/public/common/previews_state.h" #include "content/public/common/window_container_type.mojom-forward.h" -@@ -1625,6 +1626,14 @@ class CONTENT_EXPORT ContentBrowserClient { + #include "device/vr/buildflags/buildflags.h" +@@ -1664,6 +1665,14 @@ class CONTENT_EXPORT ContentBrowserClient { const base::Optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -279,7 +279,7 @@ index edf60410ba57..21da7fc05692 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1693,6 +1702,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1735,6 +1744,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -315,10 +315,10 @@ index 98c59005599e..69752184745d 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index f6d2f50e8d6b..6eb51fcda2eb 100644 +index 5b0784c844bd..a7b6d3f3c237 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -85,6 +85,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -84,6 +84,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -328,7 +328,7 @@ index f6d2f50e8d6b..6eb51fcda2eb 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -329,6 +332,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -325,6 +328,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -340,10 +340,10 @@ index f6d2f50e8d6b..6eb51fcda2eb 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 74e98485b464..c183359360c2 100644 +index 16a16b1f075d..94942f76489c 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3644,7 +3644,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3853,7 +3853,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -354,10 +354,10 @@ index 74e98485b464..c183359360c2 100644 if (!found) return nullptr; diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index baee6cbd6369..0c786588a57f 100644 +index a6118f1f5ce1..7ae0e25160bb 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -633,6 +633,8 @@ void RenderThreadImpl::Init() { +@@ -632,6 +632,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( URLLoaderThrottleProviderType::kFrame); @@ -367,10 +367,10 @@ index baee6cbd6369..0c786588a57f 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index a4382a6afa32..9c830bf29e72 100644 +index d6375e9d16dc..b9e33ebe62d1 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -895,6 +895,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() { +@@ -915,6 +915,15 @@ void RendererBlinkPlatformImpl::SetRenderingColorSpace( //------------------------------------------------------------------------------ @@ -387,19 +387,19 @@ index a4382a6afa32..9c830bf29e72 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 59d7d92cf5f7..221d8e9249d9 100644 +index cfced914c88d..a8f1ffc14cb7 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -199,6 +199,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - +@@ -210,6 +210,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { media::GpuVideoAcceleratorFactories* GetGpuFactories() override; + void SetRenderingColorSpace(const gfx::ColorSpace& color_space) override; + void DevToolsAgentAttached() override; + void DevToolsAgentDetached() override; + - // Returns non-null. - // It is invalid to call this in an incomplete env where - // RenderThreadImpl::current() returns nullptr (e.g. in some tests). + // Tells this platform that the renderer is locked to a site (i.e., a scheme + // plus eTLD+1, such as https://google.com), or to a more specific origin. + void SetIsLockedToSite(); diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc index 427132c6920e..4809ddaf21e1 100644 --- content/shell/browser/shell_plugin_service_filter.cc diff --git a/patch/patches/content_app_shutdown_2798.patch b/patch/patches/content_app_shutdown_2798.patch index 2683c5f3e..3126bcc81 100644 --- a/patch/patches/content_app_shutdown_2798.patch +++ b/patch/patches/content_app_shutdown_2798.patch @@ -1,16 +1,16 @@ diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index f5e5576fd745..086ba8edc63a 100644 +index 1dec904333df..e1f2ec06d93f 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -44,6 +44,7 @@ - #include "base/strings/stringprintf.h" +@@ -45,6 +45,7 @@ #include "base/task/post_task.h" #include "base/task/thread_pool/thread_pool_instance.h" + #include "base/threading/hang_watcher.h" +#include "base/threading/thread_restrictions.h" #include "base/trace_event/trace_event.h" #include "components/discardable_memory/service/discardable_shared_memory_manager.h" #include "components/download/public/common/download_task_runner.h" -@@ -1027,6 +1028,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1028,6 +1029,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -23,7 +23,7 @@ index f5e5576fd745..086ba8edc63a 100644 ContentMainRunner* ContentMainRunner::Create() { return ContentMainRunnerImpl::Create(); diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index 299af2871498..8639eb8843f7 100644 +index 50797fdcea18..33acf1f35429 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h @@ -51,6 +51,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { @@ -36,7 +36,7 @@ index 299af2871498..8639eb8843f7 100644 int RunServiceManager(MainFunctionParams& main_function_params, bool start_service_manager_only); diff --git content/app/content_service_manager_main_delegate.cc content/app/content_service_manager_main_delegate.cc -index 1983ab5b217d..25344b70d343 100644 +index 1e6ad316bc67..e11e443ae694 100644 --- content/app/content_service_manager_main_delegate.cc +++ content/app/content_service_manager_main_delegate.cc @@ -174,4 +174,8 @@ void ContentServiceManagerMainDelegate::SetStartServiceManagerOnly( diff --git a/patch/patches/content_pepper_flash_1586.patch b/patch/patches/content_pepper_flash_1586.patch index 3a7893971..7e7351bf5 100644 --- a/patch/patches/content_pepper_flash_1586.patch +++ b/patch/patches/content_pepper_flash_1586.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc -index be208ad722fa..df9c50da18ad 100644 +index df1d395158a3..2ab2475b9164 100644 --- content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc +++ content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc @@ -56,7 +56,7 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter( diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index f450d047b..22c3dfb1e 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -81,7 +81,7 @@ index 886372e11489..ad3bc2242883 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index 0c5f0f9af928..b27599cc1494 100644 +index 2014df5fe810..3cf97e8d8e3c 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -127,7 +127,7 @@ index bcf172e645a2..f879aa745adf 100644 // on the given |command_line|. void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); diff --git components/crash/core/app/breakpad_linux.cc components/crash/core/app/breakpad_linux.cc -index d2ca4a9056e5..3a4d8e1e82d9 100644 +index 9b07ab4667e6..07b61ac63e9d 100644 --- components/crash/core/app/breakpad_linux.cc +++ components/crash/core/app/breakpad_linux.cc @@ -28,6 +28,7 @@ @@ -138,7 +138,7 @@ index d2ca4a9056e5..3a4d8e1e82d9 100644 #include "base/files/file_path.h" #include "base/lazy_instance.h" #include "base/linux_util.h" -@@ -722,7 +723,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, +@@ -719,7 +720,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, info.process_type_length = 7; info.distro = base::g_linux_distro; info.distro_length = my_strlen(base::g_linux_distro); @@ -147,7 +147,7 @@ index d2ca4a9056e5..3a4d8e1e82d9 100644 info.process_start_time = g_process_start_time; info.oom_size = base::g_oom_size; info.pid = g_pid; -@@ -1749,10 +1750,19 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1733,10 +1734,19 @@ void HandleCrashDump(const BreakpadInfo& info) { GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); writer.AddBoundary(); @@ -169,7 +169,7 @@ index d2ca4a9056e5..3a4d8e1e82d9 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -1869,6 +1879,9 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1853,6 +1863,9 @@ void HandleCrashDump(const BreakpadInfo& info) { crash_reporter::internal::TransitionalCrashKeyStorage; CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys); const CrashKeyStorage::Entry* entry; @@ -177,9 +177,9 @@ index d2ca4a9056e5..3a4d8e1e82d9 100644 + crash_reporter::CrashReporterClient::ParameterMap parameters; + while ((entry = crash_key_iterator.Next())) { - if (g_use_crash_key_white_list && !IsInWhiteList(entry->key)) - continue; -@@ -1881,7 +1894,13 @@ void HandleCrashDump(const BreakpadInfo& info) { + size_t key_size, value_size; + // Check for malformed messages. +@@ -1863,7 +1876,13 @@ void HandleCrashDump(const BreakpadInfo& info) { ? CrashKeyStorage::value_size - 1 : my_strlen(entry->value); @@ -209,15 +209,15 @@ index 9ea80370a842..3043f7d32f33 100644 extern void InitCrashKeysForTesting(); diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc -index 44e81b2f95f6..bfa419e46bc8 100644 +index 1d0fb4f2a633..8226a3d792be 100644 --- components/crash/core/app/crash_reporter_client.cc +++ components/crash/core/app/crash_reporter_client.cc @@ -88,7 +88,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { } #endif --#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) -+#if defined(OS_POSIX) && !defined(OS_IOS) +-#if defined(OS_POSIX) && !defined(OS_MAC) ++#if defined(OS_POSIX) void CrashReporterClient::GetProductNameAndVersion(const char** product_name, const char** version) { } @@ -225,7 +225,7 @@ index 44e81b2f95f6..bfa419e46bc8 100644 std::string* version, std::string* channel) {} -+#if !defined(OS_MACOSX) ++#if !defined(OS_MAC) base::FilePath CrashReporterClient::GetReporterLogFilename() { return base::FilePath(); } @@ -237,7 +237,7 @@ index 44e81b2f95f6..bfa419e46bc8 100644 #if defined(OS_WIN) bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { -@@ -148,6 +150,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { +@@ -140,6 +142,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { return false; } @@ -257,7 +257,7 @@ index 44e81b2f95f6..bfa419e46bc8 100644 +} +#endif + -+#if defined(OS_MACOSX) ++#if defined(OS_MAC) +bool CrashReporterClient::EnableBrowserCrashForwarding() { + return true; +} @@ -266,14 +266,14 @@ index 44e81b2f95f6..bfa419e46bc8 100644 #if defined(OS_ANDROID) unsigned int CrashReporterClient::GetCrashDumpPercentage() { return 100; -@@ -210,9 +234,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { +@@ -202,9 +226,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { return false; } -bool CrashReporterClient::EnableBreakpadForProcess( - const std::string& process_type) { - return false; -+#if defined(OS_POSIX) && !defined(OS_MACOSX) ++#if defined(OS_POSIX) && !defined(OS_MAC) +CrashReporterClient::ParameterMap +CrashReporterClient::FilterParameters(const ParameterMap& parameters) { + return parameters; @@ -282,7 +282,7 @@ index 44e81b2f95f6..bfa419e46bc8 100644 } // namespace crash_reporter diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h -index 05538423d0b9..60b3403b4b0e 100644 +index aaa9ad1d58d7..14b98b2e6598 100644 --- components/crash/core/app/crash_reporter_client.h +++ components/crash/core/app/crash_reporter_client.h @@ -5,7 +5,9 @@ @@ -299,8 +299,8 @@ index 05538423d0b9..60b3403b4b0e 100644 virtual int GetResultCodeRespawnFailed(); #endif --#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_IOS) -+#if defined(OS_POSIX) && !defined(OS_IOS) +-#if defined(OS_POSIX) && !defined(OS_MAC) ++#if defined(OS_POSIX) // Returns a textual description of the product type and version to include // in the crash report. Neither out parameter should be set to NULL. // TODO(jperaza): Remove the 2-parameter overload of this method once all @@ -308,7 +308,7 @@ index 05538423d0b9..60b3403b4b0e 100644 std::string* version, std::string* channel); -+#if !defined(OS_MACOSX) ++#if !defined(OS_MAC) virtual base::FilePath GetReporterLogFilename(); // Custom crash minidump handler after the minidump is generated. @@ -320,7 +320,7 @@ index 05538423d0b9..60b3403b4b0e 100644 #endif // The location where minidump files should be written. Returns true if -@@ -210,6 +214,27 @@ class CrashReporterClient { +@@ -205,6 +209,27 @@ class CrashReporterClient { // Returns true if breakpad should run in the given process type. virtual bool EnableBreakpadForProcess(const std::string& process_type); @@ -333,13 +333,13 @@ index 05538423d0b9..60b3403b4b0e 100644 + virtual base::string16 GetCrashExternalHandler(const base::string16& exe_dir); +#endif + -+#if defined(OS_MACOSX) ++#if defined(OS_MAC) + // Returns true if forwarding of crashes to the system crash reporter is + // enabled for the browser process. + virtual bool EnableBrowserCrashForwarding(); +#endif + -+#if defined(OS_POSIX) && !defined(OS_MACOSX) ++#if defined(OS_POSIX) && !defined(OS_MAC) + // Provides an oportunity to modify the parameters that will be sent with a + // crash upload. + using ParameterMap = std::map; @@ -349,7 +349,7 @@ index 05538423d0b9..60b3403b4b0e 100644 } // namespace crash_reporter diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc -index 290b4692c16f..ef91dbdc369d 100644 +index e1c66df6cecf..681dd496292e 100644 --- components/crash/core/app/crashpad.cc +++ components/crash/core/app/crashpad.cc @@ -151,7 +151,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -363,7 +363,7 @@ index 290b4692c16f..ef91dbdc369d 100644 ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled); } diff --git components/crash/core/app/crashpad_mac.mm components/crash/core/app/crashpad_mac.mm -index 0b594d053d7c..c79b69a31dd1 100644 +index aa7c3302f2e3..c471132afe3f 100644 --- components/crash/core/app/crashpad_mac.mm +++ components/crash/core/app/crashpad_mac.mm @@ -16,12 +16,15 @@ @@ -382,18 +382,10 @@ index 0b594d053d7c..c79b69a31dd1 100644 #include "third_party/crashpad/crashpad/client/crash_report_database.h" #include "third_party/crashpad/crashpad/client/crashpad_client.h" #include "third_party/crashpad/crashpad/client/crashpad_info.h" -@@ -37,12 +40,25 @@ namespace { - std::map GetProcessSimpleAnnotations() { - static std::map annotations = []() -> auto { +@@ -39,14 +42,24 @@ std::map GetProcessSimpleAnnotations() { std::map process_annotations; -+ @autoreleasepool { NSBundle* outer_bundle = base::mac::OuterBundle(); -- NSString* product = base::mac::ObjCCast([outer_bundle -- objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]); -- process_annotations["prod"] = -- base::SysNSStringToUTF8(product).append("_Mac"); -+ + CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); + const char* product_name = ""; + const char* product_version = ""; @@ -401,18 +393,26 @@ index 0b594d053d7c..c79b69a31dd1 100644 + &product_version); + + if (strlen(product_name) == 0) { + #if BUILDFLAG(GOOGLE_CHROME_BRANDING) +- process_annotations["prod"] = "Chrome_Mac"; ++ process_annotations["product"] = "Chrome_Mac"; + #else +- NSString* product = base::mac::ObjCCast([outer_bundle +- objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]); +- process_annotations["prod"] = +- base::SysNSStringToUTF8(product).append("_Mac"); + NSString* product = base::mac::ObjCCast([outer_bundle -+ objectForInfoDictionaryKey:base::mac::CFToNSCast( -+ kCFBundleNameKey)]); ++ objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]); + process_annotations["product"] = + base::SysNSStringToUTF8(product).append("_Mac"); + #endif + } else { + process_annotations["product"] = product_name; + } #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable. -@@ -58,12 +74,16 @@ std::map GetProcessSimpleAnnotations() { +@@ -62,12 +75,16 @@ std::map GetProcessSimpleAnnotations() { process_annotations["channel"] = ""; } @@ -434,7 +434,7 @@ index 0b594d053d7c..c79b69a31dd1 100644 } // @autoreleasepool return process_annotations; }(); -@@ -123,10 +143,10 @@ base::FilePath PlatformCrashpadInitialization( +@@ -127,10 +144,10 @@ base::FilePath PlatformCrashpadInitialization( if (initial_client) { @autoreleasepool { @@ -449,7 +449,7 @@ index 0b594d053d7c..c79b69a31dd1 100644 // Is there a way to recover if this fails? CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -155,6 +175,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -159,6 +176,12 @@ base::FilePath PlatformCrashpadInitialization( "--reset-own-crash-exception-port-to-system-default"); } diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index 8d0a11d55..f71f74e40 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -146,7 +146,7 @@ index 5761c6b965b5..aee4e6c96033 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index b314e0a11b92..a374df4728c0 100644 +index 54af69767c8a..8b659955db3e 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -156,8 +156,8 @@ index b314e0a11b92..a374df4728c0 100644 +import("//cef/libcef/features/features.gni") import("../build/crashpad_buildconfig.gni") - static_library("handler") { -@@ -65,6 +66,17 @@ static_library("handler") { + if (crashpad_is_in_chromium) { +@@ -69,6 +70,17 @@ static_library("handler") { ] } @@ -175,7 +175,7 @@ index b314e0a11b92..a374df4728c0 100644 public_configs = [ "..:crashpad_config" ] public_deps = [ -@@ -77,6 +89,7 @@ static_library("handler") { +@@ -81,6 +93,7 @@ static_library("handler") { "../minidump", "../snapshot", "../tools:tool_support", @@ -184,7 +184,7 @@ index b314e0a11b92..a374df4728c0 100644 if (crashpad_is_win) { diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -index fd48e1b6bc1f..42a753fafe47 100644 +index 1e5f12374ce1..d227dea8649c 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc @@ -263,6 +263,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( @@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644 //! \brief Calls ProcessPendingReports() in response to ReportPending() having //! been called on any thread, as well as periodically on a timer. diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc -index d56857ff9042..69fc74639431 100644 +index c8001f457199..6c64610c69d4 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc @@ -36,8 +36,10 @@ @@ -264,7 +264,7 @@ index d56857ff9042..69fc74639431 100644 #include "client/crashpad_info.h" @@ -91,6 +93,10 @@ #include "handler/linux/exception_handler_server.h" - #endif // OS_MACOSX + #endif // OS_APPLE +#if BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/common/cef_crash_report_upload_thread.h" @@ -273,7 +273,7 @@ index d56857ff9042..69fc74639431 100644 namespace crashpad { namespace { -@@ -206,6 +212,9 @@ struct Options { +@@ -215,6 +221,9 @@ struct Options { bool periodic_tasks; bool rate_limit; bool upload_gzip; @@ -283,7 +283,7 @@ index d56857ff9042..69fc74639431 100644 #if defined(OS_CHROMEOS) bool use_cros_crash_reporter = false; base::FilePath minidump_dir_for_tests; -@@ -552,6 +561,9 @@ int HandlerMain(int argc, +@@ -568,6 +577,9 @@ int HandlerMain(int argc, kOptionTraceParentWithException, #endif kOptionURL, @@ -293,7 +293,7 @@ index d56857ff9042..69fc74639431 100644 #if defined(OS_CHROMEOS) kOptionUseCrosCrashReporter, kOptionMinidumpDirForTests, -@@ -650,6 +662,9 @@ int HandlerMain(int argc, +@@ -669,6 +681,9 @@ int HandlerMain(int argc, #endif // OS_ANDROID {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, @@ -303,7 +303,7 @@ index d56857ff9042..69fc74639431 100644 {nullptr, 0, nullptr, 0}, }; -@@ -798,6 +813,27 @@ int HandlerMain(int argc, +@@ -824,6 +839,27 @@ int HandlerMain(int argc, options.url = optarg; break; } @@ -331,7 +331,7 @@ index d56857ff9042..69fc74639431 100644 #if defined(OS_CHROMEOS) case kOptionUseCrosCrashReporter: { options.use_cros_crash_reporter = true; -@@ -947,8 +983,14 @@ int HandlerMain(int argc, +@@ -973,8 +1009,14 @@ int HandlerMain(int argc, upload_thread_options.upload_gzip = options.upload_gzip; upload_thread_options.watch_pending_reports = options.periodic_tasks; @@ -346,7 +346,7 @@ index d56857ff9042..69fc74639431 100644 upload_thread.Get()->Start(); } -@@ -1014,7 +1056,8 @@ int HandlerMain(int argc, +@@ -1044,7 +1086,8 @@ int HandlerMain(int argc, ScopedStoppable prune_thread; if (options.periodic_tasks) { prune_thread.Reset(new PruneCrashReportThread( diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index a7725f57d..4f2396511 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc -index bb4af725af9f..a1389be84f6e 100644 +index 3cc8dfd2754e..37b34413d506 100644 --- chrome/browser/extensions/api/streams_private/streams_private_api.cc +++ chrome/browser/extensions/api/streams_private/streams_private_api.cc @@ -6,6 +6,7 @@ @@ -8,9 +8,9 @@ index bb4af725af9f..a1389be84f6e 100644 +#include "cef/libcef/features/features.h" #include "chrome/browser/extensions/extension_tab_util.h" - #include "chrome/browser/prerender/prerender_contents.h" - #include "components/sessions/core/session_id.h" -@@ -41,6 +42,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( + #include "chrome/browser/prerender/chrome_prerender_contents_delegate.h" + #include "components/prerender/browser/prerender_contents.h" +@@ -42,6 +43,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( if (!web_contents) return; @@ -18,7 +18,7 @@ index bb4af725af9f..a1389be84f6e 100644 // If the request was for a prerender, abort the prerender and do not // continue. This is because plugins cancel prerender, see // http://crbug.com/343590. -@@ -50,6 +52,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( +@@ -51,6 +53,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( prerender_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD); return; } @@ -27,7 +27,7 @@ index bb4af725af9f..a1389be84f6e 100644 auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index da431bd8ecc5..587952b1af1c 100644 +index 0f588c70627f..a1b9ea21cc72 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -66,11 +66,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -97,7 +97,7 @@ index da431bd8ecc5..587952b1af1c 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index ee031971ea4c..c82a4f30eb7f 100644 +index 11bfec21cc9f..416de61f85fa 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -51,13 +51,19 @@ class ExtensionHost : public DeferredStartRenderHost, @@ -121,7 +121,7 @@ index ee031971ea4c..c82a4f30eb7f 100644 content::RenderViewHost* render_view_host() const; content::RenderProcessHost* render_process_host() const; bool has_loaded_once() const { return has_loaded_once_; } -@@ -176,7 +182,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -178,7 +184,8 @@ class ExtensionHost : public DeferredStartRenderHost, content::BrowserContext* browser_context_; // The host for our HTML content. @@ -132,10 +132,10 @@ index ee031971ea4c..c82a4f30eb7f 100644 // A weak pointer to the current or pending RenderViewHost. We don't access // this through the host_contents because we want to deal with the pending diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 757ed5668b94..142c0ea7f801 100644 +index 829941a3f095..dd6d5334c692 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h -@@ -56,6 +56,7 @@ class ComponentExtensionResourceManager; +@@ -57,6 +57,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -143,7 +143,7 @@ index 757ed5668b94..142c0ea7f801 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -196,6 +197,14 @@ class ExtensionsBrowserClient { +@@ -197,6 +198,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index 592b5f319..a0294deb1 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index c789fe56958f..2c57543a71d8 100644 +index aff8517d72f4..6ad4c7aefdff 100644 --- .gn +++ .gn -@@ -640,6 +640,8 @@ exec_script_whitelist = +@@ -385,6 +385,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,10 +12,10 @@ index c789fe56958f..2c57543a71d8 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 16ad01eac88d..71275b71be81 100644 +index 4e74a1d6948f..044f4016a2b6 100644 --- BUILD.gn +++ BUILD.gn -@@ -228,6 +228,7 @@ group("gn_all") { +@@ -226,6 +226,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ @@ -56,7 +56,7 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 4c051291ab4c..5b3a61149522 100644 +index 5a7d02d80a89..dcc77f0e8b33 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -3,6 +3,7 @@ @@ -67,7 +67,7 @@ index 4c051291ab4c..5b3a61149522 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/components/media_app_ui/media_app_ui.gni") -@@ -307,6 +308,7 @@ template("chrome_paks") { +@@ -315,6 +316,7 @@ template("chrome_paks") { } } @@ -75,7 +75,7 @@ index 4c051291ab4c..5b3a61149522 100644 chrome_repack_locales("${target_name}_locales") { forward_variables_from(invoker, [ -@@ -329,14 +331,17 @@ template("chrome_paks") { +@@ -337,14 +339,17 @@ template("chrome_paks") { output_locales = locales } } @@ -95,7 +95,7 @@ index 4c051291ab4c..5b3a61149522 100644 public_deps += [ ":${target_name}_200_percent" ] } diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index a04d7f31c2a6..68303e3ab3be 100644 +index 7c7af8c0d948..c7869c760b12 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn @@ -5,6 +5,7 @@ @@ -105,8 +105,8 @@ index a04d7f31c2a6..68303e3ab3be 100644 +import("//cef/libcef/features/features.gni") import("//chrome/process_version_rc_template.gni") import("//components/nacl/features.gni") - import("//third_party/icu/config.gni") -@@ -134,11 +135,13 @@ template("generate_mini_installer") { + import("//third_party/ffmpeg/ffmpeg_options.gni") +@@ -139,11 +140,13 @@ template("generate_mini_installer") { inputs = [ "$chrome_dll_file", "$root_out_dir/chrome.exe", diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 834b71050..be8146cce 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 fa2306ead7d2..c7816f841a3b 100644 +index 0818d6986440..90d0d4df9c85 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -656,4 +656,13 @@ +@@ -663,4 +663,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index dad5e021f..ce91a0034 100644 --- a/patch/patches/libxml_visibility.patch +++ b/patch/patches/libxml_visibility.patch @@ -1,8 +1,8 @@ diff --git third_party/libxml/BUILD.gn third_party/libxml/BUILD.gn -index 3fe4dfd2990b..64848dfd33d7 100644 +index a155534f66d2..7a29f910be79 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn -@@ -141,6 +141,7 @@ static_library("libxml") { +@@ -142,6 +142,7 @@ static_library("libxml") { "//third_party/blink/renderer/*", "//third_party/fontconfig", "//third_party/libxslt", diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index d797cc018..80c49b491 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 e63dfcf43147..3b7b69a688f9 100644 +index c1b5d30fd927..2e1811fc6af5 100644 --- content/browser/child_process_launcher_helper_linux.cc +++ content/browser/child_process_launcher_helper_linux.cc @@ -162,7 +162,7 @@ void ChildProcessLauncherHelper::SetProcessPriorityOnLauncherThread( diff --git a/patch/patches/linux_poll_2466.patch b/patch/patches/linux_poll_2466.patch index fde9c2d5c..84f556f62 100644 --- a/patch/patches/linux_poll_2466.patch +++ b/patch/patches/linux_poll_2466.patch @@ -1,5 +1,5 @@ diff --git base/files/file_path_watcher_linux.cc base/files/file_path_watcher_linux.cc -index 7a04ac7dfeff..f95c4811746c 100644 +index 4e231b615e8f..a5100c0bf1c8 100644 --- base/files/file_path_watcher_linux.cc +++ base/files/file_path_watcher_linux.cc @@ -5,6 +5,7 @@ diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index a64a464da..201e8c46d 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -1,21 +1,52 @@ -diff --git base/message_loop/message_loop_current.cc base/message_loop/message_loop_current.cc -index 14d7b8fbb596..4cf58414c2f0 100644 ---- base/message_loop/message_loop_current.cc -+++ base/message_loop/message_loop_current.cc -@@ -47,6 +47,8 @@ void MessageLoopCurrent::AddDestructionObserver( +diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc +index 2a286b4d269b..55ee14d93545 100644 +--- base/message_loop/message_pump_win.cc ++++ base/message_loop/message_pump_win.cc +@@ -2,6 +2,7 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. - void MessageLoopCurrent::RemoveDestructionObserver( ++#include "base/task/current_thread.h" + #include "base/message_loop/message_pump_win.h" + + #include +@@ -486,7 +487,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { + TRACE_EVENT1("base", + "MessagePumpForUI::ProcessNextWindowsMessage PeekMessage", + "sent_messages_in_queue", more_work_is_plausible); +- has_msg = ::PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE; ++ ++ // We should not process all window messages if we are in the context of an ++ // OS modal loop, i.e. in the context of a windows API call like MessageBox. ++ // This is to ensure that these messages are peeked out by the OS modal loop. ++ if (CurrentThread::Get()->os_modal_loop()) { ++ // We only peek out WM_PAINT and WM_TIMER here for reasons mentioned above. ++ has_msg = PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE) || ++ PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE); ++ } else { ++ has_msg = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != FALSE; ++ } + } + if (has_msg) + more_work_is_plausible |= ProcessMessageHelper(msg); +diff --git base/task/current_thread.cc base/task/current_thread.cc +index 068c4f837dab..50d1e4a0b770 100644 +--- base/task/current_thread.cc ++++ base/task/current_thread.cc +@@ -47,6 +47,8 @@ void CurrentThread::AddDestructionObserver( + + void CurrentThread::RemoveDestructionObserver( DestructionObserver* destruction_observer) { + if (!current_) + return; DCHECK(current_->IsBoundToCurrentThread()); current_->RemoveDestructionObserver(destruction_observer); } -diff --git base/message_loop/message_loop_current.h base/message_loop/message_loop_current.h -index 462098e2522a..b853e6dc0c40 100644 ---- base/message_loop/message_loop_current.h -+++ base/message_loop/message_loop_current.h -@@ -117,6 +117,12 @@ class BASE_EXPORT MessageLoopCurrent { +diff --git base/task/current_thread.h base/task/current_thread.h +index 52c2dbec3cac..9c8d475f50ad 100644 +--- base/task/current_thread.h ++++ base/task/current_thread.h +@@ -122,6 +122,12 @@ class BASE_EXPORT CurrentThread { // posted tasks. void SetAddQueueTimeToTasks(bool enable); @@ -28,7 +59,7 @@ index 462098e2522a..b853e6dc0c40 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 -@@ -183,6 +189,13 @@ class BASE_EXPORT MessageLoopCurrent { +@@ -187,6 +193,13 @@ class BASE_EXPORT CurrentThread { friend class web::WebTaskEnvironment; sequence_manager::internal::SequenceManagerImpl* current_; @@ -42,34 +73,3 @@ index 462098e2522a..b853e6dc0c40 100644 }; #if !defined(OS_NACL) -diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 4c500064bcd8..9b82c906b659 100644 ---- base/message_loop/message_pump_win.cc -+++ base/message_loop/message_pump_win.cc -@@ -2,6 +2,7 @@ - // Use of this source code is governed by a BSD-style license that can be - // found in the LICENSE file. - -+#include "base/message_loop/message_loop_current.h" - #include "base/message_loop/message_pump_win.h" - - #include -@@ -497,7 +498,17 @@ bool MessagePumpForUI::ProcessNextWindowsMessage() { - TRACE_EVENT1("base", - "MessagePumpForUI::ProcessNextWindowsMessage PeekMessage", - "sent_messages_in_queue", more_work_is_plausible); -- has_msg = ::PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE; -+ -+ // We should not process all window messages if we are in the context of an -+ // OS modal loop, i.e. in the context of a windows API call like MessageBox. -+ // This is to ensure that these messages are peeked out by the OS modal loop. -+ if (MessageLoopCurrent::Get()->os_modal_loop()) { -+ // We only peek out WM_PAINT and WM_TIMER here for reasons mentioned above. -+ has_msg = PeekMessage(&msg, NULL, WM_PAINT, WM_PAINT, PM_REMOVE) || -+ PeekMessage(&msg, NULL, WM_TIMER, WM_TIMER, PM_REMOVE); -+ } else { -+ has_msg = PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) != FALSE; -+ } - } - if (has_msg) - more_work_is_plausible |= ProcessMessageHelper(msg); diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 833f71019..961c7b4b1 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -1,5 +1,5 @@ diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h -index d722cbe08060..615a03b15f71 100644 +index 954e32c842a5..7563507d52d0 100644 --- content/browser/web_contents/web_contents_view.h +++ content/browser/web_contents/web_contents_view.h @@ -23,7 +23,7 @@ struct DropData; @@ -12,7 +12,7 @@ index d722cbe08060..615a03b15f71 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 390b07fc5775..a432ea7fe6a4 100644 +index 60c4fe742d7e..e47f7daa6414 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -47,10 +47,10 @@ index 390b07fc5775..a432ea7fe6a4 100644 WebContents* source, const content::OpenURLParams& params) { diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index 56babf6fff59..b97d63128d70 100644 +index 3e287fd18fee..4d5fca9bc322 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -@@ -130,6 +130,7 @@ class MimeHandlerViewGuest +@@ -129,6 +129,7 @@ class MimeHandlerViewGuest void EmbedderFullscreenToggled(bool entered_fullscreen) final; bool ZoomPropagatesFromEmbedderToGuest() const final; bool ShouldDestroyOnDetach() const final; diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index f8c88a329..051270c70 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c6..84f3b9ed7cf4 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index 1bce7961d24d..ff3baa4560ea 100644 +index ec8d2a0697de..d1adc797ebc5 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -2831,6 +2831,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -2870,6 +2870,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index 1bce7961d24d..ff3baa4560ea 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 5f3f2feec8c7..73f2bad72132 100644 +index ffeeca6e6165..9773d91492ff 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -734,6 +734,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -726,6 +726,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index 2d220fd9b..db52afeaf 100644 --- a/patch/patches/prefs_content_1161.patch +++ b/patch/patches/prefs_content_1161.patch @@ -1,8 +1,8 @@ diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h -index d67aa115c4ed..c799f2e32011 100644 +index 8e810871066b..107f15b92829 100644 --- content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h -@@ -176,6 +176,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -174,6 +174,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) @@ -11,34 +11,34 @@ index d67aa115c4ed..c799f2e32011 100644 IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc -index f85ad51fb34b..6168136649ea 100644 +index 839e3cbde987..ef1b0d7be31f 100644 --- content/public/common/web_preferences.cc +++ content/public/common/web_preferences.cc -@@ -163,6 +163,7 @@ WebPreferences::WebPreferences() +@@ -181,6 +181,7 @@ WebPreferences::WebPreferences() + #endif spatial_navigation_enabled(false), - caret_browsing_enabled(false), navigate_on_drag_drop(true), + base_background_color(0xFFFFFFFF), // Color::white v8_cache_options(blink::mojom::V8CacheOptions::kDefault), record_whole_document(false), cookie_enabled(true), diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h -index bf98747b7b38..fa046af3e0ee 100644 +index 700b47b5f521..4cd1cdceaf42 100644 --- content/public/common/web_preferences.h +++ content/public/common/web_preferences.h -@@ -180,6 +180,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -179,6 +179,7 @@ struct CONTENT_EXPORT WebPreferences { + bool smart_insert_delete_enabled; bool spatial_navigation_enabled; - bool caret_browsing_enabled; bool navigate_on_drag_drop; + uint32_t base_background_color; blink::mojom::V8CacheOptions v8_cache_options; bool record_whole_document; diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index c6a990f87306..1b9759f2b603 100644 +index 49619a9b5683..52e09111aad3 100644 --- content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc -@@ -963,6 +963,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, +@@ -950,6 +950,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, #endif WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 8dfa61ad4..0749997bc 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 b4c6ef8fec23..1e2586810d7c 100644 +index 1837e4c98e56..e6348c0e6dce 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -23,6 +23,7 @@ @@ -21,7 +21,7 @@ index b4c6ef8fec23..1e2586810d7c 100644 using content::BrowserContext; using content::BrowserThread; using content::DownloadManager; -@@ -349,6 +354,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( +@@ -357,6 +362,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager( // static DownloadPrefs* DownloadPrefs::FromBrowserContext( content::BrowserContext* context) { @@ -58,10 +58,10 @@ index 3fadaba3336f..5ef67b35883d 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html -index 56a6a8d8ee67..5fecf7ad1780 100644 +index bc7f30dba388..2cc53441f17d 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html +++ chrome/browser/resources/print_preview/ui/destination_dialog.html -@@ -141,9 +141,7 @@ +@@ -145,9 +145,7 @@
@@ -73,10 +73,10 @@ index 56a6a8d8ee67..5fecf7ad1780 100644 $i18n{cancel} diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html -index 4ec05c3fe7ba..90ff40b337bf 100644 +index 6d3d49c902e7..4769176b9550 100644 --- chrome/browser/resources/print_preview/ui/destination_select.html +++ chrome/browser/resources/print_preview/ui/destination_select.html -@@ -19,10 +19,6 @@ +@@ -20,10 +20,6 @@ @@ -112,10 +112,10 @@ index b59728f623e3..6fd443962836 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index c3a1e237fd6c..7f1e500f853c 100644 +index bb362bbd321e..ba5a9336ec6a 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -@@ -178,8 +178,10 @@ PdfPrinterHandler::PdfPrinterHandler( +@@ -184,8 +184,10 @@ PdfPrinterHandler::PdfPrinterHandler( sticky_settings_(sticky_settings) {} PdfPrinterHandler::~PdfPrinterHandler() { @@ -126,7 +126,7 @@ index c3a1e237fd6c..7f1e500f853c 100644 } void PdfPrinterHandler::Reset() { -@@ -226,12 +228,14 @@ void PdfPrinterHandler::StartPrint( +@@ -232,12 +234,14 @@ void PdfPrinterHandler::StartPrint( return; } @@ -141,7 +141,7 @@ index c3a1e237fd6c..7f1e500f853c 100644 DCHECK(!print_callback_); print_callback_ = std::move(callback); -@@ -370,7 +374,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -380,7 +384,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -153,7 +153,7 @@ index c3a1e237fd6c..7f1e500f853c 100644 return; } -@@ -380,8 +388,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -391,8 +399,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -168,7 +168,7 @@ index c3a1e237fd6c..7f1e500f853c 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -397,6 +411,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) { +@@ -408,6 +422,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) { FileSelected(path, 0, nullptr); } @@ -176,7 +176,7 @@ index c3a1e237fd6c..7f1e500f853c 100644 void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, const base::FilePath& directory) { base::FilePath path = directory.Append(filename); -@@ -421,5 +436,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -432,6 +447,37 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, &file_type_info, 0, base::FilePath::StringType(), platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -212,9 +212,10 @@ index c3a1e237fd6c..7f1e500f853c 100644 +} +#endif - } // namespace printing + base::FilePath PdfPrinterHandler::GetSaveLocation() const { + #if defined(OS_CHROMEOS) diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h -index 0881b3dd9303..4df6883d4d05 100644 +index 26954aeae08f..025ecfa9aceb 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h @@ -11,9 +11,14 @@ @@ -259,10 +260,10 @@ index 0881b3dd9303..4df6883d4d05 100644 + const std::vector& file_paths); +#endif - Profile* const profile_; - PrintPreviewStickySettings* const sticky_settings_; + // Return save location as the Drive mount or fetch from Download Preferences. + base::FilePath GetSaveLocation() const; diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index a61439ed8cae..3e210caffafe 100644 +index ba451b6c854d..0f062e69fd47 100644 --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -24,6 +24,7 @@ @@ -273,7 +274,7 @@ index a61439ed8cae..3e210caffafe 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" #include "chrome/browser/browser_process.h" -@@ -1244,7 +1245,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1254,7 +1255,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return extension_printer_handler_.get(); } @@ -282,7 +283,7 @@ index a61439ed8cae..3e210caffafe 100644 if (printer_type == PrinterType::kPrivet) { if (!privet_printer_handler_) { privet_printer_handler_ = -@@ -1252,6 +1253,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1262,6 +1263,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -292,7 +293,7 @@ index a61439ed8cae..3e210caffafe 100644 #endif if (printer_type == PrinterType::kPdf) { if (!pdf_printer_handler_) { -@@ -1324,6 +1328,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, +@@ -1334,6 +1338,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, } void PrintPreviewHandler::RegisterForGaiaCookieChanges() { @@ -300,7 +301,7 @@ index a61439ed8cae..3e210caffafe 100644 DCHECK(!identity_manager_); cloud_print_enabled_ = !base::Contains(printer_type_deny_list_, PrinterType::kCloud) && -@@ -1340,6 +1345,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { +@@ -1350,6 +1355,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); identity_manager_->AddObserver(this); @@ -309,7 +310,7 @@ index a61439ed8cae..3e210caffafe 100644 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index 1d226233cce3..7ce5bc268410 100644 +index 48dfc6e95863..5b80d64f4b47 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -27,6 +27,7 @@ @@ -318,22 +319,22 @@ index 1d226233cce3..7ce5bc268410 100644 #include "build/build_config.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/browser_process.h" - #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/pdf/pdf_extension_util.h" -@@ -86,12 +87,16 @@ namespace printing { + #include "chrome/browser/printing/background_printing_manager.h" +@@ -80,12 +81,16 @@ namespace printing { namespace { +#if BUILDFLAG(ENABLE_CEF) +const char kBasicPrintShortcut[] = ""; +#else - #if defined(OS_MACOSX) + #if defined(OS_MAC) // U+0028 U+21E7 U+2318 U+0050 U+0029 in UTF8 const char kBasicPrintShortcut[] = "\x28\xE2\x8c\xA5\xE2\x8C\x98\x50\x29"; #elif !defined(OS_CHROMEOS) const char kBasicPrintShortcut[] = "(Ctrl+Shift+P)"; #endif -+#endif ++#endif // !BUILDFLAG(ENABLE_CEF) #if !BUILDFLAG(OPTIMIZE_WEBUI) constexpr char kGeneratedPath[] = diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index 3c75ad618..807fe4ee7 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index 52efa2037a31..cc1792facfca 100644 +index 17788cb2b506..9014f48ed0dd 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc @@ -133,6 +133,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) @@ -11,10 +11,10 @@ index 52efa2037a31..cc1792facfca 100644 PrintJobWorker::~PrintJobWorker() { diff --git printing/printing_context.h printing/printing_context.h -index 6a5a7c90ef5b..04c0535046dc 100644 +index 7ac9ce996ca7..7a2099349f3b 100644 --- printing/printing_context.h +++ printing/printing_context.h -@@ -131,6 +131,13 @@ class PRINTING_EXPORT PrintingContext { +@@ -133,6 +133,13 @@ class PRINTING_EXPORT PrintingContext { int job_id() const { return job_id_; } @@ -28,14 +28,14 @@ index 6a5a7c90ef5b..04c0535046dc 100644 protected: explicit PrintingContext(Delegate* delegate); -@@ -155,6 +162,10 @@ class PRINTING_EXPORT PrintingContext { +@@ -156,6 +163,10 @@ class PRINTING_EXPORT PrintingContext { + // The job id for the current job. The value is 0 if no jobs are active. int job_id_; - ++ + // Routing IDs for the frame that owns this object. + int render_process_id_ = 0; + int render_frame_id_ = 0; -+ - private: - DISALLOW_COPY_AND_ASSIGN(PrintingContext); }; + + } // namespace printing diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index fdee9ff87..d07ba6857 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 f2c4cbf78618..2a2f4d475538 100644 +index 4f914119d21b..5be76fbbda36 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -509,6 +509,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -522,6 +522,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index 8d87c5b45..915b6cbef 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index 776c050ad31b..5107091f62b4 100644 +index 0acace592ca4..66cc3c360b79 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc -@@ -31,7 +31,8 @@ +@@ -33,7 +33,8 @@ #include "ui/base/cocoa/defaults_utils.h" #endif @@ -12,7 +12,7 @@ index 776c050ad31b..5107091f62b4 100644 #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "ui/views/linux_ui/linux_ui.h" -@@ -146,7 +147,8 @@ void UpdateFromSystemSettings(blink::mojom::RendererPreferences* prefs, +@@ -155,7 +156,8 @@ void UpdateFromSystemSettings(blink::mojom::RendererPreferences* prefs, prefs->caret_blink_interval = interval; #endif diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index ab97748af..b1d9b8fb3 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,8 +1,8 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index eeb09546b453..b97a392faf74 100644 +index df4b0a7c9bb0..140574fe2886 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -865,6 +865,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) +@@ -868,6 +868,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) : delegate_(delegate), locale_resources_data_lock_(new base::Lock), max_scale_factor_(SCALE_FACTOR_100P) { @@ -15,7 +15,7 @@ index eeb09546b453..b97a392faf74 100644 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -874,6 +880,11 @@ ResourceBundle::~ResourceBundle() { +@@ -877,6 +883,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index 071ef581c..580332df8 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,11 +1,11 @@ diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index 1a7c3d74b5c5..00c166906396 100644 +index d9cd61297548..9bfbc5212ed6 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -142,13 +142,17 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): - # variable. - if 'VSINSTALLDIR' in os.environ: - del os.environ['VSINSTALLDIR'] +@@ -149,13 +149,17 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): + del os.environ['INCLUDE'] + del os.environ['LIB'] + del os.environ['LIBPATH'] - other_path = os.path.normpath(os.path.join( + script_path = os.path.normpath(os.path.join( os.environ['GYP_MSVS_OVERRIDE_PATH'], @@ -26,7 +26,7 @@ index 1a7c3d74b5c5..00c166906396 100644 if (cpu != 'x64'): # x64 is default target CPU thus any other CPU requires a target set diff --git build/vs_toolchain.py build/vs_toolchain.py -index e60770e9b4e6..edeb0c357878 100755 +index 6bc24a921272..24ee9a0a04a9 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -89,9 +89,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 6824eaa76..167cdb272 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 3ff69bf8cd7d..fe5fbf5f79fb 100644 +index 8eeff7b2af9d..be36b6b265b9 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -676,10 +676,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -675,10 +675,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,18 +19,19 @@ index 3ff69bf8cd7d..fe5fbf5f79fb 100644 } void RenderWidgetHostViewAura::WindowTitleChanged() { -@@ -1968,6 +1970,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2040,6 +2042,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // Init(), because it needs to have the layer. if (frame_sink_id_.is_valid()) window_->SetEmbedFrameSinkId(frame_sink_id_); + + // Do this after |window_| is created to avoid crashes on Win10. + // See https://crbug.com/761389. -+ RenderViewHost* rvh = RenderViewHost::From(host_); -+ if (rvh) { ++ auto web_contents = ++ WebContents::FromRenderViewHost(RenderViewHost::From(host_)); ++ if (web_contents) { + // TODO(mostynb): actually use prefs. Landing this as a separate CL + // first to rebaseline some unreliable layout tests. -+ ignore_result(rvh->GetWebkitPreferences()); ++ ignore_result(web_contents->GetOrCreateWebPreferences()); + } } diff --git a/patch/patches/service_manager_654986.patch b/patch/patches/service_manager_654986.patch index 846119645..6f8d86397 100644 --- a/patch/patches/service_manager_654986.patch +++ b/patch/patches/service_manager_654986.patch @@ -1,5 +1,5 @@ diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc -index d277d1eea17e..5f87c13a47b1 100644 +index 607618c0fad8..d55d1c2d4046 100644 --- services/service_manager/embedder/main.cc +++ services/service_manager/embedder/main.cc @@ -244,22 +244,36 @@ int RunService(MainDelegate* delegate) { @@ -37,7 +37,7 @@ index d277d1eea17e..5f87c13a47b1 100644 int exit_code = -1; base::debug::GlobalActivityTracker* tracker = nullptr; ProcessType process_type = delegate->OverrideProcessType(); --#if defined(OS_MACOSX) +-#if defined(OS_MAC) - std::unique_ptr autorelease_pool; -#endif @@ -46,7 +46,7 @@ index d277d1eea17e..5f87c13a47b1 100644 @@ -345,12 +359,7 @@ int Main(const MainParams& params) { MainDelegate::InitializeParams init_params; - #if defined(OS_MACOSX) + #if defined(OS_MAC) - // We need this pool for all the objects created before we get to the event - // loop, but we don't want to leave them hanging around until the app quits. - // Each "main" needs to flush this pool right before it goes into its main @@ -94,7 +94,7 @@ index d277d1eea17e..5f87c13a47b1 100644 if (tracker) { if (exit_code == 0) { tracker->SetProcessPhaseIfEnabled( -@@ -465,13 +474,38 @@ int Main(const MainParams& params) { +@@ -465,12 +474,38 @@ int Main(const MainParams& params) { } } @@ -105,7 +105,7 @@ index d277d1eea17e..5f87c13a47b1 100644 + MainDelegate* delegate = params.delegate; + DCHECK(delegate); + - #if defined(OS_MACOSX) + #if defined(OS_MAC) - autorelease_pool.reset(); + params.autorelease_pool.reset(); #endif @@ -117,7 +117,7 @@ index d277d1eea17e..5f87c13a47b1 100644 +} + +int Main(MainParams& params) { -+#if defined(OS_MACOSX) ++#if defined(OS_MAC) + // We need this pool for all the objects created before we get to the event + // loop, but we don't want to leave them hanging around until the app quits. + // Each "main" needs to flush this pool right before it goes into its main @@ -125,17 +125,17 @@ index d277d1eea17e..5f87c13a47b1 100644 + params.autorelease_pool = + std::make_unique(); +#endif - ++ + int exit_code = MainInitialize(params); + if (exit_code >= 0) + return exit_code; + exit_code = MainRun(params); + MainShutdown(params); + return exit_code; } - diff --git services/service_manager/embedder/main.h services/service_manager/embedder/main.h -index 57e88aa85dfe..5ed6ec2abfda 100644 +index 57e88aa85dfe..f28c9ef4c0ea 100644 --- services/service_manager/embedder/main.h +++ services/service_manager/embedder/main.h @@ -5,9 +5,15 @@ @@ -147,9 +147,9 @@ index 57e88aa85dfe..5ed6ec2abfda 100644 #include "base/component_export.h" #include "build/build_config.h" -+#if defined(OS_MACOSX) ++#if defined(OS_MAC) +#include "base/mac/scoped_nsautorelease_pool.h" -+#endif // defined(OS_MACOSX) ++#endif // defined(OS_MAC) + namespace service_manager { @@ -159,7 +159,7 @@ index 57e88aa85dfe..5ed6ec2abfda 100644 const char** argv = nullptr; #endif + -+#if defined(OS_MACOSX) ++#if defined(OS_MAC) + std::unique_ptr autorelease_pool; +#endif }; @@ -179,15 +179,15 @@ index 57e88aa85dfe..5ed6ec2abfda 100644 } // namespace service_manager diff --git services/service_manager/embedder/set_process_title.cc services/service_manager/embedder/set_process_title.cc -index 1dc53b847ef9..5432ab02a088 100644 +index a2ced5316c78..96946a2168aa 100644 --- services/service_manager/embedder/set_process_title.cc +++ services/service_manager/embedder/set_process_title.cc -@@ -44,7 +44,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { +@@ -53,7 +53,7 @@ void SetProcessTitleFromCommandLine(const char** main_argv) { bool have_argv0 = false; - #if defined(OS_LINUX) + #if defined(OS_LINUX) || defined(OS_CHROMEOS) - DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); -+ //DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); ++ // DCHECK_EQ(base::PlatformThread::CurrentId(), getpid()); if (main_argv) setproctitle_init(main_argv); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index dbb1c99bc..92584b2ef 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index b409f1bd146c..4536b21241e6 100644 +index e5160aa3ff1a..87b037e517c2 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -19,6 +19,7 @@ @@ -10,7 +10,7 @@ index b409f1bd146c..4536b21241e6 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -723,9 +724,23 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -668,9 +669,23 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( network_context_params->cookie_manager_params = CreateCookieManagerParams(profile_, *cookie_settings_); @@ -35,7 +35,7 @@ index b409f1bd146c..4536b21241e6 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -738,7 +753,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -683,7 +698,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -46,12 +46,12 @@ index b409f1bd146c..4536b21241e6 100644 // change. network_context_params->http_server_properties_path = diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 4e621c3366ab..0a8bdbc51f9c 100644 +index a9dc5ed20a9f..3ce894531a21 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -447,6 +447,11 @@ class Profile : public content::BrowserContext { - virtual bool ShouldRestoreOldSessionCookies(); - virtual bool ShouldPersistSessionCookies(); +@@ -449,6 +449,11 @@ class Profile : public content::BrowserContext { + virtual bool ShouldRestoreOldSessionCookies() const; + virtual bool ShouldPersistSessionCookies() const; + // Returns schemes that should be cookieable, if other than the defaults. + virtual base::Optional> GetCookieableSchemes() { @@ -62,7 +62,7 @@ index 4e621c3366ab..0a8bdbc51f9c 100644 // specified isolated app (or for the profile itself, if |relative_path| is // empty). diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 477b47a77211..1dca6b496350 100644 +index 265deed0e52e..89d37ae6218a 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc @@ -479,6 +479,25 @@ void CookieMonster::SetCookieableSchemes( @@ -92,7 +92,7 @@ index 477b47a77211..1dca6b496350 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index 9908e6f8e7ed..d85793db29de 100644 +index 57ce9d640ac0..8c4cc927cf15 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h @@ -184,6 +184,8 @@ class NET_EXPORT CookieMonster : public CookieStore { @@ -105,7 +105,7 @@ index 9908e6f8e7ed..d85793db29de 100644 // Enables writing session cookies into the cookie database. If this this // method is called, it must be called before first use of the instance diff --git net/cookies/cookie_store.h net/cookies/cookie_store.h -index 47f2942cd329..b226df4c358a 100644 +index 5ffbe648343d..3d9a0f2e828f 100644 --- net/cookies/cookie_store.h +++ net/cookies/cookie_store.h @@ -149,6 +149,11 @@ class NET_EXPORT CookieStore { @@ -143,10 +143,10 @@ index 1d988375b00a..e71cbc3b612f 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 3bb208bad23c..fd50ae357d3f 100644 +index 5b4588fadf4b..1f685c4d6700 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -1809,6 +1809,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -1906,6 +1906,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( } scoped_refptr session_cleanup_cookie_store; @@ -154,7 +154,7 @@ index 3bb208bad23c..fd50ae357d3f 100644 if (params_->cookie_path) { scoped_refptr client_task_runner = base::ThreadTaskRunnerHandle::Get(); -@@ -1835,18 +1836,26 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -1932,18 +1933,26 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( session_cleanup_cookie_store = base::MakeRefCounted(sqlite_store); @@ -185,7 +185,7 @@ index 3bb208bad23c..fd50ae357d3f 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 6d5110add0e3..250175c0d05f 100644 +index 87b26150440e..60c9eee375bb 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom @@ -274,6 +274,9 @@ struct NetworkContextParams { diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index 04be3f579..9ecedd9cf 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index a0034ad3a21d..bf694fdf18d0 100644 +index eead3ac6a092..372c511b6c77 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -490,10 +490,6 @@ class LoginHandlerDelegate { +@@ -487,10 +487,6 @@ class LoginHandlerDelegate { } WebContents* web_contents = web_contents_getter_.Run(); @@ -13,7 +13,7 @@ index a0034ad3a21d..bf694fdf18d0 100644 // WeakPtr is not strictly necessary here due to OnRequestCancelled. creating_login_delegate_ = true; -@@ -550,12 +546,6 @@ void OnAuthRequiredContinuation( +@@ -547,12 +543,6 @@ void OnAuthRequiredContinuation( web_contents_getter = base::BindRepeating(GetWebContents, process_id, routing_id); } @@ -26,7 +26,7 @@ index a0034ad3a21d..bf694fdf18d0 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2358,8 +2348,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2412,8 +2402,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index a0034ad3a21d..bf694fdf18d0 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2371,6 +2365,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2425,6 +2419,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( browser_context_, is_in_memory_, relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index c5e3a62f1..f4a5d22c4 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -39,10 +39,10 @@ index f92961e9f79b..f1ff80b244ef 100644 }; diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 0c523877565b..694e3bdc7d0d 100644 +index 639ba0b04bed..538147e3fcbc 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -127,6 +127,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, +@@ -139,6 +139,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, MaybeEnableAutoResize(); } @@ -54,10 +54,10 @@ index 0c523877565b..694e3bdc7d0d 100644 if (crashed_overlay_view_ == crashed_overlay_view) return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 624dcb1a4d8a..70a48e40022d 100644 +index f18eea14290b..98b60a041720 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h -@@ -82,6 +82,10 @@ class WEBVIEW_EXPORT WebView : public View, +@@ -84,6 +84,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 151c566e3..5fb5714b4 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -1,8 +1,8 @@ diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index 12d84e3d4a09..526048daac85 100644 +index d0318111b239..bcc733af5ddb 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc -@@ -116,7 +116,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( +@@ -117,7 +117,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( // If we're not incognito mode, schedule all of our file tasks to enable // disk on the storage context. @@ -13,10 +13,10 @@ index 12d84e3d4a09..526048daac85 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 13e78598fea9..f5f3fc28c46a 100644 +index 18cb0f6c588d..93ef44e197fc 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -255,7 +255,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -253,7 +253,7 @@ StoragePartition* BrowserContext::GetStoragePartition( GetStoragePartitionMap(browser_context); auto config_to_use = storage_partition_config; @@ -25,7 +25,7 @@ index 13e78598fea9..f5f3fc28c46a 100644 config_to_use = storage_partition_config.CopyWithInMemorySet(); return partition_map->Get(config_to_use, can_create); -@@ -536,7 +536,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { +@@ -575,7 +575,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { kUseInMemoryDBDefault); std::unique_ptr stats_db; @@ -35,7 +35,7 @@ index 13e78598fea9..f5f3fc28c46a 100644 std::make_unique(nullptr); } else { diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index 4f8cfb3eb34a..8c357827e893 100644 +index fdf4b2466077..938df52d348e 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc @@ -508,7 +508,7 @@ bool DatabaseTracker::LazyInit() { diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index 8ab885c17..dc15d6310 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 31f563dd4d59..a68423706c60 100644 +index b94597784004..35e977e0d88a 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -58,6 +58,8 @@ diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index 150e47498..7fbc5d4d1 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,8 +1,8 @@ diff --git ui/base/x/x11_os_exchange_data_provider.cc ui/base/x/x11_os_exchange_data_provider.cc -index 5a38c3f841bf..bb374d08ee95 100644 +index ef6463f78c6c..fa9020caea8d 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc -@@ -122,7 +122,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, +@@ -120,7 +120,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, format_map_.Insert(gfx::GetAtom(kMimeTypeMozillaURL), mem); // Set a string fallback as well. diff --git a/patch/patches/ui_gl_utils_1123950.patch b/patch/patches/ui_gl_utils_1123950.patch new file mode 100644 index 000000000..7f401a909 --- /dev/null +++ b/patch/patches/ui_gl_utils_1123950.patch @@ -0,0 +1,13 @@ +diff --git ui/gl/gl_utils.cc ui/gl/gl_utils.cc +index 2f0832c0ae75..f8a494b05e42 100644 +--- ui/gl/gl_utils.cc ++++ ui/gl/gl_utils.cc +@@ -130,7 +130,7 @@ bool ShouldForceDirectCompositionRootSurfaceFullDamage() { + if ((brga_flags & kSupportBits) == 0) + return false; + return true; +- }; ++ }(); + return should_force; + } + #endif // OS_WIN diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 80a69f30d..69d0957b8 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -1,5 +1,5 @@ diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h -index 4c08fbf43c16..e319f8b6782f 100644 +index c746b37d6278..b6cebc24b73e 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h @@ -12,8 +12,11 @@ @@ -14,7 +14,7 @@ index 4c08fbf43c16..e319f8b6782f 100644 } namespace ui { -@@ -129,6 +132,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel +@@ -133,6 +136,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel // |event_flags| is a bit mask of ui::EventFlags. virtual void ActivatedAt(int index, int event_flags); @@ -43,10 +43,10 @@ index 4c08fbf43c16..e319f8b6782f 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 383943809398..c859bd0799d3 100644 +index 3dc9e4daf46d..f5b2eb00f36f 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -614,6 +614,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { +@@ -615,6 +615,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { } } @@ -82,7 +82,7 @@ index 383943809398..c859bd0799d3 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 9ef49c1dfda4..33d02455f24b 100644 +index 4b39abb9d16c..c3b5debf995b 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h @@ -346,6 +346,10 @@ class GFX_EXPORT RenderText { @@ -96,7 +96,7 @@ index 9ef49c1dfda4..33d02455f24b 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -1045,6 +1049,8 @@ class GFX_EXPORT RenderText { +@@ -1049,6 +1053,8 @@ class GFX_EXPORT RenderText { // Tell whether or not the |layout_text_| needs an update or is up to date. mutable bool layout_text_up_to_date_ = false; @@ -106,12 +106,12 @@ index 9ef49c1dfda4..33d02455f24b 100644 }; diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index b711c5f08f80..d0d428057e5d 100644 +index e6062daf0f1b..64aefc152a81 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h -@@ -138,6 +138,8 @@ class VIEWS_EXPORT InkDropHostView : public View { - // this isn't necessary anymore. - virtual InkDrop* GetInkDrop(); +@@ -149,6 +149,8 @@ class VIEWS_EXPORT InkDropHostView : public View { + // changes, to trigger the corresponding property change notification here. + void OnInkDropHighlightedChanged(); + InkDropMode ink_drop_mode() const { return ink_drop_mode_; } + @@ -119,10 +119,10 @@ index b711c5f08f80..d0d428057e5d 100644 // Size used for the default SquareInkDropRipple. static constexpr gfx::Size kDefaultInkDropSize = gfx::Size(24, 24); diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 3aef54f32cd9..ee16da5c2670 100644 +index 77c7f6830f9c..3a683e178668 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -487,6 +487,12 @@ void LabelButton::OnThemeChanged() { +@@ -508,6 +508,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -133,13 +133,13 @@ index 3aef54f32cd9..ee16da5c2670 100644 +} + void LabelButton::StateChanged(ButtonState old_state) { - const gfx::Size previous_image_size(image_->GetPreferredSize()); - UpdateImage(); + Button::StateChanged(old_state); + ResetLabelEnabledColor(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index ac348aa7dd46..88ab098daddc 100644 +index 45692ab8b7c3..f4484c069137 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -124,6 +124,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -130,6 +130,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ui::NativeTheme::State GetForegroundThemeState( ui::NativeTheme::ExtraParams* params) const override; @@ -150,10 +150,17 @@ index ac348aa7dd46..88ab098daddc 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index febce15ff860..c373f786d0ae 100644 +index d0b00369f1a9..920df6ad1988 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -53,6 +53,20 @@ bool IsOpaque(SkColor color) { +@@ -47,12 +47,27 @@ enum LabelPropertyKey { + kLabelLineHeight, + kLabelObscured, + kLabelAllowCharacterBreak, ++ kLabelDrawStringsFlags, + }; + + bool IsOpaque(SkColor color) { return SkColorGetA(color) == SK_AlphaOPAQUE; } @@ -174,7 +181,7 @@ index febce15ff860..c373f786d0ae 100644 } // namespace namespace views { -@@ -329,6 +343,14 @@ base::string16 Label::GetTooltipText() const { +@@ -353,6 +368,15 @@ base::string16 Label::GetTooltipText() const { return tooltip_text_; } @@ -183,13 +190,14 @@ index febce15ff860..c373f786d0ae 100644 + return; + draw_strings_flags_ = flags; + full_text_->SetDrawStringsFlags(draw_strings_flags_); -+ ResetLayout(); ++ OnPropertyChanged(&full_text_ + kLabelDrawStringsFlags, ++ kPropertyEffectsPreferredSizeChanged); +} + void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); if (tooltip_text_ == tooltip_text) -@@ -603,7 +625,19 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -617,7 +641,19 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SetFontList(font_list()); render_text->set_shadows(GetShadows()); render_text->SetCursorEnabled(false); @@ -211,10 +219,10 @@ index febce15ff860..c373f786d0ae 100644 render_text->SetMultiline(multiline); render_text->SetMaxLines(multiline ? GetMaxLines() : 0); diff --git ui/views/controls/label.h ui/views/controls/label.h -index 5a45ef3cbf00..597d5f1e8767 100644 +index 6cb286abd747..d05356e9caee 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -195,6 +195,10 @@ class VIEWS_EXPORT Label : public View, +@@ -198,6 +198,10 @@ class VIEWS_EXPORT Label : public View, gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); @@ -225,7 +233,7 @@ index 5a45ef3cbf00..597d5f1e8767 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 -@@ -428,6 +432,7 @@ class VIEWS_EXPORT Label : public View, +@@ -432,6 +436,7 @@ class VIEWS_EXPORT Label : public View, bool collapse_when_hidden_ = false; int fixed_width_ = 0; int max_width_ = 0; @@ -234,10 +242,10 @@ index 5a45ef3cbf00..597d5f1e8767 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index a039303e8b9a..60d429d88aa5 100644 +index bad1730e19a0..2054d3b48e41 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2652,8 +2652,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2668,8 +2668,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -252,7 +260,7 @@ index a039303e8b9a..60d429d88aa5 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2672,8 +2677,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2688,8 +2693,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -304,10 +312,10 @@ index 158724b4752c..c82192848584 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index 6d06d6fc20ea..28722992c551 100644 +index f14eb8069141..98b1fca6c190 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1030,6 +1030,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1070,6 +1070,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); @@ -323,7 +331,7 @@ index 6d06d6fc20ea..28722992c551 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1097,6 +1106,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1137,6 +1146,13 @@ void MenuItemView::PaintMinorIconAndText( } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -338,10 +346,10 @@ index 6d06d6fc20ea..28722992c551 100644 GetMenuController() && GetMenuController()->use_touchable_layout() ? style::CONTEXT_TOUCH_MENU diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index 7d0d04e10a19..a2fbe6b62328 100644 +index b0b1cf9a7a79..17b37e84e933 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc -@@ -236,6 +236,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { +@@ -240,6 +240,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { return false; } @@ -461,7 +469,7 @@ index 3ba6950690e3..f500022cc083 100644 content_view_->GetMenuItem()->GetMenuController()->GetAnchorPosition()); diff --git ui/views/test/ui_controls_factory_desktop_aurax11.cc ui/views/test/ui_controls_factory_desktop_aurax11.cc -index 3e603f8011dc..cb64fec8d45d 100644 +index 2d80939961d7..ef2299910d75 100644 --- ui/views/test/ui_controls_factory_desktop_aurax11.cc +++ ui/views/test/ui_controls_factory_desktop_aurax11.cc @@ -154,10 +154,6 @@ class UIControlsDesktopX11 : public UIControlsAura { @@ -476,18 +484,18 @@ index 3e603f8011dc..cb64fec8d45d 100644 // Move the cursor because EnterNotify/LeaveNotify are generated with the // current mouse position as a result of XGrabPointer() diff --git ui/views/view.h ui/views/view.h -index 23b5d3ffd8be..c468ef4b6a25 100644 +index 1990d29fcae1..dcfaaa7f6f3f 100644 --- ui/views/view.h +++ ui/views/view.h -@@ -23,6 +23,7 @@ - #include "base/logging.h" +@@ -24,6 +24,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" + #include "base/optional.h" +#include "base/supports_user_data.h" #include "build/build_config.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/accessibility/ax_enums.mojom-forward.h" -@@ -273,6 +274,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -275,6 +276,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget_180_1481_1565_1677_1749.patch b/patch/patches/views_widget_180_1481_1565_1677_1749.patch index 09e185b4b..2b2fd9bb6 100644 --- a/patch/patches/views_widget_180_1481_1565_1677_1749.patch +++ b/patch/patches/views_widget_180_1481_1565_1677_1749.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 85b265f70047..691e04ddcf97 100644 +index 934195fd77d2..8aec87d4a448 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -565,6 +565,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -560,6 +560,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,10 +18,10 @@ index 85b265f70047..691e04ddcf97 100644 return renderer_frame_number_; } diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index d6363c75664b..45288fdafdee 100644 +index af80b343dcd9..507618362acd 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -66,6 +66,7 @@ class CursorManager; +@@ -65,6 +65,7 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index d6363c75664b..45288fdafdee 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -83,6 +84,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -82,6 +83,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase float current_device_scale_factor() const { return current_device_scale_factor_; } @@ -39,7 +39,7 @@ index d6363c75664b..45288fdafdee 100644 // Returns the focused RenderWidgetHost inside this |view|'s RWH. RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -117,6 +121,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -116,6 +120,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase void DisableAutoResize(const gfx::Size& new_size) override; bool IsScrollOffsetAtTop() override; float GetDeviceScaleFactor() final; @@ -61,7 +61,7 @@ index d6363c75664b..45288fdafdee 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -616,6 +628,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -620,6 +632,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // specific RenderWidgetHostView. base::Optional display_feature_; @@ -73,10 +73,10 @@ index d6363c75664b..45288fdafdee 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index df6f607a65ae..e37f7bf73f0f 100644 +index 44586cc1789a..18705ef4e6e7 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc -@@ -34,6 +34,10 @@ +@@ -37,6 +37,10 @@ #include "ui/events/keycodes/dom/dom_code.h" #include "ui/touch_selection/touch_selection_controller.h" @@ -87,9 +87,9 @@ index df6f607a65ae..e37f7bf73f0f 100644 #if defined(OS_WIN) #include "content/browser/frame_host/render_frame_host_impl.h" #include "ui/aura/window_tree_host.h" -@@ -931,6 +935,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { - ::SetFocus(hwnd); +@@ -954,6 +958,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( } + return; } +#endif +#if defined(OS_LINUX) @@ -100,10 +100,10 @@ index df6f607a65ae..e37f7bf73f0f 100644 + host->Show(); + } #endif - // TODO(wjmaclean): can host_ ever be null? - if (host_ && set_focus_on_mouse_down_or_key_event_) { + synthetic_move_position_ = center_in_screen; + } diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 4810a45aa4b0..33e32192f975 100644 +index a7222155f4ea..77ac1f864161 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h @@ -243,6 +243,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -118,28 +118,28 @@ index 4810a45aa4b0..33e32192f975 100644 + // Chromium-controlled view/window hierarchy. + virtual bool HasExternalParent() const = 0; + - #if defined(OS_MACOSX) + #if defined(OS_MAC) // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/base/x/x11_window.cc ui/base/x/x11_window.cc -index bc5f4fefa7a0..4b2e110441be 100644 +index 24dbb60257bb..59e731f9ba0b 100644 --- ui/base/x/x11_window.cc +++ ui/base/x/x11_window.cc -@@ -270,7 +270,8 @@ void XWindow::Init(const Configuration& config) { +@@ -272,7 +272,8 @@ void XWindow::Init(const Configuration& config) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(config.bounds); - req.parent = x_root_window_; + req.parent = config.parent_widget == gfx::kNullAcceleratedWidget ? -+ x_root_window_ : config.parent_widget; ++ x_root_window_ : static_cast(config.parent_widget); req.x = bounds_in_pixels_.x(); req.y = bounds_in_pixels_.y(); req.width = bounds_in_pixels_.width(); diff --git ui/base/x/x11_window.h ui/base/x/x11_window.h -index c5b0d7227a5d..69d4f6013f3d 100644 +index af282d4190dd..147a2cd9ac4c 100644 --- ui/base/x/x11_window.h +++ ui/base/x/x11_window.h -@@ -20,6 +20,7 @@ +@@ -21,6 +21,7 @@ #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size_f.h" @@ -147,7 +147,7 @@ index c5b0d7227a5d..69d4f6013f3d 100644 #include "ui/gfx/x/event.h" #include "ui/gfx/x/sync.h" #include "ui/gfx/x/x11.h" -@@ -91,6 +92,7 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow { +@@ -93,6 +94,7 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow { std::string wm_class_name; std::string wm_class_class; std::string wm_role_name; @@ -156,10 +156,10 @@ index c5b0d7227a5d..69d4f6013f3d 100644 XWindow(); diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index bc2c18233b75..4e2f72b51cdf 100644 +index c0ba5c3a156e..c12372d6e435 100644 --- ui/platform_window/x11/x11_window.cc +++ ui/platform_window/x11/x11_window.cc -@@ -97,6 +97,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig( +@@ -93,6 +93,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig( config.wm_class_class = properties.wm_class_class; config.wm_role_name = properties.wm_role_name; config.activatable = properties.activatable; @@ -181,10 +181,29 @@ index e9bb45ad238c..68f2a5ef5d0c 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 61d8b3a06783..7f9552f2b36b 100644 +index 0bdc1470708b..0f1d6960f0ea 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -@@ -315,6 +315,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( +@@ -187,6 +187,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( + escape_behavior); + } + ++gfx::Rect DesktopWindowTreeHostLinux::GetWindowBoundsInScreen() const { ++ if (!screen_bounds_.IsEmpty()) ++ return screen_bounds_; ++ return DesktopWindowTreeHostPlatform::GetWindowBoundsInScreen(); ++} ++ ++gfx::Point DesktopWindowTreeHostLinux::GetLocationOnScreenInPixels() const { ++ if (!screen_bounds_.IsEmpty()) ++ return screen_bounds_.origin(); ++ return DesktopWindowTreeHostPlatform::GetLocationOnScreenInPixels(); ++} ++ + void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { + // The input can be disabled and the widget marked as non-active in case of + // opened file-dialogs. +@@ -319,6 +331,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( properties->wm_class_class = params.wm_class_class; properties->wm_role_name = params.wm_role_name; @@ -193,8 +212,40 @@ index 61d8b3a06783..7f9552f2b36b 100644 DCHECK(!properties->x11_extension_delegate); 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 4b6a5a4476a3..c9881d4a716c 100644 +--- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h ++++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +@@ -68,6 +68,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux + // Disables event listening to make |dialog| modal. + base::OnceClosure DisableEventListening(); + ++ void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } ++ + protected: + // Overridden from DesktopWindowTreeHost: + void Init(const Widget::InitParams& params) override; +@@ -78,6 +80,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux + const gfx::Vector2d& drag_offset, + Widget::MoveLoopSource source, + Widget::MoveLoopEscapeBehavior escape_behavior) override; ++ gfx::Rect GetWindowBoundsInScreen() const override; ++ gfx::Point GetLocationOnScreenInPixels() const override; + + // PlatformWindowDelegate: + void DispatchEvent(ui::Event* event) override; +@@ -134,6 +138,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux + // destroyed. + static std::list* open_windows_; + ++ // Override the screen bounds when the host is a child window. ++ gfx::Rect screen_bounds_; ++ + // The display and the native X window hosting the root window. + base::WeakPtrFactory weak_factory_{this}; + diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index b5430b871cfc..f0d5d8521e4b 100644 +index e9e61a24dc87..7687ded2a82e 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -140,8 +140,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -211,7 +262,7 @@ index b5430b871cfc..f0d5d8521e4b 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -918,11 +922,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -915,11 +919,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -230,10 +281,10 @@ index b5430b871cfc..f0d5d8521e4b 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { 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 c0f00b6d86d3..0a4da77de31a 100644 +index 0229c1c41502..992f89126f7f 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -294,6 +294,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -293,6 +293,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -244,86 +295,8 @@ index c0f00b6d86d3..0a4da77de31a 100644 // Owned by TooltipController, but we need to forward events to it so we keep // a reference. corewm::TooltipWin* tooltip_; -diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -index af81a254b0ce..42474f1e7c1e 100644 ---- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -@@ -78,6 +78,9 @@ DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() = default; - // DesktopWindowTreeHostX11, DesktopWindowTreeHost implementation: - - void DesktopWindowTreeHostX11::Init(const Widget::InitParams& params) { -+ if (params.parent_widget != gfx::kNullAcceleratedWidget) -+ has_external_parent_ = true; -+ - DesktopWindowTreeHostLinux::Init(params); - - // Set XEventDelegate to receive selection, drag&drop and raw key events. -@@ -101,6 +104,18 @@ DesktopWindowTreeHostX11::CreateDragDropClient( - //////////////////////////////////////////////////////////////////////////////// - // DesktopWindowTreeHostX11 implementation: - -+gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { -+ if (!screen_bounds_.IsEmpty()) -+ return screen_bounds_; -+ return DesktopWindowTreeHostLinux::GetWindowBoundsInScreen(); -+} -+ -+gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const { -+ if (!screen_bounds_.IsEmpty()) -+ return screen_bounds_.origin(); -+ return DesktopWindowTreeHostLinux::GetLocationOnScreenInPixels(); -+} -+ - void DesktopWindowTreeHostX11::OnXWindowSelectionEvent(x11::Event* xev) { - DCHECK(xev); - DCHECK(drag_drop_client_); -diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -index 695019454640..9d85e934f6e5 100644 ---- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -@@ -31,12 +31,21 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, - DesktopNativeWidgetAura* desktop_native_widget_aura); - ~DesktopWindowTreeHostX11() override; - -+ void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } -+ -+ // Returns true if the widget has a external parent view/window outside of the -+ // Chromium-controlled view/window hierarchy. -+ bool has_external_parent() const { return has_external_parent_; } -+ - protected: - // Overridden from DesktopWindowTreeHost: - void Init(const Widget::InitParams& params) override; - std::unique_ptr CreateDragDropClient( - DesktopNativeCursorManager* cursor_manager) override; - -+ gfx::Rect GetWindowBoundsInScreen() const override; -+ gfx::Point GetLocationOnScreenInPixels() const override; -+ - private: - friend class DesktopWindowTreeHostX11HighDPITest; - -@@ -50,8 +59,18 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 : public DesktopWindowTreeHostLinux, - // directly. See https://crbug.com/990756. - const ui::XWindow* GetXWindow() const; - -+ // Override the screen bounds when the host is a child window. -+ gfx::Rect screen_bounds_; -+ -+ // True if the widget has a external parent view/window outside of the -+ // Chromium-controlled view/window hierarchy. -+ bool has_external_parent_ = false; -+ - DesktopDragDropClientAuraX11* drag_drop_client_ = nullptr; - -+ // True if the xwindow has already been destroyed. -+ bool xwindow_destroyed_ = false; -+ - DISALLOW_COPY_AND_ASSIGN(DesktopWindowTreeHostX11); - }; - diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index a06ebe82c33f..559ec6d0130d 100644 +index f02508580d16..a2be2ed6aa2d 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc @@ -285,7 +285,8 @@ void Widget::Init(InitParams params) { @@ -350,7 +323,7 @@ index a06ebe82c33f..559ec6d0130d 100644 } observer_manager_.Add(GetNativeTheme()); -@@ -1154,10 +1160,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1153,10 +1159,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -368,10 +341,10 @@ index a06ebe82c33f..559ec6d0130d 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 0cbc349dd3d1..3dd288962851 100644 +index 032f77d5738a..085c4df9fa8c 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -311,6 +311,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -315,6 +315,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = nullptr; @@ -381,10 +354,10 @@ index 0cbc349dd3d1..3dd288962851 100644 // the NativeWidget may specify a default size. If the parent is specified, // |bounds| is in the parent's coordinate system. If the parent is not diff --git ui/views/widget/widget_delegate.h ui/views/widget/widget_delegate.h -index 6b4ef19ee72e..08fd84fe2e6e 100644 +index fdf697d54693..d21effca6422 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -305,6 +305,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -301,6 +301,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -409,10 +382,10 @@ index 89f5b62f95df..8f6971929a12 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index db4fe784c7e1..a7af3bbb4e0a 100644 +index 5e8d267d868d..414e20ad8203 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3072,10 +3072,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3071,10 +3071,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 86b85003b..d1d3cc722 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -1,5 +1,5 @@ diff --git components/viz/host/host_display_client.cc components/viz/host/host_display_client.cc -index 3547ee865c22..2215296ffadc 100644 +index c80e6831d4af..3fd2f9e4f822 100644 --- components/viz/host/host_display_client.cc +++ components/viz/host/host_display_client.cc @@ -43,9 +43,14 @@ void HostDisplayClient::OnDisplayReceivedCALayerParams( @@ -29,7 +29,7 @@ index 3547ee865c22..2215296ffadc 100644 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) void HostDisplayClient::DidCompleteSwapWithNewSize(const gfx::Size& size) { diff --git components/viz/host/host_display_client.h components/viz/host/host_display_client.h -index cedf833d2358..04456e045304 100644 +index 521ea99a35da..47d0ae89cdf1 100644 --- components/viz/host/host_display_client.h +++ components/viz/host/host_display_client.h @@ -31,17 +31,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient { @@ -41,7 +41,7 @@ index cedf833d2358..04456e045304 100644 // mojom::DisplayClient implementation: + void UseProxyOutputDevice(UseProxyOutputDeviceCallback callback) override; + - #if defined(OS_MACOSX) + #if defined(OS_APPLE) void OnDisplayReceivedCALayerParams( const gfx::CALayerParams& ca_layer_params) override; #endif @@ -80,14 +80,12 @@ index 1026b739d283..fe562ab60ce9 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 7b6f69e3dcce..b04d7984d855 100644 +index d991c2126b23..cc51bb326e86 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -13,7 +13,10 @@ config("viz_service_implementation") { - } +@@ -14,6 +14,8 @@ config("viz_service_implementation") { viz_component("service") { -+ never_build_jumbo = true sources = [ + "//cef/libcef/browser/osr/software_output_device_proxy.cc", + "//cef/libcef/browser/osr/software_output_device_proxy.h", @@ -95,10 +93,10 @@ index 7b6f69e3dcce..b04d7984d855 100644 "display/bsp_tree.h", "display/bsp_walk_action.cc", diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc -index da8936a87cfe..2992b7616f05 100644 +index 2da653cc9c3c..e536a34dca33 100644 --- components/viz/service/display_embedder/output_surface_provider_impl.cc +++ components/viz/service/display_embedder/output_surface_provider_impl.cc -@@ -13,6 +13,7 @@ +@@ -14,6 +14,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "build/chromecast_buildflags.h" #include "cc/base/switches.h" @@ -106,7 +104,7 @@ index da8936a87cfe..2992b7616f05 100644 #include "components/viz/common/display/renderer_settings.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/service/display_embedder/gl_output_surface.h" -@@ -223,6 +224,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( +@@ -225,6 +226,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( if (headless_) return std::make_unique(); @@ -144,10 +142,10 @@ index 2bb30e5318b6..535535dd6c10 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 641a63e8c18e..cdb9a23a1f3e 100644 +index 04da825a6b5d..3c63015b9b6c 100644 --- content/browser/compositor/viz_process_transport_factory.cc +++ content/browser/compositor/viz_process_transport_factory.cc -@@ -403,8 +403,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( +@@ -407,8 +407,13 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel( compositor_data.display_private.reset(); root_params->display_private = compositor_data.display_private.BindNewEndpointAndPassReceiver(); @@ -164,10 +162,10 @@ index 641a63e8c18e..cdb9a23a1f3e 100644 compositor_data.display_client->GetBoundRemote(resize_task_runner_); diff --git mojo/public/cpp/bindings/sync_call_restrictions.h mojo/public/cpp/bindings/sync_call_restrictions.h -index 599d24e260ae..13bb4cc5910f 100644 +index c9a75d59b7eb..e4cf92fe15e8 100644 --- mojo/public/cpp/bindings/sync_call_restrictions.h +++ mojo/public/cpp/bindings/sync_call_restrictions.h -@@ -33,6 +33,7 @@ class Compositor; +@@ -29,6 +29,7 @@ class Compositor; namespace viz { class HostFrameSinkManager; @@ -175,7 +173,7 @@ index 599d24e260ae..13bb4cc5910f 100644 } namespace mojo { -@@ -86,6 +87,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { +@@ -81,6 +82,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { // For preventing frame swaps of wrong size during resize on Windows. // (https://crbug.com/811945) friend class ui::Compositor; @@ -185,10 +183,10 @@ index 599d24e260ae..13bb4cc5910f 100644 // running in the same process, so it won't block anything. // TODO(159346933) Remove once the origin isolation logic is moved outside of diff --git services/viz/privileged/mojom/compositing/display_private.mojom services/viz/privileged/mojom/compositing/display_private.mojom -index d88fab3b7d0a..54984d27a75e 100644 +index 0c9686f3c807..6fc92dda1072 100644 --- services/viz/privileged/mojom/compositing/display_private.mojom +++ services/viz/privileged/mojom/compositing/display_private.mojom -@@ -74,12 +74,14 @@ interface DisplayPrivate { +@@ -80,12 +80,14 @@ interface DisplayPrivate { }; interface DisplayClient { @@ -216,7 +214,7 @@ index 6b7fbb6cf13d..e2af75168cb9 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 438dd212d881..c2e112def4e9 100644 +index 13665946e08a..ceea7b60d44f 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -25,7 +25,9 @@ @@ -229,7 +227,7 @@ index 438dd212d881..c2e112def4e9 100644 #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" -@@ -127,6 +129,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -128,6 +130,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -244,7 +242,7 @@ index 438dd212d881..c2e112def4e9 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 -@@ -161,6 +171,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -162,6 +172,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -254,7 +252,7 @@ index 438dd212d881..c2e112def4e9 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 -@@ -424,6 +437,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -435,6 +448,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 0b030939b..300d34444 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 1afd8ac2c2cf..34d1ec7938b2 100644 +index 4dca843104ac..63020b374688 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2225,15 +2225,22 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2561,15 +2561,22 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { std::string unique_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); @@ -33,7 +33,7 @@ index 1afd8ac2c2cf..34d1ec7938b2 100644 } CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3035,6 +3042,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3368,6 +3375,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -49,13 +49,14 @@ index 1afd8ac2c2cf..34d1ec7938b2 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -6405,6 +6421,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -6850,6 +6866,10 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } + -+ for (auto& observer : observers_) -+ observer.OnFrameFocused(node->current_frame_host()); ++ observers_.ForEachObserver([&](WebContentsObserver* observer) { ++ observer->OnFrameFocused(node->current_frame_host()); ++ }); } void WebContentsImpl::DidCallFocus() { @@ -72,7 +73,7 @@ index f1dcf53ea481..192f7c0ddd04 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 40b5d17d9c73..662068b57f36 100644 +index f1c25ed4cf62..8bb6e9a374c7 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h @@ -82,8 +82,10 @@ class BrowserContext; @@ -86,7 +87,7 @@ index 40b5d17d9c73..662068b57f36 100644 class WebUI; struct CustomContextMenuContext; struct DropData; -@@ -211,6 +213,10 @@ class WebContents : public PageNavigator, +@@ -212,6 +214,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; @@ -98,10 +99,10 @@ index 40b5d17d9c73..662068b57f36 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 e545ff70c612..41cd5299898f 100644 +index a10c5caf5a4b..ef8d3c3c1056 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -61,10 +61,12 @@ class EyeDropperListener; +@@ -62,10 +62,12 @@ class EyeDropperListener; class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; @@ -114,7 +115,7 @@ index e545ff70c612..41cd5299898f 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -337,6 +339,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -338,6 +340,14 @@ class CONTENT_EXPORT WebContentsDelegate { const std::string& partition_id, SessionStorageNamespace* session_storage_namespace); @@ -130,10 +131,10 @@ index e545ff70c612..41cd5299898f 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 0cab1ba9e1ef..1f74ccca4ff2 100644 +index 3666e0357038..b82c54816894 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -599,6 +599,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -610,6 +610,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 841ca02bc..872242f3f 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,10 +10,10 @@ index ff7a8ed89e94..77f44956ff22 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index 3278250b6d3d..4a111438d58d 100644 +index abfcd20b8941..634173c64a16 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -671,6 +671,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -696,6 +696,11 @@ class BLINK_PLATFORM_EXPORT Platform { // runs during Chromium's build step). virtual bool IsTakingV8ContextSnapshot() { return false; } @@ -26,10 +26,10 @@ index 3278250b6d3d..4a111438d58d 100644 static void InitializeMainThreadCommon(Platform* platform, std::unique_ptr main_thread); diff --git third_party/blink/renderer/core/dom/document_init.cc third_party/blink/renderer/core/dom/document_init.cc -index bab98605009b..92709eee4924 100644 +index ba112d79de9a..83f5bd971bc9 100644 --- third_party/blink/renderer/core/dom/document_init.cc +++ third_party/blink/renderer/core/dom/document_init.cc -@@ -252,11 +252,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { +@@ -176,11 +176,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { // frame()->tree().top()->securityContext() returns nullptr. // For that reason, the origin must be retrieved directly from |url|. if (frame->IsMainFrame()) @@ -44,10 +44,10 @@ index bab98605009b..92709eee4924 100644 DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index 81585d785de9..726ee5466d21 100644 +index 11b7b4a63f2e..c2714178a4a4 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1483,7 +1483,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1641,7 +1641,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) return nullptr; @@ -85,10 +85,10 @@ index 0608c4defc6d..54eaa2197957 100644 void DevToolsSession::DispatchProtocolCommand( diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index 8f2a7581185b..4fd9a3c650fd 100644 +index 45ef79f88b4d..074d5ea48b12 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc -@@ -210,7 +210,8 @@ Page::Page(PageClients& page_clients) +@@ -212,7 +212,8 @@ Page::Page(PageClients& page_clients) MakeGarbageCollected(GetVisualViewport(), GetChromeClient())), link_highlight_(MakeGarbageCollected(*this)), @@ -98,7 +98,7 @@ index 8f2a7581185b..4fd9a3c650fd 100644 // TODO(pdr): Initialize |validation_message_client_| lazily. validation_message_client_( MakeGarbageCollected(*this)), -@@ -390,21 +391,41 @@ void Page::InitialStyleChanged() { +@@ -395,21 +396,41 @@ void Page::InitialStyleChanged() { } } @@ -149,7 +149,7 @@ index 8f2a7581185b..4fd9a3c650fd 100644 page->NotifyPluginsChanged(); } } -@@ -908,7 +929,8 @@ void Page::Trace(Visitor* visitor) const { +@@ -919,7 +940,8 @@ void Page::Trace(Visitor* visitor) const { visitor->Trace(link_highlight_); visitor->Trace(spatial_navigation_controller_); visitor->Trace(main_frame_); @@ -160,10 +160,10 @@ index 8f2a7581185b..4fd9a3c650fd 100644 visitor->Trace(agent_metrics_collector_); visitor->Trace(plugins_changed_observers_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index d397e83eb4d8..dff04386de22 100644 +index b6a1caadf7b7..95fafb720083 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h -@@ -145,7 +145,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -150,7 +150,8 @@ class CORE_EXPORT Page final : public GarbageCollected, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -173,7 +173,7 @@ index d397e83eb4d8..dff04386de22 100644 // Resets the plugin data for all pages in the renderer process and notifies // PluginsChangedObservers. -@@ -406,7 +407,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -431,7 +432,8 @@ class CORE_EXPORT Page final : public GarbageCollected, const Member link_highlight_; Member spatial_navigation_controller_; diff --git a/patch/patches/webkit_pointer_event_781966.patch b/patch/patches/webkit_pointer_event_781966.patch index c7a17163a..172539a36 100644 --- a/patch/patches/webkit_pointer_event_781966.patch +++ b/patch/patches/webkit_pointer_event_781966.patch @@ -1,13 +1,13 @@ diff --git third_party/blink/renderer/core/input/pointer_event_manager.cc third_party/blink/renderer/core/input/pointer_event_manager.cc -index 99b37de3d6a1..918c6a62d4e1 100644 +index 8d8f25e2f57a..5aa055ce855f 100644 --- third_party/blink/renderer/core/input/pointer_event_manager.cc +++ third_party/blink/renderer/core/input/pointer_event_manager.cc -@@ -302,7 +302,7 @@ void PointerEventManager::HandlePointerInterruption( +@@ -304,7 +304,7 @@ void PointerEventManager::HandlePointerInterruption( for (auto pointer_event : canceled_pointer_events) { // If we are sending a pointercancel we have sent the pointerevent to some // target before. -- DCHECK(element_under_pointer_.Contains(pointer_event->pointerId())); -+ // DCHECK(element_under_pointer_.Contains(pointer_event->pointerId())); +- CHECK(element_under_pointer_.Contains(pointer_event->pointerId())); ++ // CHECK(element_under_pointer_.Contains(pointer_event->pointerId())); Element* target = - element_under_pointer_.at(pointer_event->pointerId()).target; + element_under_pointer_.at(pointer_event->pointerId())->target; diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 0cce868e9..c658057de 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index baa1cec07522..57d22d50ccb7 100644 +index 4d55813fed92..f41bd4b5590e 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h -@@ -363,6 +363,7 @@ class WebView { +@@ -371,6 +371,7 @@ class WebView { // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void SetUseExternalPopupMenus(bool); @@ -11,10 +11,10 @@ index baa1cec07522..57d22d50ccb7 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 27adaed62fe2..00ea31a5995b 100644 +index 4b42cd80d5c1..cafb43ea03f1 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -215,8 +215,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { +@@ -216,8 +216,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { g_should_use_external_popup_menus = use_external_popup_menus; } @@ -30,19 +30,19 @@ index 27adaed62fe2..00ea31a5995b 100644 } namespace { -@@ -285,6 +290,7 @@ WebViewImpl::WebViewImpl( +@@ -323,6 +328,7 @@ WebViewImpl::WebViewImpl( chrome_client_(MakeGarbageCollected(this)), minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), + should_use_external_popup_menus_(g_should_use_external_popup_menus), does_composite_(does_composite), fullscreen_controller_(std::make_unique(this)), - lifecycle_state_(mojom::blink::PageLifecycleState::New()), + receiver_(this, std::move(page_handle)) { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index e2124434e0d8..e12d31e8c520 100644 +index 510c555ca5af..242a208b7328 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -118,7 +118,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -125,7 +125,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -52,7 +52,7 @@ index e2124434e0d8..e12d31e8c520 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -614,6 +615,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -645,6 +646,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -62,10 +62,10 @@ index e2124434e0d8..e12d31e8c520 100644 TransformationMatrix device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index 45bf5dc55210..d358e7c406e4 100644 +index a923d3b27d36..d9d5b6200d31 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -842,7 +842,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { +@@ -839,7 +839,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 73c779f19..95ee6f933 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,8 +1,16 @@ 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 29953fdc7c55..89dd4e61f66f 100644 +index 0a144a99349f..7d835ce02b7f 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 -@@ -21,6 +21,7 @@ +@@ -10,6 +10,7 @@ + #include + + #include "base/bind.h" ++#include "base/command_line.h" + #include "base/json/json_string_value_serializer.h" + #include "base/logging.h" + #include "base/path_service.h" +@@ -21,6 +22,7 @@ #include "base/task/thread_pool.h" #include "build/branding_buildflags.h" #include "build/build_config.h" @@ -10,7 +18,7 @@ index 29953fdc7c55..89dd4e61f66f 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.h" #include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings_factory.h" -@@ -28,6 +29,7 @@ +@@ -28,6 +30,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/common/channel_info.h" @@ -18,7 +26,7 @@ index 29953fdc7c55..89dd4e61f66f 100644 #include "components/prefs/pref_service.h" #include "components/sync/driver/about_sync_util.h" #include "components/sync/driver/sync_service.h" -@@ -274,7 +276,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -277,7 +280,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -30,7 +38,7 @@ index 29953fdc7c55..89dd4e61f66f 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); PopulateDataReductionProxyLogs(response.get()); -@@ -364,6 +370,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -368,6 +375,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -43,7 +51,7 @@ index 29953fdc7c55..89dd4e61f66f 100644 extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry::Get(profile); std::string extensions_list; -@@ -453,6 +465,8 @@ void ChromeInternalLogSource::PopulateArcPolicyStatus( +@@ -474,6 +487,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if defined(OS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { @@ -53,7 +61,7 @@ index 29953fdc7c55..89dd4e61f66f 100644 bool result = base::win::IsKeyboardPresentOnSlate(ui::GetHiddenWindow(), &reason); diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc -index 9b25ce547635..90ab09d73df8 100644 +index 4071c4a4947f..8346a85413fd 100644 --- chrome/browser/memory_details.cc +++ chrome/browser/memory_details.cc @@ -17,6 +17,7 @@ diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index 70365a025..eeb572996 100644 --- a/patch/patches/webview_plugin_2020.patch +++ b/patch/patches/webview_plugin_2020.patch @@ -1,8 +1,8 @@ diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd -index 39f6ac6a3f52..a9540fd77690 100644 +index 4d07574af45c..56299e99f49e 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -5051,7 +5051,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -5068,7 +5068,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/patch/patches/win_base_msvc_sandbox.patch b/patch/patches/win_base_msvc_sandbox.patch deleted file mode 100644 index 2ee09a0d7..000000000 --- a/patch/patches/win_base_msvc_sandbox.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git base/values.cc base/values.cc -index 5f5657935d92..8e4b33a1eb29 100644 ---- base/values.cc -+++ base/values.cc -@@ -29,20 +29,6 @@ - - namespace base { - --// base::Value must be standard layout to guarantee that writing to --// |bool_type_| then reading |type_| is defined behaviour. See: --// --// [class.union]: --// If a standard-layout union contains several standard-layout structs that --// share a common initial sequence (9.2), and if an object of this --// standard-layout union type contains one of the standard-layout structs, --// it is permitted to inspect the common initial sequence of any of --// standard-layout struct members; --// --static_assert(std::is_standard_layout::value, -- "base::Value should be a standard-layout C++ class in order " -- "to avoid undefined behaviour in its implementation!"); -- - static_assert(sizeof(Value::DoubleStorage) == sizeof(double), - "The double and DoubleStorage types should have the same size"); - diff --git a/patch/patches/win_cpp17_msvc_sandbox_2819.patch b/patch/patches/win_cpp17_msvc_sandbox_2819.patch index b99a07ac7..5b541d8de 100644 --- a/patch/patches/win_cpp17_msvc_sandbox_2819.patch +++ b/patch/patches/win_cpp17_msvc_sandbox_2819.patch @@ -15,10 +15,10 @@ index 0083efdcd9c8..6f647c31e28a 100644 static_library("double_conversion") { diff --git base/win/BUILD.gn base/win/BUILD.gn -index 33a38267a658..0d54f224d31c 100644 +index eb5dca74bcea..be10cc59b39c 100644 --- base/win/BUILD.gn +++ base/win/BUILD.gn -@@ -31,4 +31,7 @@ static_library("pe_image") { +@@ -33,4 +33,7 @@ static_library("pe_image") { "pe_image.cc", "pe_image.h", ] diff --git a/patch/patches/win_rt_2274.patch b/patch/patches/win_rt_2274.patch index adf3d8796..c2386b83b 100644 --- a/patch/patches/win_rt_2274.patch +++ b/patch/patches/win_rt_2274.patch @@ -1,8 +1,8 @@ -diff --git services/service_manager/sandbox/win/sandbox_win.cc services/service_manager/sandbox/win/sandbox_win.cc -index cde75bd07101..34f6853596d5 100644 ---- services/service_manager/sandbox/win/sandbox_win.cc -+++ services/service_manager/sandbox/win/sandbox_win.cc -@@ -959,8 +959,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( +diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc +index d63d942c7e3e..a100fb4d685f 100644 +--- sandbox/policy/win/sandbox_win.cc ++++ sandbox/policy/win/sandbox_win.cc +@@ -953,8 +953,11 @@ ResultCode SandboxWin::StartSandboxedProcess( } // TODO(wfh): Relax strict handle checks for network process until root cause // for this crash can be resolved. See https://crbug.com/939590. @@ -10,8 +10,8 @@ index cde75bd07101..34f6853596d5 100644 + if (!launcher_process_command_line.HasSwitch("win-rt-app") && + sandbox_type != SandboxType::kNetwork) { + // Don't enable this mitigation in WinRT apps. See issue #2274. - mitigations |= sandbox::MITIGATION_STRICT_HANDLE_CHECKS; + mitigations |= MITIGATION_STRICT_HANDLE_CHECKS; + } result = policy->SetDelayedProcessMitigations(mitigations); - if (result != sandbox::SBOX_ALL_OK) + if (result != SBOX_ALL_OK) diff --git a/patch/patches/win_screenlock_1058556.patch b/patch/patches/win_screenlock_1058556.patch deleted file mode 100644 index 80ae76112..000000000 --- a/patch/patches/win_screenlock_1058556.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc -index 444e19ccb601..6d696b28f417 100644 ---- content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc -+++ content/browser/screenlock_monitor/screenlock_monitor_device_source_win.cc -@@ -49,7 +49,7 @@ bool ScreenlockMonitorDeviceSource::SessionMessageWindow::OnWndProc( - if (message == WM_WTSSESSION_CHANGE) { - ProcessWTSSessionLockMessage(wparam); - } -- return true; -+ return false; - } - - void ScreenlockMonitorDeviceSource::SessionMessageWindow:: diff --git a/tests/cefclient/CMakeLists.txt.in b/tests/cefclient/CMakeLists.txt.in index 8a9924e85..2d6eb020d 100644 --- a/tests/cefclient/CMakeLists.txt.in +++ b/tests/cefclient/CMakeLists.txt.in @@ -49,7 +49,7 @@ #cefclient Mac OS X sources {{ 'prefix': 'cefclient_macosx', - 'set': 'CEFCLIENT_MACOSX_SRCS', + 'set': 'CEFCLIENT_MAC_SRCS', 'includes': [ 'shared_sources_mac', 'cefclient_sources_mac', @@ -59,7 +59,7 @@ # cefclient Mac OS X helper sources. {{ 'prefix': 'cefclient_helper', - 'set': 'CEFCLIENT_MACOSX_HELPER_SRCS', + 'set': 'CEFCLIENT_MAC_HELPER_SRCS', 'includes': [ 'shared_sources_mac_helper', ], @@ -81,7 +81,7 @@ 'set': 'CEFCLIENT_RESOURCES_SRCS', 'includes': [ 'shared_sources_resources', - 'cefclient_bundle_resources_mac:MACOSX', + 'cefclient_bundle_resources_mac:MAC', 'cefclient_sources_resources', 'cefclient_sources_resources_extensions_set_page_color', ], @@ -94,7 +94,7 @@ # Target executable names. set(CEF_TARGET "cefclient") -if(OS_MACOSX) +if(OS_MAC) set(CEF_HELPER_TARGET "cefclient_Helper") set(CEF_HELPER_OUTPUT_NAME "cefclient Helper") else() @@ -151,7 +151,7 @@ endif() # Mac OS X configuration. # -if(OS_MACOSX) +if(OS_MAC) option(OPTION_USE_ARC "Build with ARC (automatic Reference Counting) on macOS." ON) if(OPTION_USE_ARC) list(APPEND CEF_COMPILER_FLAGS @@ -168,7 +168,7 @@ if(OS_MACOSX) ${CEFCLIENT_BROWSER_SRCS} ${CEFCLIENT_COMMON_SRCS} ${CEFCLIENT_RESOURCES_SRCS} - ${CEFCLIENT_MACOSX_SRCS} + ${CEFCLIENT_MAC_SRCS} ) # All sources required by the "cefclient Helper" target. Generates an app @@ -176,7 +176,7 @@ if(OS_MACOSX) set(CEFCLIENT_HELPER_SRCS ${CEFCLIENT_COMMON_SRCS} ${CEFCLIENT_RENDERER_SRCS} - ${CEFCLIENT_MACOSX_HELPER_SRCS} + ${CEFCLIENT_MAC_HELPER_SRCS} ) # Output path for the main app bundle. @@ -270,7 +270,7 @@ if(OS_MACOSX) "resources/" "../shared/resources/" ) - COPY_MACOSX_RESOURCES("${CEFCLIENT_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") + COPY_MAC_RESOURCES("${CEFCLIENT_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") endif() diff --git a/tests/cefclient/browser/client_types.h b/tests/cefclient/browser/client_types.h index 2eefd1901..092c71127 100644 --- a/tests/cefclient/browser/client_types.h +++ b/tests/cefclient/browser/client_types.h @@ -17,13 +17,13 @@ #define ClientWindowHandle CefWindowHandle #endif -#if defined(OS_MACOSX) +#if defined(OS_MAC) #define ClientNativeMacWindow void* #ifdef __OBJC__ #define CAST_CLIENT_NATIVE_MAC_WINDOW_TO_NSWINDOW(native) \ (__bridge NSWindow*)native #define CAST_NSWINDOW_TO_CLIENT_NATIVE_MAC_WINDOW(window) (__bridge void*)window #endif // __OBJC__ -#endif // defined OS_MACOSX +#endif // defined OS_MAC #endif // CEF_TESTS_CEFCLIENT_BROWSER_CLIENT_TYPES_H_ diff --git a/tests/cefclient/browser/osr_accessibility_node.h b/tests/cefclient/browser/osr_accessibility_node.h index ece83c018..ab8881915 100644 --- a/tests/cefclient/browser/osr_accessibility_node.h +++ b/tests/cefclient/browser/osr_accessibility_node.h @@ -10,7 +10,7 @@ #include "include/cef_browser.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) typedef void CefNativeAccessible; #if __OBJC__ #if __has_feature(objc_arc) diff --git a/tests/cefclient/browser/osr_renderer.cc b/tests/cefclient/browser/osr_renderer.cc index de2473af0..7a55c8fb9 100644 --- a/tests/cefclient/browser/osr_renderer.cc +++ b/tests/cefclient/browser/osr_renderer.cc @@ -6,7 +6,7 @@ #if defined(OS_WIN) #include -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include #elif defined(OS_LINUX) #include diff --git a/tests/cefclient/browser/root_window.h b/tests/cefclient/browser/root_window.h index b73fc514a..b089ba7e7 100644 --- a/tests/cefclient/browser/root_window.h +++ b/tests/cefclient/browser/root_window.h @@ -17,9 +17,9 @@ #include "tests/cefclient/browser/image_cache.h" #include "tests/shared/browser/main_message_loop.h" -#if defined(OS_MACOSX) && __OBJC__ +#if defined(OS_MAC) && __OBJC__ @class NSWindow; -#endif // defined(OS_MACOSX) && __OBJC__ +#endif // defined(OS_MAC) && __OBJC__ namespace client { @@ -121,7 +121,7 @@ class RootWindow // called on the main thread. static scoped_refptr GetForBrowser(int browser_id); -#if defined(OS_MACOSX) && __OBJC__ +#if defined(OS_MAC) && __OBJC__ // Returns the RootWindow associated with the specified |window|. Must be // called on the main thread. static scoped_refptr GetForNSWindow(NSWindow* window); diff --git a/tests/cefclient/browser/root_window_create.cc b/tests/cefclient/browser/root_window_create.cc index 04e347c63..563971621 100644 --- a/tests/cefclient/browser/root_window_create.cc +++ b/tests/cefclient/browser/root_window_create.cc @@ -12,7 +12,7 @@ #include "tests/cefclient/browser/root_window_win.h" #elif defined(OS_LINUX) #include "tests/cefclient/browser/root_window_gtk.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "tests/cefclient/browser/root_window_mac.h" #endif @@ -32,7 +32,7 @@ scoped_refptr RootWindow::Create(bool use_views) { return new RootWindowWin(); #elif defined(OS_LINUX) return new RootWindowGtk(); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return new RootWindowMac(); #endif diff --git a/tests/cefclient/browser/temp_window.h b/tests/cefclient/browser/temp_window.h index 499c80afa..391bba475 100644 --- a/tests/cefclient/browser/temp_window.h +++ b/tests/cefclient/browser/temp_window.h @@ -12,7 +12,7 @@ #include "tests/cefclient/browser/temp_window_win.h" #elif defined(OS_LINUX) #include "tests/cefclient/browser/temp_window_x11.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "tests/cefclient/browser/temp_window_mac.h" #endif @@ -22,7 +22,7 @@ namespace client { typedef TempWindowWin TempWindow; #elif defined(OS_LINUX) typedef TempWindowX11 TempWindow; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) typedef TempWindowMac TempWindow; #endif diff --git a/tests/cefclient/browser/window_test.cc b/tests/cefclient/browser/window_test.cc index 4cb0461d9..cfe538289 100644 --- a/tests/cefclient/browser/window_test.cc +++ b/tests/cefclient/browser/window_test.cc @@ -23,7 +23,7 @@ #include "tests/cefclient/browser/window_test_runner_win.h" #elif defined(OS_LINUX) #include "tests/cefclient/browser/window_test_runner_gtk.h" -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) #include "tests/cefclient/browser/window_test_runner_mac.h" #endif @@ -49,7 +49,7 @@ scoped_ptr CreateWindowTestRunner() { return scoped_ptr(new WindowTestRunnerWin()); #elif defined(OS_LINUX) return scoped_ptr(new WindowTestRunnerGtk()); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) return scoped_ptr(new WindowTestRunnerMac()); #else #error "No implementation available for your platform." diff --git a/tests/cefsimple/CMakeLists.txt.in b/tests/cefsimple/CMakeLists.txt.in index 12b1c84f5..9eb0824ac 100644 --- a/tests/cefsimple/CMakeLists.txt.in +++ b/tests/cefsimple/CMakeLists.txt.in @@ -13,7 +13,7 @@ 'includes': [ 'cefsimple_sources_common', 'cefsimple_sources_win:WINDOWS', - 'cefsimple_sources_mac:MACOSX', + 'cefsimple_sources_mac:MAC', 'cefsimple_sources_linux:LINUX', ], }} @@ -22,7 +22,7 @@ {{ 'prefix': 'cefsimple_helper', 'includes': [ - 'cefsimple_sources_mac_helper:MACOSX', + 'cefsimple_sources_mac_helper:MAC', ], }} @@ -31,7 +31,7 @@ 'prefix': 'cefsimple_resources', 'set': 'CEFSIMPLE_RESOURCES_SRCS', 'includes': [ - 'cefsimple_bundle_resources_mac:MACOSX', + 'cefsimple_bundle_resources_mac:MAC', ], }} @@ -42,7 +42,7 @@ # Target executable names. set(CEF_TARGET "cefsimple") -if(OS_MACOSX) +if(OS_MAC) set(CEF_HELPER_TARGET "cefsimple_Helper") set(CEF_HELPER_OUTPUT_NAME "cefsimple Helper") else() @@ -86,7 +86,7 @@ endif() # Mac OS X configuration. # -if(OS_MACOSX) +if(OS_MAC) option(OPTION_USE_ARC "Build with ARC (automatic Reference Counting) on macOS." ON) if(OPTION_USE_ARC) list(APPEND CEF_COMPILER_FLAGS @@ -184,7 +184,7 @@ if(OS_MACOSX) # directive but that doesn't properly handle nested resource directories. # Remove these prefixes from input file paths. set(PREFIXES "mac/") - COPY_MACOSX_RESOURCES("${CEFSIMPLE_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") + COPY_MAC_RESOURCES("${CEFSIMPLE_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") endif() diff --git a/tests/ceftests/CMakeLists.txt.in b/tests/ceftests/CMakeLists.txt.in index cdda2b7be..8970efb35 100644 --- a/tests/ceftests/CMakeLists.txt.in +++ b/tests/ceftests/CMakeLists.txt.in @@ -14,13 +14,13 @@ 'shared_sources_browser', 'shared_sources_common', 'shared_sources_linux:LINUX', - 'shared_sources_mac:MACOSX', + 'shared_sources_mac:MAC', 'shared_sources_renderer:WINDOWS', 'shared_sources_renderer:LINUX', 'shared_sources_win:WINDOWS', 'ceftests_sources_common', 'ceftests_sources_linux:LINUX', - 'ceftests_sources_mac:MACOSX', + 'ceftests_sources_mac:MAC', 'ceftests_sources_views:WINDOWS', 'ceftests_sources_views:LINUX', 'ceftests_sources_win:WINDOWS', @@ -33,9 +33,9 @@ 'set': 'UNITTESTS_HELPER_SRCS', 'includes': [ 'shared_sources_common', - 'shared_sources_mac_helper:MACOSX', + 'shared_sources_mac_helper:MAC', 'shared_sources_renderer', - 'ceftests_sources_mac_helper:MACOSX', + 'ceftests_sources_mac_helper:MAC', ], }} @@ -45,7 +45,7 @@ 'set': 'UNITTESTS_RESOURCES_SRCS', 'includes': [ 'shared_sources_resources', - 'ceftests_bundle_resources_mac:MACOSX', + 'ceftests_bundle_resources_mac:MAC', ], }} @@ -56,7 +56,7 @@ # Target executable names. set(CEF_TARGET "ceftests") -if(OS_MACOSX) +if(OS_MAC) set(CEF_HELPER_TARGET "ceftests_Helper") set(CEF_HELPER_OUTPUT_NAME "ceftests Helper") else() @@ -103,7 +103,7 @@ endif() # Mac OS X configuration. # -if(OS_MACOSX) +if(OS_MAC) # Output path for the main app bundle. set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app") @@ -194,7 +194,7 @@ if(OS_MACOSX) "resources/mac/" "../shared/resources/" ) - COPY_MACOSX_RESOURCES("${UNITTESTS_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") + COPY_MAC_RESOURCES("${UNITTESTS_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") endif() diff --git a/tests/ceftests/navigation_unittest.cc b/tests/ceftests/navigation_unittest.cc index 99e1a5544..9318205c4 100644 --- a/tests/ceftests/navigation_unittest.cc +++ b/tests/ceftests/navigation_unittest.cc @@ -1753,7 +1753,7 @@ class LoadNavTestHandler : public TestHandler { CefMouseEvent mouse_event; mouse_event.x = 20; mouse_event.y = 20; -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Use cmd instead of ctrl on OS X. mouse_event.modifiers = (mode_ == CTRL_LEFT_CLICK ? EVENTFLAG_COMMAND_DOWN : 0); diff --git a/tests/ceftests/os_rendering_unittest.cc b/tests/ceftests/os_rendering_unittest.cc index 37c7af593..610c03593 100644 --- a/tests/ceftests/os_rendering_unittest.cc +++ b/tests/ceftests/os_rendering_unittest.cc @@ -13,7 +13,7 @@ #include "tests/shared/browser/geometry_util.h" #include "tests/shared/browser/resource_util.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include // For character codes. #include "tests/ceftests/os_rendering_unittest_mac.h" #elif defined(OS_LINUX) @@ -37,7 +37,7 @@ const int kOsrHeight = 400; // bounding client rects for edit box and navigate button #if defined(OS_WIN) const CefRect kExpandedSelectRect(462, 42, 81, 334); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) const CefRect kExpandedSelectRect(462, 42, 75, 334); #elif defined(OS_LINUX) const CefRect kExpandedSelectRect(462, 42, 79, 334); @@ -63,7 +63,7 @@ const unsigned int kNativeKeyTestCodes[] = {XK_d, XK_o, XK_n, XK_e}; const unsigned int kNativeKeyEscape = XK_Escape; const unsigned int kNativeKeyTab = XK_Tab; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) // See kKeyCodesMap in ui/events/keycodes/keyboard_code_conversion_mac.mm #define VKEY_D 'd' @@ -81,7 +81,7 @@ const unsigned int kNativeKeyTab = kVK_Tab; #endif -#if defined(OS_MACOSX) || defined(OS_LINUX) +#if defined(OS_MAC) || defined(OS_LINUX) const unsigned int kKeyTestCodes[] = {VKEY_D, VKEY_O, VKEY_N, VKEY_E}; @@ -557,7 +557,7 @@ class OSRTestHandler : public RoutingTestHandler, #if defined(OS_WIN) SendKeyEvent(browser, VK_TAB); -#elif defined(OS_MACOSX) || defined(OS_LINUX) +#elif defined(OS_MAC) || defined(OS_LINUX) SendKeyEvent(browser, kNativeKeyTab, VKEY_TAB); #else #error "Unsupported platform" @@ -674,7 +674,7 @@ class OSRTestHandler : public RoutingTestHandler, for (size_t i = 0; i < word_length; ++i) { #if defined(OS_WIN) SendKeyEvent(browser, kKeyTestWord[i]); -#elif defined(OS_MACOSX) || defined(OS_LINUX) +#elif defined(OS_MAC) || defined(OS_LINUX) SendKeyEvent(browser, kNativeKeyTestCodes[i], kKeyTestCodes[i]); #else #error "Unsupported platform" @@ -760,7 +760,7 @@ class OSRTestHandler : public RoutingTestHandler, } else if (type == PET_POPUP) { #if defined(OS_WIN) SendKeyEvent(browser, VK_ESCAPE); -#elif defined(OS_MACOSX) || defined(OS_LINUX) +#elif defined(OS_MAC) || defined(OS_LINUX) SendKeyEvent(browser, kNativeKeyEscape, VKEY_ESCAPE); #else #error "Unsupported platform" @@ -886,7 +886,7 @@ class OSRTestHandler : public RoutingTestHandler, for (size_t i = 0; i < word_length; ++i) { #if defined(OS_WIN) SendKeyEvent(browser, kKeyTestWord[i]); -#elif defined(OS_MACOSX) || defined(OS_LINUX) +#elif defined(OS_MAC) || defined(OS_LINUX) SendKeyEvent(browser, kNativeKeyTestCodes[i], kKeyTestCodes[i]); #else #error "Unsupported platform" @@ -927,7 +927,7 @@ class OSRTestHandler : public RoutingTestHandler, for (size_t i = 0; i < word_length; ++i) { #if defined(OS_WIN) SendKeyEvent(browser, kKeyTestWord[i]); -#elif defined(OS_MACOSX) || defined(OS_LINUX) +#elif defined(OS_MAC) || defined(OS_LINUX) SendKeyEvent(browser, kNativeKeyTestCodes[i], kKeyTestCodes[i]); #else #error "Unsupported platform" @@ -1328,7 +1328,7 @@ class OSRTestHandler : public RoutingTestHandler, #if defined(OS_WIN) windowInfo.SetAsWindowless(GetDesktopWindow()); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) // An actual vies is needed only for the ContextMenu test. The menu runner // checks if the view is not nil before showing the context menu. if (test_type_ == OSR_TEST_CONTEXT_MENU) @@ -1384,7 +1384,7 @@ class OSRTestHandler : public RoutingTestHandler, } bool ExpectComputedPopupSize() const { -#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MACOSX)) +#if defined(OS_WIN) || (defined(OS_POSIX) && !defined(OS_MAC)) // On Windows the device scale factor is ignored in Blink when computing // the default form control font size (see https://crbug.com/674663#c11). // This results in better font size display but also means that we won't @@ -1436,7 +1436,7 @@ class OSRTestHandler : public RoutingTestHandler, } void SendKeyEvent(CefRefPtr browser, -#if defined(OS_LINUX) || defined(OS_MACOSX) +#if defined(OS_LINUX) || defined(OS_MAC) unsigned int native_key_code, #endif int key_code) { @@ -1450,7 +1450,7 @@ class OSRTestHandler : public RoutingTestHandler, event.native_key_code = (scanCode << 16) | // key scan code 1; // key repeat count event.windows_key_code = VkCode; -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) event.native_key_code = native_key_code; // Note that this is only correct for lower-case characters. If |key_code| // was an upper-case character then |event.character| would be the upper- diff --git a/tests/ceftests/osr_accessibility_unittest.cc b/tests/ceftests/osr_accessibility_unittest.cc index 0cf10a490..0586883bb 100644 --- a/tests/ceftests/osr_accessibility_unittest.cc +++ b/tests/ceftests/osr_accessibility_unittest.cc @@ -214,7 +214,7 @@ class AccessibilityTestHandler : public TestHandler, #if defined(OS_WIN) windowInfo.SetAsWindowless(GetDesktopWindow()); -#elif defined(OS_MACOSX) +#elif defined(OS_MAC) windowInfo.SetAsWindowless(kNullWindowHandle); #elif defined(OS_LINUX) windowInfo.SetAsWindowless(kNullWindowHandle); diff --git a/tests/ceftests/run_all_unittests.cc b/tests/ceftests/run_all_unittests.cc index 7b7f5b953..ba72a06ee 100644 --- a/tests/ceftests/run_all_unittests.cc +++ b/tests/ceftests/run_all_unittests.cc @@ -32,7 +32,7 @@ #include "tests/shared/common/client_app_other.h" #include "tests/shared/renderer/client_app_renderer.h" -#if defined(OS_MACOSX) +#if defined(OS_MAC) #include "include/wrapper/cef_library_loader.h" #endif @@ -108,7 +108,7 @@ int XIOErrorHandlerImpl(Display* display) { } // namespace int main(int argc, char* argv[]) { -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Load the CEF framework library at runtime instead of linking directly // as required by the macOS sandbox implementation. CefScopedLibraryLoader library_loader; @@ -144,7 +144,7 @@ int main(int argc, char* argv[]) { client::ClientApp::GetProcessType(test_suite.command_line()); if (process_type == client::ClientApp::BrowserProcess) { app = new client::ClientAppBrowser(); -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) } else if (process_type == client::ClientApp::RendererProcess || process_type == client::ClientApp::ZygoteProcess) { app = new client::ClientAppRenderer(); @@ -171,7 +171,7 @@ int main(int argc, char* argv[]) { test_suite.GetSettings(settings); -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Platform-specific initialization. extern void PlatformInit(); PlatformInit(); @@ -240,7 +240,7 @@ int main(int argc, char* argv[]) { // Destroy the MessageLoop. message_loop.reset(nullptr); -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Platform-specific cleanup. extern void PlatformCleanup(); PlatformCleanup(); diff --git a/tests/ceftests/test_request.cc b/tests/ceftests/test_request.cc index 216e6290d..3511e65be 100644 --- a/tests/ceftests/test_request.cc +++ b/tests/ceftests/test_request.cc @@ -113,15 +113,15 @@ void Send(const SendConfig& config, const RequestDoneCallback& callback) { std::string GetPathURL(const std::string& url) { const size_t index1 = url.find('?'); const size_t index2 = url.find('#'); - size_t index = -1; - if (index1 >= 0 && index2 >= 0) { + size_t index = std::string::npos; + if (index1 != std::string::npos && index2 != std::string::npos) { index = std::min(index1, index2); - } else if (index1 >= 0) { + } else if (index1 != std::string::npos) { index = index1; - } else if (index2 >= 0) { + } else if (index2 != std::string::npos) { index = index2; } - if (index >= 0) { + if (index != std::string::npos) { return url.substr(0, index); } return url; diff --git a/tests/ceftests/test_server.cc b/tests/ceftests/test_server.cc index a907d3b75..ecfe628d3 100644 --- a/tests/ceftests/test_server.cc +++ b/tests/ceftests/test_server.cc @@ -510,4 +510,4 @@ void ObserverHelper::OnUnregistered() { OnShutdown(); } -} // namespace test_server \ No newline at end of file +} // namespace test_server diff --git a/tests/ceftests/urlrequest_unittest.cc b/tests/ceftests/urlrequest_unittest.cc index bfbee95d3..8406b75fd 100644 --- a/tests/ceftests/urlrequest_unittest.cc +++ b/tests/ceftests/urlrequest_unittest.cc @@ -2362,6 +2362,11 @@ class RequestTestRunner : public base::RefCountedThreadSafe { // Send a request. |complete_callback| will be executed on request completion. void SendRequest(const test_request::RequestDoneCallback& done_callback) { + if (!is_browser_process_) { + // Render process requests must use CefFrame::CreateURLRequest. + EXPECT_TRUE(use_frame_method_); + } + test_request::SendConfig config; if (settings_.redirect_request) @@ -3210,9 +3215,8 @@ bool IsTestSupported(RequestTestMode test_mode, bool test_in_browser, bool test_server_backend, bool test_frame_method) { - if (!test_in_browser && !test_server_backend && !test_frame_method) { - // Requests from the render process can only reach non-server backends when - // using the CefFrame::CreateURLRequest method. + if (!test_in_browser && !test_frame_method) { + // Render process requests must use CefFrame::CreateURLRequest. return false; } diff --git a/tests/ceftests/v8_unittest.cc b/tests/ceftests/v8_unittest.cc index f720603f0..b46c33b50 100644 --- a/tests/ceftests/v8_unittest.cc +++ b/tests/ceftests/v8_unittest.cc @@ -367,7 +367,7 @@ class V8RendererTest : public ClientAppRenderer::Delegate, CefTime date; date.year = 2200; date.month = 4; -#if !defined(OS_MACOSX) +#if !defined(OS_MAC) date.day_of_week = 5; #endif date.day_of_month = 11; diff --git a/tests/shared/browser/client_app_browser.cc b/tests/shared/browser/client_app_browser.cc index a6253f914..e37d0cc54 100644 --- a/tests/shared/browser/client_app_browser.cc +++ b/tests/shared/browser/client_app_browser.cc @@ -47,7 +47,7 @@ void ClientAppBrowser::OnBeforeCommandLineProcessing( command_line->AppendSwitch("disable-gpu-shader-disk-cache"); } -#if defined(OS_MACOSX) +#if defined(OS_MAC) // Disable the toolchain prompt on macOS. command_line->AppendSwitch("use-mock-keychain"); #endif diff --git a/tools/automate/automate-git.py b/tools/automate/automate-git.py index e33b7016c..e37478a82 100644 --- a/tools/automate/automate-git.py +++ b/tools/automate/automate-git.py @@ -679,7 +679,7 @@ parser.add_option( help="Output commands without executing them.") parser.add_option('--dry-run-platform', dest='dryrunplatform', default=None, help='Simulate a dry run on the specified platform '+\ - '(windows, macosx, linux). Must be used in combination'+\ + '(windows, mac, linux). Must be used in combination'+\ ' with the --dry-run flag.') # Update-related options. @@ -970,13 +970,13 @@ if (options.buildtests or options.runtests) and len(options.testtarget) == 0: # Operating system. if options.dryrun and options.dryrunplatform is not None: platform = options.dryrunplatform - if not platform in ['windows', 'macosx', 'linux']: + if not platform in ['windows', 'mac', 'linux']: print('Invalid dry-run-platform value: %s' % (platform)) sys.exit() elif sys.platform == 'win32': platform = 'windows' elif sys.platform == 'darwin': - platform = 'macosx' + platform = 'mac' elif sys.platform.startswith('linux'): platform = 'linux' else: @@ -1039,15 +1039,15 @@ if options.arm64build: deps_file = 'DEPS' -if platform == 'macosx' and not options.x64build: - print('32-bit Mac OS X builds are not supported. ' + +if platform == 'mac' and not options.x64build: + print('32-bit MacOS builds are not supported. ' + 'Add --x64-build flag to generate a 64-bit build.') sys.exit() # Platforms that build a cef_sandbox library. sandbox_lib_platforms = ['windows'] if branch_is_3538_or_newer: - sandbox_lib_platforms.append('macosx') + sandbox_lib_platforms.append('mac') if not platform in sandbox_lib_platforms and (options.sandboxdistrib or options.sandboxdistribonly): @@ -1531,7 +1531,7 @@ elif not options.nobuild: if options.runtests: if platform == 'windows': test_exe = '%s.exe' % options.testtarget - elif platform == 'macosx': + elif platform == 'mac': test_exe = '%s.app/Contents/MacOS/%s' % (options.testtarget, options.testtarget) elif platform == 'linux': diff --git a/tools/cef_api_hash.py b/tools/cef_api_hash.py index 85b538d2f..080a79788 100644 --- a/tools/cef_api_hash.py +++ b/tools/cef_api_hash.py @@ -35,7 +35,7 @@ class cef_api_hash: self.__debug_enabled = not (self.__debugdir is None) and len(self.__debugdir) > 0 - self.platforms = ["windows", "macosx", "linux"] + self.platforms = ["windows", "mac", "linux"] self.platform_files = { # List of includes_win_capi from cef_paths2.gypi. @@ -43,7 +43,7 @@ class cef_api_hash: "internal/cef_types_win.h", ], # List of includes_mac_capi from cef_paths2.gypi. - "macosx": [ + "mac": [ "internal/cef_types_mac.h", ], # List of includes_linux_capi from cef_paths2.gypi. diff --git a/tools/cefbuilds/cef_html_builder.py b/tools/cefbuilds/cef_html_builder.py index f8fbc2af4..334cfb95a 100644 --- a/tools/cefbuilds/cef_html_builder.py +++ b/tools/cefbuilds/cef_html_builder.py @@ -126,7 +126,7 @@ class cef_html_builder: 'linux64': 'Linux 64-bit', 'linuxarm': 'Linux ARM', 'linuxarm64': 'Linux ARM64', - 'macosx64': 'Mac OS X 64-bit', + 'macosx64': 'MacOS 64-bit', 'windows32': 'Windows 32-bit', 'windows64': 'Windows 64-bit' }[platform] diff --git a/tools/gclient_hook.py b/tools/gclient_hook.py index f0be2d46b..6458bafdb 100644 --- a/tools/gclient_hook.py +++ b/tools/gclient_hook.py @@ -21,7 +21,7 @@ src_dir = os.path.abspath(os.path.join(cef_dir, os.pardir)) if sys.platform == 'win32': platform = 'windows' elif sys.platform == 'darwin': - platform = 'macosx' + platform = 'mac' elif sys.platform.startswith('linux'): platform = 'linux' else: diff --git a/tools/gn_args.py b/tools/gn_args.py index be13a7513..0a6516530 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -75,7 +75,7 @@ src_dir = os.path.abspath(os.path.join(cef_dir, os.pardir)) if sys.platform == 'win32': platform = 'windows' elif sys.platform == 'darwin': - platform = 'macosx' + platform = 'mac' elif sys.platform.startswith('linux'): platform = 'linux' else: @@ -281,7 +281,7 @@ def GetRequiredArgs(): # can't be enforced by assert(). result['enable_linux_installer'] = False - if platform == 'macosx': + if platform == 'mac': # Always generate dSYM files. The make_distrib script will fail if # enable_dsyms=true is not explicitly set when is_official_build=false. result['enable_dsyms'] = True @@ -330,7 +330,7 @@ def ValidateArgs(args): # - Windows supports "x86" and "x64". # - Mac supports only "x64". # - Linux supports only "x64" unless using a sysroot environment. - if platform == 'macosx': + if platform == 'mac': assert target_cpu == 'x64', 'target_cpu must be "x64"' elif platform == 'windows': assert target_cpu in ( @@ -546,7 +546,7 @@ def GetAllPlatformConfigs(build_args): supported_cpus = ['x86', 'x64'] if os.environ.get('CEF_ENABLE_ARM64', '') == '1': supported_cpus.append('arm64') - elif platform == 'macosx': + elif platform == 'mac': supported_cpus = ['x64'] else: raise Exception('Unsupported platform') @@ -556,7 +556,7 @@ def GetAllPlatformConfigs(build_args): result['Debug_GN_' + cpu] = GetConfigArgs(args, True, cpu) result['Release_GN_' + cpu] = GetConfigArgs(args, False, cpu) - if platform in ('windows', 'macosx') and GetArgValue( + if platform in ('windows', 'mac') and GetArgValue( args, 'is_official_build'): # Build cef_sandbox.lib with a different configuration. if create_debug: @@ -585,7 +585,7 @@ if __name__ == '__main__': # Allow override of the platform via the command-line for testing. if len(sys.argv) > 1: platform = sys.argv[1] - if not platform in ('linux', 'macosx', 'windows'): + if not platform in ('linux', 'mac', 'windows'): sys.stderr.write('Usage: %s \n' % sys.argv[0]) sys.exit() diff --git a/tools/make_api_hash_header.py b/tools/make_api_hash_header.py index 2d565f86a..6c79efcdb 100644 --- a/tools/make_api_hash_header.py +++ b/tools/make_api_hash_header.py @@ -35,8 +35,8 @@ def make_api_hash_header(cpp_header_dir): #define CEF_API_HASH_UNIVERSAL "$UNIVERSAL$" #if defined(OS_WIN) #define CEF_API_HASH_PLATFORM "$WINDOWS$" -#elif defined(OS_MACOSX) -#define CEF_API_HASH_PLATFORM "$MACOSX$" +#elif defined(OS_MAC) +#define CEF_API_HASH_PLATFORM "$MAC$" #elif defined(OS_LINUX) #define CEF_API_HASH_PLATFORM "$LINUX$" #endif diff --git a/tools/make_cmake.py b/tools/make_cmake.py index 5e4d2d22c..b81c39697 100644 --- a/tools/make_cmake.py +++ b/tools/make_cmake.py @@ -114,7 +114,7 @@ def process_cmake_template_segment(segment, segment_ct, cmake_path, variables): # 'includes': [ # 'cefsimple_sources_common', # 'cefsimple_sources_win:WINDOWS', - # 'cefsimple_sources_mac:MACOSX', + # 'cefsimple_sources_mac:MAC', # 'cefsimple_sources_linux:LINUX', # ], values = eval('{' + segment + '}', {'__builtins__': None}, None) diff --git a/tools/make_distrib.py b/tools/make_distrib.py index a034ad1ec..641f317a2 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -94,7 +94,7 @@ def get_readme_component(name): # platform directory if platform == 'windows': platform_cmp = 'win' - elif platform == 'macosx': + elif platform == 'mac': platform_cmp = 'mac' elif platform == 'linux': platform_cmp = 'linux' @@ -135,8 +135,8 @@ def create_readme(): if platform == 'windows': platform_str = 'Windows' - elif platform == 'macosx': - platform_str = 'Mac OS-X' + elif platform == 'mac': + platform_str = 'MacOS' elif platform == 'linux': platform_str = 'Linux' @@ -360,7 +360,7 @@ def combine_libs(platform, build_dir, libs, dest_lib): if platform == 'windows': cmdline = 'msvs_env.bat win%s "%s" combine_libs.py -o "%s"' % ( platform_arch, sys.executable, dest_lib) - elif platform == 'macosx': + elif platform == 'mac': # Find CEF_EXPORT symbols from libcef_sandbox.a (include/cef_sandbox_mac.h) # Export only symbols that include these strings. symbol_match = [ @@ -544,7 +544,7 @@ platform = '' if sys.platform == 'win32': platform = 'windows' elif sys.platform == 'darwin': - platform = 'macosx' + platform = 'mac' elif sys.platform.startswith('linux'): platform = 'linux' @@ -569,7 +569,7 @@ if options.arm64build and not platform in ('linux', 'windows'): print_error('--arm64-build is only supported on Linux and Windows.') sys.exit() -if options.sandbox and not platform in ('macosx', 'windows'): +if options.sandbox and not platform in ('mac', 'windows'): print_error('--sandbox is only supported on macOS and Windows.') sys.exit() @@ -632,7 +632,10 @@ else: output_dir_base = 'cef_binary_' + cef_ver if options.distribsubdir == '': - output_dir_name = output_dir_base + '_' + platform + platform_arch + # For backwards compatibility keep the old default directory name on mac. + platform_name = 'macosx' if platform == 'mac' else platform + + output_dir_name = output_dir_base + '_' + platform_name + platform_arch if options.distribsubdirsuffix != '': output_dir_name += '_' + options.distribsubdirsuffix else: @@ -1001,7 +1004,7 @@ if platform == 'windows': # transfer contents copy_dir(src_dir, docs_output_dir, options.quiet) -elif platform == 'macosx': +elif platform == 'mac': framework_name = 'Chromium Embedded Framework' framework_dsym = '%s.dSYM' % framework_name cefclient_app = 'cefclient.app'