From a3c55f1d26514691e704bfebb50f7ab56b97dc14 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 19 Apr 2018 11:44:42 -0400 Subject: [PATCH] Update to Chromium revision 9ef2aa86 (#550428) --- BUILD.gn | 46 +-- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- include/capi/cef_web_plugin_capi.h | 5 +- include/cef_web_plugin.h | 3 - include/internal/cef_types.h | 5 + libcef/browser/browser_context_impl.cc | 12 +- libcef/browser/browser_host_impl.cc | 31 +- libcef/browser/browser_host_impl.h | 9 +- libcef/browser/browser_info_manager.h | 2 +- libcef/browser/browser_main_win.cc | 6 +- libcef/browser/chrome_browser_process_stub.h | 2 +- libcef/browser/content_browser_client.cc | 83 ++++- libcef/browser/content_browser_client.h | 26 ++ .../browser/extensions/api/tabs/tabs_api.cc | 58 ++-- libcef/browser/extensions/api/tabs/tabs_api.h | 31 +- .../extensions/extension_host_delegate.cc | 2 +- .../extensions/extension_host_delegate.h | 2 +- .../browser/extensions/extension_view_host.cc | 2 +- .../extension_web_contents_observer.cc | 10 + .../extension_web_contents_observer.h | 4 + .../browser_platform_delegate_native_mac.mm | 6 +- .../browser_platform_delegate_native_win.cc | 4 +- libcef/browser/native/window_x11.cc | 2 +- libcef/browser/net/cookie_store_proxy.cc | 10 +- libcef/browser/net/scheme_handler.cc | 15 +- .../net/url_request_context_getter_impl.cc | 14 +- libcef/browser/osr/osr_accessibility_util.cc | 8 +- .../osr/render_widget_host_view_osr.cc | 42 ++- .../browser/osr/render_widget_host_view_osr.h | 12 +- .../osr/render_widget_host_view_osr_linux.cc | 2 +- .../osr/render_widget_host_view_osr_mac.mm | 33 +- .../osr/render_widget_host_view_osr_win.cc | 2 +- libcef/browser/prefs/browser_prefs.cc | 2 +- libcef/browser/prefs/renderer_prefs.cc | 2 +- .../printing/print_view_manager_base.cc | 67 ++-- .../printing/print_view_manager_base.h | 26 +- .../printing/printing_message_filter.cc | 1 - .../printing/printing_message_filter.h | 2 +- libcef/browser/process_util_impl.cc | 5 +- .../resource_dispatcher_host_delegate.cc | 83 +---- .../resource_dispatcher_host_delegate.h | 2 - .../speech_recognition_manager_delegate.cc | 127 +------ .../speech_recognition_manager_delegate.h | 7 - libcef/browser/storage_partition_proxy.cc | 11 +- libcef/browser/storage_partition_proxy.h | 5 +- .../common/cef_crash_report_upload_thread.cc | 43 +-- libcef/common/content_client.cc | 16 +- libcef/common/content_client.h | 3 + libcef/common/crash_reporter_client.cc | 8 +- libcef/common/crash_reporter_client.h | 3 + libcef/common/main_delegate.cc | 2 +- libcef/common/net/scheme_registration.cc | 2 +- libcef/common/request_impl.cc | 12 +- libcef/common/request_impl.h | 4 +- libcef/common/response_impl.cc | 8 +- libcef/common/task_runner_impl.cc | 7 +- libcef/common/widevine_loader.cc | 97 ++---- libcef/common/widevine_loader.h | 14 +- .../{webkit_glue.cc => blink_glue.cc} | 47 +-- .../renderer/{webkit_glue.h => blink_glue.h} | 14 +- libcef/renderer/browser_impl.cc | 46 +-- libcef/renderer/content_renderer_client.cc | 60 ++-- libcef/renderer/content_renderer_client.h | 8 +- libcef/renderer/dom_document_impl.cc | 14 +- libcef/renderer/dom_node_impl.cc | 30 +- libcef/renderer/dom_node_impl.h | 2 +- .../extensions/extensions_renderer_client.cc | 41 ++- .../extensions/extensions_renderer_client.h | 12 +- .../print_render_frame_helper_delegate.cc | 6 +- libcef/renderer/frame_impl.cc | 22 +- libcef/renderer/render_frame_observer.cc | 8 +- libcef/renderer/render_frame_util.cc | 6 +- libcef/renderer/render_message_filter.cc | 4 +- libcef/renderer/render_thread_observer.cc | 6 +- libcef/renderer/render_urlrequest_impl.cc | 22 +- libcef/renderer/v8_impl.cc | 41 +-- patch/patch.cfg | 9 +- patch/patches/browser_compositor_mac.patch | 21 +- patch/patches/browser_plugin_guest_1565.patch | 24 +- patch/patches/chrome_browser.patch | 6 +- .../chrome_browser_content_settings.patch | 4 +- patch/patches/chrome_browser_profiles.patch | 12 +- patch/patches/chrome_plugins.patch | 36 +- patch/patches/chrome_renderer.patch | 8 +- patch/patches/chrome_widevine.patch | 27 +- patch/patches/component_build_1617.patch | 24 +- patch/patches/compositor_1368.patch | 14 +- patch/patches/content_2015.patch | 124 +++---- patch/patches/crashpad_1995.patch | 83 ++--- patch/patches/crashpad_tp_1995.patch | 98 +++--- patch/patches/devtools_product_2300.patch | 4 +- patch/patches/extensions_1947.patch | 42 ++- patch/patches/gn_config.patch | 44 ++- patch/patches/gritsettings.patch | 4 +- patch/patches/ime_1610.patch | 16 +- patch/patches/linux_build.patch | 31 +- patch/patches/mac_gpu_2398.patch | 4 +- .../patches/message_loop_443_1992243003.patch | 10 +- .../net_security_expiration_1994.patch | 12 +- patch/patches/net_urlrequest_1327.patch | 4 +- patch/patches/pdfium_print_549365.patch | 24 +- patch/patches/prefs_content_1161.patch | 16 +- .../print_header_footer_1478_1565.patch | 43 ++- patch/patches/printing_context_2196.patch | 2 +- .../renderer_preferences_util_545103.patch | 2 +- patch/patches/rwh_background_color_1984.patch | 26 +- patch/patches/service_factory_1680.patch | 8 +- patch/patches/service_manager_654986.patch | 14 +- patch/patches/storage_partition_1973.patch | 320 ++++++++++-------- patch/patches/views_1749_2102.patch | 58 ++-- ...views_widget_180_1481_1565_1677_1749.patch | 109 +++--- patch/patches/web_contents_1257_1565.patch | 18 +- patch/patches/webkit_plugin_info_2015.patch | 120 +++---- .../patches/webkit_pointer_event_781966.patch | 10 +- patch/patches/webkit_popups.patch | 78 ++--- patch/patches/webui_2037.patch | 26 +- patch/patches/webview_plugin_2020.patch | 4 +- patch/patches/win_rt_2274.patch | 12 +- patch/patches/win_strcat_817738.patch | 28 -- tests/ceftests/display_unittest.cc | 2 +- tools/distrib/linux/README.redistrib.txt | 5 - tools/distrib/mac/README.redistrib.txt | 5 - tools/distrib/win/README.redistrib.txt | 5 - tools/fix_style.bat | 2 +- tools/git_util.py | 10 +- tools/make_distrib.bat | 2 +- tools/make_distrib.py | 25 +- tools/patch.bat | 2 +- tools/patch_updater.py | 45 +-- tools/translator.bat | 2 +- 130 files changed, 1601 insertions(+), 1522 deletions(-) rename libcef/renderer/{webkit_glue.cc => blink_glue.cc} (83%) rename libcef/renderer/{webkit_glue.h => blink_glue.h} (88%) delete mode 100644 patch/patches/win_strcat_817738.patch diff --git a/BUILD.gn b/BUILD.gn index bd92b9bd4..b4ff06425 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -100,11 +100,11 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//cef/cef_repack_locales.gni") import("//chrome/common/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") -import("//ppapi/features/features.gni") -import("//printing/features/features.gni") +import("//ppapi/buildflags/buildflags.gni") +import("//printing/buildflags/buildflags.gni") import("//services/catalog/public/tools/catalog.gni") import("//services/service_manager/public/service_manifest.gni") import("//third_party/icu/config.gni") @@ -274,8 +274,8 @@ if (is_win) { # Required by chrome_switches.cc "//chrome/common:buildflags", - "//ppapi/features:features", - "//printing/features:features", + "//ppapi/buildflags:buildflags", + "//printing/buildflags:buildflags", "//ui/base:ui_features", ] } @@ -698,10 +698,9 @@ static_library("libcef_static") { "//device/base", "//extensions/browser", "//extensions/browser/api:api_registration", + "//extensions/buildflags", "//extensions/common/api", - "//extensions/features", "//extensions/renderer", - "//extensions/utility", "//gpu", "//ipc", "//media", @@ -711,8 +710,8 @@ static_library("libcef_static") { "//net:net_utility_services", "//net:net_with_v8", "//pdf", - "//ppapi/features", - "//printing/features", + "//ppapi/buildflags", + "//printing/buildflags", "//services/network:network_service", "//services/network/public/cpp", "//services/service_manager/embedder", @@ -720,14 +719,14 @@ static_library("libcef_static") { "//services/service_manager/runner/common", "//skia", "//storage/browser", + "//third_party/blink/public:blink", "//third_party/brotli:dec", "//third_party/cld_3/src/src:cld_3", "//third_party/hunspell", "//third_party/leveldatabase", "//third_party/libxml", - "//third_party/WebKit/public:blink", "//third_party/widevine/cdm:headers", - "//third_party/widevine/cdm:widevinecdmadapter", + "//third_party/widevine/cdm", "//third_party/icu", "//third_party/zlib:minizip", "//ui/base", @@ -1075,11 +1074,11 @@ template("cef_pak_scaled") { # Each input pak file should also have a deps line for completeness. # Add associated .h files in the make_pack_header("resources") target. sources = [ - "$root_gen_dir/blink/public/resources/blink_scaled_resources_${percent}_percent.pak", "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak", "$root_gen_dir/components/components_resources_${percent}_percent.pak", "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak", "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak", + "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_${percent}_percent.pak", "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak", ] @@ -1087,18 +1086,18 @@ template("cef_pak_scaled") { # the libcef_static target. Grit deps that generate .cc files must be # listed both here and in the libcef_static target. public_deps = [ - "//third_party/WebKit/public:scaled_resources", "//chrome/renderer:resources", "//components/resources:components_scaled_resources", "//content/app/resources", "//extensions:extensions_browser_resources", + "//third_party/blink/public:scaled_resources", "//ui/resources:ui_resources_grd", ] deps = [ # This repack target generates the blink_scaled_resources_*_percent.pak # file but doesn't expose the public_deps required by make_pack_header. - "//third_party/WebKit/public:scaled_resources_${percent}_percent", + "//third_party/blink/public:scaled_resources_${percent}_percent", ] if (toolkit_views) { @@ -1215,7 +1214,6 @@ repack("pak") { # Each input pak file should also have a deps line for completeness. # Add associated .h files in the make_pack_header("resources") target. sources = [ - "$root_gen_dir/blink/public/resources/blink_resources.pak", "$root_gen_dir/chrome/browser_resources.pak", "$root_gen_dir/chrome/net_internals_resources.pak", "$root_gen_dir/chrome/common_resources.pak", @@ -1224,13 +1222,13 @@ repack("pak") { "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/content_resources.pak", "$root_gen_dir/net/net_resources.pak", + "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak", ] # Use public_deps so that generated grit headers are discoverable from # the libcef_static target. Grit deps that generate .cc files must be # listed both here and in the libcef_static target. public_deps = [ - "//third_party/WebKit/public:resources_grit", "//chrome/browser:resources", "//chrome/browser/resources:net_internals_resources", "//chrome/common:resources", @@ -1239,6 +1237,7 @@ repack("pak") { "//content/browser/tracing:resources", "//content:resources", "//net:net_resources", + "//third_party/blink/public:resources", ] output = "$root_out_dir/cef.pak" @@ -1275,9 +1274,6 @@ template("make_pack_header") { make_pack_header("resources") { header = "$root_out_dir/includes/include/cef_pack_resources.h" inputs = [ - "$root_gen_dir/blink/public/resources/grit/media_controls_resources.h", - "$root_gen_dir/blink/public/resources/grit/blink_image_resources.h", - "$root_gen_dir/blink/public/resources/grit/blink_resources.h", "$root_gen_dir/cef/grit/cef_resources.h", "$root_gen_dir/chrome/grit/browser_resources.h", "$root_gen_dir/chrome/grit/common_resources.h", @@ -1292,6 +1288,7 @@ make_pack_header("resources") { "$root_gen_dir/extensions/grit/extensions_renderer_resources.h", "$root_gen_dir/extensions/grit/extensions_resources.h", "$root_gen_dir/net/grit/net_resources.h", + "$root_gen_dir/third_party/blink/public/resources/grit/blink_resources.h", "$root_gen_dir/ui/resources/grit/ui_resources.h", "$root_gen_dir/ui/resources/grit/webui_resources.h", "$root_gen_dir/ui/views/resources/grit/views_resources.h", @@ -1357,7 +1354,6 @@ if (is_mac) { "$root_out_dir/cef_200_percent.pak", "$root_out_dir/cef_extensions.pak", "$root_out_dir/devtools_resources.pak", - "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", ] public_deps = [ @@ -1366,7 +1362,6 @@ if (is_mac) { ":pak_200_percent", ":pak_devtools", ":pak_extensions", - "//third_party/widevine/cdm:widevinecdmadapter", ] if (icu_use_data_file) { @@ -1394,6 +1389,11 @@ if (is_mac) { mac_framework_bundle("cef_framework") { output_name = cef_framework_name + framework_version = "A" + framework_contents = [ + "Resources", + ] + sources = gypi_paths2.includes_common + gypi_paths2.includes_mac + gypi_paths.autogen_cpp_includes + @@ -1429,11 +1429,11 @@ if (is_mac) { if (is_component_build) { # Set up the rpath for the framework so that it can find dylibs in the # root output directory. The framework is at - # $app_name.app/Contents/Frameworks/$output_name.framework/$output_name + # $app_name.app/Contents/Frameworks/$output_name.framework/Versions/A/$output_name # so use loader_path to go back to the root output directory. ldflags += [ "-rpath", - "@loader_path/../../../..", + "@loader_path/../../../../../..", ] } diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 930f00b14..7d5ec22a8 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': '66afc5e5d10127546cc4b98b9117aff588b5e66b', + 'chromium_checkout': '9ef2aa869bc7bc0c089e255d698cca6e47d6b038', } diff --git a/include/capi/cef_web_plugin_capi.h b/include/capi/cef_web_plugin_capi.h index 199061cab..2b9612625 100644 --- a/include/capi/cef_web_plugin_capi.h +++ b/include/capi/cef_web_plugin_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=ec4f722423ff89dd2ff61fd3336bda1776081023$ +// $hash=8815d0d0778cc210fb6f9ede9dafc5ca51124169$ // #ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ @@ -202,9 +202,6 @@ CEF_EXPORT void cef_is_web_plugin_unstable( // 2. widevinecdm file from the CDM binary distribution (e.g. // widevinecdm.dll on on Windows, libwidevinecdm.dylib on OS X, // libwidevinecdm.so on Linux). -// 3. widevidecdmadapter file from the CEF binary distribution (e.g. -// widevinecdmadapter.dll on Windows, widevinecdmadapter.plugin on OS X, -// libwidevinecdmadapter.so on Linux). // // If any of these files are missing or if the manifest file has incorrect // contents the registration will fail and |callback| will receive a |result| diff --git a/include/cef_web_plugin.h b/include/cef_web_plugin.h index d5de16aba..118788bc5 100644 --- a/include/cef_web_plugin.h +++ b/include/cef_web_plugin.h @@ -179,9 +179,6 @@ class CefRegisterCdmCallback : public virtual CefBaseRefCounted { // 2. widevinecdm file from the CDM binary distribution (e.g. // widevinecdm.dll on on Windows, libwidevinecdm.dylib on OS X, // libwidevinecdm.so on Linux). -// 3. widevidecdmadapter file from the CEF binary distribution (e.g. -// widevinecdmadapter.dll on Windows, widevinecdmadapter.plugin on OS X, -// libwidevinecdmadapter.so on Linux). // // If any of these files are missing or if the manifest file has incorrect // contents the registration will fail and |callback| will receive a |result| diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 8efe76406..7f38957c0 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -1423,6 +1423,11 @@ typedef enum { /// TID_FILE_USER_BLOCKING, + /// + // Used to launch and terminate browser processes. + /// + TID_PROCESS_LAUNCHER, + /// // Used to process IPC and network messages. Do not perform blocking tasks on // this thread. All tasks posted after diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index ce0b42916..986d4a09e 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -40,7 +40,7 @@ #include "extensions/browser/extension_protocols.h" #include "extensions/common/constants.h" #include "net/proxy_resolution/proxy_config_service.h" -#include "net/proxy_resolution/proxy_service.h" +#include "net/proxy_resolution/proxy_resolution_service.h" using content::BrowserThread; @@ -176,11 +176,11 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener { // visitedlink::VisitedLinkMaster::Listener methods. - void NewTable(mojo::SharedBufferHandle table) override { + void NewTable(base::ReadOnlySharedMemoryRegion* table_region) override { CEF_REQUIRE_UIT(); ListenerMap::iterator it = listener_map_.begin(); for (; it != listener_map_.end(); ++it) - it->second->NewTable(table); + it->second->NewTable(table_region); } void Add(visitedlink::VisitedLinkCommon::Fingerprint fingerprint) override { @@ -462,10 +462,8 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext( // data in its installation directory). extensions::InfoMap* extension_info_map = extension_system()->info_map(); (*protocol_handlers)[extensions::kExtensionScheme] = - linked_ptr( - extensions::CreateExtensionProtocolHandler(IsOffTheRecord(), - extension_info_map) - .release()); + extensions::CreateExtensionProtocolHandler(IsOffTheRecord(), + extension_info_map); } url_request_getter_ = new CefURLRequestContextGetterImpl( diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index d42e82429..d65a78ada 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -71,7 +71,7 @@ #include "content/public/common/favicon_url.h" #include "extensions/browser/process_manager.h" #include "net/base/net_errors.h" -#include "third_party/WebKit/public/web/WebFindOptions.h" +#include "third_party/blink/public/web/web_find_options.h" #include "ui/events/base_event_utils.h" #if defined(OS_MACOSX) @@ -999,16 +999,17 @@ void CefBrowserHostImpl::SetAutoResizeEnabled(bool enabled, return; } - if (!web_contents() || !web_contents()->GetRenderViewHost()) + if (enabled == auto_resize_enabled_) return; + auto_resize_enabled_ = enabled; if (enabled) { - web_contents()->GetRenderViewHost()->EnableAutoResize( - gfx::Size(min_size.width, min_size.height), - gfx::Size(max_size.width, max_size.height)); + auto_resize_min_ = gfx::Size(min_size.width, min_size.height); + auto_resize_max_ = gfx::Size(max_size.width, max_size.height); } else { - web_contents()->GetRenderViewHost()->DisableAutoResize(gfx::Size()); + auto_resize_min_ = auto_resize_max_ = gfx::Size(); } + ConfigureAutoResize(); } CefRefPtr CefBrowserHostImpl::GetExtension() { @@ -2583,7 +2584,7 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( } bool CefBrowserHostImpl::CheckMediaAccessPermission( - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, const GURL& security_origin, content::MediaStreamType type) { // Check media access permission without prompting the user. This is called @@ -2701,6 +2702,8 @@ void CefBrowserHostImpl::RenderViewDeleted( } void CefBrowserHostImpl::RenderViewReady() { + ConfigureAutoResize(); + // Send the queued messages. queue_messages_ = false; while (!queued_messages_.empty()) { @@ -3507,6 +3510,20 @@ void CefBrowserHostImpl::EnsureFileDialogManager() { } } +void CefBrowserHostImpl::ConfigureAutoResize() { + CEF_REQUIRE_UIT(); + if (!web_contents() || !web_contents()->GetRenderWidgetHostView()) { + return; + } + + if (auto_resize_enabled_) { + web_contents()->GetRenderWidgetHostView()->EnableAutoResize( + auto_resize_min_, auto_resize_max_); + } else { + web_contents()->GetRenderWidgetHostView()->DisableAutoResize(gfx::Size()); + } +} + bool CefBrowserHostImpl::Send(IPC::Message* message) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK( diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index e8b7a04ae..d09a082ed 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -473,7 +473,7 @@ class CefBrowserHostImpl : public CefBrowserHost, content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) override; - bool CheckMediaAccessPermission(content::WebContents* web_contents, + bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, content::MediaStreamType type) override; bool IsNeverVisible(content::WebContents* web_contents) override; @@ -626,6 +626,8 @@ class CefBrowserHostImpl : public CefBrowserHost, // Create the CefFileDialogManager if it doesn't already exist. void EnsureFileDialogManager(); + void ConfigureAutoResize(); + // Send a message to the RenderViewHost associated with this browser. // TODO(cef): With the introduction of OOPIFs, WebContents can span multiple // processes. Messages should be sent to specific RenderFrameHosts instead. @@ -727,6 +729,11 @@ class CefBrowserHostImpl : public CefBrowserHost, CefRefPtr extension_; bool is_background_host_ = false; + // Used with auto-resize. + bool auto_resize_enabled_ = false; + gfx::Size auto_resize_min_; + gfx::Size auto_resize_max_; + IMPLEMENT_REFCOUNTING(CefBrowserHostImpl); DISALLOW_COPY_AND_ASSIGN(CefBrowserHostImpl); }; diff --git a/libcef/browser/browser_info_manager.h b/libcef/browser/browser_info_manager.h index aac162fca..a3f5f1c6a 100644 --- a/libcef/browser/browser_info_manager.h +++ b/libcef/browser/browser_info_manager.h @@ -16,7 +16,7 @@ #include "base/synchronization/lock.h" #include "content/public/browser/render_process_host_observer.h" -#include "third_party/WebKit/public/web/window_features.mojom.h" +#include "third_party/blink/public/web/window_features.mojom.h" #include "ui/base/window_open_disposition.h" #include "url/gurl.h" diff --git a/libcef/browser/browser_main_win.cc b/libcef/browser/browser_main_win.cc index 815128484..5489384eb 100644 --- a/libcef/browser/browser_main_win.cc +++ b/libcef/browser/browser_main_win.cc @@ -8,11 +8,7 @@ #include "libcef/browser/browser_main.h" -#include "cef/grit/cef_strings.h" -#include "content/public/browser/utility_process_host.h" -#include "content/public/browser/utility_process_host_client.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/win/direct_write.h" +#include "base/logging.h" void CefBrowserMainParts::PlatformInitialize() { HRESULT res; diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index 011caf57f..0052f7d58 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -16,7 +16,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/event_router_forwarder.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "media/media_features.h" +#include "media/media_buildflags.h" class ChromeProfileManagerStub; diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 7f43772c9..f4c871f58 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -75,7 +75,9 @@ #include "content/public/common/service_names.mojom.h" #include "content/public/common/storage_quota_params.h" #include "content/public/common/web_preferences.h" +#include "extensions/browser/api/web_request/web_request_api.h" #include "extensions/browser/extension_message_filter.h" +#include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" @@ -86,7 +88,7 @@ #include "ppapi/host/ppapi_host.h" #include "services/service_manager/public/mojom/connector.mojom.h" #include "storage/browser/quota/quota_settings.h" -#include "third_party/WebKit/public/web/WebWindowFeatures.h" +#include "third_party/blink/public/web/web_window_features.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" #include "ui/base/ui_base_switches.h" @@ -729,7 +731,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) if (!browser_cmd->HasSwitch(switches::kNoSandbox)) { // Pass the Widevine CDM path to the Zygote process. See comments in - // CefWidevineLoader::AddPepperPlugins. + // CefWidevineLoader::AddContentDecryptionModules. const base::FilePath& cdm_path = CefWidevineLoader::GetInstance()->path(); if (!cdm_path.empty()) command_line->AppendSwitchPath(switches::kWidevineCdmPath, cdm_path); @@ -1025,6 +1027,68 @@ CefContentBrowserClient::CreateClientCertStore( ->CreateClientCertStore(); } +void CefContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories( + content::RenderFrameHost* frame_host, + NonNetworkURLLoaderFactoryMap* factories) { + if (!extensions::ExtensionsEnabled()) + return; + + content::BrowserContext* browser_context = + frame_host->GetProcess()->GetBrowserContext(); + factories->emplace( + extensions::kExtensionScheme, + extensions::CreateExtensionNavigationURLLoaderFactory( + frame_host, + extensions::ExtensionSystem::Get(browser_context)->info_map())); +} + +void CefContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories( + content::RenderFrameHost* frame_host, + const GURL& frame_url, + NonNetworkURLLoaderFactoryMap* factories) { + if (!extensions::ExtensionsEnabled()) + return; + + content::BrowserContext* browser_context = + frame_host->GetProcess()->GetBrowserContext(); + auto factory = extensions::MaybeCreateExtensionSubresourceURLLoaderFactory( + frame_host, frame_url, + extensions::ExtensionSystem::Get(browser_context)->info_map()); + if (factory) + factories->emplace(extensions::kExtensionScheme, std::move(factory)); +} + +bool CefContentBrowserClient::WillCreateURLLoaderFactory( + content::RenderFrameHost* frame, + bool is_navigation, + network::mojom::URLLoaderFactoryRequest* factory_request) { + if (!extensions::ExtensionsEnabled()) + return false; + + auto* web_request_api = + extensions::BrowserContextKeyedAPIFactory::Get( + frame->GetProcess()->GetBrowserContext()); + return web_request_api->MaybeProxyURLLoaderFactory(frame, is_navigation, + factory_request); +} + +bool CefContentBrowserClient::HandleExternalProtocol( + const GURL& url, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + int child_id, + content::NavigationUIData* navigation_data, + bool is_main_frame, + ui::PageTransition page_transition, + bool has_user_gesture) { + CEF_POST_TASK( + CEF_UIT, + base::Bind( + base::IgnoreResult( + &CefContentBrowserClient::HandleExternalProtocolOnUIThread), + url, web_contents_getter)); + return false; +} + void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) { // Register as a Web-safe scheme so that requests for the scheme from a // render process will be allowed in resource_dispatcher_host_impl.cc @@ -1068,3 +1132,18 @@ const extensions::Extension* CefContentBrowserClient::GetExtension( return registry->enabled_extensions().GetExtensionOrAppByURL( site_instance->GetSiteURL()); } + +// static +void CefContentBrowserClient::HandleExternalProtocolOnUIThread( + const GURL& url, + const content::ResourceRequestInfo::WebContentsGetter& + web_contents_getter) { + CEF_REQUIRE_UIT(); + content::WebContents* web_contents = web_contents_getter.Run(); + if (web_contents) { + CefRefPtr browser = + CefBrowserHostImpl::GetBrowserForContents(web_contents); + if (browser.get()) + browser->HandleExternalProtocol(url); + } +} diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index b8650b15b..69003ed2b 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -127,6 +127,27 @@ class CefContentBrowserClient : public content::ContentBrowserClient { std::unique_ptr CreateClientCertStore( content::ResourceContext* resource_context) override; + void RegisterNonNetworkNavigationURLLoaderFactories( + content::RenderFrameHost* frame_host, + NonNetworkURLLoaderFactoryMap* factories) override; + void RegisterNonNetworkSubresourceURLLoaderFactories( + content::RenderFrameHost* frame_host, + const GURL& frame_url, + NonNetworkURLLoaderFactoryMap* factories) override; + bool WillCreateURLLoaderFactory( + content::RenderFrameHost* frame, + bool is_navigation, + network::mojom::URLLoaderFactoryRequest* factory_request) override; + + bool HandleExternalProtocol( + const GURL& url, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + int child_id, + content::NavigationUIData* navigation_data, + bool is_main_frame, + ui::PageTransition page_transition, + bool has_user_gesture) override; + // Perform browser process registration for the custom scheme. void RegisterCustomScheme(const std::string& scheme); @@ -142,6 +163,11 @@ class CefContentBrowserClient : public content::ContentBrowserClient { const extensions::Extension* GetExtension( content::SiteInstance* site_instance); + static void HandleExternalProtocolOnUIThread( + const GURL& url, + const content::ResourceRequestInfo::WebContentsGetter& + web_contents_getter); + CefBrowserMainParts* browser_main_parts_; std::unique_ptr plugin_service_filter_; diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index ff0d6f64d..1fc1419f9 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -142,11 +142,11 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { return set_init_result(SUCCESS); } -bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() { +bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage(std::string* error) { CHECK_GE(execute_tab_id_, 0); CefRefPtr browser = - cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, &error_); + cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error); if (!browser) return false; @@ -156,7 +156,7 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() { ExtensionApiFrameIdMap::GetRenderFrameHostById(browser->web_contents(), frame_id); if (!rfh) { - error_ = ErrorUtils::FormatErrorMessage(keys::kFrameNotFoundError, + *error = ErrorUtils::FormatErrorMessage(keys::kFrameNotFoundError, base::IntToString(frame_id), base::IntToString(execute_tab_id_)); return false; @@ -181,11 +181,11 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() { // NOTE: This can give the wrong answer due to race conditions, but it is OK, // we check again in the renderer. if (!extension()->permissions_data()->CanAccessPage( - extension(), effective_document_url, execute_tab_id_, &error_)) { + extension(), effective_document_url, execute_tab_id_, error)) { if (is_about_url && extension()->permissions_data()->active_permissions().HasAPIPermission( APIPermission::kTab)) { - error_ = ErrorUtils::FormatErrorMessage( + *error = ErrorUtils::FormatErrorMessage( manifest_errors::kCannotAccessAboutUrl, rfh->GetLastCommittedURL().spec(), rfh->GetLastCommittedOrigin().Serialize()); @@ -196,11 +196,12 @@ bool ExecuteCodeInTabFunction::CanExecuteScriptOnPage() { return true; } -ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor() { +ScriptExecutor* ExecuteCodeInTabFunction::GetScriptExecutor( + std::string* error) { CHECK_GE(execute_tab_id_, 0); CefRefPtr browser = - cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, &error_); + cef_details_.GetBrowserForTabIdAgain(execute_tab_id_, error); if (!browser) return nullptr; @@ -217,7 +218,8 @@ const GURL& ExecuteCodeInTabFunction::GetWebViewSrc() const { return GURL::EmptyGURL(); } -bool ExecuteCodeInTabFunction::LoadFile(const std::string& file) { +bool ExecuteCodeInTabFunction::LoadFile(const std::string& file, + std::string* error) { if (cef_details_.LoadFile( file, base::BindOnce(&ExecuteCodeInTabFunction::LoadFileComplete, this, file))) { @@ -225,7 +227,7 @@ bool ExecuteCodeInTabFunction::LoadFile(const std::string& file) { } // Default handling. - return ExecuteCodeFunction::LoadFile(file); + return ExecuteCodeFunction::LoadFile(file, error); } void ExecuteCodeInTabFunction::LoadFileComplete( @@ -239,15 +241,6 @@ bool TabsExecuteScriptFunction::ShouldInsertCSS() const { return false; } -void TabsExecuteScriptFunction::OnExecuteCodeFinished( - const std::string& error, - const GURL& on_url, - const base::ListValue& result) { - if (error.empty()) - SetResult(result.CreateDeepCopy()); - ExecuteCodeInTabFunction::OnExecuteCodeFinished(error, on_url, result); -} - bool TabsInsertCSSFunction::ShouldInsertCSS() const { return true; } @@ -264,10 +257,31 @@ content::WebContents* ZoomAPIFunction::GetWebContents(int tab_id) { return browser->web_contents(); } +void ZoomAPIFunction::SendResponse(bool success) { + ResponseValue response; + if (success) { + response = ArgumentList(std::move(results_)); + } else { + response = results_ ? ErrorWithArguments(std::move(results_), error_) + : Error(error_); + } + Respond(std::move(response)); +} + +ExtensionFunction::ResponseAction ZoomAPIFunction::Run() { + if (RunAsync()) + return RespondLater(); + // TODO(devlin): Track these down and eliminate them if possible. We + // shouldn't return results and an error. + if (results_) + return RespondNow(ErrorWithArguments(std::move(results_), error_)); + return RespondNow(Error(error_)); +} + bool TabsSetZoomFunction::RunAsync() { std::unique_ptr params( tabs::SetZoom::Params::Create(*args_)); - EXTENSION_FUNCTION_VALIDATE(params); + EXTENSION_FUNCTION_PRERUN_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); @@ -299,7 +313,7 @@ bool TabsSetZoomFunction::RunAsync() { bool TabsGetZoomFunction::RunAsync() { std::unique_ptr params( tabs::GetZoom::Params::Create(*args_)); - EXTENSION_FUNCTION_VALIDATE(params); + EXTENSION_FUNCTION_PRERUN_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); @@ -319,7 +333,7 @@ bool TabsSetZoomSettingsFunction::RunAsync() { std::unique_ptr params( tabs::SetZoomSettings::Params::Create(*args_)); - EXTENSION_FUNCTION_VALIDATE(params); + EXTENSION_FUNCTION_PRERUN_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); @@ -370,7 +384,7 @@ bool TabsSetZoomSettingsFunction::RunAsync() { bool TabsGetZoomSettingsFunction::RunAsync() { std::unique_ptr params( tabs::GetZoomSettings::Params::Create(*args_)); - EXTENSION_FUNCTION_VALIDATE(params); + EXTENSION_FUNCTION_PRERUN_VALIDATE(params); int tab_id = params->tab_id ? *params->tab_id : -1; content::WebContents* web_contents = GetWebContents(tab_id); diff --git a/libcef/browser/extensions/api/tabs/tabs_api.h b/libcef/browser/extensions/api/tabs/tabs_api.h index e4c6a2eab..857246320 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.h +++ b/libcef/browser/extensions/api/tabs/tabs_api.h @@ -55,11 +55,11 @@ class ExecuteCodeInTabFunction : public ExecuteCodeFunction { // Initializes |execute_tab_id_| and |details_|. InitResult Init() override; - bool CanExecuteScriptOnPage() override; - ScriptExecutor* GetScriptExecutor() override; + bool CanExecuteScriptOnPage(std::string* error) override; + ScriptExecutor* GetScriptExecutor(std::string* error) override; bool IsWebView() const override; const GURL& GetWebViewSrc() const override; - bool LoadFile(const std::string& file) override; + bool LoadFile(const std::string& file, std::string* error) override; private: const CefExtensionFunctionDetails cef_details_; @@ -78,10 +78,6 @@ class TabsExecuteScriptFunction : public ExecuteCodeInTabFunction { private: ~TabsExecuteScriptFunction() override {} - void OnExecuteCodeFinished(const std::string& error, - const GURL& on_url, - const base::ListValue& script_result) override; - DECLARE_EXTENSION_FUNCTION("tabs.executeScript", TABS_EXECUTESCRIPT) }; @@ -94,7 +90,8 @@ class TabsInsertCSSFunction : public ExecuteCodeInTabFunction { DECLARE_EXTENSION_FUNCTION("tabs.insertCSS", TABS_INSERTCSS) }; -class ZoomAPIFunction : public AsyncExtensionFunction { +// Based on ChromeAsyncExtensionFunction. +class ZoomAPIFunction : public UIThreadExtensionFunction { public: ZoomAPIFunction(); @@ -103,10 +100,26 @@ class ZoomAPIFunction : public AsyncExtensionFunction { // Gets the WebContents for |tab_id| if it is specified. Otherwise get the // WebContents for the active tab in the current window. Calling this function - // may set error_. + // may set |error_|. content::WebContents* GetWebContents(int tab_id); + virtual bool RunAsync() = 0; + + // Responds with success/failure. |results_| or |error_| should be set + // accordingly. + void SendResponse(bool success); + + // Exposed versions of ExtensionFunction::results_ and + // ExtensionFunction::error_ that are curried into the response. + // These need to keep the same name to avoid breaking existing + // implementations, but this should be temporary with crbug.com/648275 + // and crbug.com/634140. + std::unique_ptr results_; + std::string error_; + private: + ResponseAction Run() final; + const CefExtensionFunctionDetails cef_details_; }; diff --git a/libcef/browser/extensions/extension_host_delegate.cc b/libcef/browser/extensions/extension_host_delegate.cc index f96318011..dd0cb5538 100644 --- a/libcef/browser/extensions/extension_host_delegate.cc +++ b/libcef/browser/extensions/extension_host_delegate.cc @@ -47,7 +47,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest( } bool CefExtensionHostDelegate::CheckMediaAccessPermission( - content::WebContents* web_contents, + content::RenderFrameHost* render_frame_host, const GURL& security_origin, content::MediaStreamType type, const Extension* extension) { diff --git a/libcef/browser/extensions/extension_host_delegate.h b/libcef/browser/extensions/extension_host_delegate.h index d9ea64829..f56b168e8 100644 --- a/libcef/browser/extensions/extension_host_delegate.h +++ b/libcef/browser/extensions/extension_host_delegate.h @@ -30,7 +30,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate { const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback, const Extension* extension) override; - bool CheckMediaAccessPermission(content::WebContents* web_contents, + bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, content::MediaStreamType type, const Extension* extension) override; diff --git a/libcef/browser/extensions/extension_view_host.cc b/libcef/browser/extensions/extension_view_host.cc index f89424b90..98fbe2eb5 100644 --- a/libcef/browser/extensions/extension_view_host.cc +++ b/libcef/browser/extensions/extension_view_host.cc @@ -12,7 +12,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/runtime_data.h" -#include "third_party/WebKit/public/platform/WebGestureEvent.h" +#include "third_party/blink/public/platform/web_gesture_event.h" using content::NativeWebKeyboardEvent; using content::OpenURLParams; diff --git a/libcef/browser/extensions/extension_web_contents_observer.cc b/libcef/browser/extensions/extension_web_contents_observer.cc index 96a8882c7..02a1bd6ca 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.cc +++ b/libcef/browser/extensions/extension_web_contents_observer.cc @@ -21,6 +21,16 @@ CefExtensionWebContentsObserver::CefExtensionWebContentsObserver( CefExtensionWebContentsObserver::~CefExtensionWebContentsObserver() {} +// static +void CefExtensionWebContentsObserver::CreateForWebContents( + content::WebContents* web_contents) { + content::WebContentsUserData< + CefExtensionWebContentsObserver>::CreateForWebContents(web_contents); + + // Initialize this instance if necessary. + FromWebContents(web_contents)->Initialize(); +} + void CefExtensionWebContentsObserver::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { ExtensionWebContentsObserver::RenderFrameCreated(render_frame_host); diff --git a/libcef/browser/extensions/extension_web_contents_observer.h b/libcef/browser/extensions/extension_web_contents_observer.h index 909e252a1..3690bc956 100644 --- a/libcef/browser/extensions/extension_web_contents_observer.h +++ b/libcef/browser/extensions/extension_web_contents_observer.h @@ -22,6 +22,10 @@ class CefExtensionWebContentsObserver public: ~CefExtensionWebContentsObserver() override; + // Creates and initializes an instance of this class for the given + // |web_contents|, if it doesn't already exist. + static void CreateForWebContents(content::WebContents* web_contents); + ScriptExecutor* script_executor() { return script_executor_.get(); } private: diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index 4908279fc..41294e830 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -20,9 +20,9 @@ #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" -#include "third_party/WebKit/public/platform/WebInputEvent.h" -#include "third_party/WebKit/public/platform/WebMouseEvent.h" -#include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" +#include "third_party/blink/public/platform/web_input_event.h" +#include "third_party/blink/public/platform/web_mouse_event.h" +#include "third_party/blink/public/platform/web_mouse_wheel_event.h" #import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "ui/events/keycodes/keyboard_codes_posix.h" diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index f47d53e72..bd018aca3 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -22,8 +22,8 @@ #include "base/win/registry.h" #include "base/win/win_util.h" #include "content/public/browser/native_web_keyboard_event.h" -#include "third_party/WebKit/public/platform/WebMouseEvent.h" -#include "third_party/WebKit/public/platform/WebMouseWheelEvent.h" +#include "third_party/blink/public/platform/web_mouse_event.h" +#include "third_party/blink/public/platform/web_mouse_wheel_event.h" #include "ui/aura/window.h" #include "ui/base/win/shell.h" #include "ui/display/display.h" diff --git a/libcef/browser/native/window_x11.cc b/libcef/browser/native/window_x11.cc index 32b840f01..5429fd49e 100644 --- a/libcef/browser/native/window_x11.cc +++ b/libcef/browser/native/window_x11.cc @@ -26,7 +26,7 @@ const char kNetWMPing[] = "_NET_WM_PING"; const char kNetWMState[] = "_NET_WM_STATE"; const char kXdndProxy[] = "XdndProxy"; -::Window FindEventTarget(const base::NativeEvent& xev) { +::Window FindEventTarget(const ui::PlatformEvent& xev) { ::Window target = xev->xany.window; if (xev->type == GenericEvent) target = static_cast(xev->xcookie.data)->event; diff --git a/libcef/browser/net/cookie_store_proxy.cc b/libcef/browser/net/cookie_store_proxy.cc index 17daea96e..117034a66 100644 --- a/libcef/browser/net/cookie_store_proxy.cc +++ b/libcef/browser/net/cookie_store_proxy.cc @@ -22,12 +22,18 @@ class NullCookieChangeDispatcher : public net::CookieChangeDispatcher { std::unique_ptr AddCallbackForCookie( const GURL& url, const std::string& name, - net::CookieChangeCallback callback) override WARN_UNUSED_RESULT { + net::CookieChangeCallback callback) override { + return nullptr; + } + + std::unique_ptr AddCallbackForUrl( + const GURL& url, + net::CookieChangeCallback callback) override { return nullptr; } std::unique_ptr AddCallbackForAllChanges( - net::CookieChangeCallback callback) override WARN_UNUSED_RESULT { + net::CookieChangeCallback callback) override { return nullptr; } diff --git a/libcef/browser/net/scheme_handler.cc b/libcef/browser/net/scheme_handler.cc index 7f27f5c2e..57b34c9a7 100644 --- a/libcef/browser/net/scheme_handler.cc +++ b/libcef/browser/net/scheme_handler.cc @@ -14,7 +14,7 @@ #include "base/task_scheduler/post_task.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/url_constants.h" -#include "net/net_features.h" +#include "net/net_buildflags.h" #include "net/url_request/data_protocol_handler.h" #include "net/url_request/file_protocol_handler.h" #include "net/url_request/ftp_protocol_handler.h" @@ -29,19 +29,16 @@ void InstallInternalProtectedHandlers( content::ProtocolHandlerMap* protocol_handlers, net::HostResolver* host_resolver) { protocol_handlers->insert(std::make_pair( - url::kDataScheme, linked_ptr( - new net::DataProtocolHandler))); + url::kDataScheme, std::make_unique())); protocol_handlers->insert(std::make_pair( url::kFileScheme, - linked_ptr( - new net::FileProtocolHandler(base::CreateTaskRunnerWithTraits( + std::make_unique( + base::CreateTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::USER_VISIBLE, - base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))))); + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})))); #if !BUILDFLAG(DISABLE_FTP_SUPPORT) protocol_handlers->insert(std::make_pair( - url::kFtpScheme, - linked_ptr( - net::FtpProtocolHandler::Create(host_resolver).release()))); + url::kFtpScheme, net::FtpProtocolHandler::Create(host_resolver))); #endif for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin(); diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index f85418899..bdd1f123a 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -53,7 +53,7 @@ #include "net/http/transport_security_state.h" #include "net/proxy_resolution/dhcp_pac_file_fetcher_factory.h" #include "net/proxy_resolution/pac_file_fetcher_impl.h" -#include "net/proxy_resolution/proxy_service.h" +#include "net/proxy_resolution/proxy_resolution_service.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/http_user_agent_settings.h" #include "net/url_request/url_request.h" @@ -132,14 +132,14 @@ std::unique_ptr CreateProxyResolutionService( std::unique_ptr proxy_service; if (use_v8) { - std::unique_ptr dhcp_proxy_script_fetcher; - net::DhcpProxyScriptFetcherFactory dhcp_factory; - dhcp_proxy_script_fetcher = dhcp_factory.Create(context); + std::unique_ptr dhcp_pac_file_fetcher; + net::DhcpPacFileFetcherFactory dhcp_factory; + dhcp_pac_file_fetcher = dhcp_factory.Create(context); - proxy_service = network::CreateProxyServiceUsingMojoFactory( + proxy_service = network::CreateProxyResolutionServiceUsingMojoFactory( std::move(proxy_resolver_factory), std::move(proxy_config_service), - std::make_unique(context), - std::move(dhcp_proxy_script_fetcher), context->host_resolver(), net_log, + std::make_unique(context), + std::move(dhcp_pac_file_fetcher), context->host_resolver(), net_log, network_delegate); } else { proxy_service = net::ProxyResolutionService::CreateUsingSystemProxyResolver( diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index dba1b0d60..42c533cfe 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -40,8 +40,8 @@ CefRefPtr ToCefValue(uint32_t state) { int index = 0; // Iterate and find which states are set. - for (unsigned i = static_cast(ax::mojom::Role::kNone); - i <= static_cast(ax::mojom::Role::kLast); i++) { + for (unsigned i = static_cast(ax::mojom::Role::kMinValue) + 1; + i <= static_cast(ax::mojom::Role::kMaxValue); i++) { if (state & (1 << i)) value->SetString(index++, ToString(static_cast(i))); } @@ -267,8 +267,8 @@ CefRefPtr ToCefValue(const ui::AXNodeData& node) { CefRefPtr actions_strings; size_t actions_idx = 0; - for (int action_index = static_cast(ax::mojom::Action::kNone) + 1; - action_index <= static_cast(ax::mojom::Action::kLast); + for (int action_index = static_cast(ax::mojom::Action::kMinValue) + 1; + action_index <= static_cast(ax::mojom::Action::kMaxValue); ++action_index) { auto action = static_cast(action_index); if (node.HasAction(action)) { diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 05db829bb..06c61368c 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -94,7 +94,7 @@ class CefCopyFrameGenerator { &CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult, weak_ptr_factory_.GetWeakPtr(), damage_rect)); - request->set_area(gfx::Rect(view_->GetPhysicalBackingSize())); + request->set_area(gfx::Rect(view_->GetCompositorViewportPixelSize())); view_->GetRootLayer()->RequestCopyOfOutput(std::move(request)); } @@ -206,7 +206,8 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( content::RenderWidgetHost* widget, CefRenderWidgetHostViewOSR* parent_host_view, bool is_guest_view_hack) - : background_color_(background_color), + : content::RenderWidgetHostViewBase(widget), + background_color_(background_color), frame_rate_threshold_us_(0), #if !defined(OS_MACOSX) compositor_widget_(gfx::kNullAcceleratedWidget), @@ -336,10 +337,6 @@ void CefRenderWidgetHostViewOSR::SetSize(const gfx::Size& size) {} void CefRenderWidgetHostViewOSR::SetBounds(const gfx::Rect& rect) {} -gfx::Vector2dF CefRenderWidgetHostViewOSR::GetLastScrollOffset() const { - return last_scroll_offset_; -} - gfx::NativeView CefRenderWidgetHostViewOSR::GetNativeView() const { return gfx::NativeView(); } @@ -441,6 +438,22 @@ bool CefRenderWidgetHostViewOSR::LockMouse() { void CefRenderWidgetHostViewOSR::UnlockMouse() {} +void CefRenderWidgetHostViewOSR::TakeFallbackContentFrom( + content::RenderWidgetHostView* view) { + DCHECK(!static_cast(view) + ->IsRenderWidgetHostViewChildFrame()); + DCHECK(!static_cast(view) + ->IsRenderWidgetHostViewGuest()); + CefRenderWidgetHostViewOSR* view_cef = + static_cast(view); + SetBackgroundColor(view_cef->background_color()); + if (GetDelegatedFrameHost() && view_cef->GetDelegatedFrameHost()) { + GetDelegatedFrameHost()->TakeFallbackContentFrom( + view_cef->GetDelegatedFrameHost()); + } + host()->GetContentRenderingTimeoutFrom(view_cef->host()); +} + void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink( viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) { renderer_compositor_frame_sink_ = renderer_compositor_frame_sink; @@ -665,7 +678,7 @@ gfx::Size CefRenderWidgetHostViewOSR::GetRequestedRendererSize() const { return GetDelegatedFrameHost()->GetRequestedRendererSize(); } -gfx::Size CefRenderWidgetHostViewOSR::GetPhysicalBackingSize() const { +gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() const { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), current_device_scale_factor_); } @@ -728,11 +741,6 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() { return GetViewBounds(); } -content::RenderWidgetHostImpl* -CefRenderWidgetHostViewOSR::GetRenderWidgetHostImpl() const { - return render_widget_host_; -} - viz::SurfaceId CefRenderWidgetHostViewOSR::GetCurrentSurfaceId() const { return GetDelegatedFrameHost() ? GetDelegatedFrameHost()->GetCurrentSurfaceId() @@ -766,7 +774,9 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition( for (const CefCompositionUnderline& line : underlines) { web_underlines.push_back(ui::ImeTextSpan( ui::ImeTextSpan::Type::kComposition, line.range.from, line.range.to, - line.color, line.thick ? true : false, line.background_color)); + line.thick ? ui::ImeTextSpan::Thickness::kThick + : ui::ImeTextSpan::Thickness::kThin, + line.color, line.background_color, std::vector())); } gfx::Range range(replacement_range.from, replacement_range.to); @@ -1026,7 +1036,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { // to send to the renderer, so it is required that BrowserCompositorMac be // updated first. Only notify RenderWidgetHostImpl of the update if any // properties it will query have changed. - if (browser_compositor_->UpdateNSViewAndDisplay()) + if (UpdateNSViewAndDisplay()) render_widget_host_->NotifyScreenInfoChanged(); #else render_widget_host_->NotifyScreenInfoChanged(); @@ -1051,7 +1061,7 @@ void CefRenderWidgetHostViewOSR::Invalidate( return; } - InvalidateInternal(gfx::Rect(GetPhysicalBackingSize())); + InvalidateInternal(gfx::Rect(GetCompositorViewportPixelSize())); } void CefRenderWidgetHostViewOSR::SendKeyEvent( @@ -1359,7 +1369,7 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() { PlatformResizeCompositorWidget(size_in_pixels); #if defined(OS_MACOSX) - bool resized = browser_compositor_->UpdateNSViewAndDisplay(); + bool resized = UpdateNSViewAndDisplay(); #else bool resized = true; GetDelegatedFrameHost()->WasResized(local_surface_id_, size, diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index eb91fd12c..1f3062b2f 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -102,7 +102,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void InitAsChild(gfx::NativeView parent_view) override; void SetSize(const gfx::Size& size) override; void SetBounds(const gfx::Rect& rect) override; - gfx::Vector2dF GetLastScrollOffset() const override; gfx::NativeView GetNativeView() const override; gfx::NativeViewAccessible GetNativeViewAccessible() override; void Focus() override; @@ -116,14 +115,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, SkColor background_color() const override; bool LockMouse() override; void UnlockMouse() override; + void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override; #if defined(OS_MACOSX) void SetActive(bool active) override; void ShowDefinitionForSelection() override; - bool SupportsSpeech() const override; void SpeakSelection() override; - bool IsSpeaking() const override; - void StopSpeaking() override; bool ShouldContinueToPauseForFrame() override; #endif // defined(OS_MACOSX) @@ -150,7 +147,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void SetTooltipText(const base::string16& tooltip_text) override; gfx::Size GetRequestedRendererSize() const override; - gfx::Size GetPhysicalBackingSize() const override; + gfx::Size GetCompositorViewportPixelSize() const override; void CopyFromSurface( const gfx::Rect& src_rect, const gfx::Size& output_size, @@ -158,7 +155,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void GetScreenInfo(content::ScreenInfo* results) const override; gfx::Vector2d GetOffsetFromRootSurface() override; gfx::Rect GetBoundsInRootWindow() override; - content::RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; viz::SurfaceId GetCurrentSurfaceId() const override; content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager( content::BrowserAccessibilityDelegate* delegate, @@ -302,7 +298,9 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, #if defined(OS_MACOSX) friend class MacHelper; -#endif + bool UpdateNSViewAndDisplay(); +#endif // defined(OS_MACOSX) + void PlatformCreateCompositorWidget(bool is_guest_view_hack); void PlatformResizeCompositorWidget(const gfx::Size& size); void PlatformDestroyCompositorWidget(); 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 e0a2b73b9..12c75bd29 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_linux.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_linux.cc @@ -11,7 +11,7 @@ #include "libcef/browser/native/window_x11.h" -#include "third_party/WebKit/public/platform/WebCursorInfo.h" +#include "third_party/blink/public/platform/web_cursor_info.h" #include "ui/base/x/x11_util.h" #include "ui/gfx/x/x11_types.h" diff --git a/libcef/browser/osr/render_widget_host_view_osr_mac.mm b/libcef/browser/osr/render_widget_host_view_osr_mac.mm index 46f07b57d..98c816a13 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -17,6 +17,16 @@ #include "base/strings/utf_string_conversions.h" #include "content/common/view_messages.h" #include "ui/accelerated_widget_mac/accelerated_widget_mac.h" +#include "ui/display/screen.h" + +namespace { + +display::Display GetDisplay() { + // TODO(cef): Get display info from callbacks. + return display::Screen::GetScreen()->GetDisplayNearestView(nullptr); +} + +} // namespace class MacHelper : public content::BrowserCompositorMacClient, public ui::AcceleratedWidgetMacNSView { @@ -37,7 +47,7 @@ class MacHelper : public content::BrowserCompositorMacClient, return view_->background_color(); } - void BrowserCompositorMacOnBeginFrame() override {} + void BrowserCompositorMacOnBeginFrame(base::TimeTicks frame_time) override {} void OnFrameTokenChanged(uint32_t frame_token) override { view_->render_widget_host()->DidProcessFrame(frame_token); @@ -64,6 +74,10 @@ class MacHelper : public content::BrowserCompositorMacClient, view_->render_widget_host()->DidReceiveFirstFrameAfterNavigation(); } + void DestroyCompositorForShutdown() override {} + + void WasResized() override { view_->render_widget_host()->WasResized(); } + private: // Guaranteed to outlive this object. CefRenderWidgetHostViewOSR* view_; @@ -75,18 +89,8 @@ void CefRenderWidgetHostViewOSR::SetActive(bool active) {} void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {} -bool CefRenderWidgetHostViewOSR::SupportsSpeech() const { - return false; -} - void CefRenderWidgetHostViewOSR::SpeakSelection() {} -bool CefRenderWidgetHostViewOSR::IsSpeaking() const { - return false; -} - -void CefRenderWidgetHostViewOSR::StopSpeaking() {} - bool CefRenderWidgetHostViewOSR::ShouldContinueToPauseForFrame() { return browser_compositor_->ShouldContinueToPauseForFrame(); } @@ -104,6 +108,11 @@ content::DelegatedFrameHost* CefRenderWidgetHostViewOSR::GetDelegatedFrameHost() return browser_compositor_->GetDelegatedFrameHost(); } +bool CefRenderWidgetHostViewOSR::UpdateNSViewAndDisplay() { + return browser_compositor_->UpdateNSViewAndDisplay( + GetRootLayer()->bounds().size(), GetDisplay()); +} + void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget( bool is_guest_view_hack) { // Create a borderless non-visible 1x1 window. @@ -122,7 +131,7 @@ void CefRenderWidgetHostViewOSR::PlatformCreateCompositorWidget( mac_helper_ = new MacHelper(this); browser_compositor_.reset(new content::BrowserCompositorMac( mac_helper_, mac_helper_, render_widget_host_->is_hidden(), true, - AllocateFrameSinkId(is_guest_view_hack))); + GetDisplay(), AllocateFrameSinkId(is_guest_view_hack))); } void CefRenderWidgetHostViewOSR::PlatformResizeCompositorWidget( diff --git a/libcef/browser/osr/render_widget_host_view_osr_win.cc b/libcef/browser/osr/render_widget_host_view_osr_win.cc index ed55b6035..c3b39916a 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_win.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_win.cc @@ -10,7 +10,7 @@ #include "libcef/browser/browser_host_impl.h" #include "libcef/browser/content_browser_client.h" -#include "third_party/WebKit/public/platform/WebCursorInfo.h" +#include "third_party/blink/public/platform/web_cursor_info.h" #include "ui/resources/grit/ui_unscaled_resources.h" namespace { diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 4dd39214f..e27298beb 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -43,7 +43,7 @@ #include "components/update_client/update_client.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/extension_prefs.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/l10n/l10n_util.h" namespace browser_prefs { diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 68065dd1e..a00f537be 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -36,7 +36,7 @@ #include "extensions/browser/extension_registry.h" #include "extensions/browser/view_type_utils.h" #include "extensions/common/constants.h" -#include "media/media_features.h" +#include "media/media_buildflags.h" namespace renderer_prefs { diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index 180e59220..d03400c13 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -10,7 +10,7 @@ #include "base/auto_reset.h" #include "base/bind.h" #include "base/location.h" -#include "base/memory/ptr_util.h" +#include "base/memory/ref_counted_memory.h" #include "base/memory/shared_memory.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -27,6 +27,7 @@ #include "chrome/browser/printing/printer_query.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" +#include "chrome/common/webui_url_constants.h" #include "chrome/grit/generated_resources.h" #include "components/prefs/pref_service.h" #include "components/printing/browser/print_composite_client.h" @@ -42,12 +43,14 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" +#include "extensions/common/constants.h" #include "mojo/public/cpp/system/buffer.h" -#include "printing/features/features.h" +#include "printing/buildflags/buildflags.h" #include "printing/pdf_metafile_skia.h" #include "printing/print_settings.h" #include "printing/printed_document.h" #include "ui/base/l10n/l10n_util.h" +#include "url/gurl.h" #if defined(OS_WIN) #include "base/command_line.h" @@ -59,6 +62,18 @@ using content::BrowserThread; namespace printing { +namespace { + +bool PrintingPdfContent(content::RenderFrameHost* rfh) { + GURL url = rfh->GetLastCommittedURL(); + // Whether it is inside print preview or pdf plugin extension. + return url.GetOrigin() == chrome::kChromeUIPrintURL || + (url.SchemeIs(extensions::kExtensionScheme) && + url.host_piece() == extension_misc::kPdfExtensionId); +} + +} // namespace + CefPrintViewManagerBase::CefPrintViewManagerBase( content::WebContents* web_contents) : PrintManager(web_contents), @@ -93,7 +108,7 @@ bool CefPrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) { void CefPrintViewManagerBase::PrintDocument( PrintedDocument* document, - const scoped_refptr& print_data, + const scoped_refptr& print_data, const gfx::Size& page_size, const gfx::Rect& content_area, const gfx::Point& offsets) { @@ -121,6 +136,11 @@ void CefPrintViewManagerBase::PrintDocument( print_job_->StartPdfToEmfConversion(print_data, page_size, content_area, print_text_with_gdi); } + // Indicate that the PDF is fully rendered and we no longer need the renderer + // and web contents, so the print job does not need to be cancelled if they + // die. This is needed on Windows because the PrintedDocument will not be + // considered complete until PDF conversion finishes. + document->SetConvertingPdf(); #else std::unique_ptr metafile = std::make_unique(); @@ -187,11 +207,13 @@ void CefPrintViewManagerBase::OnComposePdfDone( std::unique_ptr shared_buf = GetShmFromMojoHandle(std::move(handle)); - scoped_refptr bytes = - base::MakeRefCounted( - reinterpret_cast(shared_buf->memory()), - shared_buf->mapped_size()); - PrintDocument(document, bytes, params.page_size, params.content_area, + if (!shared_buf) + return; + + size_t size = shared_buf->mapped_size(); + auto data = base::MakeRefCounted( + std::move(shared_buf), size); + PrintDocument(document, data, params.page_size, params.content_area, params.physical_offsets); } @@ -210,8 +232,7 @@ void CefPrintViewManagerBase::OnDidPrintDocument( } auto* client = PrintCompositeClient::FromWebContents(web_contents()); - if (IsOopifEnabled() && !client->for_preview() && - document->settings().is_modifiable()) { + if (IsOopifEnabled() && !PrintingPdfContent(render_frame_host)) { client->DoCompositeDocumentToPdf( params.document_cookie, render_frame_host, content.metafile_data_handle, content.data_size, content.subframe_content_info, @@ -219,7 +240,6 @@ void CefPrintViewManagerBase::OnDidPrintDocument( weak_ptr_factory_.GetWeakPtr(), params)); return; } - auto shared_buf = std::make_unique(content.metafile_data_handle, true); if (!shared_buf->Map(content.data_size)) { @@ -227,11 +247,10 @@ void CefPrintViewManagerBase::OnDidPrintDocument( web_contents()->Stop(); return; } - scoped_refptr bytes = - base::MakeRefCounted( - reinterpret_cast(shared_buf->memory()), - content.data_size); - PrintDocument(document, bytes, params.page_size, params.content_area, + + auto data = base::MakeRefCounted( + std::move(shared_buf), content.data_size); + PrintDocument(document, data, params.page_size, params.content_area, params.physical_offsets); } @@ -358,18 +377,18 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() { if (!print_job_.get() || !print_job_->is_job_pending()) return false; - // We can't print if there is no renderer. - if (!web_contents() || !web_contents()->GetRenderViewHost() || - !web_contents()->GetRenderViewHost()->IsRenderViewLive()) { - return false; - } - // Is the document already complete? if (print_job_->document() && print_job_->document()->IsComplete()) { printing_succeeded_ = true; return true; } + // We can't print if there is no renderer. + if (!web_contents() || !web_contents()->GetRenderViewHost() || + !web_contents()->GetRenderViewHost()->IsRenderViewLive()) { + return false; + } + // WebContents is either dying or a second consecutive request to print // happened before the first had time to finish. We need to render all the // pages in an hurry if a print_job_ is still pending. No need to wait for it @@ -413,14 +432,12 @@ bool CefPrintViewManagerBase::CreateNewPrintJob(PrintJobWorkerOwner* job) { return false; } - // Ask the renderer to generate the print preview, create the print preview - // view and switch to it, initialize the printer and show the print dialog. DCHECK(!print_job_.get()); DCHECK(job); if (!job) return false; - print_job_ = new PrintJob(); + print_job_ = base::MakeRefCounted(); print_job_->Initialize(job, RenderSourceName(), number_pages_); registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(print_job_.get())); diff --git a/libcef/browser/printing/print_view_manager_base.h b/libcef/browser/printing/print_view_manager_base.h index edc3c3960..66b63628c 100644 --- a/libcef/browser/printing/print_view_manager_base.h +++ b/libcef/browser/printing/print_view_manager_base.h @@ -8,7 +8,7 @@ #include #include "base/macros.h" -#include "base/memory/ref_counted.h" +#include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/strings/string16.h" #include "build/build_config.h" @@ -18,12 +18,12 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "mojo/public/cpp/system/platform_handle.h" -#include "printing/features/features.h" +#include "printing/buildflags/buildflags.h" struct PrintHostMsg_DidPrintDocument_Params; namespace base { -class RefCountedBytes; +class RefCountedMemory; } namespace content { @@ -74,6 +74,15 @@ class CefPrintViewManagerBase : public content::NotificationObserver, // Cancels the print job. void NavigationStopped() override; + // Creates a new empty print job. It has no settings loaded. If there is + // currently a print job, safely disconnect from it. Returns false if it is + // impossible to safely disconnect from the current print job or it is + // impossible to create a new print job. + virtual bool CreateNewPrintJob(PrintJobWorkerOwner* job); + + // Manages the low-level talk to the printer. + scoped_refptr print_job_; + private: // content::NotificationObserver implementation. void Observe(int type, @@ -110,7 +119,7 @@ class CefPrintViewManagerBase : public content::NotificationObserver, // Starts printing |document| with the given |print_data|. This method assumes // |print_data| contains valid data. void PrintDocument(PrintedDocument* document, - const scoped_refptr& print_data, + const scoped_refptr& print_data, const gfx::Size& page_size, const gfx::Rect& content_area, const gfx::Point& offsets); @@ -122,12 +131,6 @@ class CefPrintViewManagerBase : public content::NotificationObserver, // RenderAllMissingPagesNow(). void ShouldQuitFromInnerMessageLoop(); - // Creates a new empty print job. It has no settings loaded. If there is - // currently a print job, safely disconnect from it. Returns false if it is - // impossible to safely disconnect from the current print job or it is - // impossible to create a new print job. - bool CreateNewPrintJob(PrintJobWorkerOwner* job); - // Makes sure the current print_job_ has all its data before continuing, and // disconnect from it. void DisconnectFromCurrentPrintJob(); @@ -163,9 +166,6 @@ class CefPrintViewManagerBase : public content::NotificationObserver, // The current RFH that is printing with a system printing dialog. content::RenderFrameHost* printing_rfh_; - // Manages the low-level talk to the printer. - scoped_refptr print_job_; - // Indication of success of the print job. bool printing_succeeded_; diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index a4d8a8776..3dc7eac8f 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -23,7 +23,6 @@ #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/features/features.h" #if defined(OS_LINUX) #include "libcef/browser/printing/print_dialog_linux.h" diff --git a/libcef/browser/printing/printing_message_filter.h b/libcef/browser/printing/printing_message_filter.h index 36139d685..290acc9e0 100644 --- a/libcef/browser/printing/printing_message_filter.h +++ b/libcef/browser/printing/printing_message_filter.h @@ -15,7 +15,7 @@ #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" #include "components/prefs/pref_member.h" #include "content/public/browser/browser_message_filter.h" -#include "printing/features/features.h" +#include "printing/buildflags/buildflags.h" struct PrintHostMsg_ScriptedPrint_Params; class Profile; diff --git a/libcef/browser/process_util_impl.cc b/libcef/browser/process_util_impl.cc index 3f547ce6d..fb42a9558 100644 --- a/libcef/browser/process_util_impl.cc +++ b/libcef/browser/process_util_impl.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/process/launch.h" -#include "content/public/browser/browser_thread.h" +#include "content/public/browser/child_process_launcher_utils.h" bool CefLaunchProcess(CefRefPtr command_line) { if (!command_line.get()) { @@ -15,8 +15,7 @@ bool CefLaunchProcess(CefRefPtr command_line) { return false; } - if (!content::BrowserThread::CurrentlyOn( - content::BrowserThread::PROCESS_LAUNCHER)) { + if (!content::CurrentlyOnProcessLauncherTaskRunner()) { NOTREACHED() << "called on invalid thread"; return false; } diff --git a/libcef/browser/resource_dispatcher_host_delegate.cc b/libcef/browser/resource_dispatcher_host_delegate.cc index 8c6f48d87..fa8fbe2d4 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.cc +++ b/libcef/browser/resource_dispatcher_host_delegate.cc @@ -30,65 +30,10 @@ #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" -namespace { - -void SendExecuteMimeTypeHandlerEvent( - std::unique_ptr stream, - int64_t expected_content_size, - const std::string& extension_id, - const std::string& view_id, - bool embedded, - int frame_tree_node_id, - int render_process_id, - int render_frame_id) { - CEF_REQUIRE_UIT(); - - content::WebContents* web_contents = nullptr; - if (frame_tree_node_id != -1) { - web_contents = - content::WebContents::FromFrameTreeNodeId(frame_tree_node_id); - } else { - web_contents = content::WebContents::FromRenderFrameHost( - content::RenderFrameHost::FromID(render_process_id, render_frame_id)); - } - if (!web_contents) - return; - - CefRefPtr browser = - CefBrowserHostImpl::GetBrowserForContents(web_contents); - if (!browser.get()) - return; - - content::BrowserContext* browser_context = web_contents->GetBrowserContext(); - - extensions::StreamsPrivateAPI* streams_private = - extensions::StreamsPrivateAPI::Get(browser_context); - if (!streams_private) - return; - - streams_private->ExecuteMimeTypeHandler( - extension_id, std::move(stream), view_id, expected_content_size, embedded, - frame_tree_node_id, render_process_id, render_frame_id); -} - -} // namespace - CefResourceDispatcherHostDelegate::CefResourceDispatcherHostDelegate() {} CefResourceDispatcherHostDelegate::~CefResourceDispatcherHostDelegate() {} -bool CefResourceDispatcherHostDelegate::HandleExternalProtocol( - const GURL& url, - content::ResourceRequestInfo* info) { - CEF_POST_TASK( - CEF_UIT, - base::Bind(base::IgnoreResult(&CefResourceDispatcherHostDelegate:: - HandleExternalProtocolOnUIThread), - base::Unretained(this), url, - info->GetWebContentsGetterForRequest())); - return false; -} - // Implementation based on // ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream. bool CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream( @@ -150,12 +95,14 @@ void CefResourceDispatcherHostDelegate::OnStreamCreated( stream_target_info_.find(request); CHECK(ix != stream_target_info_.end()); bool embedded = info->GetResourceType() != content::RESOURCE_TYPE_MAIN_FRAME; - CEF_POST_TASK( - CEF_UIT, - base::Bind(&SendExecuteMimeTypeHandlerEvent, base::Passed(&stream), - request->GetExpectedContentSize(), ix->second.extension_id, - ix->second.view_id, embedded, info->GetFrameTreeNodeId(), - info->GetChildID(), info->GetRenderFrameID())); + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce( + &extensions::StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent, + request->GetExpectedContentSize(), ix->second.extension_id, + ix->second.view_id, embedded, info->GetFrameTreeNodeId(), + info->GetChildID(), info->GetRenderFrameID(), std::move(stream), + nullptr /* transferrable_loader */, GURL())); stream_target_info_.erase(request); } @@ -178,17 +125,3 @@ void CefResourceDispatcherHostDelegate::OnRequestRedirected( response->head.headers->AddHeader("Access-Control-Allow-Credentials: true"); } } - -void CefResourceDispatcherHostDelegate::HandleExternalProtocolOnUIThread( - const GURL& url, - const content::ResourceRequestInfo::WebContentsGetter& - web_contents_getter) { - CEF_REQUIRE_UIT(); - content::WebContents* web_contents = web_contents_getter.Run(); - if (web_contents) { - CefRefPtr browser = - CefBrowserHostImpl::GetBrowserForContents(web_contents); - if (browser.get()) - browser->HandleExternalProtocol(url); - } -} diff --git a/libcef/browser/resource_dispatcher_host_delegate.h b/libcef/browser/resource_dispatcher_host_delegate.h index a801b6f98..2c39a5cc5 100644 --- a/libcef/browser/resource_dispatcher_host_delegate.h +++ b/libcef/browser/resource_dispatcher_host_delegate.h @@ -21,8 +21,6 @@ class CefResourceDispatcherHostDelegate ~CefResourceDispatcherHostDelegate() override; // ResourceDispatcherHostDelegate methods. - bool HandleExternalProtocol(const GURL& url, - content::ResourceRequestInfo* info) override; bool ShouldInterceptResourceAsStream(net::URLRequest* request, const std::string& mime_type, GURL* origin, diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 856a0cac2..cb9fcb163 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -28,101 +28,6 @@ using content::BrowserThread; using content::SpeechRecognitionManager; using content::WebContents; -// Simple utility to get notified when a WebContents is closed or crashes. -// Both the callback site and the callback thread are passed by the caller in -// the constructor. There is no restriction on the constructor, however this -// class must be destroyed on the UI thread, due to the NotificationRegistrar -// dependency. -class CefSpeechRecognitionManagerDelegate::WebContentsWatcher - : public base::RefCountedThreadSafe, - public content::NotificationObserver { - public: - typedef base::Callback - WebContentsClosedCallback; - - WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback, - BrowserThread::ID callback_thread) - : web_contents_closed_callback_(web_contents_closed_callback), - callback_thread_(callback_thread) {} - - // Starts monitoring the WebContents corresponding to the given - // |render_process_id|, |render_view_id| pair, invoking - // |web_contents_closed_callback_| if closed/unloaded. - void Watch(int render_process_id, int render_view_id) { - if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::Bind(&WebContentsWatcher::Watch, this, - render_process_id, render_view_id)); - return; - } - - WebContents* web_contents = NULL; - content::RenderViewHost* render_view_host = - content::RenderViewHost::FromID(render_process_id, render_view_id); - if (render_view_host) - web_contents = WebContents::FromRenderViewHost(render_view_host); - DCHECK(web_contents); - - // Avoid multiple registrations on |registrar_| for the same |web_contents|. - if (registered_web_contents_.find(web_contents) != - registered_web_contents_.end()) { - return; - } - registered_web_contents_.insert(web_contents); - - // Lazy initialize the registrar. - if (!registrar_.get()) - registrar_.reset(new content::NotificationRegistrar()); - - registrar_->Add(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, - content::Source(web_contents)); - } - - // content::NotificationObserver implementation. - void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type); - - WebContents* web_contents = content::Source(source).ptr(); - int render_process_id = - web_contents->GetRenderViewHost()->GetProcess()->GetID(); - int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); - - registrar_->Remove(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, - content::Source(web_contents)); - registered_web_contents_.erase(web_contents); - - BrowserThread::PostTask(callback_thread_, FROM_HERE, - base::Bind(web_contents_closed_callback_, - render_process_id, render_view_id)); - } - - private: - friend class base::RefCountedThreadSafe; - - ~WebContentsWatcher() override { - // Must be destroyed on the UI thread due to |registrar_| non thread-safety. - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - } - - // Lazy-initialized and used on the UI thread to handle web contents - // notifications (tab closing). - std::unique_ptr registrar_; - - // Keeps track of which WebContent(s) have been registered, in order to avoid - // double registrations on |registrar_| - std::set registered_web_contents_; - - // Callback used to notify, on the thread specified by |callback_thread_| the - // closure of a registered tab. - WebContentsClosedCallback web_contents_closed_callback_; - content::BrowserThread::ID callback_thread_; - - DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher); -}; - CefSpeechRecognitionManagerDelegate ::CefSpeechRecognitionManagerDelegate() { const base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); @@ -132,37 +37,7 @@ CefSpeechRecognitionManagerDelegate ::CefSpeechRecognitionManagerDelegate() { CefSpeechRecognitionManagerDelegate ::~CefSpeechRecognitionManagerDelegate() {} -void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback( - int render_process_id, - int render_view_id) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - - SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance(); - // |manager| becomes NULL if a browser shutdown happens between the post of - // this task (from the UI thread) and this call (on the IO thread). In this - // case we just return. - if (!manager) - return; - - manager->AbortAllSessionsForRenderView(render_process_id, render_view_id); -} - -void CefSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) { - const content::SpeechRecognitionSessionContext& context = - SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id); - - // Register callback to auto abort session on tab closure. - // |web_contents_watcher_| is lazyly istantiated on the first call. - if (!web_contents_watcher_.get()) { - web_contents_watcher_ = new WebContentsWatcher( - base::Bind( - &CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback, - base::Unretained(this)), - BrowserThread::IO); - } - web_contents_watcher_->Watch(context.render_process_id, - context.render_view_id); -} +void CefSpeechRecognitionManagerDelegate::OnRecognitionStart(int session_id) {} void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {} diff --git a/libcef/browser/speech_recognition_manager_delegate.h b/libcef/browser/speech_recognition_manager_delegate.h index f35d933b8..bb8bb86f8 100644 --- a/libcef/browser/speech_recognition_manager_delegate.h +++ b/libcef/browser/speech_recognition_manager_delegate.h @@ -48,13 +48,6 @@ class CefSpeechRecognitionManagerDelegate bool FilterProfanities(int render_process_id) override; private: - class WebContentsWatcher; - - // Callback called by |web_contents_watcher_| on the IO thread to signal - // web contents closure. - void WebContentsClosedCallback(int render_process_id, int render_view_id); - - scoped_refptr web_contents_watcher_; bool filter_profanities_; DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionManagerDelegate); diff --git a/libcef/browser/storage_partition_proxy.cc b/libcef/browser/storage_partition_proxy.cc index 6d941e651..51071877b 100644 --- a/libcef/browser/storage_partition_proxy.cc +++ b/libcef/browser/storage_partition_proxy.cc @@ -30,11 +30,16 @@ network::mojom::NetworkContext* CefStoragePartitionProxy::GetNetworkContext() { return parent_->GetNetworkContext(); } -scoped_refptr +scoped_refptr CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcess() { return parent_->GetURLLoaderFactoryForBrowserProcess(); } +std::unique_ptr +CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcessIOThread() { + return parent_->GetURLLoaderFactoryForBrowserProcessIOThread(); +} + network::mojom::CookieManager* CefStoragePartitionProxy::GetCookieManagerForBrowserProcess() { return parent_->GetCookieManagerForBrowserProcess(); @@ -101,6 +106,10 @@ CefStoragePartitionProxy::GetPlatformNotificationContext() { return parent_->GetPlatformNotificationContext(); } +content::WebPackageContext* CefStoragePartitionProxy::GetWebPackageContext() { + return parent_->GetWebPackageContext(); +} + void CefStoragePartitionProxy::ClearDataForOrigin( uint32_t remove_mask, uint32_t quota_storage_remove_mask, diff --git a/libcef/browser/storage_partition_proxy.h b/libcef/browser/storage_partition_proxy.h index 5fed7bbcd..14bc12716 100644 --- a/libcef/browser/storage_partition_proxy.h +++ b/libcef/browser/storage_partition_proxy.h @@ -25,8 +25,10 @@ class CefStoragePartitionProxy : public content::StoragePartition { net::URLRequestContextGetter* GetURLRequestContext() override; net::URLRequestContextGetter* GetMediaURLRequestContext() override; network::mojom::NetworkContext* GetNetworkContext() override; - scoped_refptr + scoped_refptr GetURLLoaderFactoryForBrowserProcess() override; + std::unique_ptr + GetURLLoaderFactoryForBrowserProcessIOThread() override; network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override; storage::QuotaManager* GetQuotaManager() override; content::AppCacheService* GetAppCacheService() override; @@ -43,6 +45,7 @@ class CefStoragePartitionProxy : public content::StoragePartition { content::ZoomLevelDelegate* GetZoomLevelDelegate() override; content::PlatformNotificationContext* GetPlatformNotificationContext() override; + content::WebPackageContext* GetWebPackageContext() override; void ClearDataForOrigin(uint32_t remove_mask, uint32_t quota_storage_remove_mask, const GURL& storage_origin) override; diff --git a/libcef/common/cef_crash_report_upload_thread.cc b/libcef/common/cef_crash_report_upload_thread.cc index f0b23850d..1c81feb29 100644 --- a/libcef/common/cef_crash_report_upload_thread.cc +++ b/libcef/common/cef_crash_report_upload_thread.cc @@ -9,38 +9,6 @@ using namespace crashpad; -namespace { - -// Calls CrashReportDatabase::RecordUploadAttempt() with |successful| set to -// false upon destruction unless disarmed by calling Fire() or Disarm(). Fire() -// triggers an immediate call. Armed upon construction. -class CallRecordUploadAttempt { - public: - CallRecordUploadAttempt(CrashReportDatabase* database, - const CrashReportDatabase::Report* report) - : database_(database), report_(report) {} - - ~CallRecordUploadAttempt() { Fire(); } - - void Fire() { - if (report_) { - database_->RecordUploadAttempt(report_, false, std::string()); - } - - Disarm(); - } - - void Disarm() { report_ = nullptr; } - - private: - CrashReportDatabase* database_; // weak - const CrashReportDatabase::Report* report_; // weak - - DISALLOW_COPY_AND_ASSIGN(CallRecordUploadAttempt); -}; - -} // namespace - CefCrashReportUploadThread::CefCrashReportUploadThread( CrashReportDatabase* database, const std::string& url, @@ -109,7 +77,7 @@ void CefCrashReportUploadThread::ProcessPendingReport( return; } - const CrashReportDatabase::Report* upload_report; + std::unique_ptr upload_report; CrashReportDatabase::OperationStatus status = database_->GetReportForUploading(report.uuid, &upload_report); switch (status) { @@ -133,22 +101,19 @@ void CefCrashReportUploadThread::ProcessPendingReport( return; } - CallRecordUploadAttempt call_record_upload_attempt(database_, upload_report); - std::string response_body; - UploadResult upload_result = UploadReport(upload_report, &response_body); + UploadResult upload_result = + UploadReport(upload_report.get(), &response_body); switch (upload_result) { case UploadResult::kSuccess: // The upload completed successfully. - call_record_upload_attempt.Disarm(); - database_->RecordUploadAttempt(upload_report, true, response_body); + database_->RecordUploadComplete(std::move(upload_report), response_body); if (MaxUploadsEnabled()) recent_upload_ct_++; ResetBackoff(); break; case UploadResult::kPermanentFailure: // The upload should never be retried. - call_record_upload_attempt.Fire(); database_->SkipReportUpload(report.uuid, Metrics::CrashSkippedReason::kUploadFailed); break; diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index c91a979ec..4cec9c055 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -204,17 +204,21 @@ void CefContentClient::AddPepperPlugins( ComputeBuiltInPlugins(plugins); AddPepperFlashFromCommandLine(plugins); -#if defined(OS_LINUX) -#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) - CefWidevineLoader::AddPepperPlugins(plugins); -#endif -#endif - content::PepperPluginInfo plugin; if (GetSystemPepperFlash(&plugin)) plugins->push_back(plugin); } +void CefContentClient::AddContentDecryptionModules( + std::vector* cdms, + std::vector* cdm_host_file_paths) { +#if defined(OS_LINUX) +#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) + CefWidevineLoader::AddContentDecryptionModules(cdms, cdm_host_file_paths); +#endif +#endif +} + void CefContentClient::AddAdditionalSchemes(Schemes* schemes) { DCHECK(!scheme_info_list_locked_); diff --git a/libcef/common/content_client.h b/libcef/common/content_client.h index e3272942f..cb39ce560 100644 --- a/libcef/common/content_client.h +++ b/libcef/common/content_client.h @@ -33,6 +33,9 @@ class CefContentClient : public content::ContentClient, // content::ContentClient methods. void AddPepperPlugins( std::vector* plugins) override; + void AddContentDecryptionModules( + std::vector* cdms, + std::vector* cdm_host_file_paths) override; void AddAdditionalSchemes(Schemes* schemes) override; std::string GetProduct() const override; std::string GetChromeProduct() const override; diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 1371d66f3..f419ace17 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -556,7 +556,7 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() { if (embedded_handler) { crash_reporter::InitializeCrashpadWithEmbeddedHandler( process_type.empty(), install_static::UTF16ToUTF8(process_type), - std::string()); + std::string(), base::FilePath()); } else { crash_reporter::InitializeCrashpad( process_type.empty(), install_static::UTF16ToUTF8(process_type)); @@ -603,6 +603,12 @@ bool CefCrashReporterClient::GetCrashMetricsLocation( void CefCrashReporterClient::GetProductNameAndVersion(const char** product_name, const char** version) { + GetProductNameAndVersion(product_name, version, nullptr); +} + +void CefCrashReporterClient::GetProductNameAndVersion(const char** product_name, + const char** version, + const char** channel) { *product_name = product_name_.c_str(); *version = product_version_.c_str(); } diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 884fffad1..09ef62b82 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -53,6 +53,9 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { #elif defined(OS_POSIX) void GetProductNameAndVersion(const char** product_name, const char** version) override; + void GetProductNameAndVersion(const char** product_name, + const char** version, + const char** channel) override; #if !defined(OS_MACOSX) base::FilePath GetReporterLogFilename() override; bool EnableBreakpadForProcess(const std::string& process_type) override; diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 13f462636..30e618220 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -34,7 +34,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" #include "extensions/common/constants.h" -#include "ipc/ipc_features.h" +#include "ipc/ipc_buildflags.h" #include "pdf/pdf_ppapi.h" #include "ui/base/layout.h" #include "ui/base/material_design/material_design_controller.h" diff --git a/libcef/common/net/scheme_registration.cc b/libcef/common/net/scheme_registration.cc index 16a7b7cd2..fbe1b0423 100644 --- a/libcef/common/net/scheme_registration.cc +++ b/libcef/common/net/scheme_registration.cc @@ -8,7 +8,7 @@ #include "content/public/common/url_constants.h" #include "extensions/common/constants.h" -#include "net/net_features.h" +#include "net/net_buildflags.h" #include "url/url_constants.h" namespace scheme { diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 79893f5ab..a72b49309 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -35,12 +35,12 @@ #include "net/url_request/url_fetcher.h" #include "net/url_request/url_request.h" #include "services/network/public/cpp/network_switches.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/WebKit/public/platform/modules/fetch/fetch_api_request.mojom-shared.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" +#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom-shared.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/platform/web_url_error.h" +#include "third_party/blink/public/platform/web_url_request.h" +#include "third_party/blink/public/web/web_security_policy.h" namespace { diff --git a/libcef/common/request_impl.h b/libcef/common/request_impl.h index 006a3a51a..37c4dcd3e 100644 --- a/libcef/common/request_impl.h +++ b/libcef/common/request_impl.h @@ -13,8 +13,8 @@ #include "include/cef_request.h" #include "base/synchronization/lock.h" -#include "third_party/WebKit/public/platform/WebHTTPBody.h" -#include "third_party/WebKit/public/platform/WebReferrerPolicy.h" +#include "third_party/blink/public/platform/web_http_body.h" +#include "third_party/blink/public/platform/web_referrer_policy.h" #include "url/gurl.h" namespace navigation_interception { diff --git a/libcef/common/response_impl.cc b/libcef/common/response_impl.cc index 57d5c3a66..9a871a0da 100644 --- a/libcef/common/response_impl.cc +++ b/libcef/common/response_impl.cc @@ -11,10 +11,10 @@ #include "net/http/http_request_headers.h" #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" -#include "third_party/WebKit/public/platform/WebHTTPHeaderVisitor.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" +#include "third_party/blink/public/platform/web_http_header_visitor.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/platform/web_url_response.h" #define CHECK_READONLY_RETURN_VOID() \ if (read_only_) { \ diff --git a/libcef/common/task_runner_impl.cc b/libcef/common/task_runner_impl.cc index c5151d64a..75e4e7934 100644 --- a/libcef/common/task_runner_impl.cc +++ b/libcef/common/task_runner_impl.cc @@ -13,6 +13,7 @@ #include "base/message_loop/message_loop.h" #include "base/threading/thread_task_runner_handle.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/child_process_launcher_utils.h" using content::BrowserThread; @@ -73,6 +74,8 @@ scoped_refptr CefTaskRunnerImpl::GetTaskRunner( return client->user_visible_task_runner(); case TID_FILE_USER_BLOCKING: return client->user_blocking_task_runner(); + case TID_PROCESS_LAUNCHER: + return content::GetProcessLauncherTaskRunner(); case TID_IO: id = BrowserThread::IO; break; @@ -81,7 +84,7 @@ scoped_refptr CefTaskRunnerImpl::GetTaskRunner( }; if (id >= 0 && - BrowserThread::IsMessageLoopValid(static_cast(id))) { + BrowserThread::IsThreadInitialized(static_cast(id))) { return BrowserThread::GetTaskRunnerForThread( static_cast(id)); } @@ -98,7 +101,7 @@ CefTaskRunnerImpl::GetCurrentTaskRunner() { // GetTaskRunner(). Otherwise BelongsToThread() will return incorrect results. BrowserThread::ID current_id; if (BrowserThread::GetCurrentThreadIdentifier(¤t_id) && - BrowserThread::IsMessageLoopValid(current_id)) { + BrowserThread::IsThreadInitialized(current_id)) { task_runner = BrowserThread::GetTaskRunnerForThread(current_id); } diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index 0e181f302..6df068f2d 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -19,11 +19,11 @@ #include "base/strings/string_piece.h" #include "base/strings/string_split.h" #include "base/strings/utf_string_conversions.h" -#include "chrome/common/widevine_cdm_constants.h" #include "content/browser/plugin_service_impl.h" #include "content/public/browser/cdm_registry.h" #include "content/public/common/cdm_info.h" #include "content/public/common/content_switches.h" +#include "media/cdm/cdm_host_file.h" #include "media/cdm/supported_cdm_versions.h" namespace { @@ -174,31 +174,9 @@ bool IsCompatibleWithChrome(const base::DictionaryValue& manifest, error_message); } -// Populate the PepperPluginInfo structure. -void GetPluginInfo(const base::FilePath& cdm_adapter_path, - const base::FilePath& cdm_path, - const std::string& cdm_version, - const std::string& cdm_codecs, - bool supports_persistent_license, - content::PepperPluginInfo* widevine_cdm) { - widevine_cdm->is_out_of_process = true; - widevine_cdm->path = cdm_adapter_path; - widevine_cdm->name = kWidevineCdmDisplayName; - widevine_cdm->description = - kWidevineCdmDescription + std::string(" (version: ") + cdm_version + ")"; - widevine_cdm->version = cdm_version; - content::WebPluginMimeType widevine_cdm_mime_type( - kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension, - kWidevineCdmPluginMimeTypeDescription); - - widevine_cdm->mime_types.push_back(widevine_cdm_mime_type); - widevine_cdm->permissions = kWidevineCdmPluginPermissions; -} - // Verify and load the contents of |base_path|. cef_cdm_registration_error_t LoadWidevineCdmInfo( const base::FilePath& base_path, - base::FilePath* cdm_adapter_path, base::FilePath* cdm_path, std::string* cdm_version, std::string* cdm_codecs, @@ -206,13 +184,6 @@ cef_cdm_registration_error_t LoadWidevineCdmInfo( std::string* error_message) { std::stringstream ss; - *cdm_adapter_path = base_path.AppendASCII(kWidevineCdmAdapterFileName); - if (!base::PathExists(*cdm_adapter_path)) { - ss << "Missing adapter file " << cdm_adapter_path->value(); - *error_message = ss.str(); - return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS; - } - *cdm_path = base_path.AppendASCII( base::GetNativeLibraryName(kWidevineCdmLibraryName)); if (!base::PathExists(*cdm_path)) { @@ -286,33 +257,28 @@ std::vector ConvertCodecsString(const std::string& codecs) { return supported_video_codecs; } -void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path, - const base::FilePath& cdm_path, +content::CdmInfo MakeCdmInfo(const base::FilePath& cdm_path, + const std::string& cdm_version, + const std::string& cdm_codecs, + bool supports_persistent_license) { + std::vector supported_video_codecs = + ConvertCodecsString(cdm_codecs); + return content::CdmInfo( + kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version), + cdm_path, kWidevineCdmFileSystemId, supported_video_codecs, + supports_persistent_license, kWidevineKeySystem, false); +} + +void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_path, const std::string& cdm_version, const std::string& cdm_codecs, bool supports_persistent_license, CefRefPtr callback) { CEF_REQUIRE_UIT(); - content::PepperPluginInfo widevine_cdm; - GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs, - supports_persistent_license, &widevine_cdm); - - // true = Add to beginning of list to override any existing registrations. - content::PluginService::GetInstance()->RegisterInternalPlugin( - widevine_cdm.ToWebPluginInfo(), true); - // Tell the browser to refresh the plugin list. Then tell all renderers to - // update their plugin list caches. - content::PluginService::GetInstance()->RefreshPlugins(); - content::PluginService::GetInstance()->PurgePluginListCache(NULL, false); - - // Also register Widevine with the CdmRegistry. - std::vector supported_video_codecs = - ConvertCodecsString(cdm_codecs); - content::CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo( - kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version), - cdm_path, kWidevineCdmFileSystemId, supported_video_codecs, - supports_persistent_license, kWidevineKeySystem, false)); + // Register Widevine with the CdmRegistry. + content::CdmRegistry::GetInstance()->RegisterCdm(MakeCdmInfo( + cdm_path, cdm_version, cdm_codecs, supports_persistent_license)); DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(), callback); @@ -323,15 +289,14 @@ void LoadWidevineCdmInfoOnBlockingThread( CefRefPtr callback) { CEF_REQUIRE_BLOCKING(); - base::FilePath cdm_adapter_path; base::FilePath cdm_path; std::string cdm_version; std::string cdm_codecs; bool supports_persistent_license; std::string error_message; - cef_cdm_registration_error_t result = LoadWidevineCdmInfo( - base_path, &cdm_adapter_path, &cdm_path, &cdm_version, &cdm_codecs, - &supports_persistent_license, &error_message); + cef_cdm_registration_error_t result = + LoadWidevineCdmInfo(base_path, &cdm_path, &cdm_version, &cdm_codecs, + &supports_persistent_license, &error_message); if (result != CEF_CDM_REGISTRATION_ERROR_NONE) { CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result, error_message, callback)); @@ -340,9 +305,8 @@ void LoadWidevineCdmInfoOnBlockingThread( // Continue execution on the UI thread. CEF_POST_TASK(CEF_UIT, - base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path, - cdm_path, cdm_version, cdm_codecs, - supports_persistent_license, callback)); + base::Bind(RegisterWidevineCdmOnUIThread, cdm_path, cdm_version, + cdm_codecs, supports_persistent_license, callback)); } } // namespace @@ -379,8 +343,9 @@ void CefWidevineLoader::OnContextInitialized() { #if defined(OS_LINUX) // static -void CefWidevineLoader::AddPepperPlugins( - std::vector* plugins) { +void CefWidevineLoader::AddContentDecryptionModules( + std::vector* cdms, + std::vector* cdm_host_file_paths) { const base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); @@ -409,18 +374,16 @@ void CefWidevineLoader::AddPepperPlugins( std::string cdm_codecs; bool supports_persistent_license; std::string error_message; - cef_cdm_registration_error_t result = LoadWidevineCdmInfo( - base_path, &cdm_adapter_path, &cdm_path, &cdm_version, &cdm_codecs, - &supports_persistent_license, &error_message); + cef_cdm_registration_error_t result = + LoadWidevineCdmInfo(base_path, &cdm_path, &cdm_version, &cdm_codecs, + &supports_persistent_license, &error_message); if (result != CEF_CDM_REGISTRATION_ERROR_NONE) { LOG(ERROR) << "Widevine CDM registration failed; " << error_message; return; } - content::PepperPluginInfo widevine_cdm; - GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs, - supports_persistent_license, &widevine_cdm); - plugins->push_back(widevine_cdm); + cdms->push_back(MakeCdmInfo(cdm_path, cdm_version, cdm_codecs, + supports_persistent_license)); } #endif // defined(OS_LINUX) diff --git a/libcef/common/widevine_loader.h b/libcef/common/widevine_loader.h index 5e1894d7d..2a6d068bc 100644 --- a/libcef/common/widevine_loader.h +++ b/libcef/common/widevine_loader.h @@ -19,7 +19,11 @@ #include "base/lazy_instance.h" namespace content { -struct PepperPluginInfo; +struct CdmInfo; +} + +namespace media { +struct CdmHostFilePath; } class CefWidevineLoader { @@ -38,10 +42,12 @@ class CefWidevineLoader { #if defined(OS_LINUX) // The zygote process which is used when the sandbox is enabled on Linux - // requires early loading of pepper plugins. Other processes will receive + // requires early loading of CDM modules. Other processes will receive // load notification in the usual way. - // Called from CefContentClient::AddPepperPlugins. - static void AddPepperPlugins(std::vector* plugins); + // Called from CefContentClient::AddContentDecryptionModules. + static void AddContentDecryptionModules( + std::vector* cdms, + std::vector* cdm_host_file_paths); const base::FilePath& path() { return path_; } #endif diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/blink_glue.cc similarity index 83% rename from libcef/renderer/webkit_glue.cc rename to libcef/renderer/blink_glue.cc index 752362ee5..624da47b8 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -3,38 +3,39 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "libcef/renderer/webkit_glue.h" +#include "libcef/renderer/blink_glue.h" #include "base/compiler_specific.h" MSVC_PUSH_WARNING_LEVEL(0); -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebNode.h" -#include "third_party/WebKit/public/web/WebViewClient.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url_response.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_element.h" +#include "third_party/blink/public/web/web_node.h" +#include "third_party/blink/public/web/web_view_client.h" -#include "third_party/WebKit/Source/bindings/core/v8/ScriptController.h" -#include "third_party/WebKit/Source/bindings/core/v8/ScriptSourceCode.h" -#include "third_party/WebKit/Source/core/dom/Document.h" -#include "third_party/WebKit/Source/core/dom/Element.h" -#include "third_party/WebKit/Source/core/dom/Node.h" -#include "third_party/WebKit/Source/core/editing/serializers/Serialization.h" -#include "third_party/WebKit/Source/core/exported/WebViewImpl.h" -#include "third_party/WebKit/Source/core/frame/LocalFrame.h" -#include "third_party/WebKit/Source/core/frame/Settings.h" -#include "third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h" -#include "third_party/WebKit/Source/platform/bindings/ScriptForbiddenScope.h" -#include "third_party/WebKit/Source/platform/bindings/V8Binding.h" -#include "third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.h" -#include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.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/core/dom/document.h" +#include "third_party/blink/renderer/core/dom/element.h" +#include "third_party/blink/renderer/core/dom/node.h" +#include "third_party/blink/renderer/core/editing/serializers/serialization.h" +#include "third_party/blink/renderer/core/exported/web_view_impl.h" +#include "third_party/blink/renderer/core/frame/local_frame.h" +#include "third_party/blink/renderer/core/frame/settings.h" +#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" +#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/weborigin/scheme_registry.h" MSVC_POP_WARNING(); #undef LOG #include "base/logging.h" -namespace webkit_glue { +namespace blink_glue { const int64_t kInvalidFrameId = -1; @@ -229,4 +230,4 @@ bool ResponseWasCached(const blink::WebURLResponse& response) { return response.ToResourceResponse().WasCached(); } -} // namespace webkit_glue +} // namespace blink_glue diff --git a/libcef/renderer/webkit_glue.h b/libcef/renderer/blink_glue.h similarity index 88% rename from libcef/renderer/webkit_glue.h rename to libcef/renderer/blink_glue.h index 8b4a12fff..9da8935c6 100644 --- a/libcef/renderer/webkit_glue.h +++ b/libcef/renderer/blink_glue.h @@ -3,8 +3,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ -#define CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ +#ifndef CEF_LIBCEF_RENDERER_BLINK_GLUE_H_ +#define CEF_LIBCEF_RENDERER_BLINK_GLUE_H_ #include @@ -13,8 +13,8 @@ #include "include/internal/cef_types.h" -#include "third_party/WebKit/Source/platform/loader/fetch/AccessControlStatus.h" -#include "third_party/WebKit/public/platform/WebCommon.h" +#include "third_party/blink/public/platform/web_common.h" +#include "third_party/blink/renderer/platform/loader/fetch/access_control_status.h" #include "v8/include/v8.h" namespace blink { @@ -26,7 +26,7 @@ class WebURLResponse; class WebView; } // namespace blink -namespace webkit_glue { +namespace blink_glue { BLINK_EXPORT extern const int64_t kInvalidFrameId; @@ -84,6 +84,6 @@ class BLINK_EXPORT CefScriptForbiddenScope final { BLINK_EXPORT bool ResponseWasCached(const blink::WebURLResponse& response); -} // namespace webkit_glue +} // namespace blink_glue -#endif // CEF_LIBCEF_RENDERER_WEBKIT_GLUE_H_ +#endif // CEF_LIBCEF_RENDERER_BLINK_GLUE_H_ diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index f14fcdb94..4cac29295 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -13,11 +13,11 @@ #include "libcef/common/process_message_impl.h" #include "libcef/common/request_impl.h" #include "libcef/common/response_manager.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/content_renderer_client.h" #include "libcef/renderer/dom_document_impl.h" #include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/thread_util.h" -#include "libcef/renderer/webkit_glue.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" @@ -26,18 +26,18 @@ #include "content/public/renderer/navigation_state.h" #include "content/public/renderer/render_view.h" #include "content/renderer/navigation_state_impl.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebFrameContentDumper.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebNode.h" -#include "third_party/WebKit/public/web/WebScriptSource.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" -#include "third_party/WebKit/public/web/WebView.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/platform/web_url_error.h" +#include "third_party/blink/public/platform/web_url_response.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_frame.h" +#include "third_party/blink/public/web/web_frame_content_dumper.h" +#include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/public/web/web_node.h" +#include "third_party/blink/public/web/web_script_source.h" +#include "third_party/blink/public/web/web_security_policy.h" +#include "third_party/blink/public/web/web_view.h" using blink::WebFrame; using blink::WebLocalFrame; @@ -72,25 +72,25 @@ CefRefPtr CefBrowserImpl::GetHost() { bool CefBrowserImpl::CanGoBack() { CEF_REQUIRE_RT_RETURN(false); - return webkit_glue::CanGoBack(render_view()->GetWebView()); + return blink_glue::CanGoBack(render_view()->GetWebView()); } void CefBrowserImpl::GoBack() { CEF_REQUIRE_RT_RETURN_VOID(); - webkit_glue::GoBack(render_view()->GetWebView()); + blink_glue::GoBack(render_view()->GetWebView()); } bool CefBrowserImpl::CanGoForward() { CEF_REQUIRE_RT_RETURN(false); - return webkit_glue::CanGoForward(render_view()->GetWebView()); + return blink_glue::CanGoForward(render_view()->GetWebView()); } void CefBrowserImpl::GoForward() { CEF_REQUIRE_RT_RETURN_VOID(); - webkit_glue::GoForward(render_view()->GetWebView()); + blink_glue::GoForward(render_view()->GetWebView()); } bool CefBrowserImpl::IsLoading() { @@ -349,11 +349,11 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( frames_.insert(std::make_pair(frame_id, framePtr)); const int64_t parent_id = frame->Parent() == NULL - ? webkit_glue::kInvalidFrameId + ? blink_glue::kInvalidFrameId : frame->Parent()->IsWebLocalFrame() ? render_frame_util::GetIdentifier( frame->Parent()->ToWebLocalFrame()) - : webkit_glue::kInvalidFrameId; + : blink_glue::kInvalidFrameId; const base::string16& name = base::UTF8ToUTF16(render_frame_util::GetName(frame)); @@ -364,7 +364,7 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( } CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) { - if (frame_id == webkit_glue::kInvalidFrameId) { + if (frame_id == blink_glue::kInvalidFrameId) { if (render_view()->GetWebView()) { WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { @@ -607,7 +607,7 @@ void CefBrowserImpl::OnRequest(const Cef_Request_Params& params) { blink::WebFrameContentDumper::DumpAsMarkup(web_frame).Utf8(); success = true; } else if (base::LowerCaseEqualsASCII(command, "gettext")) { - response = webkit_glue::DumpDocumentText(web_frame); + response = blink_glue::DumpDocumentText(web_frame); success = true; } else if (web_frame->ExecuteCommand( blink::WebString::FromUTF8(command))) { @@ -667,8 +667,8 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { WebView* web_view = render_view()->GetWebView(); - const bool canGoBack = webkit_glue::CanGoBack(web_view); - const bool canGoForward = webkit_glue::CanGoForward(web_view); + const bool canGoBack = blink_glue::CanGoBack(web_view); + const bool canGoForward = blink_glue::CanGoForward(web_view); load_handler->OnLoadingStateChange(this, isLoading, canGoBack, canGoForward); diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index 806c8640c..ca68e264c 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -23,6 +23,7 @@ #include "libcef/common/extensions/extensions_util.h" #include "libcef/common/request_impl.h" #include "libcef/common/values_impl.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/extensions/extensions_renderer_client.h" #include "libcef/renderer/extensions/print_render_frame_helper_delegate.h" @@ -31,7 +32,6 @@ #include "libcef/renderer/render_thread_observer.h" #include "libcef/renderer/thread_util.h" #include "libcef/renderer/v8_impl.h" -#include "libcef/renderer/webkit_glue.h" #include "base/command_line.h" #include "base/macros.h" @@ -78,21 +78,21 @@ #include "services/service_manager/public/cpp/connector.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "services/service_manager/public/cpp/service_context.h" -#include "third_party/WebKit/public/common/associated_interfaces/associated_interface_provider.h" -#include "third_party/WebKit/public/platform/Platform.h" -#include "third_party/WebKit/public/platform/URLConversion.h" -#include "third_party/WebKit/public/platform/WebPrerenderingSupport.h" -#include "third_party/WebKit/public/platform/WebRuntimeFeatures.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/scheduler/renderer_process_type.h" -#include "third_party/WebKit/public/web/WebConsoleMessage.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebPrerendererClient.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" -#include "third_party/WebKit/public/web/WebView.h" +#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" +#include "third_party/blink/public/platform/platform.h" +#include "third_party/blink/public/platform/scheduler/renderer_process_type.h" +#include "third_party/blink/public/platform/url_conversion.h" +#include "third_party/blink/public/platform/web_prerendering_support.h" +#include "third_party/blink/public/platform/web_runtime_features.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/web/web_console_message.h" +#include "third_party/blink/public/web/web_element.h" +#include "third_party/blink/public/web/web_frame.h" +#include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/public/web/web_prerenderer_client.h" +#include "third_party/blink/public/web/web_security_policy.h" +#include "third_party/blink/public/web/web_view.h" #include "ui/base/l10n/l10n_util.h" #if defined(OS_MACOSX) @@ -258,11 +258,11 @@ void CefContentRendererClient::WebKitInitialized() { const blink::WebString& scheme = blink::WebString::FromUTF8(info.scheme_name); if (info.is_local) - webkit_glue::RegisterURLSchemeAsLocal(scheme); + blink_glue::RegisterURLSchemeAsLocal(scheme); if (info.is_display_isolated) blink::WebSecurityPolicy::RegisterURLSchemeAsDisplayIsolated(scheme); if (info.is_secure) - webkit_glue::RegisterURLSchemeAsSecure(scheme); + blink_glue::RegisterURLSchemeAsSecure(scheme); } } @@ -511,17 +511,20 @@ bool CefContentRendererClient::ShouldFork(blink::WebLocalFrame* frame, return false; } -bool CefContentRendererClient::WillSendRequest( +void CefContentRendererClient::WillSendRequest( blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - GURL* new_url) { + const url::Origin* initiator_origin, + GURL* new_url, + bool* attach_same_site_cookies) { if (extensions::ExtensionsEnabled()) { - return extensions_renderer_client_->WillSendRequest(frame, transition_type, - url, new_url); + extensions_renderer_client_->WillSendRequest(frame, transition_type, url, + initiator_origin, new_url, + attach_same_site_cookies); + if (!new_url->is_empty()) + return; } - - return false; } unsigned long long CefContentRendererClient::VisitedLinkHash( @@ -535,14 +538,21 @@ bool CefContentRendererClient::IsLinkVisited(unsigned long long link_hash) { return observer_->visited_link_slave()->IsVisited(link_hash); } +bool CefContentRendererClient::IsOriginIsolatedPepperPlugin( + const base::FilePath& plugin_path) { + return plugin_path == + base::FilePath::FromUTF8Unsafe(CefContentClient::kPDFPluginPath); +} + content::BrowserPluginDelegate* CefContentRendererClient::CreateBrowserPluginDelegate( content::RenderFrame* render_frame, + const content::WebPluginInfo& info, const std::string& mime_type, const GURL& original_url) { DCHECK(extensions::ExtensionsEnabled()); return extensions::CefExtensionsRendererClient::CreateBrowserPluginDelegate( - render_frame, mime_type, original_url); + render_frame, info, mime_type, original_url); } void CefContentRendererClient::AddSupportedKeySystems( diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index a0b253d67..b82a5c7b8 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -114,15 +114,19 @@ class CefContentRendererClient : public content::ContentRendererClient, bool is_initial_navigation, bool is_server_redirect, bool* send_referrer) override; - bool WillSendRequest(blink::WebLocalFrame* frame, + void WillSendRequest(blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - GURL* new_url) override; + const url::Origin* initiator_origin, + GURL* new_url, + bool* attach_same_site_cookies) override; unsigned long long VisitedLinkHash(const char* canonical_url, size_t length) override; bool IsLinkVisited(unsigned long long link_hash) override; + bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override; content::BrowserPluginDelegate* CreateBrowserPluginDelegate( content::RenderFrame* render_frame, + const content::WebPluginInfo& info, const std::string& mime_type, const GURL& original_url) override; void AddSupportedKeySystems( diff --git a/libcef/renderer/dom_document_impl.cc b/libcef/renderer/dom_document_impl.cc index 1c4c1609d..f96efa268 100644 --- a/libcef/renderer/dom_document_impl.cc +++ b/libcef/renderer/dom_document_impl.cc @@ -7,13 +7,13 @@ #include "libcef/renderer/thread_util.h" #include "base/logging.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebNode.h" -#include "third_party/WebKit/public/web/WebRange.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_element.h" +#include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/public/web/web_node.h" +#include "third_party/blink/public/web/web_range.h" using blink::WebDocument; using blink::WebElement; diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index 1d80b15ba..92e998cb2 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -5,22 +5,22 @@ #include "libcef/renderer/dom_node_impl.h" #include "libcef/common/tracker.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/dom_document_impl.h" #include "libcef/renderer/thread_util.h" -#include "libcef/renderer/webkit_glue.h" #include "base/logging.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/web/WebDOMEvent.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebFormControlElement.h" -#include "third_party/WebKit/public/web/WebInputElement.h" -#include "third_party/WebKit/public/web/WebNode.h" -#include "third_party/WebKit/public/web/WebSelectElement.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_dom_event.h" +#include "third_party/blink/public/web/web_element.h" +#include "third_party/blink/public/web/web_form_control_element.h" +#include "third_party/blink/public/web/web_input_element.h" +#include "third_party/blink/public/web/web_node.h" +#include "third_party/blink/public/web/web_select_element.h" using blink::WebDocument; using blink::WebDOMEvent; @@ -48,7 +48,7 @@ CefDOMNodeImpl::Type CefDOMNodeImpl::GetType() { if (!VerifyContext()) return DOM_NODE_TYPE_UNSUPPORTED; - return webkit_glue::GetNodeType(node_); + return blink_glue::GetNodeType(node_); } bool CefDOMNodeImpl::IsText() { @@ -75,7 +75,7 @@ bool CefDOMNodeImpl::IsEditable() { if (node_.IsElementNode()) { const WebElement& element = node_.ToConst(); - if (webkit_glue::IsTextControlElement(element)) + if (blink_glue::IsTextControlElement(element)) return true; // Also return true if it has an ARIA role of 'textbox'. @@ -143,7 +143,7 @@ CefString CefDOMNodeImpl::GetName() { if (!VerifyContext()) return str; - const WebString& name = webkit_glue::GetNodeName(node_); + const WebString& name = blink_glue::GetNodeName(node_); if (!name.IsNull()) str = name.Utf16(); @@ -196,8 +196,8 @@ bool CefDOMNodeImpl::SetValue(const CefString& value) { if (node_.IsElementNode()) return false; - return webkit_glue::SetNodeValue(node_, - WebString::FromUTF16(value.ToString16())); + return blink_glue::SetNodeValue(node_, + WebString::FromUTF16(value.ToString16())); } CefString CefDOMNodeImpl::GetAsMarkup() { @@ -205,7 +205,7 @@ CefString CefDOMNodeImpl::GetAsMarkup() { if (!VerifyContext()) return str; - const WebString& markup = webkit_glue::CreateNodeMarkup(node_); + const WebString& markup = blink_glue::CreateNodeMarkup(node_); if (!markup.IsNull()) str = markup.Utf16(); diff --git a/libcef/renderer/dom_node_impl.h b/libcef/renderer/dom_node_impl.h index 62f8835b7..e73647764 100644 --- a/libcef/renderer/dom_node_impl.h +++ b/libcef/renderer/dom_node_impl.h @@ -7,7 +7,7 @@ #pragma once #include "include/cef_dom.h" -#include "third_party/WebKit/public/web/WebNode.h" +#include "third_party/blink/public/web/web_node.h" class CefDOMDocumentImpl; diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index e30e2fb8b..c5e9d9187 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -17,6 +17,7 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_thread.h" #include "extensions/common/constants.h" +#include "extensions/common/permissions/permissions_data.h" #include "extensions/common/switches.h" #include "extensions/renderer/dispatcher.h" #include "extensions/renderer/extension_frame_helper.h" @@ -26,9 +27,9 @@ #include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h" #include "extensions/renderer/renderer_extension_registry.h" #include "extensions/renderer/script_context.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebPluginParams.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/public/web/web_plugin_params.h" namespace extensions { @@ -162,21 +163,42 @@ bool CefExtensionsRendererClient::OverrideCreatePlugin( return !guest_view_api_available; } -bool CefExtensionsRendererClient::WillSendRequest( +void CefExtensionsRendererClient::WillSendRequest( blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - GURL* new_url) { + const url::Origin* initiator_origin, + GURL* new_url, + bool* attach_same_site_cookies) { + if (initiator_origin && + initiator_origin->scheme() == extensions::kExtensionScheme) { + const extensions::RendererExtensionRegistry* extension_registry = + extensions::RendererExtensionRegistry::Get(); + const Extension* extension = + extension_registry->GetByID(initiator_origin->host()); + if (extension) { + int tab_id = extensions::ExtensionFrameHelper::Get( + content::RenderFrame::FromWebFrame(frame)) + ->tab_id(); + GURL request_url(url); + if (extension->permissions_data()->GetPageAccess(extension, request_url, + tab_id, nullptr) == + extensions::PermissionsData::ACCESS_ALLOWED || + extension->permissions_data()->GetContentScriptAccess( + extension, request_url, tab_id, nullptr) == + extensions::PermissionsData::ACCESS_ALLOWED) { + *attach_same_site_cookies = true; + } + } + } + // Check whether the request should be allowed. If not allowed, we reset the // URL to something invalid to prevent the request and cause an error. if (url.ProtocolIs(extensions::kExtensionScheme) && !resource_request_policy_->CanRequestResource(GURL(url), frame, transition_type)) { *new_url = GURL(chrome::kExtensionInvalidRequestURL); - return true; } - - return false; } void CefExtensionsRendererClient::RunScriptsAtDocumentStart( @@ -250,11 +272,12 @@ bool CefExtensionsRendererClient::ShouldFork(blink::WebLocalFrame* frame, content::BrowserPluginDelegate* CefExtensionsRendererClient::CreateBrowserPluginDelegate( content::RenderFrame* render_frame, + const content::WebPluginInfo& info, const std::string& mime_type, const GURL& original_url) { if (mime_type == content::kBrowserPluginMimeType) return new extensions::ExtensionsGuestViewContainer(render_frame); - return new extensions::MimeHandlerViewContainer(render_frame, mime_type, + return new extensions::MimeHandlerViewContainer(render_frame, info, mime_type, original_url); } diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 7240c73d6..5fbbf9fdf 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -25,8 +25,13 @@ class WebURL; namespace content { class BrowserPluginDelegate; class RenderFrame; +struct WebPluginInfo; } // namespace content +namespace url { +class Origin; +} + namespace extensions { class Dispatcher; @@ -53,10 +58,12 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { service_manager::BinderRegistry* registry); bool OverrideCreatePlugin(content::RenderFrame* render_frame, const blink::WebPluginParams& params); - bool WillSendRequest(blink::WebLocalFrame* frame, + void WillSendRequest(blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - GURL* new_url); + const url::Origin* initiator_origin, + GURL* new_url, + bool* attach_same_site_cookies); void RunScriptsAtDocumentStart(content::RenderFrame* render_frame); void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame); void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame); @@ -69,6 +76,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { bool* send_referrer); static content::BrowserPluginDelegate* CreateBrowserPluginDelegate( content::RenderFrame* render_frame, + const content::WebPluginInfo& info, const std::string& mime_type, const GURL& original_url); diff --git a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc index dac1fc0c4..2de41c035 100644 --- a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc +++ b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc @@ -12,9 +12,9 @@ #include "content/public/renderer/render_view.h" #include "extensions/common/constants.h" #include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebElement.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_element.h" +#include "third_party/blink/public/web/web_local_frame.h" namespace extensions { diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index 1283432ad..4c4284082 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -15,22 +15,22 @@ #include "libcef/common/cef_messages.h" #include "libcef/common/net/http_header_utils.h" #include "libcef/common/request_impl.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/dom_document_impl.h" #include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/thread_util.h" #include "libcef/renderer/v8_impl.h" -#include "libcef/renderer/webkit_glue.h" -#include "third_party/WebKit/public/platform/WebData.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebDocument.h" -#include "third_party/WebKit/public/web/WebFrameContentDumper.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" -#include "third_party/WebKit/public/web/WebScriptSource.h" -#include "third_party/WebKit/public/web/WebView.h" +#include "third_party/blink/public/platform/web_data.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/web/blink.h" +#include "third_party/blink/public/web/web_document.h" +#include "third_party/blink/public/web/web_frame_content_dumper.h" +#include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/public/web/web_script_source.h" +#include "third_party/blink/public/web/web_view.h" using blink::WebString; @@ -92,7 +92,7 @@ void CefFrameImpl::GetText(CefRefPtr visitor) { CEF_REQUIRE_RT_RETURN_VOID(); if (frame_) { - const CefString& content = webkit_glue::DumpDocumentText(frame_); + const CefString& content = blink_glue::DumpDocumentText(frame_); visitor->Visit(content); } } diff --git a/libcef/renderer/render_frame_observer.cc b/libcef/renderer/render_frame_observer.cc index d6edf15df..5d604b134 100644 --- a/libcef/renderer/render_frame_observer.cc +++ b/libcef/renderer/render_frame_observer.cc @@ -14,13 +14,13 @@ #include "libcef/common/cef_messages.h" #include "libcef/common/content_client.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/content_renderer_client.h" #include "libcef/renderer/v8_impl.h" -#include "libcef/renderer/webkit_glue.h" #include "content/public/renderer/render_frame.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/blink/public/web/blink.h" +#include "third_party/blink/public/web/web_local_frame.h" CefRenderFrameObserver::CefRenderFrameObserver( content::RenderFrame* render_frame) @@ -138,7 +138,7 @@ void CefRenderFrameObserver::WillReleaseScriptContext( // The released context should not be used for script execution. // Depending on how the context is released this may or may not already // be set. - webkit_glue::CefScriptForbiddenScope forbidScript; + blink_glue::CefScriptForbiddenScope forbidScript; CefRefPtr contextPtr( new CefV8ContextImpl(isolate, context)); diff --git a/libcef/renderer/render_frame_util.cc b/libcef/renderer/render_frame_util.cc index 48690dee8..5466aa5eb 100644 --- a/libcef/renderer/render_frame_util.cc +++ b/libcef/renderer/render_frame_util.cc @@ -5,11 +5,11 @@ #include "libcef/renderer/render_frame_util.h" -#include "libcef/renderer/webkit_glue.h" +#include "libcef/renderer/blink_glue.h" #include "base/logging.h" #include "content/renderer/render_frame_impl.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/blink/public/web/web_local_frame.h" namespace render_frame_util { @@ -21,7 +21,7 @@ int64_t GetIdentifier(blink::WebLocalFrame* frame) { DCHECK(render_frame); if (render_frame) return render_frame->GetRoutingID(); - return webkit_glue::kInvalidFrameId; + return blink_glue::kInvalidFrameId; } std::string GetName(blink::WebLocalFrame* frame) { diff --git a/libcef/renderer/render_message_filter.cc b/libcef/renderer/render_message_filter.cc index eb5c2d065..ac83ad2bc 100644 --- a/libcef/renderer/render_message_filter.cc +++ b/libcef/renderer/render_message_filter.cc @@ -12,8 +12,8 @@ #include "base/message_loop/message_loop.h" #include "chrome/common/render_messages.h" #include "content/public/browser/browser_thread.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/web/web_security_policy.h" #include "url/gurl.h" #include "url/url_util.h" diff --git a/libcef/renderer/render_thread_observer.cc b/libcef/renderer/render_thread_observer.cc index 4a16e0206..e20f4eb4d 100644 --- a/libcef/renderer/render_thread_observer.cc +++ b/libcef/renderer/render_thread_observer.cc @@ -16,9 +16,9 @@ #include "content/public/renderer/render_thread.h" #include "net/base/net_module.h" #include "services/service_manager/public/cpp/binder_registry.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/web/WebSecurityPolicy.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/web/web_security_policy.h" bool CefRenderThreadObserver::is_incognito_process_ = false; diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index d5a451518..aaac43fb2 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -9,19 +9,19 @@ #include "libcef/common/request_impl.h" #include "libcef/common/response_impl.h" #include "libcef/common/task_runner_impl.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/content_renderer_client.h" -#include "libcef/renderer/webkit_glue.h" #include "base/logging.h" #include "base/message_loop/message_loop.h" -#include "third_party/WebKit/public/platform/WebString.h" -#include "third_party/WebKit/public/platform/WebURL.h" -#include "third_party/WebKit/public/platform/WebURLError.h" -#include "third_party/WebKit/public/platform/WebURLLoader.h" -#include "third_party/WebKit/public/platform/WebURLLoaderClient.h" -#include "third_party/WebKit/public/platform/WebURLLoaderFactory.h" -#include "third_party/WebKit/public/platform/WebURLRequest.h" -#include "third_party/WebKit/public/platform/WebURLResponse.h" +#include "third_party/blink/public/platform/web_string.h" +#include "third_party/blink/public/platform/web_url.h" +#include "third_party/blink/public/platform/web_url_error.h" +#include "third_party/blink/public/platform/web_url_loader.h" +#include "third_party/blink/public/platform/web_url_loader_client.h" +#include "third_party/blink/public/platform/web_url_loader_factory.h" +#include "third_party/blink/public/platform/web_url_request.h" +#include "third_party/blink/public/platform/web_url_response.h" using blink::WebReferrerPolicy; using blink::WebString; @@ -139,7 +139,7 @@ class CefRenderURLRequest::Context const WebURLResponse& response) { DCHECK(CalledOnValidThread()); - response_was_cached_ = webkit_glue::ResponseWasCached(response); + response_was_cached_ = blink_glue::ResponseWasCached(response); response_ = CefResponse::Create(); CefResponseImpl* responseImpl = static_cast(response_.get()); @@ -160,7 +160,7 @@ class CefRenderURLRequest::Context void OnResponse(const WebURLResponse& response) { DCHECK(CalledOnValidThread()); - response_was_cached_ = webkit_glue::ResponseWasCached(response); + response_was_cached_ = blink_glue::ResponseWasCached(response); response_ = CefResponse::Create(); CefResponseImpl* responseImpl = static_cast(response_.get()); diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index 08e4b3a0f..205f10af0 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -24,18 +24,18 @@ #include "libcef/common/content_client.h" #include "libcef/common/task_runner_impl.h" #include "libcef/common/tracker.h" +#include "libcef/renderer/blink_glue.h" #include "libcef/renderer/browser_impl.h" #include "libcef/renderer/render_frame_util.h" #include "libcef/renderer/thread_util.h" -#include "libcef/renderer/webkit_glue.h" #include "base/bind.h" #include "base/lazy_instance.h" #include "base/strings/string_number_conversions.h" #include "base/threading/thread_local.h" -#include "third_party/WebKit/public/web/WebFrame.h" -#include "third_party/WebKit/public/web/WebKit.h" -#include "third_party/WebKit/public/web/WebLocalFrame.h" +#include "third_party/blink/public/web/blink.h" +#include "third_party/blink/public/web/web_frame.h" +#include "third_party/blink/public/web/web_local_frame.h" #include "url/gurl.h" namespace { @@ -625,9 +625,9 @@ void AccessorNameSetterCallbackImpl( } // Two helper functions for V8 Interceptor callbacks. -CefString PropertyToIndex(v8::Local str) { +CefString PropertyToIndex(v8::Local property) { CefString name; - GetCefString(str, name); + GetCefString(property.As(), name); return name; } @@ -636,7 +636,7 @@ int PropertyToIndex(uint32_t index) { } // V8 Interceptor callbacks. -// T == v8::Local for named property handlers and +// T == v8::Local for named property handlers and // T == uint32_t for indexed property handlers template void InterceptorGetterCallbackImpl( @@ -994,7 +994,7 @@ CefRefPtr CefV8ContextImpl::GetFrame() { CefRefPtr CefV8ContextImpl::GetGlobal() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(NULL); - if (webkit_glue::IsScriptForbidden()) + if (blink_glue::IsScriptForbidden()) return nullptr; v8::Isolate* isolate = handle_->isolate(); @@ -1007,7 +1007,7 @@ CefRefPtr CefV8ContextImpl::GetGlobal() { bool CefV8ContextImpl::Enter() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); - if (webkit_glue::IsScriptForbidden()) + if (blink_glue::IsScriptForbidden()) return false; v8::Isolate* isolate = handle_->isolate(); @@ -1028,7 +1028,7 @@ bool CefV8ContextImpl::Enter() { bool CefV8ContextImpl::Exit() { CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); - if (webkit_glue::IsScriptForbidden()) + if (blink_glue::IsScriptForbidden()) return false; if (enter_count_ <= 0) { @@ -1070,7 +1070,7 @@ bool CefV8ContextImpl::Eval(const CefString& code, CEF_V8_REQUIRE_VALID_HANDLE_RETURN(false); - if (webkit_glue::IsScriptForbidden()) + if (blink_glue::IsScriptForbidden()) return false; if (code.empty()) { @@ -1091,10 +1091,9 @@ bool CefV8ContextImpl::Eval(const CefString& code, v8::TryCatch try_catch(isolate); try_catch.SetVerbose(true); - v8::MaybeLocal func_rv = - webkit_glue::ExecuteV8ScriptAndReturnValue( - source, source_url, start_line, context, isolate, try_catch, - blink::AccessControlStatus::kNotSharableCrossOrigin); + v8::MaybeLocal func_rv = blink_glue::ExecuteV8ScriptAndReturnValue( + source, source_url, start_line, context, isolate, try_catch, + blink::AccessControlStatus::kNotSharableCrossOrigin); if (try_catch.HasCaught()) { exception = new CefV8ExceptionImpl(context, try_catch.Message()); @@ -1115,7 +1114,7 @@ v8::Local CefV8ContextImpl::GetV8Context() { blink::WebLocalFrame* CefV8ContextImpl::GetWebFrame() { CEF_REQUIRE_RT(); - if (webkit_glue::IsScriptForbidden()) + if (blink_glue::IsScriptForbidden()) return nullptr; v8::HandleScope handle_scope(handle_->isolate()); @@ -1325,9 +1324,11 @@ CefRefPtr CefV8Value::CreateObject( v8::Local obj; if (interceptor.get()) { v8::Local tmpl = v8::ObjectTemplate::New(isolate); - tmpl->SetNamedPropertyHandler( - InterceptorGetterCallbackImpl>, - InterceptorSetterCallbackImpl>); + tmpl->SetHandler(v8::NamedPropertyHandlerConfiguration( + InterceptorGetterCallbackImpl>, + InterceptorSetterCallbackImpl>, nullptr, nullptr, + nullptr, v8::Local(), + v8::PropertyHandlerFlags::kOnlyInterceptStrings)); tmpl->SetIndexedPropertyHandler(InterceptorGetterCallbackImpl, InterceptorSetterCallbackImpl); @@ -2374,7 +2375,7 @@ CefRefPtr CefV8ValueImpl::ExecuteFunctionWithContext( v8::TryCatch try_catch(isolate); try_catch.SetVerbose(true); - v8::MaybeLocal func_rv = webkit_glue::CallV8Function( + v8::MaybeLocal func_rv = blink_glue::CallV8Function( context_local, func, recv, argc, argv, handle_->isolate()); if (!HasCaught(context_local, try_catch) && !func_rv.IsEmpty()) { diff --git a/patch/patch.cfg b/patch/patch.cfg index 7140581b5..58c718987 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -328,6 +328,8 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2256 # # Linux: Fix GTK2 compile errors. + # + # Linux: Fix "undefined symbol: ErrHandler" runtime error. 'name': 'linux_build', }, { @@ -336,6 +338,8 @@ patches = [ # WebContents. # (b) Always create ProcessManager using CEF's BrowserContextImpl. # https://bitbucket.org/chromiumembedded/cef/issues/1947 + # + # Don't initialize PrerenderContents object in StreamsPrivateAPI. 'name': 'extensions_1947', }, { @@ -358,9 +362,4 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2398 'name': 'mac_gpu_2398', }, - { - # Windows: Resolve conflict between base::StrCat and Win32 StrCat. - # https://bugs.chromium.org/p/chromium/issues/detail?id=817738 - 'name': 'win_strcat_817738', - }, ] diff --git a/patch/patches/browser_compositor_mac.patch b/patch/patches/browser_compositor_mac.patch index e2e586836..72de9f2cd 100644 --- a/patch/patches/browser_compositor_mac.patch +++ b/patch/patches/browser_compositor_mac.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h -index dad7599ed999..c8daf2ba58c8 100644 +index 091f34477c01..44002b362be7 100644 --- content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h -@@ -52,11 +52,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { +@@ -55,11 +55,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { // These will not return nullptr until Destroy is called. DelegatedFrameHost* GetDelegatedFrameHost(); @@ -17,10 +17,10 @@ index dad7599ed999..c8daf2ba58c8 100644 void DidCreateNewRendererCompositorFrameSink( viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink); diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm -index 07d42e680951..46699b959d2d 100644 +index fac719b0bb6f..0672d1445f39 100644 --- content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -215,6 +215,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {} +@@ -208,6 +208,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { g_spare_recyclable_compositors.Get().clear(); } @@ -33,22 +33,11 @@ index 07d42e680951..46699b959d2d 100644 gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() { if (recyclable_compositor_) { return recyclable_compositor_->accelerated_widget_mac() -@@ -268,7 +274,9 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {} - accelerated_widget_mac_ns_view_->AcceleratedWidgetGetNSView(); - display::Display new_display = - display::Screen::GetScreen()->GetDisplayNearestView(ns_view); -- gfx::Size new_size_dip([ns_view bounds].size); -+ // TODO(cef): Get display info from callbacks. |ns_view| will be nullptr. -+ gfx::Size new_size_dip(ns_view ? gfx::Size([ns_view bounds].size) : -+ root_layer_->bounds().size()); - if (new_size_dip == dfh_size_dip_ && new_display == dfh_display_) - return false; - diff --git ui/accelerated_widget_mac/accelerated_widget_mac.mm ui/accelerated_widget_mac/accelerated_widget_mac.mm index 8306398431d9..5ab4fef9ac0f 100644 --- ui/accelerated_widget_mac/accelerated_widget_mac.mm +++ ui/accelerated_widget_mac/accelerated_widget_mac.mm -@@ -71,6 +71,10 @@ - (void)setContentsChanged; +@@ -71,6 +71,10 @@ void AcceleratedWidgetMac::SetNSView(AcceleratedWidgetMacNSView* view) { DCHECK(view && !view_); view_ = view; diff --git a/patch/patches/browser_plugin_guest_1565.patch b/patch/patches/browser_plugin_guest_1565.patch index 3d29e8f76..7b1aae594 100644 --- a/patch/patches/browser_plugin_guest_1565.patch +++ b/patch/patches/browser_plugin_guest_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc -index 593f46130e32..5f7d2fe7355d 100644 +index 15994d5dada4..e19eca0c4369 100644 --- content/browser/browser_plugin/browser_plugin_guest.cc +++ content/browser/browser_plugin/browser_plugin_guest.cc -@@ -322,8 +322,11 @@ void BrowserPluginGuest::InitInternal( +@@ -315,8 +315,11 @@ void BrowserPluginGuest::InitInternal( static_cast(GetWebContents()->GetView()); } @@ -15,7 +15,7 @@ index 593f46130e32..5f7d2fe7355d 100644 // Once a BrowserPluginGuest has an embedder WebContents, it's considered to // be attached. -@@ -806,10 +809,19 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -799,10 +802,19 @@ void BrowserPluginGuest::OnWillAttachComplete( static_cast(GetWebContents()->GetView()); if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { web_contents_view->CreateViewForWidget( @@ -37,10 +37,10 @@ index 593f46130e32..5f7d2fe7355d 100644 attached_ = true; diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc -index 7c83d2a63b2c..070982ea2298 100644 +index af9c604d5785..81d3071b0f3d 100644 --- content/browser/frame_host/interstitial_page_impl.cc +++ content/browser/frame_host/interstitial_page_impl.cc -@@ -614,7 +614,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { +@@ -618,7 +618,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { WebContentsView* wcv = static_cast(web_contents())->GetView(); RenderWidgetHostViewBase* view = @@ -79,7 +79,7 @@ index cf8c74f4c744..b8cefb4b154b 100644 // Creates a new View that holds a popup and receives messages for it. virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc -index 13d687ea411e..f16415faa23f 100644 +index 3aea2d29dc40..65ab77f7ddf5 100644 --- content/browser/web_contents/web_contents_view_aura.cc +++ content/browser/web_contents/web_contents_view_aura.cc @@ -781,7 +781,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size, @@ -101,7 +101,7 @@ index 13d687ea411e..f16415faa23f 100644 g_create_render_widget_host_view ? g_create_render_widget_host_view(render_widget_host, diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h -index 2371c819e665..40fa46097de1 100644 +index 82807c7f77fd..60bd9ceaf9ee 100644 --- content/browser/web_contents/web_contents_view_aura.h +++ content/browser/web_contents/web_contents_view_aura.h @@ -114,7 +114,7 @@ class CONTENT_EXPORT WebContentsViewAura @@ -266,10 +266,10 @@ index d05dd5421458..fa13775f0512 100644 // a BrowserPlugin even when we are using cross process frames for guests. It // should be removed after resolving https://crbug.com/642826). 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 6f2b56d0cd90..ec6f15c0a789 100644 +index 6861814915c2..766090cd3b06 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 -@@ -174,6 +174,8 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -192,6 +192,8 @@ void MimeHandlerViewGuest::CreateWebContents( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; @@ -278,7 +278,7 @@ index 6f2b56d0cd90..ec6f15c0a789 100644 callback.Run(WebContents::Create(params)); registry_.AddInterface( -@@ -199,6 +201,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { +@@ -225,6 +227,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { return true; } @@ -298,10 +298,10 @@ index 6f2b56d0cd90..ec6f15c0a789 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 df25eca4aeae..3072be6a9ca5 100644 +index 2bc53e063aae..9814b40f84ea 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 -@@ -89,6 +89,10 @@ class MimeHandlerViewGuest : +@@ -108,6 +108,10 @@ class MimeHandlerViewGuest : bool ZoomPropagatesFromEmbedderToGuest() const final; bool ShouldDestroyOnDetach() const final; diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 4a73a60ca..b045f5e47 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 ac49d3b83913..69696c72d0f3 100644 +index ac64f5c5cd14..d926502a78a0 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -8,6 +8,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index ac49d3b83913..69696c72d0f3 100644 import("//chrome/common/features.gni") import("//components/feature_engagement/features.gni") import("//components/nacl/features.gni") -@@ -1591,6 +1592,7 @@ jumbo_split_static_library("browser") { +@@ -1581,6 +1582,7 @@ jumbo_split_static_library("browser") { "//base:i18n", "//base/allocator:buildflags", "//cc", @@ -18,7 +18,7 @@ index ac49d3b83913..69696c72d0f3 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1845,6 +1847,10 @@ jumbo_split_static_library("browser") { +@@ -1835,6 +1837,10 @@ jumbo_split_static_library("browser") { "//ui/web_dialogs", ] diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index fb83464cc..1ca4ed980 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 2e8e68563c3c..54a1834c6055 100644 +index 07ebea6a6ebf..d60387aa4cdf 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -7,6 +7,7 @@ @@ -12,7 +12,7 @@ index 2e8e68563c3c..54a1834c6055 100644 #include "chrome/common/chrome_features.h" @@ -16,6 +17,10 @@ #include "content/public/browser/browser_thread.h" - #include "extensions/features/features.h" + #include "extensions/buildflags/buildflags.h" +#if BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/common/extensions/extensions_util.h" diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index b50c1f761..5f89ffc4e 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -71,10 +71,10 @@ index e8e76ce5b954..1dd338dd0142 100644 content::BrowserContext* GetBrowserContextRedirectedInIncognito( content::BrowserContext* context); diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 06cc4ca5c59c..a610360829d8 100644 +index 7675240b2556..08f621236038 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) +@@ -378,7 +378,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -84,10 +84,10 @@ index 06cc4ca5c59c..a610360829d8 100644 this)); } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 95d20f01a062..96834378f487 100644 +index 9a0d8dd4c3e6..6cfbfd1ddc8d 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -93,7 +93,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -94,7 +94,7 @@ class ProfileManager : public content::NotificationObserver, // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -96,7 +96,7 @@ index 95d20f01a062..96834378f487 100644 // Returns total number of profiles available on this machine. size_t GetNumberOfProfiles(); -@@ -124,7 +124,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -125,7 +125,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -105,7 +105,7 @@ index 95d20f01a062..96834378f487 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -133,7 +133,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -134,7 +134,7 @@ class ProfileManager : public content::NotificationObserver, // Get the Profile last used (the Profile to which owns the most recently // focused window) with this Chrome build. If no signed profile has been // stored in Local State, hand back the Default profile. diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 5d27e902d..85583dd75 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index ab3fd0de9e07..298db88e685f 100644 +index 484e07af5a98..0e62e20095c7 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc -@@ -17,6 +17,7 @@ +@@ -16,6 +16,7 @@ #include "base/task_runner_util.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" @@ -10,7 +10,7 @@ index ab3fd0de9e07..298db88e685f 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/plugins/chrome_plugin_service_filter.h" -@@ -55,6 +56,11 @@ +@@ -53,6 +54,11 @@ #include "url/gurl.h" #include "url/origin.h" @@ -22,7 +22,7 @@ index ab3fd0de9e07..298db88e685f 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "components/guest_view/browser/guest_view_base.h" #include "extensions/browser/extension_registry.h" -@@ -76,12 +82,10 @@ namespace { +@@ -74,12 +80,10 @@ namespace { class PluginInfoHostImplShutdownNotifierFactory : public BrowserContextKeyedServiceShutdownNotifierFactory { public: @@ -37,7 +37,7 @@ index ab3fd0de9e07..298db88e685f 100644 PluginInfoHostImplShutdownNotifierFactory>; PluginInfoHostImplShutdownNotifierFactory() -@@ -93,6 +97,16 @@ class PluginInfoHostImplShutdownNotifierFactory +@@ -91,6 +95,16 @@ class PluginInfoHostImplShutdownNotifierFactory DISALLOW_COPY_AND_ASSIGN(PluginInfoHostImplShutdownNotifierFactory); }; @@ -54,7 +54,7 @@ index ab3fd0de9e07..298db88e685f 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) // Returns whether a request from a plugin to load |resource| from a renderer // with process id |process_id| is a request for an internal resource by an app -@@ -101,6 +115,9 @@ bool IsPluginLoadingAccessibleResourceInWebView( +@@ -99,6 +113,9 @@ bool IsPluginLoadingAccessibleResourceInWebView( extensions::ExtensionRegistry* extension_registry, int process_id, const GURL& resource) { @@ -64,7 +64,7 @@ index ab3fd0de9e07..298db88e685f 100644 extensions::WebViewRendererState* renderer_state = extensions::WebViewRendererState::GetInstance(); std::string partition_id; -@@ -130,12 +147,16 @@ bool IsPluginLoadingAccessibleResourceInWebView( +@@ -128,12 +145,16 @@ bool IsPluginLoadingAccessibleResourceInWebView( PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile) : render_process_id_(render_process_id), resource_context_(profile->GetResourceContext()), @@ -84,7 +84,7 @@ index ab3fd0de9e07..298db88e685f 100644 allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated, profile->GetPrefs()); allow_outdated_plugins_.MoveToThread( -@@ -234,6 +255,7 @@ void PluginInfoHostImpl::PluginsLoaded( +@@ -232,6 +253,7 @@ void PluginInfoHostImpl::PluginsLoaded( plugin_metadata->identifier(), &output->status); } @@ -92,7 +92,7 @@ index ab3fd0de9e07..298db88e685f 100644 if (output->status == chrome::mojom::PluginStatus::kNotFound) { // Check to see if the component updater can fetch an implementation. base::PostTaskAndReplyWithResult( -@@ -245,7 +267,9 @@ void PluginInfoHostImpl::PluginsLoaded( +@@ -243,7 +265,9 @@ void PluginInfoHostImpl::PluginsLoaded( base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this, params, std::move(output), std::move(callback), std::move(plugin_metadata))); @@ -103,7 +103,7 @@ index ab3fd0de9e07..298db88e685f 100644 GetPluginInfoFinish(params, std::move(output), std::move(callback), std::move(plugin_metadata)); } -@@ -258,6 +282,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( +@@ -256,6 +280,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( PluginMetadata::SecurityStatus security_status, const std::string& plugin_identifier, chrome::mojom::PluginStatus* status) const { @@ -118,7 +118,7 @@ index ab3fd0de9e07..298db88e685f 100644 if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { *status = chrome::mojom::PluginStatus::kAllowed; return; -@@ -382,16 +414,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( +@@ -380,16 +412,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( return false; } @@ -157,10 +157,10 @@ index ab3fd0de9e07..298db88e685f 100644 // If we broke out of the loop, we have found an enabled plugin. bool enabled = i < matching_plugins.size(); diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index 700886c6ce89..8a47ec9f91a3 100644 +index 1cd2e64b9eb9..a46e40fb1e25 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -774,6 +774,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -770,6 +770,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -168,7 +168,7 @@ index 700886c6ce89..8a47ec9f91a3 100644 observer->IsPluginTemporarilyAllowed(identifier)) { status = chrome::mojom::PluginStatus::kAllowed; } -@@ -961,7 +962,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -957,7 +958,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( &plugin_auth_host); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -178,7 +178,7 @@ index 700886c6ce89..8a47ec9f91a3 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -970,7 +972,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -966,7 +968,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -188,7 +188,7 @@ index 700886c6ce89..8a47ec9f91a3 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -980,7 +983,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -976,7 +979,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -198,7 +198,7 @@ index 700886c6ce89..8a47ec9f91a3 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -988,7 +992,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -984,7 +988,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -209,7 +209,7 @@ index 700886c6ce89..8a47ec9f91a3 100644 } case chrome::mojom::PluginStatus::kComponentUpdateRequired: { diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc -index 6bc73727e61b..4f84ab989060 100644 +index 7052b1d68246..ba05a591ebf5 100644 --- chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ chrome/renderer/plugins/chrome_plugin_placeholder.cc @@ -350,8 +350,11 @@ void ChromePluginPlaceholder::OnBlockedContent( diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 2ade81e23..5c919c0d9 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 1ec9a536a378..8ab180c18d8e 100644 +index 0903a4520939..be719c54f671 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -3,6 +3,7 @@ @@ -9,8 +9,8 @@ index 1ec9a536a378..8ab180c18d8e 100644 +import("//cef/libcef/features/features.gni") import("//chrome/common/features.gni") import("//components/nacl/features.gni") - import("//components/spellcheck/spellcheck_build_features.gni") -@@ -106,6 +107,7 @@ static_library("renderer") { + import("//components/offline_pages/buildflags/features.gni") +@@ -109,6 +110,7 @@ static_library("renderer") { defines = [] deps = [ @@ -18,7 +18,7 @@ index 1ec9a536a378..8ab180c18d8e 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -166,6 +168,10 @@ static_library("renderer") { +@@ -169,6 +171,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 36585723a..47085c3c9 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,8 +1,8 @@ diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc -index 750df2f7fbbe..5b46bb127102 100644 +index d15599593511..0f37d5933391 100644 --- chrome/common/chrome_content_client.cc +++ chrome/common/chrome_content_client.cc -@@ -91,7 +91,8 @@ +@@ -92,7 +92,8 @@ #if BUILDFLAG(ENABLE_LIBRARY_CDMS) #include "media/cdm/cdm_paths.h" // nogncheck @@ -10,5 +10,26 @@ index 750df2f7fbbe..5b46bb127102 100644 +#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) && \ + defined(WIDEVINE_CDM_VERSION_STRING) #define WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT - #include "chrome/common/widevine_cdm_constants.h" #endif + #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) +diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn +index 55b471ea..6dac055 100644 +--- third_party/widevine/cdm/BUILD.gn ++++ third_party/widevine/cdm/BUILD.gn +@@ -4,6 +4,7 @@ + + import("//build/config/chrome_build.gni") + import("//build/config/features.gni") ++import("//cef/libcef/features/features.gni") + import("//media/cdm/library_cdm/cdm_paths.gni") + import("//media/media_options.gni") + import("//third_party/widevine/cdm/widevine.gni") +@@ -11,7 +12,7 @@ import("//third_party/widevine/cdm/widevine.gni") + # Internal Cast builds set enable_widevine=true to bring in Widevine support. + # TODO(xhwang): Support component updated CDM on other platforms and remove this + # assert. +-assert(!enable_widevine || is_win || is_mac || is_chromecast, ++assert(!enable_widevine || is_win || is_mac || is_chromecast || enable_cef, + "Component updated CDM only supported on Windows and Mac for now.") + + widevine_arch = current_cpu diff --git a/patch/patches/component_build_1617.patch b/patch/patches/component_build_1617.patch index bcf3a0f1d..c3ddd52cf 100644 --- a/patch/patches/component_build_1617.patch +++ b/patch/patches/component_build_1617.patch @@ -12,24 +12,24 @@ index 4393a8fac233..860715e86900 100644 public: explicit ContentServiceManagerMainDelegate(const ContentMainParams& params); ~ContentServiceManagerMainDelegate() override; -diff --git third_party/WebKit/Source/controller/BUILD.gn third_party/WebKit/Source/controller/BUILD.gn -index 67afa8b0bcef..20591788d173 100644 ---- third_party/WebKit/Source/controller/BUILD.gn -+++ third_party/WebKit/Source/controller/BUILD.gn +diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn +index 5726fbac54bf..46fd0b2bd568 100644 +--- third_party/blink/renderer/controller/BUILD.gn ++++ third_party/blink/renderer/controller/BUILD.gn @@ -25,6 +25,7 @@ component("controller") { configs += [ "//build/config/compiler:wexit_time_destructors", + "//cef/libcef/features:config", - "//third_party/WebKit/Source:config", - "//third_party/WebKit/Source:inside_blink", - "//third_party/WebKit/Source:non_test_config", + "//third_party/blink/renderer:config", + "//third_party/blink/renderer:inside_blink", + "//third_party/blink/renderer:non_test_config", @@ -41,6 +42,8 @@ component("controller") { - "DevToolsFrontendImpl.h", - "OomInterventionImpl.cpp", - "OomInterventionImpl.h", -+ "//cef/libcef/renderer/webkit_glue.cc", -+ "//cef/libcef/renderer/webkit_glue.h", + "dev_tools_frontend_impl.h", + "oom_intervention_impl.cc", + "oom_intervention_impl.h", ++ "//cef/libcef/renderer/blink_glue.cc", ++ "//cef/libcef/renderer/blink_glue.h", ] if (is_mac) { diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index c180e239f..5992fd339 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,8 +1,8 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index b40de2a2910a..da20699a5d64 100644 +index 7b9fc4114c52..bdbbf93f6f0d 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc -@@ -492,9 +492,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( +@@ -495,9 +495,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( // surfaces as they are not following the correct mode. DisableGpuCompositing(compositor.get()); } @@ -18,13 +18,13 @@ index b40de2a2910a..da20699a5d64 100644 + display_output_surface = std::make_unique( -- CreateSoftwareOutputDevice(compositor->widget()), vsync_callback, -+ std::move(output_device), vsync_callback, - compositor->task_runner()); +- CreateSoftwareOutputDevice(compositor->widget()), ++ std::move(output_device), + std::move(vsync_callback), compositor->task_runner()); } else { DCHECK(context_provider); diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 78b361460638..bbde6e19916d 100644 +index a6a0cb9df028..478f11e0d925 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -24,6 +24,7 @@ @@ -63,7 +63,7 @@ index 78b361460638..bbde6e19916d 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 -@@ -441,6 +456,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -442,6 +457,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ui::ContextFactory* context_factory_; ui::ContextFactoryPrivate* context_factory_private_; diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index cbb539297..2dd45f322 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index 03ca8ad55078..0899131ab154 100644 +index cbc50ff93650..c91171abf5b0 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -540,8 +540,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context, +@@ -571,8 +571,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context, content::PluginService* plugin_service = content::PluginService::GetInstance(); bool plugin_found = plugin_service->GetPluginInfo( @@ -14,10 +14,10 @@ index 03ca8ad55078..0899131ab154 100644 // The GetPlugins call causes the plugin list to be refreshed. Once that's // done we can retry the GetPluginInfo call. We break out of this cycle diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc -index 8e6ef99239ab..24ceaf229702 100644 +index e47d5ea63e5a..f2d21e4cefe4 100644 --- chrome/browser/plugins/chrome_plugin_service_filter.cc +++ chrome/browser/plugins/chrome_plugin_service_filter.cc -@@ -178,6 +178,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( +@@ -177,6 +177,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( int render_frame_id, const void* context, const GURL& plugin_content_url, @@ -38,7 +38,7 @@ index 133145db74bf..021ab307ee2a 100644 content::WebPluginInfo* plugin) override; diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc -index 3b0948c90a00..f0fb3b5d9d55 100644 +index d05027d09165..d3f57f6d96d7 100644 --- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc +++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc @@ -53,7 +53,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor( @@ -51,7 +51,7 @@ index 3b0948c90a00..f0fb3b5d9d55 100644 return nullptr; } diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm -index b1a49f718226..cb56c9fd4765 100644 +index 569e6112d86b..41599944688a 100644 --- chrome/browser/ui/cocoa/drag_util.mm +++ chrome/browser/ui/cocoa/drag_util.mm @@ -51,7 +51,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) { @@ -64,7 +64,7 @@ index b1a49f718226..cb56c9fd4765 100644 } diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index f4eb41e948bb..7e47a184d8c0 100644 +index dfbad402f1ea..7a332ea67611 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -601,6 +601,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted( @@ -76,10 +76,10 @@ index f4eb41e948bb..7e47a184d8c0 100644 mime_type, false, NULL, &plugin, NULL)); } diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc -index 2986bf0e340e..6ef8486960ce 100644 +index 0c0c4cbb9efe..4703ce943367 100644 --- content/browser/frame_host/navigation_handle_impl.cc +++ content/browser/frame_host/navigation_handle_impl.cc -@@ -368,12 +368,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() { +@@ -382,12 +382,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() { } RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { @@ -93,10 +93,10 @@ index 2986bf0e340e..6ef8486960ce 100644 } diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc -index 1f566ef1f437..cffef1c8a2f2 100644 +index f47a05e199ef..3010f016c035 100644 --- content/browser/frame_host/render_frame_host_impl.cc +++ content/browser/frame_host/render_frame_host_impl.cc -@@ -1527,6 +1527,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( +@@ -1552,6 +1552,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( if (GetNavigationHandle()) { GetNavigationHandle()->set_net_error_code( static_cast(params.error_code)); @@ -104,7 +104,7 @@ index 1f566ef1f437..cffef1c8a2f2 100644 } frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); -@@ -3269,9 +3270,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() { +@@ -3309,9 +3310,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() { &QuotaDispatcherHost::CreateForFrame, GetProcess(), routing_id_)); if (base::FeatureList::IsEnabled(network::features::kNetworkService)) { @@ -117,7 +117,7 @@ index 1f566ef1f437..cffef1c8a2f2 100644 // TODO(https://crbug.com/813479): Investigate why we need to explicitly // specify task runner for BrowserThread::IO here. // Bind calls to the BindRegistry should come on to the IO thread by -@@ -3545,9 +3546,9 @@ void RenderFrameHostImpl::CommitNavigation( +@@ -3588,9 +3589,9 @@ void RenderFrameHostImpl::CommitNavigation( // however only do this for cross-document navigations, because the // alternative would be redundant effort. network::mojom::URLLoaderFactoryPtrInfo default_factory_info; @@ -130,10 +130,10 @@ index 1f566ef1f437..cffef1c8a2f2 100644 if (subresource_loader_params && subresource_loader_params->loader_factory_info.is_valid()) { // If the caller has supplied a default URLLoaderFactory override (for -@@ -4162,8 +4163,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve( - auto* context = GetSiteInstance()->GetBrowserContext(); - GetContentClient()->browser()->WillCreateURLLoaderFactory( - this, false /* is_navigation */, &default_factory_request); +@@ -4218,8 +4219,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve( + // Keep DevTools proxy lasy, i.e. closest to the network. + RenderFrameDevToolsAgentHost::WillCreateURLLoaderFactory( + this, false, &default_factory_request); - StoragePartitionImpl* storage_partition = static_cast( - BrowserContext::GetStoragePartition(context, GetSiteInstance())); + StoragePartition* storage_partition = @@ -142,10 +142,10 @@ index 1f566ef1f437..cffef1c8a2f2 100644 storage_partition->GetNetworkContext()->CreateURLLoaderFactory( std::move(default_factory_request), GetProcess()->GetID()); diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index b3653373a51f..6db0652284ec 100644 +index 80fd7cf89578..8e965cd18a47 100644 --- content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc -@@ -546,6 +546,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, +@@ -552,6 +552,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, void RenderFrameMessageFilter::OnGetPlugins( bool refresh, @@ -153,7 +153,7 @@ index b3653373a51f..6db0652284ec 100644 const url::Origin& main_frame_origin, IPC::Message* reply_msg) { // Don't refresh if the specified threshold has not been passed. Note that -@@ -567,18 +568,19 @@ void RenderFrameMessageFilter::OnGetPlugins( +@@ -573,18 +574,19 @@ void RenderFrameMessageFilter::OnGetPlugins( PluginServiceImpl::GetInstance()->GetPlugins( base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this, @@ -175,7 +175,7 @@ index b3653373a51f..6db0652284ec 100644 int routing_id = MSG_ROUTING_NONE; // In this loop, copy the WebPluginInfo (and do not use a reference) because // the filter might mutate it. -@@ -587,7 +589,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( +@@ -593,7 +595,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( if (!filter || filter->IsPluginAvailable(child_process_id, routing_id, resource_context_, main_frame_origin.GetURL(), @@ -184,7 +184,7 @@ index b3653373a51f..6db0652284ec 100644 plugins.push_back(plugin); } } -@@ -599,6 +601,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( +@@ -605,6 +607,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( void RenderFrameMessageFilter::OnGetPluginInfo( int render_frame_id, const GURL& url, @@ -192,7 +192,7 @@ index b3653373a51f..6db0652284ec 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool* found, -@@ -607,8 +610,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( +@@ -613,8 +616,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( bool allow_wildcard = true; *found = plugin_service_->GetPluginInfo( render_process_id_, render_frame_id, resource_context_, url, @@ -204,10 +204,10 @@ index b3653373a51f..6db0652284ec 100644 void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h -index db9398a07607..ce062d8a9ccd 100644 +index 871e11f61274..5b1009ab7ec6 100644 --- content/browser/frame_host/render_frame_message_filter.h +++ content/browser/frame_host/render_frame_message_filter.h -@@ -136,13 +136,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter +@@ -139,13 +139,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter #if BUILDFLAG(ENABLE_PLUGINS) void OnGetPlugins(bool refresh, @@ -225,7 +225,7 @@ index db9398a07607..ce062d8a9ccd 100644 const std::string& mime_type, bool* found, diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc -index a9322bc8b5d7..0b3bfef2237b 100644 +index 577f62b57ff2..3847f8ec616a 100644 --- content/browser/loader/mime_sniffing_resource_handler.cc +++ content/browser/loader/mime_sniffing_resource_handler.cc @@ -494,8 +494,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler( @@ -240,10 +240,10 @@ index a9322bc8b5d7..0b3bfef2237b 100644 if (stale) { // Refresh the plugins asynchronously. diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 130f4d8e92e8..bade33e04c2e 100644 +index dcdae19642b5..f1b3c8166ce9 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -262,6 +262,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -286,6 +286,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, ResourceContext* context, const GURL& url, @@ -251,7 +251,7 @@ index 130f4d8e92e8..bade33e04c2e 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -278,7 +279,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -302,7 +303,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, context, @@ -262,10 +262,10 @@ index 130f4d8e92e8..bade33e04c2e 100644 if (actual_mime_type) *actual_mime_type = mime_types[i]; diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h -index e6de4ca6c8b3..18eea4948e43 100644 +index 4e11056a3dc9..973ad50975e1 100644 --- content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h -@@ -63,6 +63,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { +@@ -65,6 +65,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { int render_frame_id, ResourceContext* context, const GURL& url, @@ -274,10 +274,10 @@ index e6de4ca6c8b3..18eea4948e43 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/common/frame_messages.h content/common/frame_messages.h -index 8e482fa78e3a..99b8e486e88f 100644 +index 7ee98ee35116..63082b5a8132 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -1362,8 +1362,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -1387,8 +1387,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // Used to get the list of plugins. |main_frame_origin| is used to handle // exceptions for plugin content settings. @@ -288,7 +288,7 @@ index 8e482fa78e3a..99b8e486e88f 100644 url::Origin /* main_frame_origin */, std::vector /* plugins */) -@@ -1371,9 +1372,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins, +@@ -1396,9 +1397,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -301,7 +301,7 @@ index 8e482fa78e3a..99b8e486e88f 100644 std::string /* mime_type */, bool /* found */, diff --git content/ppapi_plugin/ppapi_blink_platform_impl.cc content/ppapi_plugin/ppapi_blink_platform_impl.cc -index bf3c786b5093..ea8f85700e86 100644 +index a6e5823a51d7..397bb78e41fb 100644 --- content/ppapi_plugin/ppapi_blink_platform_impl.cc +++ content/ppapi_plugin/ppapi_blink_platform_impl.cc @@ -199,6 +199,7 @@ blink::WebThemeEngine* PpapiBlinkPlatformImpl::ThemeEngine() { @@ -325,10 +325,10 @@ index 8a58a2ae1e2f..21b18ff2eba7 100644 blink::WebPluginListBuilder*) override; blink::WebData GetDataResource(const char* name) override; diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h -index ac05c13b1df8..762262bff01a 100644 +index 27021d64244d..60f1ec1845d9 100644 --- content/public/browser/plugin_service.h +++ content/public/browser/plugin_service.h -@@ -74,6 +74,7 @@ class PluginService { +@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService { int render_frame_id, ResourceContext* context, const GURL& url, @@ -349,10 +349,10 @@ index 3b610b1f554e..7c439e060779 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 34aed4fd3565..364f042ee903 100644 +index a68f00aec37a..696f9efab95d 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -74,6 +74,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -77,6 +77,9 @@ class CONTENT_EXPORT ContentRendererClient { // Notifies us that the RenderThread has been created. virtual void RenderThreadStarted() {} @@ -362,7 +362,7 @@ index 34aed4fd3565..364f042ee903 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -333,6 +336,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -356,6 +359,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -374,12 +374,12 @@ index 34aed4fd3565..364f042ee903 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h -index aa77b86eee98..097d26a80aa9 100644 +index 74a031ad10c3..3b3f9e292f4b 100644 --- content/public/renderer/render_frame_observer.h +++ content/public/renderer/render_frame_observer.h -@@ -121,6 +121,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, - // load. This is used for UseCounter feature metrics. - virtual void DidObserveNewFeatureUsage(blink::mojom::WebFeature feature) {} +@@ -123,6 +123,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, + virtual void DidObserveNewCssPropertyUsage(int css_property, + bool is_animated) {} + // Called when this frame gains focus. + virtual void FrameFocused() {} @@ -388,10 +388,10 @@ index aa77b86eee98..097d26a80aa9 100644 virtual void FocusedNodeChanged(const blink::WebNode& node) {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 259d31191208..890ec89bbaee 100644 +index fede37b7301b..6bda5cfdbcd1 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3447,7 +3447,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3486,7 +3486,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -401,7 +401,7 @@ index 259d31191208..890ec89bbaee 100644 params.mime_type.Utf8(), &found, &info, &mime_type)); if (!found) return nullptr; -@@ -3808,6 +3809,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { +@@ -3847,6 +3848,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { void RenderFrameImpl::FrameFocused() { Send(new FrameHostMsg_FrameFocused(routing_id_)); @@ -411,10 +411,10 @@ index 259d31191208..890ec89bbaee 100644 void RenderFrameImpl::WillCommitProvisionalLoad() { diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 81d3f80db8ef..1e349f80ed23 100644 +index 089bc9a31881..7c938b4d3c8d 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -925,6 +925,8 @@ void RenderThreadImpl::Init( +@@ -942,6 +942,8 @@ void RenderThreadImpl::Init( StartServiceManagerConnection(); @@ -424,10 +424,10 @@ index 81d3f80db8ef..1e349f80ed23 100644 base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 0affacaa0294..8c08aad965a2 100644 +index 58008cefd4be..c933ed29f304 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -849,6 +849,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor( +@@ -842,6 +842,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor( void RendererBlinkPlatformImpl::GetPluginList( bool refresh, @@ -435,7 +435,7 @@ index 0affacaa0294..8c08aad965a2 100644 const blink::WebSecurityOrigin& mainFrameOrigin, blink::WebPluginListBuilder* builder) { #if BUILDFLAG(ENABLE_PLUGINS) -@@ -856,7 +857,8 @@ void RendererBlinkPlatformImpl::GetPluginList( +@@ -849,7 +850,8 @@ void RendererBlinkPlatformImpl::GetPluginList( if (!plugin_refresh_allowed_) refresh = false; RenderThread::Get()->Send( @@ -445,7 +445,7 @@ index 0affacaa0294..8c08aad965a2 100644 for (const WebPluginInfo& plugin : plugins) { builder->AddPlugin(WebString::FromUTF16(plugin.name), WebString::FromUTF16(plugin.desc), -@@ -1417,6 +1419,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() { +@@ -1416,6 +1418,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() { base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); } @@ -461,10 +461,10 @@ index 0affacaa0294..8c08aad965a2 100644 if (!web_database_host_) { web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index e8a4578009d1..780d8b29acb2 100644 +index 611b6b70f3cb..98e858e6bd93 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -128,6 +128,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -126,6 +126,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { viz::FrameSinkId GenerateFrameSinkId() override; void GetPluginList(bool refresh, @@ -507,7 +507,7 @@ index 7767a620a9fd..8a95377f5f3b 100644 WebPluginInfo* plugin) override; diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc -index 6746b9f16e7e..8634ada48d57 100644 +index dfc1e111ac10..23106007a32e 100644 --- content/test/fake_plugin_service.cc +++ content/test/fake_plugin_service.cc @@ -29,6 +29,7 @@ bool FakePluginService::GetPluginInfo(int render_process_id, @@ -519,7 +519,7 @@ index 6746b9f16e7e..8634ada48d57 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h -index db23a83ed079..57a4c536118c 100644 +index 84bed37848d9..1a66c0757437 100644 --- content/test/fake_plugin_service.h +++ content/test/fake_plugin_service.h @@ -30,6 +30,7 @@ class FakePluginService : public PluginService { @@ -531,10 +531,10 @@ index db23a83ed079..57a4c536118c 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc -index 25182fdb0928..9cc19c4016d3 100644 +index c58ced83f5a3..b59123565abd 100644 --- content/test/test_blink_web_unit_test_support.cc +++ content/test/test_blink_web_unit_test_support.cc -@@ -324,6 +324,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { +@@ -325,6 +325,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { void TestBlinkWebUnitTestSupport::GetPluginList( bool refresh, @@ -543,11 +543,11 @@ index 25182fdb0928..9cc19c4016d3 100644 blink::WebPluginListBuilder* builder) { builder->AddPlugin("pdf", "pdf", "pdf-files"); diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h -index d8ad7b6e4435..5eda4bc3c2d5 100644 +index 06ddd5b7b28f..c3371fecff87 100644 --- content/test/test_blink_web_unit_test_support.h +++ content/test/test_blink_web_unit_test_support.h -@@ -72,6 +72,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { - const blink::WebSize& size) override; +@@ -73,6 +73,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { + viz::ResourceFormat format) override; void GetPluginList(bool refresh, + bool is_main_frame, diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 870236dc2..c3055a8e0 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -45,7 +45,7 @@ index bcf172e645a2..a46141ea43e0 100644 // Sets the kNumSwitches key and the set of keys named using kSwitchFormat based // on the given |command_line|. diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn -index 08dc1ddba75a..e2bc7c365980 100644 +index e66f49a470f8..f2b725efb6fd 100644 --- chrome_elf/BUILD.gn +++ chrome_elf/BUILD.gn @@ -7,6 +7,7 @@ @@ -56,7 +56,7 @@ index 08dc1ddba75a..e2bc7c365980 100644 import("//chrome/process_version_rc_template.gni") import("//testing/test.gni") -@@ -186,9 +187,6 @@ static_library("blacklist") { +@@ -196,9 +197,6 @@ static_library("blacklist") { static_library("crash") { sources = [ @@ -66,7 +66,7 @@ index 08dc1ddba75a..e2bc7c365980 100644 "crash/crash_helper.cc", "crash/crash_helper.h", ] -@@ -196,6 +194,7 @@ static_library("crash") { +@@ -206,6 +204,7 @@ static_library("crash") { ":hook_util", "//base", # This needs to go. DEP of app, crash_keys, client. "//base:base_static", # pe_image @@ -74,7 +74,7 @@ index 08dc1ddba75a..e2bc7c365980 100644 "//chrome/install_static:install_static_util", "//components/crash/content/app", "//components/crash/core/common", # crash_keys -@@ -203,6 +202,17 @@ static_library("crash") { +@@ -213,6 +212,17 @@ static_library("crash") { "//content/public/common:result_codes", "//third_party/crashpad/crashpad/client", # DumpWithoutCrash ] @@ -93,7 +93,7 @@ index 08dc1ddba75a..e2bc7c365980 100644 static_library("hook_util") { diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc -index e8e27dc4ebd7..7cb2149ec41d 100644 +index fdc51ab22807..cb0a99dd190c 100644 --- chrome_elf/crash/crash_helper.cc +++ chrome_elf/crash/crash_helper.cc @@ -11,12 +11,17 @@ @@ -127,7 +127,7 @@ index e8e27dc4ebd7..7cb2149ec41d 100644 g_crash_helper_enabled = true; return true; diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc -index 460f7ac4defa..1c1b11f87e91 100644 +index 1dde47fb6bba..8b96a022abf0 100644 --- components/crash/content/app/breakpad_linux.cc +++ components/crash/content/app/breakpad_linux.cc @@ -28,6 +28,7 @@ @@ -146,7 +146,7 @@ index 460f7ac4defa..1c1b11f87e91 100644 #endif bool g_is_crash_reporter_enabled = false; -@@ -689,7 +691,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, +@@ -686,7 +688,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); @@ -155,7 +155,7 @@ index 460f7ac4defa..1c1b11f87e91 100644 info.process_start_time = g_process_start_time; info.oom_size = base::g_oom_size; info.pid = g_pid; -@@ -1345,7 +1347,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, +@@ -1342,7 +1344,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, header_content_encoding, header_content_type, post_file, @@ -164,7 +164,7 @@ index 460f7ac4defa..1c1b11f87e91 100644 "--timeout=10", // Set a timeout so we don't hang forever. "--tries=1", // Don't retry if the upload fails. "-O", // Output reply to the file descriptor path. -@@ -1685,10 +1687,19 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1682,10 +1684,19 @@ void HandleCrashDump(const BreakpadInfo& info) { GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); writer.AddBoundary(); @@ -186,7 +186,7 @@ index 460f7ac4defa..1c1b11f87e91 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -1793,10 +1804,20 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1803,10 +1814,20 @@ void HandleCrashDump(const BreakpadInfo& info) { crash_reporter::internal::TransitionalCrashKeyStorage; CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys); const CrashKeyStorage::Entry* entry; @@ -208,7 +208,7 @@ index 460f7ac4defa..1c1b11f87e91 100644 writer.AddBoundary(); writer.Flush(); } -@@ -2006,6 +2027,17 @@ void SetChannelCrashKey(const std::string& channel) { +@@ -2016,6 +2037,17 @@ void SetChannelCrashKey(const std::string& channel) { channel_key.Set(channel); } @@ -241,10 +241,10 @@ index 9ee85554812c..7af55ddda8fe 100644 extern void InitCrashKeysForTesting(); diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc -index a37619c815e3..e13a0f7ade86 100644 +index 4ec26a2a487a..0eba6a25009c 100644 --- components/crash/content/app/crash_reporter_client.cc +++ components/crash/content/app/crash_reporter_client.cc -@@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { +@@ -88,7 +88,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { } #endif @@ -253,12 +253,15 @@ index a37619c815e3..e13a0f7ade86 100644 void CrashReporterClient::GetProductNameAndVersion(const char** product_name, const char** version) { } +@@ -97,6 +97,7 @@ void CrashReporterClient::GetProductNameAndVersion(const char** product_name, + const char** version, + const char** channel) {} +#if !defined(OS_MACOSX) base::FilePath CrashReporterClient::GetReporterLogFilename() { return base::FilePath(); } -@@ -101,6 +102,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename) { +@@ -105,6 +106,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename) { return false; } #endif @@ -266,9 +269,9 @@ index a37619c815e3..e13a0f7ade86 100644 #if defined(OS_WIN) bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { -@@ -145,6 +147,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { +@@ -147,6 +149,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { + return false; } - #endif +bool CrashReporterClient::EnableBreakpadForProcess( + const std::string& process_type) { @@ -300,8 +303,8 @@ index a37619c815e3..e13a0f7ade86 100644 int CrashReporterClient::GetAndroidMinidumpDescriptor() { return 0; @@ -175,9 +203,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { + return false; } - #endif -bool CrashReporterClient::EnableBreakpadForProcess( - const std::string& process_type) { @@ -315,7 +318,7 @@ index a37619c815e3..e13a0f7ade86 100644 } // namespace crash_reporter diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h -index 75d3d6d93873..aa86f45c9746 100644 +index 94cdee55b87c..4612a6a6461a 100644 --- components/crash/content/app/crash_reporter_client.h +++ components/crash/content/app/crash_reporter_client.h @@ -5,7 +5,9 @@ @@ -328,7 +331,7 @@ index 75d3d6d93873..aa86f45c9746 100644 #include "base/strings/string16.h" #include "build/build_config.h" -@@ -91,12 +93,13 @@ class CrashReporterClient { +@@ -91,7 +93,7 @@ class CrashReporterClient { virtual int GetResultCodeRespawnFailed(); #endif @@ -336,14 +339,16 @@ index 75d3d6d93873..aa86f45c9746 100644 +#if defined(OS_POSIX) && !defined(OS_IOS) // Returns a textual description of the product type and version to include // in the crash report. Neither out parameter should be set to NULL. - virtual void GetProductNameAndVersion(const char** product_name, - const char** version); + // TODO(jperaza): Remove the 2-parameter overload of this method once all +@@ -102,6 +104,7 @@ class CrashReporterClient { + const char** version, + const char** channel); +#if !defined(OS_MACOSX) virtual base::FilePath GetReporterLogFilename(); // Custom crash minidump handler after the minidump is generated. -@@ -105,6 +108,7 @@ class CrashReporterClient { +@@ -110,6 +113,7 @@ class CrashReporterClient { // WARNING: this handler runs in a compromised context. It may not call into // libc nor allocate memory normally. virtual bool HandleCrashDump(const char* crashdump_filename); @@ -351,7 +356,7 @@ index 75d3d6d93873..aa86f45c9746 100644 #endif // The location where minidump files should be written. Returns true if -@@ -180,6 +184,30 @@ class CrashReporterClient { +@@ -181,6 +185,30 @@ class CrashReporterClient { // Returns true if breakpad should run in the given process type. virtual bool EnableBreakpadForProcess(const std::string& process_type); @@ -383,10 +388,10 @@ index 75d3d6d93873..aa86f45c9746 100644 } // namespace crash_reporter diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc -index 36ff7c219ad5..241156316efc 100644 +index a5f6b2e6f423..b3892d3743ff 100644 --- components/crash/content/app/crashpad.cc +++ components/crash/content/app/crashpad.cc -@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client, +@@ -147,7 +147,8 @@ void InitializeCrashpadImpl(bool initial_client, // fallback. Forwarding is turned off for debug-mode builds even for the // browser process, because the system's crash reporter can take a very long // time to chew on symbols. @@ -397,7 +402,7 @@ index 36ff7c219ad5..241156316efc 100644 ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled); } diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm -index 6508c2a06760..f51ce5a17e63 100644 +index eb82f44053ce..daf2c722837c 100644 --- components/crash/content/app/crashpad_mac.mm +++ components/crash/content/app/crashpad_mac.mm @@ -16,11 +16,14 @@ @@ -415,7 +420,7 @@ index 6508c2a06760..f51ce5a17e63 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" -@@ -41,9 +44,10 @@ base::FilePath PlatformCrashpadInitialization( +@@ -42,9 +45,10 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, if (initial_client) { @autoreleasepool { @@ -429,7 +434,7 @@ index 6508c2a06760..f51ce5a17e63 100644 // Is there a way to recover if this fails? CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -55,16 +59,27 @@ base::FilePath PlatformCrashpadInitialization( +@@ -56,16 +60,27 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, // crash server won't have symbols for any other build types. std::string url = "https://clients2.google.com/cr/report"; #else @@ -462,7 +467,7 @@ index 6508c2a06760..f51ce5a17e63 100644 #if defined(GOOGLE_CHROME_BUILD) // Empty means stable. -@@ -80,12 +95,16 @@ base::FilePath PlatformCrashpadInitialization( +@@ -81,12 +96,16 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, process_annotations["channel"] = ""; } @@ -484,7 +489,7 @@ index 6508c2a06760..f51ce5a17e63 100644 std::vector arguments; -@@ -107,6 +126,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -108,6 +127,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, "--reset-own-crash-exception-port-to-system-default"); } @@ -498,7 +503,7 @@ index 6508c2a06760..f51ce5a17e63 100644 handler_path, database_path, metrics_path, url, process_annotations, arguments, true, false); diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc -index a5d1afc409f4..dc9917f7eca9 100644 +index 8b0edef1b594..22555bb9dc77 100644 --- components/crash/content/app/crashpad_win.cc +++ components/crash/content/app/crashpad_win.cc @@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations( @@ -524,7 +529,7 @@ index a5d1afc409f4..dc9917f7eca9 100644 #endif } -@@ -62,7 +62,9 @@ base::FilePath PlatformCrashpadInitialization( +@@ -62,7 +62,9 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, base::FilePath metrics_path; // Only valid in the browser process. const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME"; @@ -534,7 +539,7 @@ index a5d1afc409f4..dc9917f7eca9 100644 std::unique_ptr env(base::Environment::Create()); if (initial_client) { CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -82,13 +84,13 @@ base::FilePath PlatformCrashpadInitialization( +@@ -82,13 +84,13 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, #if defined(GOOGLE_CHROME_BUILD) std::string url = "https://clients2.google.com/cr/report"; @@ -549,9 +554,9 @@ index a5d1afc409f4..dc9917f7eca9 100644 + std::string url = crash_reporter_client->GetCrashServerURL(); +#endif - wchar_t exe_file_path[MAX_PATH] = {}; - CHECK( -@@ -103,13 +105,14 @@ base::FilePath PlatformCrashpadInitialization( + base::FilePath exe_file(exe_path); + if (exe_file.empty()) { +@@ -106,13 +108,14 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, crashpad::TriState::kEnabled, kIndirectMemoryLimit); } @@ -571,7 +576,7 @@ index a5d1afc409f4..dc9917f7eca9 100644 if (!user_data_dir.empty()) { start_arguments.push_back(std::string("--user-data-dir=") + user_data_dir); -@@ -120,9 +123,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -123,9 +126,12 @@ base::FilePath PlatformCrashpadInitialization(bool initial_client, start_arguments.push_back("/prefetch:7"); } else { base::FilePath exe_dir = exe_file.DirName(); @@ -586,10 +591,10 @@ index a5d1afc409f4..dc9917f7eca9 100644 if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) { diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc -index 46954327b9c7..62a7ce8d4e46 100644 +index f66e16a2ebc2..23118ffbeb4b 100644 --- content/browser/frame_host/debug_urls.cc +++ content/browser/frame_host/debug_urls.cc -@@ -139,7 +139,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) { +@@ -129,7 +129,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) { cc::switches::kEnableGpuBenchmarking) && (PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED)); diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index 1325515b4..580490ca5 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -40,10 +40,10 @@ index 6dac5f3002b3..34f5ee111d3d 100644 virtual ~PruneCondition() {} diff --git third_party/crashpad/crashpad/client/settings.cc third_party/crashpad/crashpad/client/settings.cc -index 15d16f2e0928..5e8eadfd3ad1 100644 +index 20bd2581cd97..16d63af65e2f 100644 --- third_party/crashpad/crashpad/client/settings.cc +++ third_party/crashpad/crashpad/client/settings.cc -@@ -38,7 +38,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) { +@@ -85,7 +85,7 @@ void ScopedLockedFileHandleTraits::Free(FileHandle handle) { struct Settings::Data { static const uint32_t kSettingsMagic = 'CPds'; @@ -52,7 +52,7 @@ index 15d16f2e0928..5e8eadfd3ad1 100644 enum Options : uint32_t { kUploadsEnabled = 1 << 0, -@@ -49,6 +49,9 @@ struct Settings::Data { +@@ -96,6 +96,9 @@ struct Settings::Data { options(0), padding_0(0), last_upload_attempt_time(0), @@ -62,7 +62,7 @@ index 15d16f2e0928..5e8eadfd3ad1 100644 client_id() {} uint32_t magic; -@@ -56,6 +59,9 @@ struct Settings::Data { +@@ -103,6 +106,9 @@ struct Settings::Data { uint32_t options; uint32_t padding_0; int64_t last_upload_attempt_time; // time_t @@ -72,7 +72,7 @@ index 15d16f2e0928..5e8eadfd3ad1 100644 UUID client_id; }; -@@ -141,6 +147,56 @@ bool Settings::SetLastUploadAttemptTime(time_t time) { +@@ -186,6 +192,56 @@ bool Settings::SetLastUploadAttemptTime(time_t time) { return WriteSettings(handle.get(), settings); } @@ -130,10 +130,10 @@ index 15d16f2e0928..5e8eadfd3ad1 100644 Settings::ScopedLockedFileHandle Settings::MakeScopedLockedFileHandle( FileHandle file, diff --git third_party/crashpad/crashpad/client/settings.h third_party/crashpad/crashpad/client/settings.h -index b64f74fbaf28..0c3c22e215b6 100644 +index a2b0c74636f4..01370fdc20d9 100644 --- third_party/crashpad/crashpad/client/settings.h +++ third_party/crashpad/crashpad/client/settings.h -@@ -102,6 +102,11 @@ class Settings { +@@ -111,6 +111,11 @@ class Settings { //! error logged. bool SetLastUploadAttemptTime(time_t time); @@ -146,7 +146,7 @@ index b64f74fbaf28..0c3c22e215b6 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index 9c337697b605..b1fbd1de6074 100644 +index 78a4b092d8a8..c2d3acfab889 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -179,20 +179,20 @@ index 9c337697b605..b1fbd1de6074 100644 cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union } diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -index 7505524b693b..4f8ceaa43bd6 100644 +index 715c533a2756..6f19e2ebc234 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -@@ -302,6 +302,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( - if (minidump_process_snapshot.Initialize(&minidump_file_reader)) { +@@ -264,6 +264,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( + if (minidump_process_snapshot.Initialize(reader)) { parameters = BreakpadHTTPFormParametersFromMinidump(&minidump_process_snapshot); + if (!parameters.empty()) + parameters = FilterParameters(parameters); } - if (!minidump_file_reader.SeekSet(start_offset)) { + if (!reader->SeekSet(start_offset)) { diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h -index cdd1502b7e2f..cb8450a892ba 100644 +index 2ec1147d2620..8ff9a72e0bd7 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h @@ -15,6 +15,7 @@ @@ -203,16 +203,16 @@ index cdd1502b7e2f..cb8450a892ba 100644 #include #include -@@ -99,7 +100,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { - //! This method may be called from any thread. - void ReportPending(const UUID& report_uuid); +@@ -103,7 +104,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate, + //! It is expected to only be called from the same thread that called Start(). + void Stop() override; - private: + protected: //! \brief The result code from UploadReport(). enum class UploadResult { //! \brief The crash report was uploaded successfully. -@@ -127,7 +128,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { +@@ -131,7 +132,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate, //! object was constructed with \a watch_pending_reports, it will also scan //! the crash report database for other pending reports, and process those as //! well. @@ -221,7 +221,7 @@ index cdd1502b7e2f..cb8450a892ba 100644 //! \brief Processes a single pending report from the database. //! -@@ -141,7 +142,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { +@@ -145,7 +146,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate, //! remain in the “pending” state. If the upload fails and no more retries are //! desired, or report upload is disabled, it will be marked as “completed” in //! the database without ever having been uploaded. @@ -230,8 +230,8 @@ index cdd1502b7e2f..cb8450a892ba 100644 //! \brief Attempts to upload a crash report. //! -@@ -158,6 +159,11 @@ class CrashReportUploadThread : public WorkerThread::Delegate { - UploadResult UploadReport(const CrashReportDatabase::Report* report, +@@ -162,6 +163,11 @@ class CrashReportUploadThread : public WorkerThread::Delegate, + UploadResult UploadReport(const CrashReportDatabase::UploadReport* report, std::string* response_body); + using ParameterMap = std::map; @@ -243,12 +243,12 @@ index cdd1502b7e2f..cb8450a892ba 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 f175fddf6084..d6285bbf28bf 100644 +index dd7adf6503fd..4ae51a58aa6e 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc -@@ -35,8 +35,10 @@ - #include "base/metrics/persistent_histogram_allocator.h" +@@ -36,8 +36,10 @@ #include "base/scoped_generic.h" + #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" +#include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -257,8 +257,8 @@ index f175fddf6084..d6285bbf28bf 100644 #include "client/crash_report_database.h" #include "client/crashpad_client.h" #include "client/crashpad_info.h" -@@ -79,6 +81,10 @@ - #include "handler/fuchsia/exception_handler_server.h" +@@ -90,6 +92,10 @@ + #include "handler/linux/exception_handler_server.h" #endif // OS_MACOSX +#if BUILDFLAG(ENABLE_CEF) @@ -268,7 +268,7 @@ index f175fddf6084..d6285bbf28bf 100644 namespace crashpad { namespace { -@@ -154,6 +160,9 @@ struct Options { +@@ -173,6 +179,9 @@ struct Options { bool periodic_tasks; bool rate_limit; bool upload_gzip; @@ -278,9 +278,9 @@ index f175fddf6084..d6285bbf28bf 100644 }; // Splits |key_value| on '=' and inserts the resulting key and value into |map|. -@@ -451,6 +460,9 @@ int HandlerMain(int argc, - kOptionResetOwnCrashExceptionPortToSystemDefault, - #endif // OS_MACOSX +@@ -532,6 +541,9 @@ int HandlerMain(int argc, + kOptionInitialClientFD, + #endif kOptionURL, + kOptionMaxUploads, + kOptionMaxDatabaseSize, @@ -288,7 +288,7 @@ index f175fddf6084..d6285bbf28bf 100644 // Standard options. kOptionHelp = -2, -@@ -501,6 +513,9 @@ int HandlerMain(int argc, +@@ -589,6 +601,9 @@ int HandlerMain(int argc, {"url", required_argument, nullptr, kOptionURL}, {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, @@ -298,7 +298,7 @@ index f175fddf6084..d6285bbf28bf 100644 {nullptr, 0, nullptr, 0}, }; -@@ -605,6 +620,27 @@ int HandlerMain(int argc, +@@ -714,6 +729,27 @@ int HandlerMain(int argc, options.url = optarg; break; } @@ -326,28 +326,28 @@ index f175fddf6084..d6285bbf28bf 100644 case kOptionHelp: { Usage(me); MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly); -@@ -772,15 +808,23 @@ int HandlerMain(int argc, - upload_thread_options.rate_limit = options.rate_limit; - upload_thread_options.upload_gzip = options.upload_gzip; - upload_thread_options.watch_pending_reports = options.periodic_tasks; -+#if BUILDFLAG(ENABLE_CEF) -+ CefCrashReportUploadThread upload_thread(database.get(), -+ options.url, -+ upload_thread_options, -+ options.max_uploads); -+#else - CrashReportUploadThread upload_thread(database.get(), - options.url, - upload_thread_options); -+#endif - upload_thread.Start(); +@@ -822,8 +858,14 @@ int HandlerMain(int argc, + upload_thread_options.upload_gzip = options.upload_gzip; + upload_thread_options.watch_pending_reports = options.periodic_tasks; - std::unique_ptr prune_thread; ++#if BUILDFLAG(ENABLE_CEF) ++ upload_thread.Reset(new CefCrashReportUploadThread( ++ database.get(), options.url, upload_thread_options, ++ options.max_uploads)); ++#else + upload_thread.Reset(new CrashReportUploadThread( + database.get(), options.url, upload_thread_options)); ++#endif + upload_thread.Get()->Start(); + } + +@@ -844,7 +886,8 @@ int HandlerMain(int argc, + ScopedStoppable prune_thread; if (options.periodic_tasks) { - prune_thread.reset(new PruneCrashReportThread( + prune_thread.Reset(new PruneCrashReportThread( - database.get(), PruneCondition::GetDefault())); + database.get(), PruneCondition::GetDefault(options.max_database_size, + options.max_database_age))); - prune_thread->Start(); + prune_thread.Get()->Start(); } diff --git a/patch/patches/devtools_product_2300.patch b/patch/patches/devtools_product_2300.patch index 50b7661b4..e69b62146 100644 --- a/patch/patches/devtools_product_2300.patch +++ b/patch/patches/devtools_product_2300.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 1a93ba92a9e0..2c4b116d25ea 100644 +index cae7c566146e..95b4c23c53c9 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -543,7 +543,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -564,7 +564,7 @@ void DevToolsHttpHandler::OnJsonRequest( version.SetString("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.SetString("WebKit-Version", GetWebKitVersion()); diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 91b89b838..6fc93c35c 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,8 +1,36 @@ +diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc +index 53c7404ef1f9..ac33df7cfe0e 100644 +--- chrome/browser/extensions/api/streams_private/streams_private_api.cc ++++ chrome/browser/extensions/api/streams_private/streams_private_api.cc +@@ -9,6 +9,7 @@ + + #include "base/lazy_instance.h" + #include "base/values.h" ++#include "cef/libcef/features/features.h" + #include "chrome/browser/extensions/extension_tab_util.h" + #include "chrome/browser/prerender/prerender_contents.h" + #include "chrome/common/extensions/api/streams_private.h" +@@ -79,6 +80,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( + if (!web_contents) + return; + ++#if !BUILDFLAG(ENABLE_CEF) + // 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. +@@ -88,6 +90,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( + prerender_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD); + return; + } ++#endif // !BUILDFLAG(ENABLE_CEF) + + auto* browser_context = web_contents->GetBrowserContext(); + StreamsPrivateAPI* streams_private = GetStreamsPrivateAPI(browser_context); diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc -index d7342d69dd8e..33d538952375 100644 +index 33678d6f3cbf..e16bd447aea2 100644 --- content/browser/frame_host/render_frame_host_manager.cc +++ content/browser/frame_host/render_frame_host_manager.cc -@@ -891,10 +891,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( +@@ -898,10 +898,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( // TODO(alexmos): This check should've been enforced earlier in the // navigation, in chrome::Navigate(). Verify this, and then convert this to // a CHECK and remove the fallback. @@ -18,7 +46,7 @@ index d7342d69dd8e..33d538952375 100644 return true; } -@@ -1033,7 +1034,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation( +@@ -1041,7 +1042,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation( // Double-check that the new SiteInstance is associated with the right // BrowserContext. @@ -29,10 +57,10 @@ index d7342d69dd8e..33d538952375 100644 // If |new_instance| is a new SiteInstance for a subframe that requires a // dedicated process, set its process reuse policy so that such subframes are diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 5373ee07b5cd..2558e590ba7c 100644 +index a9818834fec3..d21e360bea01 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -354,6 +354,13 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -366,6 +366,13 @@ class CONTENT_EXPORT ContentBrowserClient { const GURL& current_url, const GURL& new_url); @@ -47,7 +75,7 @@ index 5373ee07b5cd..2558e590ba7c 100644 // current SiteInstance, if it does not yet have a site. virtual bool ShouldAssignSiteForURL(const GURL& url); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index d60c12116dcc..70d376348c46 100644 +index a5a821840124..a2a8a0d63272 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -68,11 +68,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -117,7 +145,7 @@ index d60c12116dcc..70d376348c46 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index 34812c083bf5..1ccfaf6e1c45 100644 +index c93e3a48c7ee..ff6e2dbbca56 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -51,13 +51,19 @@ class ExtensionHost : public DeferredStartRenderHost, diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index ef2c01e19..b78f828be 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 50a8a2fe9f1e..719adff0da9b 100644 +index 2bcaabc1330e..6e6cbb542a59 100644 --- .gn +++ .gn -@@ -241,6 +241,8 @@ exec_script_whitelist = +@@ -244,6 +244,8 @@ exec_script_whitelist = # in the Chromium repo outside of //build. "//build_overrides/build.gni", @@ -12,10 +12,10 @@ index 50a8a2fe9f1e..719adff0da9b 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 161519ebfeac..c034f54603e8 100644 +index acd17275a438..52ea2a4654b0 100644 --- BUILD.gn +++ BUILD.gn -@@ -190,6 +190,7 @@ group("gn_all") { +@@ -192,6 +192,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ @@ -56,10 +56,10 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index a1d2ea4b2394..50514a54e64f 100644 +index fce62521a385..73fa49852fd6 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -132,19 +132,22 @@ def _LoadToolchainEnv(cpu, sdk_dir): +@@ -134,26 +134,29 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): # variable. if 'VSINSTALLDIR' in os.environ: del os.environ['VSINSTALLDIR'] @@ -70,21 +70,35 @@ index a1d2ea4b2394..50514a54e64f 100644 - raise Exception('%s is missing - make sure VC++ tools are installed.' % - script_path) - script_path = other_path +- cpu_arg = "amd64" +- if (cpu != 'x64'): +- # x64 is default target CPU thus any other CPU requires a target set +- cpu_arg += '_' + cpu +- args = [script_path, cpu_arg] +- # Store target must come before any SDK version declaration +- if (target_store): +- args.append(['store']) - # Chromium requires the 10.0.15063.468 SDK - previous versions don't have - # all of the required declarations and 10.0.16299.0 has some - # incompatibilities (crbug.com/773476). -- args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', -- '10.0.15063.0'] +- args.append('10.0.15063.0') - variables = _LoadEnvFromBat(args) + script_path = os.path.normpath(os.path.join( + os.environ['GYP_MSVS_OVERRIDE_PATH'], + 'VC/Auxiliary/Build/vcvarsall.bat')) + if os.path.exists(script_path): ++ cpu_arg = "amd64" ++ if (cpu != 'x64'): ++ # x64 is default target CPU thus any other CPU requires a target set ++ cpu_arg += '_' + cpu ++ args = [script_path, cpu_arg] ++ # Store target must come before any SDK version declaration ++ if (target_store): ++ args.append(['store']) + # Chromium requires the 10.0.15063.468 SDK - previous versions don't have + # all of the required declarations and 10.0.16299.0 has some + # incompatibilities (crbug.com/773476). -+ args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', -+ '10.0.15063.0'] ++ args.append('10.0.15063.0') + variables = _LoadEnvFromBat(args) + else: + variables = [] @@ -96,7 +110,7 @@ index a1d2ea4b2394..50514a54e64f 100644 diff --git build/vs_toolchain.py build/vs_toolchain.py -index 5f9541e4556f..c1144b30f237 100755 +index 6060415bda86..1cc1eaae0a1d 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -81,11 +81,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): @@ -119,10 +133,10 @@ index 5f9541e4556f..c1144b30f237 100755 # directory in order to run binaries locally, but they are needed in order # to create isolates or the mini_installer. Copying them to the output diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 94c5f759a0dd..a166b6302eeb 100644 +index 6d412994ffd8..575536f80166 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni -@@ -253,7 +253,7 @@ template("chrome_paks") { +@@ -257,7 +257,7 @@ template("chrome_paks") { } input_locales = locales @@ -132,10 +146,10 @@ index 94c5f759a0dd..a166b6302eeb 100644 if (is_mac) { output_locales = locales_as_mac_outputs diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index 3ed598db3989..b23170bc4591 100644 +index c365088b90b7..29c28300979e 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn -@@ -143,7 +143,7 @@ template("generate_mini_installer") { +@@ -133,7 +133,7 @@ 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 324bd05a6..085c2df66 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids -index 499d041b08c0..b036897264f7 100644 +index 3539e7ce5ab4..53a318e3cf14 100644 --- tools/gritsettings/resource_ids +++ tools/gritsettings/resource_ids -@@ -396,4 +396,11 @@ +@@ -408,4 +408,11 @@ # 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/ime_1610.patch b/patch/patches/ime_1610.patch index b2cd65c12..cd4b37154 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,15 +1,15 @@ -diff --git ui/base/ime/input_method_win.cc ui/base/ime/input_method_win.cc -index 06f8831222dd..68297ba47dd3 100644 ---- ui/base/ime/input_method_win.cc -+++ ui/base/ime/input_method_win.cc -@@ -685,8 +685,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { +diff --git ui/base/ime/input_method_win_base.cc ui/base/ime/input_method_win_base.cc +index 0e89451afb3b..1a0bdac93c1b 100644 +--- ui/base/ime/input_method_win_base.cc ++++ ui/base/ime/input_method_win_base.cc +@@ -53,8 +53,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { // receiving keyboard input as long as it is an active window. This works well // even when the |attached_window_handle| becomes active but has not received // WM_FOCUS yet. + // With CEF |toplevel_window_handle_| may be a child window. return toplevel_window_handle_ && -- GetActiveWindow() == toplevel_window_handle_; -+ GetActiveWindow() == ::GetAncestor(toplevel_window_handle_, GA_ROOT); +- GetActiveWindow() == toplevel_window_handle_; ++ GetActiveWindow() == ::GetAncestor(toplevel_window_handle_, GA_ROOT); } - ui::EventDispatchDetails InputMethodWin::DispatchFabricatedKeyEvent( + LRESULT InputMethodWinBase::OnChar(HWND window_handle, diff --git a/patch/patches/linux_build.patch b/patch/patches/linux_build.patch index f6ef1f418..3b0181ec4 100644 --- a/patch/patches/linux_build.patch +++ b/patch/patches/linux_build.patch @@ -1,14 +1,14 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 9a10137aa405..6dd8033a0b33 100644 +index 461e62da2d50..7cd9237c03ca 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -137,7 +137,7 @@ declare_args() { - is_posix && !using_sanitizer && !(is_android && use_order_profiling) && - ((use_lld && !is_nacl) || - (use_gold && -- ((!is_android && linux_use_bundled_binutils) || is_chromeos || -+ ((!is_android && linux_use_bundled_binutils && current_cpu != "x86") || is_chromeos || - !(current_cpu == "x86" || current_cpu == "x64")))) +@@ -149,7 +149,7 @@ declare_args() { + !(is_android && use_order_profiling) && + ((use_lld && !is_nacl) || + (use_gold && +- ((!is_android && linux_use_bundled_binutils) || is_chromeos || ++ ((!is_android && linux_use_bundled_binutils && current_cpu != "x86") || is_chromeos || + !(current_cpu == "x86" || current_cpu == "x64")))) } diff --git chrome/browser/ui/libgtkui/gtk_util.cc chrome/browser/ui/libgtkui/gtk_util.cc @@ -60,3 +60,18 @@ index 96f8c0e71472..49c462b37e12 100644 ScopedStyleContext child_context(gtk_style_context_new()); gtk_style_context_set_path(child_context, path); +diff --git third_party/unrar/BUILD.gn third_party/unrar/BUILD.gn +index 6e2bc75171ee..9275f68d12e3 100644 +--- third_party/unrar/BUILD.gn ++++ third_party/unrar/BUILD.gn +@@ -56,6 +56,10 @@ if (safe_browsing_mode == 1) { + "src/volume.cpp", + ] + ++ if (is_posix && !is_mac) { ++ sources += [ "src/global.cpp" ] ++ } ++ + configs -= [ + "//build/config/compiler:chromium_code", + "//build/config/compiler:no_exceptions", diff --git a/patch/patches/mac_gpu_2398.patch b/patch/patches/mac_gpu_2398.patch index ee7b9b2e4..f35bb1629 100644 --- a/patch/patches/mac_gpu_2398.patch +++ b/patch/patches/mac_gpu_2398.patch @@ -1,8 +1,8 @@ diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc -index 828ce9bb0138..1301e6cc1d14 100644 +index d58e64ff1939..d83df5dc84ee 100644 --- ui/gl/init/gl_initializer_mac.cc +++ ui/gl/init/gl_initializer_mac.cc -@@ -40,11 +40,8 @@ bool InitializeOneOffForSandbox() { +@@ -47,11 +47,8 @@ bool InitializeOneOffForSandbox() { // GPU-related stuff is very slow without this, probably because // the sandbox prevents loading graphics drivers or some such. std::vector attribs; diff --git a/patch/patches/message_loop_443_1992243003.patch b/patch/patches/message_loop_443_1992243003.patch index fa4f2c6a7..3af8bb014 100644 --- a/patch/patches/message_loop_443_1992243003.patch +++ b/patch/patches/message_loop_443_1992243003.patch @@ -1,8 +1,8 @@ diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h -index 27ee7fe8155b..353a61c3badd 100644 +index 439d364fc54c..6cbe494e7041 100644 --- base/message_loop/message_loop.h +++ base/message_loop/message_loop.h -@@ -266,6 +266,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, +@@ -257,6 +257,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, void AddTaskObserver(TaskObserver* task_observer); void RemoveTaskObserver(TaskObserver* task_observer); @@ -19,7 +19,7 @@ index 27ee7fe8155b..353a61c3badd 100644 // Returns true if the message loop is idle (ignoring delayed tasks). This is // the same condition which triggers DoWork() to return false: i.e. // out of tasks which can be processed at the current run-level -- there might -@@ -373,6 +383,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, +@@ -358,6 +368,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, // is known to generate a system-driven nested loop. bool task_execution_allowed_ = true; @@ -33,10 +33,10 @@ index 27ee7fe8155b..353a61c3badd 100644 // if type_ is TYPE_CUSTOM and pump_ is null. MessagePumpFactoryCallback pump_factory_; diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 5069b8524924..e88a3c7974f2 100644 +index b145a1d54a32..9b28169050b2 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc -@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) { +@@ -372,20 +372,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) { } bool MessagePumpForUI::ProcessPumpReplacementMessage() { diff --git a/patch/patches/net_security_expiration_1994.patch b/patch/patches/net_security_expiration_1994.patch index 49b8a1050..0d2223cb8 100644 --- a/patch/patches/net_security_expiration_1994.patch +++ b/patch/patches/net_security_expiration_1994.patch @@ -55,10 +55,10 @@ index fb6f4847cfe9..aa4c1cdafb9f 100644 } // namespace net diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc -index cd4e9c74a31c..66e3598bb127 100644 +index 2f07f68ace0d..8c223aed6210 100644 --- net/http/transport_security_state.cc +++ net/http/transport_security_state.cc -@@ -1564,8 +1564,10 @@ void TransportSecurityState::ClearReportCachesForTesting() { +@@ -1581,8 +1581,10 @@ void TransportSecurityState::ClearReportCachesForTesting() { sent_expect_ct_reports_cache_.Clear(); } @@ -72,10 +72,10 @@ index cd4e9c74a31c..66e3598bb127 100644 // We consider built-in information to be timely for 10 weeks. return (base::Time::Now() - build_time).InDays() < 70 /* 10 weeks */; diff --git net/http/transport_security_state.h net/http/transport_security_state.h -index 79d3a1c3453f..d97e26b4b024 100644 +index cf034710df38..d53de146034e 100644 --- net/http/transport_security_state.h +++ net/http/transport_security_state.h -@@ -576,6 +576,10 @@ class NET_EXPORT TransportSecurityState { +@@ -582,6 +582,10 @@ class NET_EXPORT TransportSecurityState { // Expect-CT reports. void ClearReportCachesForTesting(); @@ -86,7 +86,7 @@ index 79d3a1c3453f..d97e26b4b024 100644 private: friend class TransportSecurityStateTest; friend class TransportSecurityStateStaticFuzzer; -@@ -596,7 +600,7 @@ class NET_EXPORT TransportSecurityState { +@@ -602,7 +606,7 @@ class NET_EXPORT TransportSecurityState { // IsBuildTimely returns true if the current build is new enough ensure that // built in security information (i.e. HSTS preloading and pinning // information) is timely. @@ -95,7 +95,7 @@ index 79d3a1c3453f..d97e26b4b024 100644 // Helper method for actually checking pins. PKPStatus CheckPublicKeyPinsImpl( -@@ -705,6 +709,8 @@ class NET_EXPORT TransportSecurityState { +@@ -711,6 +715,8 @@ class NET_EXPORT TransportSecurityState { // True if public key pinning bypass is enabled for local trust anchors. bool enable_pkp_bypass_for_local_trust_anchors_; diff --git a/patch/patches/net_urlrequest_1327.patch b/patch/patches/net_urlrequest_1327.patch index d4ca5719c..c0c945ee6 100644 --- a/patch/patches/net_urlrequest_1327.patch +++ b/patch/patches/net_urlrequest_1327.patch @@ -1,8 +1,8 @@ diff --git net/url_request/url_request.h net/url_request/url_request.h -index c0fc8aeee535..0a16da034f80 100644 +index 57273101f211..cbd357b4d910 100644 --- net/url_request/url_request.h +++ net/url_request/url_request.h -@@ -705,10 +705,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData { +@@ -712,10 +712,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData { void set_socket_tag(const SocketTag& socket_tag); const SocketTag& socket_tag() const { return socket_tag_; } diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch index baa880421..a462b5229 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,10 +1,10 @@ diff --git BUILD.gn BUILD.gn -index d7c8640a2..7f508fdae 100644 +index 2f74e43bf..a74e2dade 100644 --- BUILD.gn +++ BUILD.gn -@@ -231,6 +231,10 @@ jumbo_static_library("pdfium") { - if (pdf_is_complete_lib) { +@@ -240,6 +240,10 @@ jumbo_static_library("pdfium") { complete_static_lib = true + configs -= [ "//build/config/compiler:thin_archive" ] } + + include_dirs = [ @@ -13,19 +13,19 @@ index d7c8640a2..7f508fdae 100644 } jumbo_static_library("test_support") { -diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp -index e890aa009..cabb73bb6 100644 ---- fpdfsdk/fpdfview.cpp -+++ fpdfsdk/fpdfview.cpp +diff --git fpdfsdk/fpdf_view.cpp fpdfsdk/fpdf_view.cpp +index cd8edbbdd..ea06a5576 100644 +--- fpdfsdk/fpdf_view.cpp ++++ fpdfsdk/fpdf_view.cpp @@ -36,6 +36,7 @@ + #include "fpdfsdk/cpdfsdk_memoryaccess.h" #include "fpdfsdk/cpdfsdk_pageview.h" - #include "fpdfsdk/fsdk_define.h" - #include "fpdfsdk/fsdk_pauseadapter.h" + #include "fpdfsdk/ipdfsdk_pauseadapter.h" +#include "fxjs/cfxjs_engine.h" #include "fxjs/ijs_runtime.h" - #include "public/fpdf_edit.h" - #include "public/fpdf_ext.h" -@@ -495,6 +496,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { + #include "public/fpdf_formfill.h" + #include "third_party/base/ptr_util.h" +@@ -186,6 +187,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { CPDF_ModuleMgr::Destroy(); CFX_GEModule::Destroy(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index cdc8b0fc4..4b7ecf9c5 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 6b1fa1ceb553..d3c6c961ccdf 100644 +index 3b72878d9462..02ed570accd6 100644 --- content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h -@@ -183,6 +183,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -185,6 +185,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,10 +11,10 @@ index 6b1fa1ceb553..d3c6c961ccdf 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 e147056305cb..ee7d1a7d8c87 100644 +index 53bc2c0a9711..d070118f34cf 100644 --- content/public/common/web_preferences.cc +++ content/public/common/web_preferences.cc -@@ -166,6 +166,7 @@ WebPreferences::WebPreferences() +@@ -174,6 +174,7 @@ WebPreferences::WebPreferences() spatial_navigation_enabled(false), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), @@ -23,10 +23,10 @@ index e147056305cb..ee7d1a7d8c87 100644 record_whole_document(false), save_previous_document_resources(SavePreviousDocumentResources::NEVER), diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h -index 43606a755fa2..967190fc8f83 100644 +index e4fc39c60fd7..f19fccf47261 100644 --- content/public/common/web_preferences.h +++ content/public/common/web_preferences.h -@@ -186,6 +186,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -190,6 +190,7 @@ struct CONTENT_EXPORT WebPreferences { bool spatial_navigation_enabled; bool use_solid_color_scrollbars; bool navigate_on_drag_drop; @@ -35,10 +35,10 @@ index 43606a755fa2..967190fc8f83 100644 bool record_whole_document; SavePreviousDocumentResources save_previous_document_resources; diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index 6e57733e6657..18cb21550b0b 100644 +index 58cf6da520e2..02ad4c2998bf 100644 --- content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc -@@ -1235,6 +1235,7 @@ void RenderViewImpl::ApplyWebPreferencesInternal( +@@ -1209,6 +1209,7 @@ void RenderViewImpl::ApplyWebPreferencesInternal( blink::WebView* web_view, CompositorDependencies* compositor_deps) { ApplyWebPreferences(prefs, web_view); diff --git a/patch/patches/print_header_footer_1478_1565.patch b/patch/patches/print_header_footer_1478_1565.patch index 4447546e8..253c3dcb8 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index c50380806706..011b63531a33 100644 +index 72dde06a99a7..0a7cd2e45d2c 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -919,6 +919,7 @@ split_static_library("ui") { +@@ -923,6 +923,7 @@ split_static_library("ui") { "//base:i18n", "//base/allocator:buildflags", "//cc/paint", @@ -11,7 +11,7 @@ index c50380806706..011b63531a33 100644 "//chrome:resources", "//chrome:strings", diff --git chrome/browser/ui/cocoa/applescript/tab_applescript.mm chrome/browser/ui/cocoa/applescript/tab_applescript.mm -index e5ac419b8f4c..ced62e390bc4 100644 +index 33216fef9a1b..c84572425a8d 100644 --- chrome/browser/ui/cocoa/applescript/tab_applescript.mm +++ chrome/browser/ui/cocoa/applescript/tab_applescript.mm @@ -9,7 +9,7 @@ @@ -34,7 +34,7 @@ index e5ac419b8f4c..ced62e390bc4 100644 using content::NavigationController; using content::NavigationEntry; using content::OpenURLParams; -@@ -232,11 +236,15 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, +@@ -231,11 +235,15 @@ void ResumeAppleEventAndSendReply(NSAppleEventManagerSuspensionID suspension_id, - (void)handlesPrintScriptCommand:(NSScriptCommand*)command { AppleScript::LogAppleScriptUMA(AppleScript::AppleScriptCommand::TAB_PRINT); @@ -51,7 +51,7 @@ index e5ac419b8f4c..ced62e390bc4 100644 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command { diff --git chrome/browser/ui/webui/settings/printing_handler.cc chrome/browser/ui/webui/settings/printing_handler.cc -index 45644030eb24..c894209e1530 100644 +index 8647b2daf9ea..b070ab3e4b86 100644 --- chrome/browser/ui/webui/settings/printing_handler.cc +++ chrome/browser/ui/webui/settings/printing_handler.cc @@ -6,9 +6,13 @@ @@ -82,7 +82,7 @@ index 45644030eb24..c894209e1530 100644 } // namespace settings diff --git chrome/common/chrome_utility_printing_messages.h chrome/common/chrome_utility_printing_messages.h -index 6dfe3b430d7d..82e3ab03bdc4 100644 +index f903429e25e4..cde2124fb18e 100644 --- chrome/common/chrome_utility_printing_messages.h +++ chrome/common/chrome_utility_printing_messages.h @@ -16,7 +16,7 @@ @@ -103,12 +103,12 @@ index 6dfe3b430d7d..82e3ab03bdc4 100644 #endif // CHROME_COMMON_CHROME_UTILITY_PRINTING_MESSAGES_H_ diff --git chrome/utility/printing_handler.h chrome/utility/printing_handler.h -index b56deaf18589..3d931b55686f 100644 +index 006966fd1c58..db9cd49af2a4 100644 --- chrome/utility/printing_handler.h +++ chrome/utility/printing_handler.h @@ -11,7 +11,7 @@ #include "build/build_config.h" - #include "printing/features/features.h" + #include "printing/buildflags/buildflags.h" -#if !defined(OS_WIN) || !BUILDFLAG(ENABLE_PRINT_PREVIEW) +#if !defined(OS_WIN) @@ -116,7 +116,7 @@ index b56deaf18589..3d931b55686f 100644 #endif diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc -index 6df98550d22d..3192faf033f8 100644 +index b308dc410ffb..6c92009df454 100644 --- components/printing/common/print_messages.cc +++ components/printing/common/print_messages.cc @@ -148,7 +148,6 @@ PrintMsg_PrintFrame_Params::PrintMsg_PrintFrame_Params() {} @@ -133,7 +133,7 @@ index 6df98550d22d..3192faf033f8 100644 } -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h -index 22469f97d1f9..fd303fd1e764 100644 +index 0f1e59167b24..783cbcdc6bd9 100644 --- components/printing/common/print_messages.h +++ components/printing/common/print_messages.h @@ -85,7 +85,6 @@ struct PrintMsg_PrintFrame_Params { @@ -242,7 +242,7 @@ index 22469f97d1f9..fd303fd1e764 100644 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ diff --git components/printing/renderer/print_render_frame_helper.cc components/printing/renderer/print_render_frame_helper.cc -index 2d81ba90d69c..0f70f15f2deb 100644 +index 1c914fd1ba34..6141c4021785 100644 --- components/printing/renderer/print_render_frame_helper.cc +++ components/printing/renderer/print_render_frame_helper.cc @@ -326,7 +326,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, @@ -433,7 +433,7 @@ index 2d81ba90d69c..0f70f15f2deb 100644 PrintRenderFrameHelper::PrintPreviewContext::PrintPreviewContext() : total_page_count_(0), diff --git components/printing/renderer/print_render_frame_helper.h components/printing/renderer/print_render_frame_helper.h -index 64a6dd6a1912..8c87d7565eca 100644 +index b1b1a18dd6aa..8e014acdd246 100644 --- components/printing/renderer/print_render_frame_helper.h +++ components/printing/renderer/print_render_frame_helper.h @@ -145,10 +145,8 @@ class PrintRenderFrameHelper @@ -514,13 +514,28 @@ index 64a6dd6a1912..8c87d7565eca 100644 PrintPreviewContext print_preview_context_; bool is_loading_; bool is_scripted_preview_delayed_; +diff --git components/printing_strings.grdp components/printing_strings.grdp +index a669226337f2..5e3c3caa2aa2 100644 +--- components/printing_strings.grdp ++++ components/printing_strings.grdp +@@ -1,10 +1,8 @@ + + +- + + + $1HP LaserJet on $2printserver + + +- + diff --git components/pwg_encoder/BUILD.gn components/pwg_encoder/BUILD.gn -index 452c53bff69f..abb4dc0e6219 100644 +index 96ae254116a9..3697d6034300 100644 --- components/pwg_encoder/BUILD.gn +++ components/pwg_encoder/BUILD.gn @@ -4,8 +4,6 @@ - import("//printing/features/features.gni") + import("//printing/buildflags/buildflags.gni") -assert(enable_print_preview) - diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index fe146006f..78da66c29 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 ba99093fc98e..5e1da4621361 100644 +index da87d60520c6..1c45a50595b5 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc @@ -142,6 +142,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index ef1038d5e..393c13081 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index ef8350dd1f99..601db5845c8a 100644 +index ef6eeb91a9e5..72e5fbcc1883 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc @@ -32,7 +32,8 @@ diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 567894e23..e888d17b8 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,35 +1,23 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 087bc630062a..bd6ae8b47a1b 100644 +index 867b83e3be2f..d5e46c884d8f 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -433,13 +433,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura( - selection_controller_client_.reset( - new TouchSelectionControllerClientAura(this)); - CreateSelectionController(); -- -- RenderViewHost* rvh = RenderViewHost::From(host_); -- if (rvh) { -- // TODO(mostynb): actually use prefs. Landing this as a separate CL -- // first to rebaseline some unreliable layout tests. -- ignore_result(rvh->GetWebkitPreferences()); -- } - } - - //////////////////////////////////////////////////////////////////////////////// -@@ -789,8 +782,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( +@@ -734,9 +734,11 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( + return; background_color_ = color; - bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; +- bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; - window_->layer()->SetFillsBoundsOpaquely(opaque); - window_->layer()->SetColor(color); + if (window_) { ++ bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; + window_->layer()->SetFillsBoundsOpaquely(opaque); + window_->layer()->SetColor(color); + } } - bool RenderWidgetHostViewAura::IsMouseLocked() { -@@ -1922,6 +1917,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { + void RenderWidgetHostViewAura::WindowTitleChanged() { +@@ -1869,6 +1871,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { if (frame_sink_id_.is_valid()) window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/service_factory_1680.patch b/patch/patches/service_factory_1680.patch index 2dffca4fe..c87e2af15 100644 --- a/patch/patches/service_factory_1680.patch +++ b/patch/patches/service_factory_1680.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/spellchecker/spellcheck_factory.cc chrome/browser/spellchecker/spellcheck_factory.cc -index 20054d12bc55..106c18216e57 100644 +index 64b5243d510a..8ae3001f85fc 100644 --- chrome/browser/spellchecker/spellcheck_factory.cc +++ chrome/browser/spellchecker/spellcheck_factory.cc -@@ -18,6 +18,13 @@ +@@ -17,6 +17,13 @@ #include "services/service_manager/public/cpp/identity.h" #include "ui/base/l10n/l10n_util.h" @@ -16,7 +16,7 @@ index 20054d12bc55..106c18216e57 100644 // static SpellcheckService* SpellcheckServiceFactory::GetForContext( content::BrowserContext* context) { -@@ -38,7 +45,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderer( +@@ -37,7 +44,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderer( // static SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() { @@ -97,7 +97,7 @@ index 2907619549ba..f941fba363b5 100644 SupervisedUserSettingsServiceFactory(); diff --git chrome/browser/ui/prefs/prefs_tab_helper.cc chrome/browser/ui/prefs/prefs_tab_helper.cc -index 23dfe243fb83..7eb879cadcbb 100644 +index 5486b8e15cb4..9015c41f1f81 100644 --- chrome/browser/ui/prefs/prefs_tab_helper.cc +++ chrome/browser/ui/prefs/prefs_tab_helper.cc @@ -11,8 +11,8 @@ diff --git a/patch/patches/service_manager_654986.patch b/patch/patches/service_manager_654986.patch index 6407bf452..a0611b55f 100644 --- a/patch/patches/service_manager_654986.patch +++ b/patch/patches/service_manager_654986.patch @@ -1,8 +1,8 @@ diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc -index ed36168629af..20be6bed9f79 100644 +index 24551fba132e..f4b38b871f9a 100644 --- services/service_manager/embedder/main.cc +++ services/service_manager/embedder/main.cc -@@ -301,13 +301,30 @@ int RunService(MainDelegate* delegate) { +@@ -300,13 +300,30 @@ int RunService(MainDelegate* delegate) { return exit_code; } @@ -34,7 +34,7 @@ index ed36168629af..20be6bed9f79 100644 MainDelegate* delegate = params.delegate; DCHECK(delegate); -@@ -375,30 +392,14 @@ int Main(const MainParams& params) { +@@ -374,30 +391,14 @@ int Main(const MainParams& params) { MainDelegate::InitializeParams init_params; #if defined(OS_MACOSX) @@ -69,7 +69,7 @@ index ed36168629af..20be6bed9f79 100644 mojo_config.max_message_num_bytes = kMaximumMojoMessageSize; delegate->OverrideMojoConfiguration(&mojo_config); mojo::edk::Init(mojo_config); -@@ -433,6 +434,16 @@ int Main(const MainParams& params) { +@@ -432,6 +433,16 @@ int Main(const MainParams& params) { trace_config, base::trace_event::TraceLog::RECORDING_MODE); } @@ -86,7 +86,7 @@ index ed36168629af..20be6bed9f79 100644 switch (process_type) { case ProcessType::kDefault: NOTREACHED(); -@@ -454,6 +465,8 @@ int Main(const MainParams& params) { +@@ -453,6 +464,8 @@ int Main(const MainParams& params) { break; } @@ -95,7 +95,7 @@ index ed36168629af..20be6bed9f79 100644 if (tracker) { if (exit_code == 0) { tracker->SetProcessPhaseIfEnabled( -@@ -465,13 +478,38 @@ int Main(const MainParams& params) { +@@ -464,13 +477,38 @@ int Main(const MainParams& params) { } } @@ -124,7 +124,7 @@ index ed36168629af..20be6bed9f79 100644 + // Each "main" needs to flush this pool right before it goes into its main + // event loop to get rid of the cruft. + params.autorelease_pool = -+ base::MakeUnique(); ++ std::make_unique(); +#endif + + int exit_code = MainInitialize(params); diff --git a/patch/patches/storage_partition_1973.patch b/patch/patches/storage_partition_1973.patch index cbfe193dc..72e8ac8cf 100644 --- a/patch/patches/storage_partition_1973.patch +++ b/patch/patches/storage_partition_1973.patch @@ -1,8 +1,8 @@ diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc -index b5f06abaeb8a..dd0fac00e45e 100644 +index 3a34269fbc04..b3637d969367 100644 --- content/browser/appcache/appcache_internals_ui.cc +++ content/browser/appcache/appcache_internals_ui.cc -@@ -371,8 +371,8 @@ void AppCacheInternalsUI::CreateProxyForPartition( +@@ -373,8 +373,8 @@ void AppCacheInternalsUI::CreateProxyForPartition( StoragePartition* storage_partition) { scoped_refptr proxy = new Proxy(weak_ptr_factory_.GetWeakPtr(), storage_partition->GetPath()); @@ -14,7 +14,7 @@ index b5f06abaeb8a..dd0fac00e45e 100644 } diff --git content/browser/background_fetch/background_fetch_service_impl.cc content/browser/background_fetch/background_fetch_service_impl.cc -index be53f5115d3d..92f09f04f3a1 100644 +index c481fb6c0411..a9f6e7bcf7a0 100644 --- content/browser/background_fetch/background_fetch_service_impl.cc +++ content/browser/background_fetch/background_fetch_service_impl.cc @@ -38,8 +38,7 @@ void BackgroundFetchServiceImpl::Create( @@ -28,10 +28,10 @@ index be53f5115d3d..92f09f04f3a1 100644 origin, std::move(request))); } diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index 05e3cc192262..3775eab5323b 100644 +index 0b5780dfe117..a499aaacb879 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc -@@ -85,6 +85,11 @@ class BlobHandleImpl : public BlobHandle { +@@ -87,6 +87,11 @@ class BlobHandleImpl : public BlobHandle { ChromeBlobStorageContext::ChromeBlobStorageContext() {} @@ -44,10 +44,10 @@ index 05e3cc192262..3775eab5323b 100644 BrowserContext* context) { DCHECK_CURRENTLY_ON(BrowserThread::UI); diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h -index 8c5b031e1e65..bbe6fa6525a6 100644 +index 043d968ca6ab..edb3c0d80c12 100644 --- content/browser/blob_storage/chrome_blob_storage_context.h +++ content/browser/blob_storage/chrome_blob_storage_context.h -@@ -50,6 +50,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext +@@ -52,6 +52,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext public: ChromeBlobStorageContext(); @@ -57,7 +57,7 @@ index 8c5b031e1e65..bbe6fa6525a6 100644 static ChromeBlobStorageContext* GetFor( BrowserContext* browser_context); diff --git content/browser/bluetooth/web_bluetooth_service_impl.cc content/browser/bluetooth/web_bluetooth_service_impl.cc -index e5c7291dcc8f..0eec8a11db35 100644 +index cda94e43e866..84fde20fdce2 100644 --- content/browser/bluetooth/web_bluetooth_service_impl.cc +++ content/browser/bluetooth/web_bluetooth_service_impl.cc @@ -1233,9 +1233,9 @@ url::Origin WebBluetoothServiceImpl::GetOrigin() { @@ -73,10 +73,10 @@ index e5c7291dcc8f..0eec8a11db35 100644 partition->GetBluetoothAllowedDevicesMap(); return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin()); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 0cf6cde723e6..ae04e57bfcbb 100644 +index 15cb62d76bb0..4de29a1f11f9 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -132,11 +132,18 @@ StoragePartition* GetStoragePartitionFromConfig( +@@ -130,11 +130,18 @@ StoragePartition* GetStoragePartitionFromConfig( StoragePartitionImplMap* partition_map = GetStoragePartitionMap(browser_context); @@ -98,7 +98,7 @@ index 0cf6cde723e6..ae04e57bfcbb 100644 } void SaveSessionStateOnIOThread( -@@ -579,6 +586,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor( +@@ -585,6 +592,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor( BrowserContext::BrowserContext() : media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {} @@ -111,7 +111,7 @@ index 0cf6cde723e6..ae04e57bfcbb 100644 CHECK(GetUserData(kMojoWasInitialized)) << "Attempting to destroy a BrowserContext that never called " diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc -index 5501f6ad645d..7ecacac8c92d 100644 +index 5449b409717a..b138a8ca7fa3 100644 --- content/browser/devtools/protocol/service_worker_handler.cc +++ content/browser/devtools/protocol/service_worker_handler.cc @@ -170,8 +170,7 @@ void ServiceWorkerHandler::SetRenderer(int process_host_id, @@ -147,10 +147,10 @@ index ec9ab86d0ca6..0fe5219f1e84 100644 base::WeakPtrFactory weak_factory_; diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc -index 02470e87915b..38caa4e8a936 100644 +index 316ddd4982c9..cab536b7a0ec 100644 --- content/browser/download/download_manager_impl.cc +++ content/browser/download/download_manager_impl.cc -@@ -78,9 +78,9 @@ +@@ -87,9 +87,9 @@ namespace content { namespace { @@ -163,7 +163,7 @@ index 02470e87915b..38caa4e8a936 100644 DCHECK_CURRENTLY_ON(BrowserThread::UI); SiteInstance* site_instance = nullptr; -@@ -90,8 +90,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context, +@@ -99,8 +99,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context, if (render_frame_host_) site_instance = render_frame_host_->GetSiteInstance(); } @@ -173,52 +173,93 @@ index 02470e87915b..38caa4e8a936 100644 } bool CanRequestURLFromRenderer(int render_process_id, GURL url) { -@@ -1161,7 +1160,7 @@ void DownloadManagerImpl::BeginDownloadInternal( +@@ -823,8 +822,8 @@ void DownloadManagerImpl::ResumeInterruptedDownload( + std::unique_ptr params, + uint32_t id, + const GURL& site_url) { +- StoragePartitionImpl* storage_partition = static_cast( +- BrowserContext::GetStoragePartitionForSite(browser_context_, site_url)); ++ StoragePartition* storage_partition = ++ BrowserContext::GetStoragePartitionForSite(browser_context_, site_url); + params->set_url_request_context_getter( + storage_partition->GetURLRequestContext()); + BeginDownloadInternal(std::move(params), nullptr, id, storage_partition); +@@ -1030,7 +1029,7 @@ void DownloadManagerImpl::DownloadUrl( + download::RecordDownloadCountWithSource( + download::DownloadCountTypes::DOWNLOAD_TRIGGERED_COUNT, + params->download_source()); +- StoragePartitionImpl* storage_partition = ++ StoragePartition* storage_partition = + GetStoragePartition(browser_context_, params->render_process_host_id(), + params->render_frame_host_routing_id()); + BeginDownloadInternal(std::move(params), std::move(blob_data_handle), +@@ -1247,7 +1246,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete( + tab_referrer_url = entry->GetReferrer().url; + } + } +- StoragePartitionImpl* storage_partition = ++ StoragePartition* storage_partition = + GetStoragePartition(browser_context_, render_process_id, render_frame_id); + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, +@@ -1257,7 +1256,8 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete( + tab_referrer_url, std::move(url_chain), suggested_filename, + std::move(response), std::move(cert_status), + std::move(url_loader_client_endpoints), +- storage_partition->url_loader_factory_getter(), ++ base::WrapRefCounted( ++ storage_partition->url_loader_factory_getter()), + base::MessageLoop::current()->task_runner())); + } + +@@ -1299,7 +1299,7 @@ void DownloadManagerImpl::BeginDownloadInternal( + std::unique_ptr params, + std::unique_ptr blob_data_handle, + uint32_t id, +- StoragePartitionImpl* storage_partition) { ++ StoragePartition* storage_partition) { if (base::FeatureList::IsEnabled(network::features::kNetworkService)) { std::unique_ptr request = - CreateResourceRequest(params.get()); -- StoragePartitionImpl* storage_partition = -+ StoragePartition* storage_partition = - GetStoragePartition(browser_context_, params->render_process_host_id(), - params->render_frame_host_routing_id()); + download::CreateResourceRequest(params.get()); +diff --git content/browser/download/download_manager_impl.h content/browser/download/download_manager_impl.h +index 13ae60ba1130..be2515338f7e 100644 +--- content/browser/download/download_manager_impl.h ++++ content/browser/download/download_manager_impl.h +@@ -41,7 +41,7 @@ class DownloadRequestHandleInterface; -@@ -1182,7 +1181,8 @@ void DownloadManagerImpl::BeginDownloadInternal( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&BeginResourceDownload, std::move(params), - std::move(request), std::move(blob_data_handle), -- storage_partition->url_loader_factory_getter(), id, -+ base::WrapRefCounted( -+ storage_partition->url_loader_factory_getter()), id, - weak_factory_.GetWeakPtr(), site_url, tab_url, - tab_referrer_url), - base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler, -diff --git content/browser/download/parallel_download_job.cc content/browser/download/parallel_download_job.cc -index de25ae93f74d..73f490f783c9 100644 ---- content/browser/download/parallel_download_job.cc -+++ content/browser/download/parallel_download_job.cc -@@ -304,8 +304,7 @@ void ParallelDownloadJob::CreateRequest(int64_t offset, int64_t length) { + namespace content { + class ResourceContext; +-class StoragePartitionImpl; ++class StoragePartition; + class URLLoaderFactoryGetter; - // Send the request. - worker->SendRequest(std::move(download_params), -- static_cast(storage_partition) -- ->url_loader_factory_getter()); -+ storage_partition->url_loader_factory_getter()); - DCHECK(workers_.find(offset) == workers_.end()); - workers_[offset] = std::move(worker); - } + class CONTENT_EXPORT DownloadManagerImpl +@@ -250,7 +250,7 @@ class CONTENT_EXPORT DownloadManagerImpl + std::unique_ptr params, + std::unique_ptr blob_data_handle, + uint32_t id, +- StoragePartitionImpl* storage_partition); ++ StoragePartition* storage_partition); + + void InterceptNavigationOnChecksComplete( + ResourceRequestInfo::WebContentsGetter web_contents_getter, diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc -index 8e4c4a42b0a0..f78f3d3817ae 100644 +index 4b7db1b992e4..7befff0086b1 100644 --- content/browser/loader/navigation_url_loader_network_service.cc +++ content/browser/loader/navigation_url_loader_network_service.cc -@@ -1020,11 +1020,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( +@@ -1231,7 +1231,7 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( } } - auto* partition = static_cast(storage_partition); + auto* partition = storage_partition; + non_network_url_loader_factories_[url::kFileScheme] = + std::make_unique( + partition->browser_context()->GetPath(), +@@ -1245,7 +1245,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( DCHECK(!request_controller_); request_controller_ = std::make_unique( - std::move(initial_handlers), std::move(new_request), resource_context, + std::move(initial_interceptors), std::move(new_request), resource_context, - partition->url_loader_factory_getter(), request_info->common_params.url, + base::WrapRefCounted(partition->url_loader_factory_getter()), + request_info->common_params.url, @@ -226,7 +267,7 @@ index 8e4c4a42b0a0..f78f3d3817ae 100644 request_info->common_params.suggested_filename, std::move(proxied_factory_request), std::move(proxied_factory_info), diff --git content/browser/payments/payment_app_installer.cc content/browser/payments/payment_app_installer.cc -index d01fb931d358..962d10d44141 100644 +index 6a6e31bdb070..dce0433e1775 100644 --- content/browser/payments/payment_app_installer.cc +++ content/browser/payments/payment_app_installer.cc @@ -125,9 +125,9 @@ class SelfDeleteInstaller @@ -242,10 +283,10 @@ index d01fb931d358..962d10d44141 100644 partition->GetPaymentAppContext(); diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc -index d899d32fd383..7e62c70fc70a 100644 +index 5d4aefd16449..b5f99bc43389 100644 --- content/browser/payments/payment_app_provider_impl.cc +++ content/browser/payments/payment_app_provider_impl.cc -@@ -329,10 +329,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context, +@@ -307,10 +307,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context, ServiceWorkerStartCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -260,7 +301,7 @@ index d899d32fd383..7e62c70fc70a 100644 BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, -@@ -373,8 +374,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps( +@@ -377,8 +378,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps( GetAllPaymentAppsCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -272,22 +313,10 @@ index d899d32fd383..7e62c70fc70a 100644 partition->GetPaymentAppContext(); diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index 8c34d8e7af5e..55c0060a6c81 100644 +index 3e6f43de2a5d..e5c1d2031173 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -500,9 +500,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver { - SpareRenderProcessHostManager() {} - - void WarmupSpareRenderProcessHost(BrowserContext* browser_context) { -- StoragePartitionImpl* current_partition = -- static_cast( -- BrowserContext::GetStoragePartition(browser_context, nullptr)); -+ StoragePartition* current_partition = -+ BrowserContext::GetStoragePartition(browser_context, nullptr); - - if (spare_render_process_host_ && - matching_browser_context_ == browser_context && -@@ -641,11 +640,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data, +@@ -718,11 +718,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data, // Gets the correct render process to use for this SiteInstance. RenderProcessHost* GetProcessHost(SiteInstance* site_instance, bool is_for_guests_only) { @@ -303,7 +332,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 // Is this the default storage partition? If it isn't, then just give it its // own non-shared process. -@@ -1240,7 +1238,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { +@@ -1335,7 +1334,7 @@ int RenderProcessHost::GetCurrentRenderProcessCountForTesting() { // static RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( BrowserContext* browser_context, @@ -312,7 +341,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 SiteInstance* site_instance, bool is_for_guests_only) { if (g_render_process_host_factory_) { -@@ -1249,8 +1247,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( +@@ -1344,8 +1343,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( } if (!storage_partition_impl) { @@ -323,16 +352,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 } // If we've made a StoragePartition for guests (e.g., for the tag), // stash the Site URL on it. This way, when we start a service worker inside -@@ -1272,7 +1270,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( - // static - RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( - BrowserContext* browser_context, -- StoragePartitionImpl* storage_partition_impl, -+ StoragePartition* storage_partition_impl, - SiteInstance* site_instance, - bool is_for_guests_only) { - RenderProcessHost* render_process_host = -@@ -1292,7 +1290,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( +@@ -1370,7 +1369,7 @@ const unsigned int RenderProcessHostImpl::kMaxFrameDepthForPriority = RenderProcessHostImpl::RenderProcessHostImpl( BrowserContext* browser_context, @@ -341,7 +361,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 bool is_for_guests_only) : fast_shutdown_started_(false), deleting_soon_(false), -@@ -1325,7 +1323,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( +@@ -1403,7 +1402,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( indexed_db_factory_(new IndexedDBDispatcherHost( id_, storage_partition_impl_->GetURLRequestContext(), @@ -351,7 +371,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 ChromeBlobStorageContext::GetFor(browser_context_))), channel_connected_(false), sent_render_process_ready_(false), -@@ -1359,7 +1358,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( +@@ -1440,7 +1440,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( } push_messaging_manager_.reset(new PushMessagingManager( @@ -360,8 +380,8 @@ index 8c34d8e7af5e..55c0060a6c81 100644 + storage_partition_impl_->GetServiceWorkerContext()))); AddObserver(indexed_db_factory_.get()); - -@@ -1680,6 +1680,20 @@ void RenderProcessHostImpl::ResetChannelProxy() { + #if defined(OS_MACOSX) +@@ -1768,6 +1769,20 @@ void RenderProcessHostImpl::ResetChannelProxy() { void RenderProcessHostImpl::CreateMessageFilters() { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -382,7 +402,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 AddFilter(new ResourceSchedulerFilter(GetID())); MediaInternals* media_internals = MediaInternals::GetInstance(); // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages -@@ -1694,8 +1708,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1782,8 +1797,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { new RenderMessageFilter( GetID(), GetBrowserContext(), request_context.get(), widget_helper_.get(), media_internals, @@ -393,7 +413,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 AddFilter(render_message_filter.get()); render_frame_message_filter_ = new RenderFrameMessageFilter( -@@ -1724,10 +1738,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1810,10 +1825,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { ChromeBlobStorageContext::GetFor(browser_context); resource_message_filter_ = new ResourceMessageFilter( @@ -404,9 +424,9 @@ index 8c34d8e7af5e..55c0060a6c81 100644 - storage_partition_impl_->GetServiceWorkerContext(), + service_worker_context, storage_partition_impl_->GetPrefetchURLLoaderService(), - get_contexts_callback, + std::move(get_contexts_callback), BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); -@@ -1754,8 +1768,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1840,8 +1855,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { } AddFilter( new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service())); @@ -416,13 +436,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 #if BUILDFLAG(ENABLE_WEBRTC) peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID()); -@@ -1778,13 +1791,12 @@ void RenderProcessHostImpl::CreateMessageFilters() { - - scoped_refptr cache_storage_filter = - new CacheStorageDispatcherHost(); -- cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext()); -+ cache_storage_filter->Init(cache_storage_context); - AddFilter(cache_storage_filter.get()); +@@ -1863,8 +1877,7 @@ void RenderProcessHostImpl::CreateMessageFilters() { scoped_refptr service_worker_filter = new ServiceWorkerDispatcherHost(GetID(), resource_context); @@ -432,7 +446,7 @@ index 8c34d8e7af5e..55c0060a6c81 100644 AddFilter(service_worker_filter.get()); #if BUILDFLAG(ENABLE_WEBRTC) -@@ -1796,11 +1808,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1876,11 +1889,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { AddFilter(new TraceMessageFilter(GetID())); AddFilter(new ResolveProxyMsgHelper(request_context.get())); @@ -445,7 +459,17 @@ index 8c34d8e7af5e..55c0060a6c81 100644 resource_context, service_worker_context, browser_context); AddFilter(notification_message_filter_.get()); -@@ -1934,7 +1943,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { +@@ -1902,7 +1912,8 @@ void RenderProcessHostImpl::BindCacheStorage( + cache_storage_dispatcher_host_ = + base::MakeRefCounted(); + cache_storage_dispatcher_host_->Init( +- storage_partition_impl_->GetCacheStorageContext()); ++ static_cast( ++ storage_partition_impl_->GetCacheStorageContext())); + } + // Send the binding to IO thread, because Cache Storage handles Mojo IPC on IO + // thread entirely. +@@ -2040,7 +2051,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { registry->AddInterface(base::BindRepeating( &AppCacheDispatcherHost::Create, @@ -456,27 +480,18 @@ index 8c34d8e7af5e..55c0060a6c81 100644 AddUIThreadInterface(registry.get(), base::Bind(&FieldTrialRecorder::Create)); diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h -index 51c2ff46b9ad..5e830df5d433 100644 +index 3a37edd2ac2a..360011cbc76d 100644 --- content/browser/renderer_host/render_process_host_impl.h +++ content/browser/renderer_host/render_process_host_impl.h -@@ -83,7 +83,6 @@ class ResourceMessageFilter; +@@ -89,7 +89,6 @@ class ResourceMessageFilter; class SiteInstance; class SiteInstanceImpl; class StoragePartition; -class StoragePartitionImpl; #if BUILDFLAG(ENABLE_WEBRTC) - class P2PSocketDispatcherHost; -@@ -126,7 +125,7 @@ class CONTENT_EXPORT RenderProcessHostImpl - // legal). - static RenderProcessHost* CreateOrUseSpareRenderProcessHost( - BrowserContext* browser_context, -- StoragePartitionImpl* storage_partition_impl, -+ StoragePartition* storage_partition_impl, - SiteInstance* site_instance, - bool is_for_guests_only); - -@@ -138,7 +137,7 @@ class CONTENT_EXPORT RenderProcessHostImpl + class MediaStreamTrackMetricsHost; +@@ -136,7 +135,7 @@ class CONTENT_EXPORT RenderProcessHostImpl // null. static RenderProcessHost* CreateRenderProcessHost( BrowserContext* browser_context, @@ -485,7 +500,7 @@ index 51c2ff46b9ad..5e830df5d433 100644 SiteInstance* site_instance, bool is_for_guests_only); -@@ -419,7 +418,7 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -436,7 +435,7 @@ class CONTENT_EXPORT RenderProcessHostImpl // Use CreateRenderProcessHost() instead of calling this constructor // directly. RenderProcessHostImpl(BrowserContext* browser_context, @@ -494,7 +509,7 @@ index 51c2ff46b9ad..5e830df5d433 100644 bool is_for_guests_only); // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected -@@ -655,10 +654,10 @@ class CONTENT_EXPORT RenderProcessHostImpl +@@ -710,10 +709,10 @@ class CONTENT_EXPORT RenderProcessHostImpl // called. int instance_id_ = 1; @@ -508,10 +523,10 @@ index 51c2ff46b9ad..5e830df5d433 100644 // The observers watching our lifetime. base::ObserverList observers_; diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc -index 9b1c71bdb19c..891969b30d79 100644 +index 24bd8c4e1e28..0b33d7d17f69 100644 --- content/browser/renderer_interface_binders.cc +++ content/browser/renderer_interface_binders.cc -@@ -134,7 +134,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { +@@ -137,7 +137,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { parameterized_binder_registry_.AddInterface( base::Bind([](payments::mojom::PaymentManagerRequest request, RenderProcessHost* host, const url::Origin& origin) { @@ -520,7 +535,7 @@ index 9b1c71bdb19c..891969b30d79 100644 ->GetPaymentAppContext() ->CreatePaymentManager(std::move(request)); })); -@@ -148,7 +148,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { +@@ -157,7 +157,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { parameterized_binder_registry_.AddInterface(base::BindRepeating( [](blink::mojom::LockManagerRequest request, RenderProcessHost* host, const url::Origin& origin) { @@ -529,7 +544,7 @@ index 9b1c71bdb19c..891969b30d79 100644 ->GetLockManager() ->CreateService(std::move(request), origin); })); -@@ -157,9 +157,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { +@@ -166,9 +166,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { parameterized_binder_registry_.AddInterface( base::Bind([](blink::mojom::NotificationServiceRequest request, RenderProcessHost* host, const url::Origin& origin) { @@ -544,7 +559,7 @@ index 9b1c71bdb19c..891969b30d79 100644 parameterized_binder_registry_.AddInterface( base::BindRepeating(&BackgroundFetchServiceImpl::Create)); diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc -index 11b579bdeca4..8dcbe5ff390e 100644 +index 4b08ffd8b662..a09bdc7cb892 100644 --- content/browser/shared_worker/shared_worker_connector_impl.cc +++ content/browser/shared_worker/shared_worker_connector_impl.cc @@ -41,8 +41,8 @@ void SharedWorkerConnectorImpl::Connect( @@ -558,11 +573,27 @@ index 11b579bdeca4..8dcbe5ff390e 100644 service->ConnectToWorker(process_id_, frame_id_, std::move(info), std::move(client), creation_context_type, blink::MessagePortChannel(std::move(message_port))); +diff --git content/browser/shared_worker/shared_worker_service_impl.cc content/browser/shared_worker/shared_worker_service_impl.cc +index 5589e34dec3f..85fe4dededa7 100644 +--- content/browser/shared_worker/shared_worker_service_impl.cc ++++ content/browser/shared_worker/shared_worker_service_impl.cc +@@ -167,8 +167,9 @@ void SharedWorkerServiceImpl::ConnectToWorker( + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::BindOnce(&CreateScriptLoaderOnIO, +- service_worker_context_->storage_partition() +- ->url_loader_factory_getter(), ++ base::WrapRefCounted( ++ service_worker_context_->storage_partition() ++ ->url_loader_factory_getter()), + service_worker_context_, process_id, + base::BindOnce(&SharedWorkerServiceImpl::CreateWorker, + weak_factory_.GetWeakPtr(), diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h -index 580d2e0d78d9..0309f5c1df48 100644 +index 38d0aadaad67..730406c96605 100644 --- content/browser/storage_partition_impl.h +++ content/browser/storage_partition_impl.h -@@ -99,7 +99,7 @@ class CONTENT_EXPORT StoragePartitionImpl +@@ -102,7 +102,7 @@ class CONTENT_EXPORT StoragePartitionImpl storage::FileSystemContext* GetFileSystemContext() override; storage::DatabaseTracker* GetDatabaseTracker() override; DOMStorageContextWrapper* GetDOMStorageContext() override; @@ -571,7 +602,7 @@ index 580d2e0d78d9..0309f5c1df48 100644 IndexedDBContextImpl* GetIndexedDBContext() override; CacheStorageContextImpl* GetCacheStorageContext() override; ServiceWorkerContextWrapper* GetServiceWorkerContext() override; -@@ -137,14 +137,14 @@ class CONTENT_EXPORT StoragePartitionImpl +@@ -141,14 +141,14 @@ class CONTENT_EXPORT StoragePartitionImpl void FlushNetworkInterfaceForTesting() override; void WaitForDeletionTasksForTesting() override; @@ -594,7 +625,7 @@ index 580d2e0d78d9..0309f5c1df48 100644 // mojom::StoragePartitionService interface. void OpenLocalStorage(const url::Origin& origin, -@@ -153,18 +153,18 @@ class CONTENT_EXPORT StoragePartitionImpl +@@ -157,18 +157,18 @@ class CONTENT_EXPORT StoragePartitionImpl const std::string& namespace_id, mojom::SessionStorageNamespaceRequest request) override; @@ -617,7 +648,7 @@ index 580d2e0d78d9..0309f5c1df48 100644 auto& bindings_for_testing() { return bindings_; } -@@ -175,10 +175,11 @@ class CONTENT_EXPORT StoragePartitionImpl +@@ -179,10 +179,11 @@ class CONTENT_EXPORT StoragePartitionImpl // one must use the "chrome-guest://blahblah" site URL to ensure that the // service worker stays in this StoragePartition. This is an empty GURL if // this StoragePartition is not for guests. @@ -632,10 +663,10 @@ index 580d2e0d78d9..0309f5c1df48 100644 } diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc -index 7aafca3aafcd..aac07962f6a5 100644 +index 0ab6a2d6f963..f24e547f2396 100644 --- content/browser/streams/stream_context.cc +++ content/browser/streams/stream_context.cc -@@ -22,6 +22,11 @@ namespace content { +@@ -21,6 +21,11 @@ namespace content { StreamContext::StreamContext() {} @@ -660,12 +691,12 @@ index 075ae3e7431e..57fb5fd2c4a8 100644 void InitializeOnIOThread(); diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc -index 32457c8510f9..27f3012f76f5 100644 +index fb7a2fe41f94..f8232c08e924 100644 --- content/browser/webui/web_ui_url_loader_factory.cc +++ content/browser/webui/web_ui_url_loader_factory.cc -@@ -20,13 +20,13 @@ +@@ -19,13 +19,13 @@ + #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/histogram_internals_url_loader.h" - #include "content/browser/loader/global_routing_id.h" #include "content/browser/resource_context_impl.h" -#include "content/browser/storage_partition_impl.h" #include "content/browser/webui/network_error_url_loader.h" @@ -678,7 +709,7 @@ index 32457c8510f9..27f3012f76f5 100644 #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/url_constants.h" -@@ -296,9 +296,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory, +@@ -313,9 +313,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory, const std::string& scheme() const { return scheme_; } private: @@ -691,10 +722,10 @@ index 32457c8510f9..27f3012f76f5 100644 RenderFrameHost* render_frame_host_; diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h -index 9edd7b1d9123..c61b034c68cc 100644 +index ddb422866966..5f0996729c1c 100644 --- content/public/browser/browser_context.h +++ content/public/browser/browser_context.h -@@ -207,6 +207,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { +@@ -206,6 +206,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { BrowserContext(); @@ -703,7 +734,7 @@ index 9edd7b1d9123..c61b034c68cc 100644 ~BrowserContext() override; // Shuts down the storage partitions associated to this browser context. -@@ -295,6 +297,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { +@@ -294,6 +296,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { const base::FilePath& partition_path, bool in_memory) = 0; @@ -719,42 +750,35 @@ index 9edd7b1d9123..c61b034c68cc 100644 std::map; diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h -index 55c298e02b57..b277e50ab372 100644 +index ec12926fcbbb..0e583b393936 100644 --- content/public/browser/storage_partition.h +++ content/public/browser/storage_partition.h -@@ -14,6 +14,7 @@ +@@ -13,6 +13,7 @@ + #include "base/files/file_path.h" #include "base/time/time.h" #include "content/common/content_export.h" - #include "content/public/common/shared_url_loader_factory.h" +#include "mojo/public/cpp/bindings/binding_set.h" #include "net/cookies/cookie_store.h" + #include "services/network/public/cpp/shared_url_loader_factory.h" - class GURL; -@@ -49,13 +50,23 @@ class DatabaseTracker; - namespace content { +@@ -58,12 +59,27 @@ class ServiceWorkerContext; + class SharedWorkerService; + class WebPackageContext; - class AppCacheService; +class BackgroundFetchContext; +class BackgroundSyncContext; +class BlobRegistryWrapper; +class BlobURLLoaderFactory; +class BluetoothAllowedDevicesMap; +class BroadcastChannelProvider; - class BrowserContext; - class CacheStorageContext; - class DOMStorageContext; - class IndexedDBContext; +class LockManager; +class PaymentAppContextImpl; - class PlatformNotificationContext; +class PrefetchURLLoaderService; - class ServiceWorkerContext; - class SharedWorkerService; +class URLLoaderFactoryGetter; - ++ #if !defined(OS_ANDROID) class HostZoomLevelContext; -@@ -63,6 +74,10 @@ class HostZoomMap; + class HostZoomMap; class ZoomLevelDelegate; #endif // !defined(OS_ANDROID) @@ -765,7 +789,7 @@ index 55c298e02b57..b277e50ab372 100644 // Defines what persistent state a child process can access. // // The StoragePartition defines the view each child process has of the -@@ -90,6 +105,7 @@ class CONTENT_EXPORT StoragePartition { +@@ -96,6 +112,7 @@ class CONTENT_EXPORT StoragePartition { virtual storage::FileSystemContext* GetFileSystemContext() = 0; virtual storage::DatabaseTracker* GetDatabaseTracker() = 0; virtual DOMStorageContext* GetDOMStorageContext() = 0; @@ -773,7 +797,7 @@ index 55c298e02b57..b277e50ab372 100644 virtual IndexedDBContext* GetIndexedDBContext() = 0; virtual ServiceWorkerContext* GetServiceWorkerContext() = 0; virtual SharedWorkerService* GetSharedWorkerService() = 0; -@@ -209,6 +225,26 @@ class CONTENT_EXPORT StoragePartition { +@@ -216,6 +233,26 @@ class CONTENT_EXPORT StoragePartition { // Wait until all deletions tasks are finished. For test use only. virtual void WaitForDeletionTasksForTesting() = 0; @@ -801,10 +825,10 @@ index 55c298e02b57..b277e50ab372 100644 virtual ~StoragePartition() {} }; diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index f6986c4babc4..1a467451e351 100644 +index 2b415cceb6cb..e3b71f3f0e74 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -492,7 +492,7 @@ bool DatabaseTracker::LazyInit() { +@@ -482,7 +482,7 @@ bool DatabaseTracker::LazyInit() { meta_table_.reset(new sql::MetaTable()); is_initialized_ = diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index e8139d355..4a56fbe65 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -39,10 +39,10 @@ index 605dc1b17e43..24c385a53289 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 3d706df56ee6..f10d816a3f05 100644 +index 39702db77da5..fa1a84425200 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -518,6 +518,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) { +@@ -524,6 +524,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) { } } @@ -57,7 +57,7 @@ index 3d706df56ee6..f10d816a3f05 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -1465,6 +1473,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -1485,6 +1493,19 @@ void RenderText::OnTextAttributeChanged() { if (!multiline_ && replace_newline_chars_with_symbols_) base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_); @@ -78,10 +78,10 @@ index 3d706df56ee6..f10d816a3f05 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 47fa4c605ce1..f5587fac6b5d 100644 +index 4cc2bdc85fe8..2b05443698da 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -295,6 +295,10 @@ class GFX_EXPORT RenderText { +@@ -299,6 +299,10 @@ class GFX_EXPORT RenderText { void SetElideBehavior(ElideBehavior elide_behavior); ElideBehavior elide_behavior() const { return elide_behavior_; } @@ -92,7 +92,7 @@ index 47fa4c605ce1..f5587fac6b5d 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -858,6 +862,8 @@ class GFX_EXPORT RenderText { +@@ -882,6 +886,8 @@ class GFX_EXPORT RenderText { // Extra spacing placed between glyphs; used for obscured text styling. int glyph_spacing_ = 0; @@ -102,10 +102,10 @@ index 47fa4c605ce1..f5587fac6b5d 100644 }; diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index 34ea050d06a8..7bdd050802a0 100644 +index 81d018254a5d..f5911778e3b6 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h -@@ -67,6 +67,8 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { +@@ -73,6 +73,8 @@ class VIEWS_EXPORT InkDropHostView : public View, public InkDropHost { // them. void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event); @@ -115,10 +115,10 @@ index 34ea050d06a8..7bdd050802a0 100644 static constexpr int kInkDropSmallCornerRadius = 2; static constexpr int kInkDropLargeCornerRadius = 4; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 7cf98686b710..9c18255901bb 100644 +index d56f4cb2f73c..c89650dbd675 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -188,6 +188,7 @@ gfx::Size LabelButton::CalculatePreferredSize() const { +@@ -187,6 +187,7 @@ gfx::Size LabelButton::CalculatePreferredSize() const { Label label(GetText(), {label_->font_list()}); label.SetLineHeight(label_->line_height()); label.SetShadows(label_->shadows()); @@ -126,7 +126,7 @@ index 7cf98686b710..9c18255901bb 100644 if (style_ == STYLE_BUTTON) { // Some text appears wider when rendered normally than when rendered bold. -@@ -406,6 +407,12 @@ std::unique_ptr LabelButton::CreateInkDropHighlight() +@@ -405,6 +406,12 @@ std::unique_ptr LabelButton::CreateInkDropHighlight() gfx::RectF(image()->GetMirroredBounds()).CenterPoint()); } @@ -211,10 +211,10 @@ index 8fb11e1cf9cb..bd2951bd948b 100644 // The time is used for simulating menu behavior for the menu button; that // is, if the menu is shown and the button is pressed, we need to close the diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 6b6d5f02b8ab..0dc4d1f0f389 100644 +index b5baab3cbb18..ee82e1b05b60 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -42,6 +42,20 @@ namespace { +@@ -41,6 +41,20 @@ namespace { gfx::Insets NonBorderInsets(const Label& label) { return label.GetInsets() - label.View::GetInsets(); } @@ -235,7 +235,7 @@ index 6b6d5f02b8ab..0dc4d1f0f389 100644 } // namespace const char Label::kViewClassName[] = "Label"; -@@ -203,6 +217,14 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -202,6 +216,14 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { ResetLayout(); } @@ -250,7 +250,7 @@ index 6b6d5f02b8ab..0dc4d1f0f389 100644 void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); tooltip_text_ = tooltip_text; -@@ -431,7 +453,19 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -430,7 +452,19 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SetFontList(font_list()); render_text->set_shadows(shadows()); render_text->SetCursorEnabled(false); @@ -272,7 +272,7 @@ index 6b6d5f02b8ab..0dc4d1f0f389 100644 render_text->SetMaxLines(multi_line() ? max_lines() : 0); render_text->SetWordWrapBehavior(full_text_->word_wrap_behavior()); diff --git ui/views/controls/label.h ui/views/controls/label.h -index 635025a82505..58899c5ec0aa 100644 +index 1d35afeda78f..333f9c0f778d 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h @@ -153,6 +153,10 @@ class VIEWS_EXPORT Label : public View, @@ -286,7 +286,7 @@ index 635025a82505..58899c5ec0aa 100644 // 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 revert to -@@ -367,6 +371,7 @@ class VIEWS_EXPORT Label : public View, +@@ -370,6 +374,7 @@ class VIEWS_EXPORT Label : public View, bool collapse_when_hidden_; int fixed_width_; int max_width_; @@ -295,10 +295,10 @@ index 635025a82505..58899c5ec0aa 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 4feb2cd4b2e7..c7590702bf95 100644 +index 1e6f6cc17281..bcecef51482e 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2261,8 +2261,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2316,8 +2316,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -313,7 +313,7 @@ index 4feb2cd4b2e7..c7590702bf95 100644 MenuItemView* to_select = NULL; if (item->GetSubmenu()->GetMenuItemCount() > 0) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2277,8 +2282,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2332,8 +2337,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -373,10 +373,10 @@ index 4dea63f9f286..ef50b710c5af 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 4cf7d61f7efe..d6f00c797979 100644 +index 257f71e6eaa4..1a53b4c6e2e7 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -823,7 +823,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { +@@ -842,7 +842,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { // only need the background when we want it to look different, as when we're // selected. ui::NativeTheme* native_theme = GetNativeTheme(); @@ -390,7 +390,7 @@ index 4cf7d61f7efe..d6f00c797979 100644 gfx::Rect item_bounds(0, 0, width(), height()); AdjustBoundsForRTLUI(&item_bounds); -@@ -933,6 +938,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { +@@ -952,6 +957,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { SkColor MenuItemView::GetTextColor(bool minor, bool render_selection, bool emphasized) const { @@ -402,13 +402,13 @@ index 4cf7d61f7efe..d6f00c797979 100644 + } + ui::NativeTheme::ColorId color_id = - minor ? ui::NativeTheme::kColorId_MenuItemSubtitleColor + minor ? ui::NativeTheme::kColorId_MenuItemMinorTextColor : ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index 2a540157090f..23aa93f96d76 100644 +index e1a2339bddbf..1f209c328a94 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc -@@ -245,6 +245,77 @@ void MenuModelAdapter::SelectionChanged(MenuItemView* menu) { +@@ -228,6 +228,77 @@ void MenuModelAdapter::SelectionChanged(MenuItemView* menu) { NOTREACHED(); } @@ -512,10 +512,10 @@ index 0ac493c3c6a0..741769e90eb0 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 01069fe8680b..928ee7cb4d90 100644 +index 2e2e6b2aa26e..0c2ce1af6021 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -184,6 +184,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -183,6 +183,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_view_ = new MenuScrollView(content_view); AddChildView(scroll_view_); @@ -528,7 +528,7 @@ index 01069fe8680b..928ee7cb4d90 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 875ac82283b3..44424b2ce138 100644 +index 9e16b4c88177..3d660e406709 100644 --- ui/views/test/ui_controls_factory_desktop_aurax11.cc +++ ui/views/test/ui_controls_factory_desktop_aurax11.cc @@ -140,10 +140,6 @@ class UIControlsDesktopX11 : public UIControlsAura { 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 371105777..cf371afe5 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 151c87cd72e3..593a79904382 100644 +index ca70db586f53..80cc47fdbb50 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -312,6 +312,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() const { +@@ -371,6 +371,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() const { return screen_info.device_scale_factor; } @@ -18,10 +18,10 @@ index 151c87cd72e3..593a79904382 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 06f2793aa2d7..06244d674026 100644 +index 895e2dcaf262..8333bd24b192 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -79,6 +79,7 @@ class BrowserAccessibilityManager; +@@ -80,6 +80,7 @@ class BrowserAccessibilityManager; class CursorManager; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index 06f2793aa2d7..06244d674026 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -98,6 +99,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -101,6 +102,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase float current_device_scale_factor() const { return current_device_scale_factor_; } @@ -39,16 +39,16 @@ index 06f2793aa2d7..06244d674026 100644 // Returns the focused RenderWidgetHost inside this |view|'s RWH. RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -122,6 +126,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, - bool editable) override; - void GetScreenInfo(ScreenInfo* screen_info) const override; +@@ -132,6 +136,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase + void DisableAutoResize(const gfx::Size& new_size) override; + bool IsScrollOffsetAtTop() const override; float GetDeviceScaleFactor() const final; + void SetHasExternalParent(bool val) override; + bool HasExternalParent() const override; TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; -@@ -412,6 +418,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -423,6 +429,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase // helps to position the full screen widget on the correct monitor. virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; @@ -61,9 +61,9 @@ index 06f2793aa2d7..06244d674026 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -559,6 +571,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -590,6 +602,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase - WebContentsAccessibility* web_contents_accessibility_; + bool is_currently_scrolling_viewport_; + // True if the widget has a external parent view/window outside of the + // Chromium-controlled view/window hierarchy. @@ -73,11 +73,11 @@ index 06f2793aa2d7..06244d674026 100644 #if defined(USE_AURA) void OnDidScheduleEmbed(int routing_id, 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 8318ed172a75..0d6023427bf4 100644 +index e046d3a5e231..4c9d6059adb9 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc -@@ -28,6 +28,10 @@ - #include "ui/events/blink/web_input_event.h" +@@ -30,6 +30,10 @@ + #include "ui/events/keycodes/dom/keycode_converter.h" #include "ui/touch_selection/touch_selection_controller.h" +#if defined(OS_LINUX) @@ -87,7 +87,7 @@ index 8318ed172a75..0d6023427bf4 100644 #if defined(OS_WIN) #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/public/common/context_menu_params.h" -@@ -880,6 +884,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { +@@ -882,6 +886,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { ::SetFocus(hwnd); } } @@ -103,10 +103,10 @@ index 8318ed172a75..0d6023427bf4 100644 // TODO(wjmaclean): can host_ ever be null? if (host_ && set_focus_on_mouse_down_or_key_event_) { diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index e967efe6ad9b..3c49ea9ac980 100644 +index 1ced1c489b4d..3ee7cbf075d8 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h -@@ -213,6 +213,14 @@ class CONTENT_EXPORT RenderWidgetHostView { +@@ -242,6 +242,14 @@ class CONTENT_EXPORT RenderWidgetHostView { // This must always return the same device scale factor as GetScreenInfo. virtual float GetDeviceScaleFactor() const = 0; @@ -135,10 +135,10 @@ index f772f64d656e..7d13f9f81b6c 100644 return host ? host->GetAcceleratedWidget() : NULL; } 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 19f103c0385e..737125f8f601 100644 +index 2f8194254c1a..dbb57b13d465 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -86,6 +86,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( +@@ -85,6 +85,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( should_animate_window_close_(false), pending_close_(false), has_non_client_view_(false), @@ -146,7 +146,7 @@ index 19f103c0385e..737125f8f601 100644 tooltip_(NULL) { } -@@ -124,8 +125,12 @@ void DesktopWindowTreeHostWin::Init(aura::Window* content_window, +@@ -119,8 +120,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_); HWND parent_hwnd = NULL; @@ -160,7 +160,7 @@ index 19f103c0385e..737125f8f601 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -849,11 +854,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -850,11 +855,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -177,12 +177,12 @@ index 19f103c0385e..737125f8f601 100644 + HandleActivationChanged(false); } - bool DesktopWindowTreeHostWin::HandleMouseEvent(const ui::MouseEvent& event) { + 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 732f492c102f..a7007468c3b7 100644 +index 4120d3ae63f5..a02f7320347c 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -277,6 +277,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -279,6 +279,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -194,7 +194,7 @@ index 732f492c102f..a7007468c3b7 100644 // 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 f8550833ee6f..117a47a7aacd 100644 +index 35ef8238a101..5ea914d301cf 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -145,6 +145,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -205,7 +205,7 @@ index f8550833ee6f..117a47a7aacd 100644 drag_drop_client_(NULL), native_widget_delegate_(native_widget_delegate), desktop_native_widget_aura_(desktop_native_widget_aura), -@@ -158,6 +159,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( +@@ -157,6 +158,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( has_window_focus_(false), has_pointer_focus_(false), modal_dialog_counter_(0), @@ -213,7 +213,7 @@ index f8550833ee6f..117a47a7aacd 100644 close_widget_factory_(this), weak_factory_(this) {} -@@ -193,6 +195,8 @@ std::vector DesktopWindowTreeHostX11::GetAllOpenWindows() { +@@ -192,6 +194,8 @@ std::vector DesktopWindowTreeHostX11::GetAllOpenWindows() { } gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const { @@ -222,7 +222,7 @@ index f8550833ee6f..117a47a7aacd 100644 return bounds_in_pixels_; } -@@ -505,7 +509,8 @@ void DesktopWindowTreeHostX11::CloseNow() { +@@ -502,7 +506,8 @@ void DesktopWindowTreeHostX11::CloseNow() { // Actually free our native resources. if (ui::PlatformEventSource::GetInstance()) ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); @@ -232,7 +232,7 @@ index f8550833ee6f..117a47a7aacd 100644 xwindow_ = x11::None; desktop_native_widget_aura_->OnHostClosed(); -@@ -646,6 +651,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( +@@ -643,6 +648,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( } gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { @@ -241,7 +241,7 @@ index f8550833ee6f..117a47a7aacd 100644 return ToDIPRect(bounds_in_pixels_); } -@@ -1253,6 +1260,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( +@@ -1257,6 +1264,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( } gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const { @@ -250,7 +250,7 @@ index f8550833ee6f..117a47a7aacd 100644 return bounds_in_pixels_.origin(); } -@@ -1364,7 +1373,6 @@ void DesktopWindowTreeHostX11::InitX11Window( +@@ -1372,7 +1381,6 @@ void DesktopWindowTreeHostX11::InitX11Window( ::Atom window_type; switch (params.type) { case Widget::InitParams::TYPE_MENU: @@ -258,7 +258,7 @@ index f8550833ee6f..117a47a7aacd 100644 window_type = gfx::GetAtom("_NET_WM_WINDOW_TYPE_MENU"); break; case Widget::InitParams::TYPE_TOOLTIP: -@@ -1420,9 +1428,15 @@ void DesktopWindowTreeHostX11::InitX11Window( +@@ -1428,9 +1436,15 @@ void DesktopWindowTreeHostX11::InitX11Window( attribute_mask |= CWBorderPixel; swa.border_pixel = 0; @@ -275,7 +275,7 @@ index f8550833ee6f..117a47a7aacd 100644 bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.height(), 0, // border width -@@ -2020,6 +2034,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( +@@ -2028,6 +2042,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( } break; } @@ -287,10 +287,10 @@ index f8550833ee6f..117a47a7aacd 100644 case x11::FocusOut: OnFocusEvent(xev->type == x11::FocusIn, event->xfocus.mode, 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 021a1d9ad2b1..7f8ccfb73acd 100644 +index 79d677baa9f7..9056f02c37f0 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -@@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -87,6 +87,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // Disables event listening to make |dialog| modal. std::unique_ptr DisableEventListening(); @@ -302,8 +302,8 @@ index 021a1d9ad2b1..7f8ccfb73acd 100644 + protected: // Overridden from DesktopWindowTreeHost: - void Init(aura::Window* content_window, -@@ -302,6 +308,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 + void Init(const Widget::InitParams& params) override; +@@ -309,6 +315,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // The bounds of |xwindow_|. gfx::Rect bounds_in_pixels_; @@ -313,7 +313,7 @@ index 021a1d9ad2b1..7f8ccfb73acd 100644 // Whenever the bounds are set, we keep the previous set of bounds around so // we can have a better chance of getting the real // |restored_bounds_in_pixels_|. Window managers tend to send a Configure -@@ -341,6 +350,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -348,6 +357,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 // Whether we used an ARGB visual for our window. bool use_argb_visual_; @@ -324,7 +324,7 @@ index 021a1d9ad2b1..7f8ccfb73acd 100644 DesktopDragDropClientAuraX11* drag_drop_client_; std::unique_ptr x11_non_client_event_filter_; -@@ -431,6 +444,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 +@@ -436,6 +449,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 uint32_t modal_dialog_counter_; @@ -335,10 +335,10 @@ index 021a1d9ad2b1..7f8ccfb73acd 100644 base::WeakPtrFactory weak_factory_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 926519dfa332..e06be5a1b0eb 100644 +index 7bc25d68ab4d..b6c69838fcc4 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -130,6 +130,7 @@ Widget::InitParams::InitParams(Type type) +@@ -133,6 +133,7 @@ Widget::InitParams::InitParams(Type type) use_system_default_icon(false), show_state(ui::SHOW_STATE_DEFAULT), parent(nullptr), @@ -346,7 +346,7 @@ index 926519dfa332..e06be5a1b0eb 100644 native_widget(nullptr), desktop_window_tree_host(nullptr), layer_type(ui::LAYER_TEXTURED), -@@ -304,7 +305,7 @@ void Widget::Init(const InitParams& in_params) { +@@ -307,7 +308,7 @@ void Widget::Init(const InitParams& in_params) { params.name = params.delegate->GetContentsView()->GetClassName(); params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -355,7 +355,7 @@ index 926519dfa332..e06be5a1b0eb 100644 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && params.type != views::Widget::InitParams::TYPE_WINDOW && -@@ -368,7 +369,12 @@ void Widget::Init(const InitParams& in_params) { +@@ -374,7 +375,12 @@ void Widget::Init(const InitParams& in_params) { } } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); @@ -369,7 +369,7 @@ index 926519dfa332..e06be5a1b0eb 100644 } // This must come after SetContentsView() or it might not be able to find // the correct NativeTheme (on Linux). See http://crbug.com/384492 -@@ -1098,10 +1104,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1110,10 +1116,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -387,7 +387,7 @@ index 926519dfa332..e06be5a1b0eb 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 6c0c60807a2b..87ed97b90ab5 100644 +index e2df1f67a8b9..920f2ea6a8b7 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h @@ -252,6 +252,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -399,7 +399,7 @@ index 6c0c60807a2b..87ed97b90ab5 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 8ae821974838..c73b20dcb9b0 100644 +index c1cfaebc4172..b9ee0751189d 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h @@ -183,6 +183,10 @@ class VIEWS_EXPORT WidgetDelegate { @@ -411,7 +411,7 @@ index 8ae821974838..c73b20dcb9b0 100644 + virtual bool MaybeGetMaximumSize(gfx::Size* size) const { return false; } + protected: - virtual ~WidgetDelegate() {} + virtual ~WidgetDelegate(); diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc index c7296fed234d..244d0034a1c4 100644 @@ -427,21 +427,24 @@ index c7296fed234d..244d0034a1c4 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 c8fb7eecb9c8..49c0bc6c5f60 100644 +index 6a468941cf4a..55a159a2dbff 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -2687,8 +2687,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, - active_mouse_tracking_flags_ = 0; +@@ -2794,10 +2794,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. - return (ui::RerouteMouseWheel(hwnd(), w_param, l_param) || -- delegate_->HandleMouseEvent(ui::MouseWheelEvent(msg))) ? 0 : 1; +- delegate_->HandleMouseEvent(&mouse_wheel_event)) +- ? 0 +- : 1; + if (ui::RerouteMouseWheel(hwnd(), w_param, l_param) || -+ delegate_->HandleMouseEvent(ui::MouseWheelEvent(msg))) { ++ delegate_->HandleMouseEvent(&mouse_wheel_event)) { + SetMsgHandled(TRUE); + return 0; ++ } else { ++ return 1; + } -+ return 1; } // There are cases where the code handling the message destroys the window, diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index 98a15195d..d5171cab7 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 ca66c499f1e8..9208b43f669a 100644 +index a45b0e73714b..9581ed604d19 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -1733,21 +1733,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1783,21 +1783,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { std::string unique_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); @@ -45,7 +45,7 @@ index ca66c499f1e8..9208b43f669a 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -2298,6 +2307,15 @@ void WebContentsImpl::CreateNewWindow( +@@ -2398,6 +2407,15 @@ void WebContentsImpl::CreateNewWindow( create_params.renderer_initiated_creation = main_frame_route_id != MSG_ROUTING_NONE; @@ -61,7 +61,7 @@ index ca66c499f1e8..9208b43f669a 100644 WebContentsImpl* new_contents = nullptr; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -2327,7 +2345,7 @@ void WebContentsImpl::CreateNewWindow( +@@ -2427,7 +2445,7 @@ void WebContentsImpl::CreateNewWindow( // TODO(brettw): It seems bogus that we have to call this function on the // newly created object and give it one of its own member variables. new_view->CreateViewForWidget( @@ -70,7 +70,7 @@ index ca66c499f1e8..9208b43f669a 100644 } // Save the created window associated with the route so we can show it // later. -@@ -5573,7 +5591,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { +@@ -5749,7 +5767,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostViewBase* rwh_view = @@ -95,10 +95,10 @@ index 53d56abb35a3..d7b955f42ca5 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 2dfd24904480..c254945f1621 100644 +index be4048f9963d..df3f9af6dbf3 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -69,9 +69,11 @@ class BrowserPluginGuestDelegate; +@@ -70,9 +70,11 @@ class BrowserPluginGuestDelegate; class InterstitialPage; class RenderFrameHost; class RenderViewHost; @@ -110,7 +110,7 @@ index 2dfd24904480..c254945f1621 100644 struct CustomContextMenuContext; struct DropData; struct Manifest; -@@ -174,6 +176,10 @@ class WebContents : public PageNavigator, +@@ -175,6 +177,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. blink::WebSandboxFlags starting_sandbox_flags; @@ -122,7 +122,7 @@ index 2dfd24904480..c254945f1621 100644 // Creates a new WebContents. diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index 6f0c02b02dc7..705795a4a5f5 100644 +index 28cf408db3b5..5ccc783dd8b9 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -45,11 +45,13 @@ class ColorChooser; diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 017b41be0..85b989719 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,7 +1,31 @@ -diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp -index 8088169f0434..47cf612db044 100644 ---- third_party/WebKit/Source/core/dom/DOMImplementation.cpp -+++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp +diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h +index d4948345246e..73b7e0b1effe 100644 +--- third_party/blink/public/platform/platform.h ++++ third_party/blink/public/platform/platform.h +@@ -382,6 +382,7 @@ class BLINK_PLATFORM_EXPORT Platform { + // satisfy this call. mainFrameOrigin is used by the browser process to + // filter plugins from the plugin list based on content settings. + virtual void GetPluginList(bool refresh, ++ bool is_main_frame, + const WebSecurityOrigin& main_frame_origin, + WebPluginListBuilder*) {} + +@@ -754,6 +755,11 @@ class BLINK_PLATFORM_EXPORT Platform { + // runs during Chromium's build step). + virtual bool IsTakingV8ContextSnapshot() { return false; } + ++ // DevTools ------------------------------------------------------------ ++ ++ virtual void DevToolsAgentAttached() {} ++ virtual void DevToolsAgentDetached() {} ++ + protected: + Platform(); + virtual ~Platform(); +diff --git third_party/blink/renderer/core/dom/dom_implementation.cc third_party/blink/renderer/core/dom/dom_implementation.cc +index c80fedc37a43..3b3cf2d73511 100644 +--- third_party/blink/renderer/core/dom/dom_implementation.cc ++++ third_party/blink/renderer/core/dom/dom_implementation.cc @@ -243,10 +243,11 @@ Document* DOMImplementation::createDocument(const String& type, if (init.GetFrame()->IsMainFrame()) { scoped_refptr origin = @@ -16,11 +40,11 @@ index 8088169f0434..47cf612db044 100644 ->Tree() .Top() .GetSecurityContext() -diff --git third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp -index 647da1f97f5c..4ef9014aecd9 100644 ---- third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp -+++ third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp -@@ -322,6 +322,8 @@ WebDevToolsAgentImpl::Session::Session( +diff --git third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc +index edf785effe8e..c895b23bc409 100644 +--- third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc ++++ third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc +@@ -323,6 +323,8 @@ WebDevToolsAgentImpl::Session::Session( &WebDevToolsAgentImpl::Session::Detach, WrapWeakPersistent(this))); InitializeInspectorSession(reattach_state); @@ -29,7 +53,7 @@ index 647da1f97f5c..4ef9014aecd9 100644 } WebDevToolsAgentImpl::Session::~Session() { -@@ -347,6 +349,7 @@ void WebDevToolsAgentImpl::Session::Detach() { +@@ -348,6 +350,7 @@ void WebDevToolsAgentImpl::Session::Detach() { io_session_->DeleteSoon(); io_session_ = nullptr; inspector_session_->Dispose(); @@ -37,11 +61,11 @@ index 647da1f97f5c..4ef9014aecd9 100644 } void WebDevToolsAgentImpl::Session::SendProtocolResponse(int session_id, -diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp -index d300bba78132..48ca90b83fd6 100644 ---- third_party/WebKit/Source/core/frame/LocalFrame.cpp -+++ third_party/WebKit/Source/core/frame/LocalFrame.cpp -@@ -1132,7 +1132,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() { +diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc +index 04520b3a5427..a9a4f345386e 100644 +--- third_party/blink/renderer/core/frame/local_frame.cc ++++ third_party/blink/renderer/core/frame/local_frame.cc +@@ -1177,7 +1177,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) return nullptr; @@ -50,11 +74,11 @@ index d300bba78132..48ca90b83fd6 100644 Tree().Top().GetSecurityContext()->GetSecurityOrigin()); } -diff --git third_party/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp -index 2cedf7285afd..f3690511ceda 100644 ---- third_party/WebKit/Source/core/page/Page.cpp -+++ third_party/WebKit/Source/core/page/Page.cpp -@@ -148,7 +148,8 @@ Page::Page(PageClients& page_clients) +diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc +index a825578f8eee..b122d7fbf994 100644 +--- third_party/blink/renderer/core/page/page.cc ++++ third_party/blink/renderer/core/page/page.cc +@@ -153,7 +153,8 @@ Page::Page(PageClients& page_clients) overscroll_controller_( OverscrollController::Create(GetVisualViewport(), GetChromeClient())), main_frame_(nullptr), @@ -64,7 +88,7 @@ index 2cedf7285afd..f3690511ceda 100644 use_counter_(page_clients.chrome_client && page_clients.chrome_client->IsSVGImageChromeClient() ? UseCounter::kSVGImageContext -@@ -319,21 +320,40 @@ void Page::RefreshPlugins() { +@@ -327,21 +328,40 @@ void Page::RefreshPlugins() { PluginData::RefreshBrowserSidePluginCache(); } @@ -114,7 +138,7 @@ index 2cedf7285afd..f3690511ceda 100644 page->NotifyPluginsChanged(); } } -@@ -706,7 +726,8 @@ void Page::Trace(blink::Visitor* visitor) { +@@ -714,7 +734,8 @@ void Page::Trace(blink::Visitor* visitor) { visitor->Trace(visual_viewport_); visitor->Trace(overscroll_controller_); visitor->Trace(main_frame_); @@ -124,11 +148,11 @@ index 2cedf7285afd..f3690511ceda 100644 visitor->Trace(validation_message_client_); visitor->Trace(use_counter_); visitor->Trace(plugins_changed_observers_); -diff --git third_party/WebKit/Source/core/page/Page.h third_party/WebKit/Source/core/page/Page.h -index d32684c1a180..f3d034d358a7 100644 ---- third_party/WebKit/Source/core/page/Page.h -+++ third_party/WebKit/Source/core/page/Page.h -@@ -137,7 +137,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, +diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h +index e614d62e2eeb..e180d16a7d47 100644 +--- third_party/blink/renderer/core/page/page.h ++++ third_party/blink/renderer/core/page/page.h +@@ -138,7 +138,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -138,7 +162,7 @@ index d32684c1a180..f3d034d358a7 100644 // Refreshes the browser-side plugin cache. static void RefreshPlugins(); -@@ -353,7 +354,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, +@@ -373,7 +374,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, // longer needed. Member main_frame_; @@ -148,10 +172,10 @@ index d32684c1a180..f3d034d358a7 100644 Member validation_message_client_; -diff --git third_party/WebKit/Source/platform/plugins/PluginData.cpp third_party/WebKit/Source/platform/plugins/PluginData.cpp -index cef04c3b20c7..6ab47bb7872a 100644 ---- third_party/WebKit/Source/platform/plugins/PluginData.cpp -+++ third_party/WebKit/Source/platform/plugins/PluginData.cpp +diff --git third_party/blink/renderer/platform/plugins/plugin_data.cc third_party/blink/renderer/platform/plugins/plugin_data.cc +index 122ad2b0fa79..869bbf71bc44 100644 +--- third_party/blink/renderer/platform/plugins/plugin_data.cc ++++ third_party/blink/renderer/platform/plugins/plugin_data.cc @@ -79,16 +79,18 @@ void PluginData::Trace(blink::Visitor* visitor) { // static void PluginData::RefreshBrowserSidePluginCache() { @@ -174,10 +198,10 @@ index cef04c3b20c7..6ab47bb7872a 100644 for (PluginInfo* plugin_info : plugins_) { for (MimeClassInfo* mime_class_info : plugin_info->mimes_) -diff --git third_party/WebKit/Source/platform/plugins/PluginData.h third_party/WebKit/Source/platform/plugins/PluginData.h -index bdd586bd9621..13efebb33a49 100644 ---- third_party/WebKit/Source/platform/plugins/PluginData.h -+++ third_party/WebKit/Source/platform/plugins/PluginData.h +diff --git third_party/blink/renderer/platform/plugins/plugin_data.h third_party/blink/renderer/platform/plugins/plugin_data.h +index 736a244e720f..2279b0b8dd1e 100644 +--- third_party/blink/renderer/platform/plugins/plugin_data.h ++++ third_party/blink/renderer/platform/plugins/plugin_data.h @@ -95,7 +95,8 @@ class PLATFORM_EXPORT PluginData final const HeapVector>& Plugins() const { return plugins_; } const HeapVector>& Mimes() const { return mimes_; } @@ -188,27 +212,3 @@ index bdd586bd9621..13efebb33a49 100644 void ResetPluginData(); bool SupportsMimeType(const String& mime_type) const; -diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h -index d6ce9d31e241..93d4c32b656a 100644 ---- third_party/WebKit/public/platform/Platform.h -+++ third_party/WebKit/public/platform/Platform.h -@@ -383,6 +383,7 @@ class BLINK_PLATFORM_EXPORT Platform { - // satisfy this call. mainFrameOrigin is used by the browser process to - // filter plugins from the plugin list based on content settings. - virtual void GetPluginList(bool refresh, -+ bool is_main_frame, - const WebSecurityOrigin& main_frame_origin, - WebPluginListBuilder*) {} - -@@ -746,6 +747,11 @@ class BLINK_PLATFORM_EXPORT Platform { - // runs during Chromium's build step). - virtual bool IsTakingV8ContextSnapshot() { return false; } - -+ // DevTools ------------------------------------------------------------ -+ -+ virtual void DevToolsAgentAttached() {} -+ virtual void DevToolsAgentDetached() {} -+ - protected: - Platform(); - virtual ~Platform(); diff --git a/patch/patches/webkit_pointer_event_781966.patch b/patch/patches/webkit_pointer_event_781966.patch index ac181ca6b..93b234b30 100644 --- a/patch/patches/webkit_pointer_event_781966.patch +++ b/patch/patches/webkit_pointer_event_781966.patch @@ -1,8 +1,8 @@ -diff --git third_party/WebKit/Source/core/input/PointerEventManager.cpp third_party/WebKit/Source/core/input/PointerEventManager.cpp -index ce07c49a4777..ed1ef44ac2de 100644 ---- third_party/WebKit/Source/core/input/PointerEventManager.cpp -+++ third_party/WebKit/Source/core/input/PointerEventManager.cpp -@@ -270,7 +270,7 @@ void PointerEventManager::HandlePointerInterruption( +diff --git third_party/blink/renderer/core/input/pointer_event_manager.cc third_party/blink/renderer/core/input/pointer_event_manager.cc +index 19739bb1ff36..58c9b10c1ff5 100644 +--- third_party/blink/renderer/core/input/pointer_event_manager.cc ++++ third_party/blink/renderer/core/input/pointer_event_manager.cc +@@ -287,7 +287,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. diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 13f78fe10..f61b4eb4d 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,29 @@ -diff --git third_party/WebKit/Source/core/exported/WebViewImpl.cpp third_party/WebKit/Source/core/exported/WebViewImpl.cpp -index 494a9bc0f294..a766c5d047b0 100644 ---- third_party/WebKit/Source/core/exported/WebViewImpl.cpp -+++ third_party/WebKit/Source/core/exported/WebViewImpl.cpp -@@ -253,8 +253,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { +diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h +index e6ab3248281e..645fab919ace 100644 +--- third_party/blink/public/web/web_view.h ++++ third_party/blink/public/web/web_view.h +@@ -357,6 +357,7 @@ class WebView : protected WebWidget { + + // Sets whether select popup menus should be rendered by the browser. + BLINK_EXPORT static void SetUseExternalPopupMenus(bool); ++ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0; + + // Hides any popup (suggestions, selects...) that might be showing. + virtual void HidePopups() = 0; +@@ -387,6 +388,8 @@ class WebView : protected WebWidget { + unsigned inactive_background_color, + unsigned inactive_foreground_color) = 0; + ++ virtual void SetBaseBackgroundColor(WebColor color) = 0; ++ + // Modal dialog support ------------------------------------------------ + + // Call these methods before and after running a nested, modal event loop +diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc +index 0d070fb8df7c..de3b889ce29a 100644 +--- third_party/blink/renderer/core/exported/web_view_impl.cc ++++ third_party/blink/renderer/core/exported/web_view_impl.cc +@@ -251,8 +251,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { g_should_use_external_popup_menus = use_external_popup_menus; } @@ -18,7 +39,7 @@ index 494a9bc0f294..a766c5d047b0 100644 } namespace { -@@ -345,6 +350,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, +@@ -343,6 +348,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, enable_fake_page_scale_animation_for_testing_(false), fake_page_scale_animation_page_scale_factor_(0), fake_page_scale_animation_use_anchor_(false), @@ -26,11 +47,11 @@ index 494a9bc0f294..a766c5d047b0 100644 compositor_device_scale_factor_override_(0), suppress_next_keypress_event_(false), ime_accept_events_(true), -diff --git third_party/WebKit/Source/core/exported/WebViewImpl.h third_party/WebKit/Source/core/exported/WebViewImpl.h -index 4e820e7746b7..52c6eaaf2f89 100644 ---- third_party/WebKit/Source/core/exported/WebViewImpl.h -+++ third_party/WebKit/Source/core/exported/WebViewImpl.h -@@ -106,7 +106,8 @@ class CORE_EXPORT WebViewImpl final +diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h +index 68fadab79a6e..bc397a361f39 100644 +--- third_party/blink/renderer/core/exported/web_view_impl.h ++++ third_party/blink/renderer/core/exported/web_view_impl.h +@@ -102,7 +102,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). @@ -40,7 +61,7 @@ index 4e820e7746b7..52c6eaaf2f89 100644 // WebWidget methods: void Close() override; -@@ -256,7 +257,7 @@ class CORE_EXPORT WebViewImpl final +@@ -246,7 +247,7 @@ class CORE_EXPORT WebViewImpl final : public WebView, HitTestResult CoreHitTestResultAt(const WebPoint&); void InvalidateRect(const IntRect&); @@ -49,7 +70,7 @@ index 4e820e7746b7..52c6eaaf2f89 100644 void SetBaseBackgroundColorOverride(WebColor); void ClearBaseBackgroundColorOverride(); void SetBackgroundColorOverride(WebColor); -@@ -602,6 +603,8 @@ class CORE_EXPORT WebViewImpl final +@@ -619,6 +620,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_; bool fake_page_scale_animation_use_anchor_; @@ -58,11 +79,11 @@ index 4e820e7746b7..52c6eaaf2f89 100644 float compositor_device_scale_factor_override_; TransformationMatrix device_emulation_transform_; -diff --git third_party/WebKit/Source/core/page/ChromeClientImpl.cpp third_party/WebKit/Source/core/page/ChromeClientImpl.cpp -index fd6ddf8f6c82..c953adec0b27 100644 ---- third_party/WebKit/Source/core/page/ChromeClientImpl.cpp -+++ third_party/WebKit/Source/core/page/ChromeClientImpl.cpp -@@ -779,7 +779,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, +diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc +index 484f950bd065..a0c47c7ea782 100644 +--- third_party/blink/renderer/core/page/chrome_client_impl.cc ++++ third_party/blink/renderer/core/page/chrome_client_impl.cc +@@ -783,7 +783,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, return nullptr; NotifyPopupOpeningObservers(); @@ -71,24 +92,3 @@ index fd6ddf8f6c82..c953adec0b27 100644 return new ExternalPopupMenu(frame, select, *web_view_); DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); -diff --git third_party/WebKit/public/web/WebView.h third_party/WebKit/public/web/WebView.h -index 8fc376c9973c..4f2ee40e800c 100644 ---- third_party/WebKit/public/web/WebView.h -+++ third_party/WebKit/public/web/WebView.h -@@ -361,6 +361,7 @@ class WebView : protected WebWidget { - - // Sets whether select popup menus should be rendered by the browser. - BLINK_EXPORT static void SetUseExternalPopupMenus(bool); -+ virtual void SetUseExternalPopupMenusThisInstance(bool) = 0; - - // Hides any popup (suggestions, selects...) that might be showing. - virtual void HidePopups() = 0; -@@ -391,6 +392,8 @@ class WebView : protected WebWidget { - unsigned inactive_background_color, - unsigned inactive_foreground_color) = 0; - -+ virtual void SetBaseBackgroundColor(WebColor color) = 0; -+ - // Modal dialog support ------------------------------------------------ - - // Call these methods before and after running a nested, modal event loop diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 992043404..b8833a877 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index e3a222a90f33..8b909deef05d 100644 +index af2362c38753..74a7fcf954a3 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 @@ -17,6 +17,7 @@ @@ -10,7 +10,7 @@ index e3a222a90f33..8b909deef05d 100644 #include "chrome/common/pref_names.h" #include "components/browser_sync/profile_sync_service.h" #include "components/prefs/pref_service.h" -@@ -164,6 +165,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -171,6 +172,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { } void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { @@ -21,7 +21,7 @@ index e3a222a90f33..8b909deef05d 100644 // We are only interested in sync logs for the primary user profile. Profile* profile = ProfileManager::GetPrimaryUserProfile(); if (!profile || -@@ -208,6 +213,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -215,6 +220,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -35,7 +35,7 @@ index e3a222a90f33..8b909deef05d 100644 extensions::ExtensionRegistry::Get(profile); std::string extensions_list; diff --git chrome/browser/memory_details.cc chrome/browser/memory_details.cc -index 5ef6e7292f5f..2884102c28e8 100644 +index 34bc5ae039b8..77556e63ac6d 100644 --- chrome/browser/memory_details.cc +++ chrome/browser/memory_details.cc @@ -16,6 +16,7 @@ @@ -46,7 +46,7 @@ index 5ef6e7292f5f..2884102c28e8 100644 #include "components/nacl/common/nacl_process_type.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/browser_child_process_host_iterator.h" -@@ -253,8 +254,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() { +@@ -250,8 +251,11 @@ void MemoryDetails::CollectChildInfoOnUIThread() { #if BUILDFLAG(ENABLE_EXTENSIONS) // Determine if this is an extension process. @@ -60,10 +60,10 @@ index 5ef6e7292f5f..2884102c28e8 100644 render_process_host->GetBrowserContext(); extensions::ExtensionRegistry* extension_registry = diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc -index 302df0f9a2cf..f6714b63a9f2 100644 +index 9a9192ba6718..54edcbc95534 100644 --- chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc -@@ -553,41 +553,31 @@ void NetInternalsMessageHandler::OnClearBrowserCache( +@@ -554,41 +554,31 @@ void NetInternalsMessageHandler::OnClearBrowserCache( void NetInternalsMessageHandler::OnGetPrerenderInfo( const base::ListValue* list) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -110,7 +110,7 @@ index 302df0f9a2cf..f6714b63a9f2 100644 } //////////////////////////////////////////////////////////////////////////////// -@@ -667,9 +657,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( +@@ -668,9 +658,17 @@ void NetInternalsMessageHandler::IOThreadImpl::OnRendererReady( PrePopulateEventList(); @@ -131,7 +131,7 @@ index 302df0f9a2cf..f6714b63a9f2 100644 } void NetInternalsMessageHandler::IOThreadImpl::OnGetNetInfo( -@@ -1180,7 +1178,8 @@ void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() { +@@ -1181,7 +1179,8 @@ void NetInternalsMessageHandler::IOThreadImpl::PrePopulateEventList() { std::set contexts; for (const auto& getter : context_getters_) contexts.insert(getter->GetURLRequestContext()); @@ -142,10 +142,10 @@ index 302df0f9a2cf..f6714b63a9f2 100644 // Add entries for ongoing network objects. CreateNetLogEntriesForActiveObjects(contexts, this); diff --git content/browser/resource_context_impl.cc content/browser/resource_context_impl.cc -index 895a9367b85b..eeb9c6922a3c 100644 +index 261e9343b8a2..0fe566c705a4 100644 --- content/browser/resource_context_impl.cc +++ content/browser/resource_context_impl.cc -@@ -57,6 +57,10 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext( +@@ -56,6 +56,10 @@ URLDataManagerBackend* GetURLDataManagerForResourceContext( context->GetUserData(kURLDataManagerBackendKeyName)); } @@ -170,10 +170,10 @@ index 903cc543a242..5bd30ae82974 100644 CONTENT_EXPORT void InitializeResourceContext(BrowserContext* browser_context); diff --git content/browser/webui/url_data_manager.cc content/browser/webui/url_data_manager.cc -index bdfc5d93765c..5464716aead4 100644 +index a2d542f817e3..fc81237f729a 100644 --- content/browser/webui/url_data_manager.cc +++ content/browser/webui/url_data_manager.cc -@@ -150,6 +150,11 @@ void URLDataManager::UpdateWebUIDataSource( +@@ -149,6 +149,11 @@ void URLDataManager::UpdateWebUIDataSource( ->UpdateWebUIDataSource(source_name, std::move(update)); } diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index cbf412036..ae132e3fb 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 6cd05c6fcd2a..eedc0295d8b8 100644 +index bcabf55e8150..36fd80391fe1 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -4830,7 +4830,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -4841,7 +4841,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/patch/patches/win_rt_2274.patch b/patch/patches/win_rt_2274.patch index 0276b6495..c7dbefd87 100644 --- a/patch/patches/win_rt_2274.patch +++ b/patch/patches/win_rt_2274.patch @@ -1,18 +1,20 @@ diff --git services/service_manager/sandbox/win/sandbox_win.cc services/service_manager/sandbox/win/sandbox_win.cc -index 6c7356eacc42..4804ce497e1b 100644 +index 50430a8e2f8f..424af4cb70f6 100644 --- services/service_manager/sandbox/win/sandbox_win.cc +++ services/service_manager/sandbox/win/sandbox_win.cc -@@ -865,8 +865,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( +@@ -865,10 +865,13 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( #endif // Post-startup mitigations. - mitigations = sandbox::MITIGATION_STRICT_HANDLE_CHECKS | - sandbox::MITIGATION_DLL_SEARCH_ORDER; + mitigations = sandbox::MITIGATION_DLL_SEARCH_ORDER; + if (!cmd_line->HasSwitch(switches::kAllowThirdPartyModules)) + mitigations |= sandbox::MITIGATION_FORCE_MS_SIGNED_BINS; + if (!launcher_process_command_line.HasSwitch("win-rt-app")) { + // Don't enable this mitigation in WinRT apps. See issue #2274. + mitigations |= sandbox::MITIGATION_STRICT_HANDLE_CHECKS; + } - if (base::FeatureList::IsEnabled( - service_manager::features::kWinSboxForceMsSigned) && - !cmd_line->HasSwitch(switches::kAllowThirdPartyModules)) { + + result = policy->SetDelayedProcessMitigations(mitigations); + if (result != sandbox::SBOX_ALL_OK) diff --git a/patch/patches/win_strcat_817738.patch b/patch/patches/win_strcat_817738.patch deleted file mode 100644 index 3027e38cd..000000000 --- a/patch/patches/win_strcat_817738.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git base/strings/strcat.h base/strings/strcat.h -index b249d49..44c6211 100644 ---- base/strings/strcat.h -+++ base/strings/strcat.h -@@ -11,6 +11,12 @@ - #include "base/compiler_specific.h" - #include "base/containers/span.h" - #include "base/strings/string_piece.h" -+#include "build/build_config.h" -+ -+#if defined(OS_WIN) -+// To resolve a conflict with Win32 API StrCat macro. -+#include "base/win/windows_types.h" -+#endif - - namespace base { - -diff --git base/win/windows_types.h base/win/windows_types.h -index 8060f03..2a86195 100644 ---- base/win/windows_types.h -+++ base/win/windows_types.h -@@ -248,5 +248,6 @@ - #define SendMessageCallback SendMessageCallbackW - #define SetCurrentDirectory SetCurrentDirectoryW - #define StartService StartServiceW -+#define StrCat StrCatW - - #endif // BASE_WIN_WINDOWS_TYPES_H diff --git a/tests/ceftests/display_unittest.cc b/tests/ceftests/display_unittest.cc index 73f95d7af..06ba2113e 100644 --- a/tests/ceftests/display_unittest.cc +++ b/tests/ceftests/display_unittest.cc @@ -176,7 +176,7 @@ class AutoResizeTestHandler : public RoutingTestHandler { bool OnAutoResize(CefRefPtr browser, const CefSize& new_size) override { - if (new_size.width == 16 && new_size.height == 10) { + if (new_size.width == 1064 && new_size.height == 576) { // Ignore this initial resize that may or may not occur. } else if (!got_auto_resize1_) { got_auto_resize1_.yes(); diff --git a/tools/distrib/linux/README.redistrib.txt b/tools/distrib/linux/README.redistrib.txt index 13be552a3..355097111 100644 --- a/tools/distrib/linux/README.redistrib.txt +++ b/tools/distrib/linux/README.redistrib.txt @@ -69,8 +69,3 @@ run but any related functionality may become broken or disabled. * swiftshader/libGLESv2.so Without these files WebGL will not function in software-only mode when the GPU is not available or disabled. - -* Widevine CDM support. - * libwidevinecdmadapter.so - Without this file playback of Widevine projected content will not function. - See the CefRegisterWidevineCdm() function in cef_web_plugin.h for usage. diff --git a/tools/distrib/mac/README.redistrib.txt b/tools/distrib/mac/README.redistrib.txt index ecbffc2c3..1f4dd9b0a 100644 --- a/tools/distrib/mac/README.redistrib.txt +++ b/tools/distrib/mac/README.redistrib.txt @@ -104,8 +104,3 @@ run but any related functionality may become broken or disabled. * Chromium Embedded Framework.framework/Resources/crash_report_sender * Chromium Embedded Framework.framework/Resources/Info.plist Without these files breakpad support (crash reporting) will not function. - -* Widevine CDM support. - * widevinecdmadapter.plugin - Without this file playback of Widevine projected content will not function. - See the CefRegisterWidevineCdm() function in cef_web_plugin.h for usage. diff --git a/tools/distrib/win/README.redistrib.txt b/tools/distrib/win/README.redistrib.txt index 5a8c7ac37..5ffa8fffd 100644 --- a/tools/distrib/win/README.redistrib.txt +++ b/tools/distrib/win/README.redistrib.txt @@ -72,8 +72,3 @@ run but any related functionality may become broken or disabled. * swiftshader/libGLESv2.dll Without these files WebGL will not function in software-only mode when the GPU is not available or disabled. - -* Widevine CDM support. - * widevinecdmadapter.dll - Without this file playback of Widevine projected content will not function. - See the CefRegisterWidevineCdm() function in cef_web_plugin.h for usage. diff --git a/tools/fix_style.bat b/tools/fix_style.bat index 4270518a0..09ea0be29 100644 --- a/tools/fix_style.bat +++ b/tools/fix_style.bat @@ -1,2 +1,2 @@ @echo off -python.bat tools\fix_style.py %* +python.bat %~dp0\fix_style.py %* diff --git a/tools/git_util.py b/tools/git_util.py index b6aa0fa97..dedd8a327 100644 --- a/tools/git_util.py +++ b/tools/git_util.py @@ -94,20 +94,22 @@ def git_apply_patch_file(patch_path, patch_dir): sys.stdout.write('... patch directory is not a repository root.\n') return 'fail' + config = '-p0 --ignore-whitespace' + # Output patch contents. - cmd = '%s apply -p0 --numstat' % git_exe + cmd = '%s apply %s --numstat' % (git_exe, config) result = exec_cmd(cmd, patch_dir, patch_string) write_indented_output(result['out'].replace('', patch_name)) # Reverse check to see if the patch has already been applied. - cmd = '%s apply -p0 --reverse --check' % git_exe + cmd = '%s apply %s --reverse --check' % (git_exe, config) result = exec_cmd(cmd, patch_dir, patch_string) if result['err'].find('error:') < 0: sys.stdout.write('... already applied (skipping).\n') return 'skip' # Normal check to see if the patch can be applied cleanly. - cmd = '%s apply -p0 --check' % git_exe + cmd = '%s apply %s --check' % (git_exe, config) result = exec_cmd(cmd, patch_dir, patch_string) if result['err'].find('error:') >= 0: sys.stdout.write('... failed to apply:\n') @@ -116,7 +118,7 @@ def git_apply_patch_file(patch_path, patch_dir): # Apply the patch file. This should always succeed because the previous # command succeeded. - cmd = '%s apply -p0' % git_exe + cmd = '%s apply %s' % (git_exe, config) result = exec_cmd(cmd, patch_dir, patch_string) if result['err'] == '': sys.stdout.write('... successfully applied.\n') diff --git a/tools/make_distrib.bat b/tools/make_distrib.bat index c92dc7a46..aea1ee544 100644 --- a/tools/make_distrib.bat +++ b/tools/make_distrib.bat @@ -1,2 +1,2 @@ @echo off -python.bat make_distrib.py --output-dir ..\binary_distrib\ %* +python.bat %~dp0\make_distrib.py --output-dir %~dp0\..\binary_distrib\ %* diff --git a/tools/make_distrib.py b/tools/make_distrib.py index aa3db9e02..7f67b55f8 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -701,9 +701,6 @@ if platform == 'windows': {'path': 'natives_blob.bin'}, {'path': 'snapshot_blob.bin', 'conditional': True}, {'path': 'v8_context_snapshot.bin', 'conditional': True}, - # Should match the output path from media/cdm/ppapi/cdm_paths.gni. - {'path': 'WidevineCdm\\_platform_specific\\win_%s\\widevinecdmadapter.dll' % \ - ('x64' if options.x64build else 'x86'), 'out_path': 'widevinecdmadapter.dll'}, {'path': 'swiftshader\\libEGL.dll'}, {'path': 'swiftshader\\libGLESv2.dll'}, ] @@ -862,11 +859,11 @@ elif platform == 'macosx': valid_build_dir = build_dir dst_dir = os.path.join(output_dir, 'Debug') make_dir(dst_dir, options.quiet) + framework_src_dir = os.path.join( + build_dir, '%s/Contents/Frameworks/%s.framework/Versions/A' % + (cefclient_app, framework_name)) framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name) - copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \ - framework_dst_dir, options.quiet) - move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \ - os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet) + copy_dir(framework_src_dir, framework_dst_dir, options.quiet) if not options.nosymbols: # create the symbol output directory @@ -889,16 +886,21 @@ elif platform == 'macosx': valid_build_dir = build_dir dst_dir = os.path.join(output_dir, 'Release') make_dir(dst_dir, options.quiet) + framework_src_dir = os.path.join( + build_dir, '%s/Contents/Frameworks/%s.framework/Versions/A' % + (cefclient_app, framework_name)) if mode != 'client': framework_dst_dir = os.path.join(dst_dir, '%s.framework' % framework_name) - copy_dir(os.path.join(build_dir, 'cefclient.app/Contents/Frameworks/%s.framework' % framework_name), \ - framework_dst_dir, options.quiet) - move_file(os.path.join(framework_dst_dir, 'Resources/widevinecdmadapter.plugin'), \ - os.path.join(dst_dir, 'widevinecdmadapter.plugin'), options.quiet) else: copy_dir( os.path.join(build_dir, cefclient_app), os.path.join(dst_dir, cefclient_app), options.quiet) + # Replace the versioned framework with an unversioned framework in the sample app. + framework_dst_dir = os.path.join( + dst_dir, '%s/Contents/Frameworks/%s.framework' % (cefclient_app, + framework_name)) + remove_dir(framework_dst_dir, options.quiet) + copy_dir(framework_src_dir, framework_dst_dir, options.quiet) if not options.nosymbols: # create the symbol output directory @@ -969,7 +971,6 @@ elif platform == 'linux': {'path': libcef_so}, {'path': 'libEGL.so'}, {'path': 'libGLESv2.so'}, - {'path': 'libwidevinecdmadapter.so'}, {'path': 'natives_blob.bin'}, {'path': 'snapshot_blob.bin', 'conditional': True}, {'path': 'v8_context_snapshot.bin', 'conditional': True}, diff --git a/tools/patch.bat b/tools/patch.bat index c05a68f65..ae3616d86 100644 --- a/tools/patch.bat +++ b/tools/patch.bat @@ -1,2 +1,2 @@ @echo off -python.bat tools\patcher.py \ No newline at end of file +python.bat %~dp0\patcher.py \ No newline at end of file diff --git a/tools/patch_updater.py b/tools/patch_updater.py index 54550f925..80c347a73 100644 --- a/tools/patch_updater.py +++ b/tools/patch_updater.py @@ -68,6 +68,12 @@ parser.add_option( dest='resave', default=False, help='re-save existing patch files to pick up manual changes') +parser.add_option( + '--reapply', + action='store_true', + dest='reapply', + default=False, + help='reapply the patch without first reverting changes') parser.add_option( '--revert', action='store_true', @@ -131,24 +137,25 @@ for patch in patches: added_paths = [] if not options.resave: - # Revert any changes to existing files in the patch. - for patch_path in patch_paths: - patch_path_abs = os.path.abspath(os.path.join(patch_root_abs, \ - patch_path)) - if os.path.exists(patch_path_abs): - msg('Reverting changes to %s' % patch_path_abs) - cmd = 'git checkout -- %s' % (patch_path_abs) - result = exec_cmd(cmd, patch_root_abs) - if result['err'] != '': - msg('Failed to revert file: %s' % result['err']) - msg('Deleting file %s' % patch_path_abs) - os.remove(patch_path_abs) + if not options.reapply: + # Revert any changes to existing files in the patch. + for patch_path in patch_paths: + patch_path_abs = os.path.abspath(os.path.join(patch_root_abs, \ + patch_path)) + if os.path.exists(patch_path_abs): + msg('Reverting changes to %s' % patch_path_abs) + cmd = 'git checkout -- %s' % (patch_path_abs) + result = exec_cmd(cmd, patch_root_abs) + if result['err'] != '': + msg('Failed to revert file: %s' % result['err']) + msg('Deleting file %s' % patch_path_abs) + os.remove(patch_path_abs) + added_paths.append(patch_path_abs) + if result['out'] != '': + sys.stdout.write(result['out']) + else: + msg('Skipping non-existing file %s' % patch_path_abs) added_paths.append(patch_path_abs) - if result['out'] != '': - sys.stdout.write(result['out']) - else: - msg('Skipping non-existing file %s' % patch_path_abs) - added_paths.append(patch_path_abs) if not options.revert: # Apply the patch file. @@ -163,7 +170,7 @@ for patch in patches: patch['name']) continue - if not options.revert: + if not options.revert and not options.reapply: msg('Saving changes to %s' % patch_file) if added_paths: # Inform git of the added paths so they appear in the patch file. @@ -174,7 +181,7 @@ for patch in patches: # Re-create the patch file. patch_paths_str = ' '.join(patch_paths) - cmd = 'git diff --no-prefix --relative %s' % patch_paths_str + cmd = 'git diff --no-prefix --relative --ignore-space-at-eol %s' % patch_paths_str result = exec_cmd(cmd, patch_root_abs) if result['err'] != '' and result['err'].find('warning:') != 0: raise Exception('Failed to create patch file: %s' % result['err']) diff --git a/tools/translator.bat b/tools/translator.bat index a63c8d17c..348700a50 100644 --- a/tools/translator.bat +++ b/tools/translator.bat @@ -1,3 +1,3 @@ @echo off -call python.bat translator.py --root-dir .. %* +call python.bat %~dp0\translator.py --root-dir %~dp0\.. %* pause \ No newline at end of file