diff --git a/BUILD.gn b/BUILD.gn index c34ff172a..873afb382 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -100,6 +100,7 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//cef/cef_repack_locales.gni") import("//chrome/common/features.gni") +import("//content/public/app/mac_helpers.gni") import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") @@ -124,6 +125,110 @@ if (is_mac) { import("//build/mac/tweak_info_plist.gni") import("//build/util/version.gni") import("//media/cdm/library_cdm/cdm_paths.gni") + import("//build/config/mac/base_rules.gni") + + # Template to compile .xib and .storyboard files. + # + # Arguments + # + # sources: + # list of string, sources to compile + # + # ibtool_flags: + # (optional) list of string, additional flags to pass to the ibtool + template("compile_ib_files") { + action_foreach(target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + assert(defined(invoker.sources), + "sources must be specified for $target_name") + assert(defined(invoker.output_extension), + "output_extension must be specified for $target_name") + + ibtool_flags = [] + if (defined(invoker.ibtool_flags)) { + ibtool_flags = invoker.ibtool_flags + } + + _output_extension = invoker.output_extension + + script = "//cef/tools/compile_ib_files.py" + sources = invoker.sources + outputs = [ + "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension", + ] + args = [ + "--input", + "{{source}}", + "--output", + rebase_path( + "$target_gen_dir/$target_name/{{source_name_part}}.$_output_extension", + root_build_dir), + ] + if (!use_system_xcode) { + args += [ + "--developer_dir", + hermetic_xcode_path, + ] + } + args += ibtool_flags + } + } + + # Template to compile and package Mac XIB files as bundle data. + # + # Arguments + # + # sources: + # list of string, sources to comiple + # + # output_path: + # (optional) string, the path to use for the outputs list in the + # bundle_data step. If unspecified, defaults to bundle_resources_dir. + template("mac_xib_bundle_data") { + _target_name = target_name + _compile_target_name = _target_name + "_compile_ibtool" + + compile_ib_files(_compile_target_name) { + forward_variables_from(invoker, [ "testonly" ]) + visibility = [ ":$_target_name" ] + sources = invoker.sources + output_extension = "nib" + ibtool_flags = [ + "--minimum-deployment-target", + mac_deployment_target, + + # TODO(rsesek): Enable this once all the bots are on Xcode 7+. + # "--target-device", + # "mac", + ] + } + + bundle_data(_target_name) { + forward_variables_from(invoker, + [ + "testonly", + "visibility", + ]) + + public_deps = [ + ":$_compile_target_name", + ] + sources = get_target_outputs(":$_compile_target_name") + + _output_path = "{{bundle_resources_dir}}" + if (defined(invoker.output_path)) { + _output_path = invoker.output_path + } + + outputs = [ + "$_output_path/{{source_file_part}}", + ] + } + } } if (is_win) { import("//build/config/win/console_app.gni") @@ -249,6 +354,9 @@ if (is_win) { "//ppapi/buildflags:buildflags", "//printing/buildflags:buildflags", "//ui/base:buildflags", + + # Required by content_switches.cc + "//media:media_buildflags", ] } } @@ -519,6 +627,8 @@ static_library("libcef_static") { "libcef/common/process_message_impl.h", "libcef/common/request_impl.cc", "libcef/common/request_impl.h", + "libcef/common/resource_bundle_delegate.cc", + "libcef/common/resource_bundle_delegate.h", "libcef/common/resource_bundle_impl.cc", "libcef/common/resource_bundle_impl.h", "libcef/common/response_impl.cc", @@ -659,7 +769,7 @@ static_library("libcef_static") { "//components/proxy_config", "//components/safe_browsing/db:test_database_manager", "//components/services/pdf_compositor/public/cpp:factory", - "//components/services/pdf_compositor/public/interfaces", + "//components/services/pdf_compositor/public/mojom", "//components/tracing", "//components/update_client", "//components/url_formatter", @@ -1065,7 +1175,7 @@ source_set("cef_content_browser_overlay_manifest") { "//base", "//components/services/heap_profiling/public/mojom", "//extensions/buildflags", - "//extensions/common:mojo", + "//extensions/common:mojom", "//extensions/common/api:mojom", "//services/service_manager/public/cpp", "//third_party/blink/public/common", @@ -1104,7 +1214,7 @@ source_set("cef_content_renderer_overlay_manifest") { "//components/services/heap_profiling/public/mojom", "//components/subresource_filter/content/mojom", "//extensions/buildflags", - "//extensions/common:mojo", + "//extensions/common:mojom", "//services/service_manager/public/cpp", "//third_party/blink/public/common", ] @@ -1150,7 +1260,6 @@ source_set("builtin_service_manifests") { "//components/startup_metric_utils/common:interfaces", "//extensions/buildflags", "//printing/buildflags", - "//services/proxy_resolver/public/cpp:manifest", "//services/service_manager/public/cpp", ] } @@ -1686,32 +1795,60 @@ if (is_mac) { ] } - mac_app_bundle("${app_name}_helper_app") { - testonly = app_testonly - output_name = app_helper_name + template("cef_helper_app") { + mac_app_bundle(target_name) { + assert(defined(invoker.helper_sources)) + assert(defined(invoker.helper_name_suffix)) + assert(defined(invoker.helper_bundle_id_suffix)) - sources = invoker.helper_sources + testonly = app_testonly + output_name = app_helper_name + invoker.helper_name_suffix - deps = [ - ":cef_make_headers", - ":cef_sandbox", - ":libcef_dll_wrapper", - ] - if (defined(invoker.helper_deps)) { - deps += invoker.helper_deps + sources = invoker.helper_sources + + extra_substitutions = [ + "BUNDLE_ID_SUFFIX=${invoker.helper_bundle_id_suffix}", + ] + + deps = [ + ":cef_make_headers", + ":cef_sandbox", + ":libcef_dll_wrapper", + ] + if (defined(invoker.helper_deps)) { + deps += invoker.helper_deps + } + + ldflags = [ + # The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/ + # so set rpath up to the base. + "-rpath", + "@executable_path/../../../../../..", + ] + + info_plist_target = ":${app_name}_helper_plist" + + if (defined(invoker.helper_defines)) { + defines = invoker.helper_defines + } } + } - ldflags = [ - # The helper is in $app_name.app/Contents/Frameworks/$app_name Helper.app/Contents/MacOS/ - # so set rpath up to the base. - "-rpath", - "@executable_path/../../../../../..", - ] + foreach(helper_params, content_mac_helpers) { + _helper_target = helper_params[0] + _helper_bundle_id = helper_params[1] + _helper_suffix = helper_params[2] + cef_helper_app("${app_name}_helper_app_${_helper_target}") { + helper_sources = invoker.helper_sources + if (defined(invoker.helper_deps)) { + helper_deps = invoker.helper_deps + } + if (defined(invoker.helper_defines)) { + helper_defines = invoker.helper_defines + } - info_plist_target = ":${app_name}_helper_plist" - - if (defined(invoker.helper_defines)) { - defines = invoker.helper_defines + helper_name_suffix = _helper_suffix + helper_bundle_id_suffix = _helper_bundle_id } } @@ -1719,14 +1856,19 @@ if (is_mac) { testonly = app_testonly sources = [ "$root_out_dir/$cef_framework_name.framework", - "$root_out_dir/$app_helper_name.app", ] public_deps = [ ":cef_framework", - ":${app_name}_helper_app", ] + foreach(helper_params, content_mac_helpers) { + sources += [ + "$root_out_dir/${app_helper_name}${helper_params[2]}.app", + ] + public_deps += [ ":${app_name}_helper_app_${helper_params[0]}" ] + } + outputs = [ "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}", ] @@ -1879,7 +2021,6 @@ if (is_mac) { sources = [ "tests/cefsimple/mac/English.lproj/MainMenu.xib", ] - output_path = "{{bundle_resources_dir}}/English.lproj" } @@ -1940,7 +2081,6 @@ if (is_mac) { sources = [ "tests/ceftests/resources/mac/English.lproj/MainMenu.xib", ] - output_path = "{{bundle_resources_dir}}/English.lproj" } @@ -2032,12 +2172,9 @@ if (is_mac) { gypi_paths2.shared_sources_browser + gypi_paths2.shared_sources_common + gypi_paths2.shared_sources_renderer + - gypi_paths2.shared_sources_resources + gypi_paths2.cefclient_sources_browser + gypi_paths2.cefclient_sources_common + - gypi_paths2.cefclient_sources_renderer + - gypi_paths2.cefclient_sources_resources + - gypi_paths2.cefclient_sources_resources_extensions_set_page_color + gypi_paths2.cefclient_sources_renderer deps = [ ":libcef", @@ -2188,7 +2325,6 @@ if (is_mac) { gypi_paths2.shared_sources_browser + gypi_paths2.shared_sources_common + gypi_paths2.shared_sources_renderer + - gypi_paths2.shared_sources_resources + gypi_paths2.ceftests_sources_common + gypi_paths2.ceftests_sources_views diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 1ca80f6db..9d345e915 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/76.0.3809.0' + 'chromium_checkout': 'refs/tags/77.0.3865.0' } diff --git a/cef_paths2.gypi b/cef_paths2.gypi index 3440a1d01..410523e4a 100644 --- a/cef_paths2.gypi +++ b/cef_paths2.gypi @@ -352,10 +352,7 @@ 'tests/cefclient/browser/window_test_runner_win.cc', 'tests/cefclient/browser/window_test_runner_win.h', 'tests/cefclient/cefclient_win.cc', - 'tests/cefclient/resources/win/cefclient.exe.manifest', - 'tests/cefclient/resources/win/cefclient.ico', 'tests/cefclient/resources/win/cefclient.rc', - 'tests/cefclient/resources/win/small.ico', ], 'cefclient_sources_mac': [ 'tests/cefclient/browser/browser_window_osr_mac.h', @@ -424,13 +421,10 @@ 'tests/cefsimple/simple_handler.h', ], 'cefsimple_sources_win': [ - 'tests/cefsimple/cefsimple.exe.manifest', 'tests/cefsimple/cefsimple.rc', 'tests/cefsimple/cefsimple_win.cc', 'tests/cefsimple/simple_handler_win.cc', 'tests/cefsimple/resource.h', - 'tests/cefsimple/res/cefsimple.ico', - 'tests/cefsimple/res/small.ico', ], 'cefsimple_sources_mac': [ 'tests/cefsimple/cefsimple_mac.mm', @@ -531,10 +525,7 @@ ], 'ceftests_sources_win': [ 'tests/ceftests/resource_util_win_idmap.cc', - 'tests/ceftests/resources/win/ceftests.exe.manifest', - 'tests/ceftests/resources/win/ceftests.ico', 'tests/ceftests/resources/win/ceftests.rc', - 'tests/ceftests/resources/win/small.ico', ], 'ceftests_sources_mac': [ 'tests/ceftests/os_rendering_unittest_mac.h', diff --git a/cmake/cef_variables.cmake.in b/cmake/cef_variables.cmake.in index dcaf182f0..d06cb23b0 100644 --- a/cmake/cef_variables.cmake.in +++ b/cmake/cef_variables.cmake.in @@ -346,6 +346,15 @@ if(OS_MACOSX) set(CEF_SANDBOX_LIB_DEBUG "${CEF_BINARY_DIR_DEBUG}/cef_sandbox.a") set(CEF_SANDBOX_LIB_RELEASE "${CEF_BINARY_DIR_RELEASE}/cef_sandbox.a") endif() + + # CEF Helper app suffixes. + # Format is "::". + set(CEF_HELPER_APP_SUFFIXES + "::" + " (GPU):_gpu:.gpu" + " (Plugin):_plugin:.plugin" + " (Renderer):_renderer:.renderer" + ) endif() diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 437ca917f..782d44db5 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -901,7 +901,7 @@ typedef enum { // No error. ERR_NONE = 0, -#define NET_ERROR(label, value) ERR_ ## label = value, +#define NET_ERROR(label, value) ERR_##label = value, #include "include/base/internal/cef_net_error_list.h" #undef NET_ERROR diff --git a/libcef/browser/browser_context.cc b/libcef/browser/browser_context.cc index cedc7fcf4..fc0c19c46 100644 --- a/libcef/browser/browser_context.cc +++ b/libcef/browser/browser_context.cc @@ -406,13 +406,6 @@ net::URLRequestContextGetter* CefBrowserContext::CreateMediaRequestContext() { return GetRequestContext(); } -net::URLRequestContextGetter* -CefBrowserContext::CreateMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) { - return nullptr; -} - void CefBrowserContext::SetCorsOriginAccessListForOrigin( const url::Origin& source_origin, std::vector allow_patterns, @@ -433,6 +426,10 @@ CefBrowserContext::GetURLLoaderFactory() { ->GetURLLoaderFactoryForBrowserProcess(); } +base::FilePath CefBrowserContext::GetPath() { + return cache_path_; +} + base::FilePath CefBrowserContext::GetPath() const { return cache_path_; } @@ -510,15 +507,6 @@ net::URLRequestContextGetter* CefBrowserContext::CreateRequestContext( return nullptr; } -net::URLRequestContextGetter* -CefBrowserContext::CreateRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory, - content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) { - return nullptr; -} - PrefService* CefBrowserContext::GetPrefs() { return pref_service_.get(); } diff --git a/libcef/browser/browser_context.h b/libcef/browser/browser_context.h index 97c40d006..fc6c24038 100644 --- a/libcef/browser/browser_context.h +++ b/libcef/browser/browser_context.h @@ -125,14 +125,12 @@ class CefBrowserContext : public ChromeProfileStub, override; net::URLRequestContextGetter* GetRequestContext() override; net::URLRequestContextGetter* CreateMediaRequestContext() override; - net::URLRequestContextGetter* CreateMediaRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory) override; void SetCorsOriginAccessListForOrigin( const url::Origin& source_origin, std::vector allow_patterns, std::vector block_patterns, base::OnceClosure closure) override; + base::FilePath GetPath() override; base::FilePath GetPath() const override; std::unique_ptr CreateZoomLevelDelegate( const base::FilePath& partition_path) override; @@ -151,11 +149,6 @@ class CefBrowserContext : public ChromeProfileStub, net::URLRequestContextGetter* CreateRequestContext( content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors) override; - net::URLRequestContextGetter* CreateRequestContextForStoragePartition( - const base::FilePath& partition_path, - bool in_memory, - content::ProtocolHandlerMap* protocol_handlers, - content::URLRequestInterceptorScopedVector request_interceptors) override; // Profile methods. ChromeZoomLevelPrefs* GetZoomLevelPrefs() override; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index b3b56d113..51c28d4cd 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -735,7 +735,7 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) { std::unique_ptr params( content::DownloadRequestUtils::CreateDownloadForWebContentsMainFrame( - web_contents(), gurl, NO_TRAFFIC_ANNOTATION_YET)); + web_contents(), gurl, MISSING_TRAFFIC_ANNOTATION)); manager->DownloadUrl(std::move(params)); } @@ -1744,7 +1744,7 @@ void CefBrowserHostImpl::RunFileChooser( file_dialog_manager_->RunFileChooser(params, callback); } -bool CefBrowserHostImpl::EmbedsFullscreenWidget() const { +bool CefBrowserHostImpl::EmbedsFullscreenWidget() { // When using windowless rendering do not allow Flash to create its own // full- screen widget. return IsWindowless(); @@ -1763,12 +1763,12 @@ void CefBrowserHostImpl::ExitFullscreenModeForTab( } bool CefBrowserHostImpl::IsFullscreenForTabOrPending( - const content::WebContents* web_contents) const { + const content::WebContents* web_contents) { return is_fullscreen_; } blink::WebDisplayMode CefBrowserHostImpl::GetDisplayMode( - const content::WebContents* web_contents) const { + const content::WebContents* web_contents) { return is_fullscreen_ ? blink::kWebDisplayModeFullscreen : blink::kWebDisplayModeBrowser; } @@ -2442,18 +2442,21 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( base::CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kEnableMediaStream)) { // Cancel the request. - std::move(callback).Run(devices, blink::MEDIA_DEVICE_PERMISSION_DENIED, - std::unique_ptr()); + std::move(callback).Run( + devices, blink::mojom::MediaStreamRequestResult::PERMISSION_DENIED, + std::unique_ptr()); return; } // Based on chrome/browser/media/media_stream_devices_controller.cc bool microphone_requested = - (request.audio_type == blink::MEDIA_DEVICE_AUDIO_CAPTURE); - bool webcam_requested = - (request.video_type == blink::MEDIA_DEVICE_VIDEO_CAPTURE); + (request.audio_type == + blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE); + bool webcam_requested = (request.video_type == + blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE); bool screen_requested = - (request.video_type == blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE); + (request.video_type == + blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE); if (microphone_requested || webcam_requested || screen_requested) { // Pick the desired device or fall back to the first available of the // given type. @@ -2475,20 +2478,20 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( media_id = content::DesktopMediaID::Parse(request.requested_video_device_id); } - devices.push_back( - blink::MediaStreamDevice(blink::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE, - media_id.ToString(), "Screen")); + devices.push_back(blink::MediaStreamDevice( + blink::mojom::MediaStreamType::GUM_DESKTOP_VIDEO_CAPTURE, + media_id.ToString(), "Screen")); } } - std::move(callback).Run(devices, blink::MEDIA_DEVICE_OK, + std::move(callback).Run(devices, blink::mojom::MediaStreamRequestResult::OK, std::unique_ptr()); } bool CefBrowserHostImpl::CheckMediaAccessPermission( content::RenderFrameHost* render_frame_host, const GURL& security_origin, - blink::MediaStreamType type) { + blink::mojom::MediaStreamType type) { // Check media access permission without prompting the user. This is called // when loading the Pepper Flash plugin. const base::CommandLine* command_line = diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 461d4e144..383f1b19f 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -432,16 +432,16 @@ class CefBrowserHostImpl : public CefBrowserHost, void RunFileChooser(content::RenderFrameHost* render_frame_host, std::unique_ptr listener, const blink::mojom::FileChooserParams& params) override; - bool EmbedsFullscreenWidget() const override; + bool EmbedsFullscreenWidget() override; void EnterFullscreenModeForTab( content::WebContents* web_contents, const GURL& origin, const blink::WebFullscreenOptions& options) override; void ExitFullscreenModeForTab(content::WebContents* web_contents) override; bool IsFullscreenForTabOrPending( - const content::WebContents* web_contents) const override; + const content::WebContents* web_contents) override; blink::WebDisplayMode GetDisplayMode( - const content::WebContents* web_contents) const override; + const content::WebContents* web_contents) override; void FindReply(content::WebContents* web_contents, int request_id, int number_of_matches, @@ -458,7 +458,7 @@ class CefBrowserHostImpl : public CefBrowserHost, content::MediaResponseCallback callback) override; bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, - blink::MediaStreamType type) override; + blink::mojom::MediaStreamType type) override; bool IsNeverVisible(content::WebContents* web_contents) override; // content::WebContentsObserver methods. diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index b0695929c..85530d0c0 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -167,10 +167,9 @@ int CefBrowserMainParts::PreCreateThreads() { return 0; } -void CefBrowserMainParts::ServiceManagerConnectionStarted( - content::ServiceManagerConnection* connection) { +void CefBrowserMainParts::PostCreateThreads() { for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) - chrome_extra_parts_[i]->ServiceManagerConnectionStarted(connection); + chrome_extra_parts_[i]->PostCreateThreads(); } void CefBrowserMainParts::PreMainMessageLoopRun() { diff --git a/libcef/browser/browser_main.h b/libcef/browser/browser_main.h index ed05f98fb..70ffe58fa 100644 --- a/libcef/browser/browser_main.h +++ b/libcef/browser/browser_main.h @@ -46,8 +46,7 @@ class CefBrowserMainParts : public content::BrowserMainParts { void PreMainMessageLoopStart() override; void PostMainMessageLoopStart() override; int PreCreateThreads() override; - void ServiceManagerConnectionStarted( - content::ServiceManagerConnection* connection) override; + void PostCreateThreads() override; void PreMainMessageLoopRun() override; void PostMainMessageLoopRun() override; void PostDestroyThreads() override; diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 858f6308c..31a06f3b6 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -41,9 +41,10 @@ void ChromeBrowserProcessStub::Initialize() { DCHECK(!initialized_); DCHECK(!context_initialized_); DCHECK(!shutdown_); + DCHECK(!field_trial_list_); // Initialize this early before any code tries to check feature flags. - content::SetUpFieldTrialsAndFeatureList(); + field_trial_list_ = content::SetUpFieldTrialsAndFeatureList(); initialized_ = true; } @@ -101,11 +102,9 @@ void ChromeBrowserProcessStub::Shutdown() { background_printing_manager_.reset(); - shutdown_ = true; -} + field_trial_list_.reset(); -void ChromeBrowserProcessStub::ResourceDispatcherHostCreated() { - NOTREACHED(); + shutdown_ = true; } void ChromeBrowserProcessStub::EndSession() { @@ -133,10 +132,6 @@ rappor::RapporServiceImpl* ChromeBrowserProcessStub::rappor_service() { return NULL; } -IOThread* ChromeBrowserProcessStub::io_thread() { - return NULL; -} - SystemNetworkContextManager* ChromeBrowserProcessStub::system_network_context_manager() { DCHECK(SystemNetworkContextManager::GetInstance()); @@ -173,12 +168,6 @@ PrefService* ChromeBrowserProcessStub::local_state() { return local_state_.get(); } -net::URLRequestContextGetter* -ChromeBrowserProcessStub::system_request_context() { - NOTREACHED(); - return NULL; -} - scoped_refptr ChromeBrowserProcessStub::shared_url_loader_factory() { NOTREACHED(); @@ -343,23 +332,6 @@ StartupData* ChromeBrowserProcessStub::startup_data() { void ChromeBrowserProcessStub::StartAutoupdateTimer() {} #endif -net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() { - DCHECK(initialized_); - if (!net_log_) { - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - net_log_ = std::make_unique(); - if (command_line.HasSwitch(network::switches::kLogNetLog)) { - net_log_->StartWritingToFile( - command_line.GetSwitchValuePath(network::switches::kLogNetLog), - net::GetNetCaptureModeFromCommandLine(command_line, - network::switches::kLogNetLog), - command_line.GetCommandLineString(), std::string()); - } - } - return net_log_.get(); -} - component_updater::ComponentUpdateService* ChromeBrowserProcessStub::component_updater() { NOTREACHED(); diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index 29619285b..11e171c4c 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -13,6 +13,7 @@ #include #include "base/compiler_specific.h" +#include "base/metrics/field_trial.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/event_router_forwarder.h" #include "media/media_buildflags.h" @@ -38,20 +39,17 @@ class ChromeBrowserProcessStub : public BrowserProcess { void Shutdown(); // BrowserProcess implementation. - void ResourceDispatcherHostCreated() override; void EndSession() override; void FlushLocalStateAndReply(base::OnceClosure reply) override; metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() override; metrics::MetricsService* metrics_service() override; rappor::RapporServiceImpl* rappor_service() override; - IOThread* io_thread() override; SystemNetworkContextManager* system_network_context_manager() override; network::NetworkQualityTracker* network_quality_tracker() override; WatchDogThread* watchdog_thread() override; ProfileManager* profile_manager() override; PrefService* local_state() override; - net::URLRequestContextGetter* system_request_context() override; scoped_refptr shared_url_loader_factory() override; variations::VariationsService* variations_service() override; @@ -92,7 +90,6 @@ class ChromeBrowserProcessStub : public BrowserProcess { void StartAutoupdateTimer() override; #endif - net_log::ChromeNetLog* net_log() override; component_updater::ComponentUpdateService* component_updater() override; component_updater::SupervisedUserWhitelistInstaller* supervised_user_whitelist_installer() override; @@ -116,7 +113,6 @@ class ChromeBrowserProcessStub : public BrowserProcess { std::unique_ptr print_job_manager_; std::unique_ptr profile_manager_; scoped_refptr event_router_forwarder_; - std::unique_ptr net_log_; scoped_refptr print_preview_dialog_controller_; std::unique_ptr @@ -125,6 +121,7 @@ class ChromeBrowserProcessStub : public BrowserProcess { // Must be destroyed after |local_state_|. std::unique_ptr browser_policy_connector_; + std::unique_ptr field_trial_list_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProcessStub); }; diff --git a/libcef/browser/chrome_profile_stub.cc b/libcef/browser/chrome_profile_stub.cc index aaf894e11..a70951299 100644 --- a/libcef/browser/chrome_profile_stub.cc +++ b/libcef/browser/chrome_profile_stub.cc @@ -12,6 +12,14 @@ ChromeProfileStub::ChromeProfileStub() {} ChromeProfileStub::~ChromeProfileStub() {} +bool ChromeProfileStub::IsOffTheRecord() { + return false; +} + +bool ChromeProfileStub::IsOffTheRecord() const { + return false; +} + scoped_refptr ChromeProfileStub::GetIOTaskRunner() { NOTREACHED(); return scoped_refptr(); @@ -70,12 +78,6 @@ PrefService* ChromeProfileStub::GetOffTheRecordPrefs() { return NULL; } -base::OnceCallback -ChromeProfileStub::GetExtensionsCookieStoreGetter() { - NOTREACHED(); - return base::OnceCallback(); -} - bool ChromeProfileStub::IsSameProfile(Profile* profile) { NOTREACHED(); return false; @@ -106,6 +108,10 @@ bool ChromeProfileStub::WasCreatedByVersionOrLater(const std::string& version) { return false; } +bool ChromeProfileStub::IsIndependentOffTheRecordProfile() { + return false; +} + void ChromeProfileStub::SetExitType(ExitType exit_type) { NOTREACHED(); } diff --git a/libcef/browser/chrome_profile_stub.h b/libcef/browser/chrome_profile_stub.h index 635ff24bd..f0527901f 100644 --- a/libcef/browser/chrome_profile_stub.h +++ b/libcef/browser/chrome_profile_stub.h @@ -20,6 +20,8 @@ class ChromeProfileStub : public Profile { protected: // Profile methods. + bool IsOffTheRecord() override; + bool IsOffTheRecord() const override; scoped_refptr GetIOTaskRunner() override; std::string GetProfileUserName() const override; ProfileType GetProfileType() const override; @@ -33,14 +35,13 @@ class ChromeProfileStub : public Profile { bool IsLegacySupervised() const override; ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; PrefService* GetOffTheRecordPrefs() override; - base::OnceCallback GetExtensionsCookieStoreGetter() - override; bool IsSameProfile(Profile* profile) override; base::Time GetStartTime() const override; base::FilePath last_selected_directory() override; void set_last_selected_directory(const base::FilePath& path) override; GURL GetHomePage() override; bool WasCreatedByVersionOrLater(const std::string& version) override; + bool IsIndependentOffTheRecordProfile() override; void SetExitType(ExitType exit_type) override; ExitType GetLastSessionExitType() override; diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 4d760c07a..fa038e574 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -75,7 +75,7 @@ #include "components/services/heap_profiling/heap_profiling_service.h" #include "components/services/heap_profiling/public/mojom/constants.mojom.h" #include "components/services/pdf_compositor/public/cpp/pdf_compositor_service_factory.h" -#include "components/services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h" +#include "components/services/pdf_compositor/public/mojom/pdf_compositor.mojom.h" #include "components/version_info/version_info.h" #include "content/browser/frame_host/navigation_handle_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h" @@ -116,7 +116,6 @@ #include "net/ssl/ssl_cert_request_info.h" #include "ppapi/host/ppapi_host.h" #include "services/network/public/cpp/network_switches.h" -#include "services/proxy_resolver/proxy_resolver_service.h" #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #include "services/service_manager/embedder/switches.h" #include "services/service_manager/public/mojom/connector.mojom.h" @@ -723,12 +722,6 @@ void CefContentBrowserClient::RunServiceInstance( std::make_unique(std::move(*receiver))); return; } - if (service_name == proxy_resolver::mojom::kProxyResolverServiceName) { - service_manager::Service::RunAsyncUntilTermination( - std::make_unique( - std::move(*receiver))); - return; - } } void CefContentBrowserClient::RunServiceInstanceOnIOThread( @@ -896,8 +889,7 @@ void CefContentBrowserClient::AdjustUtilityServiceProcessCommandLine( // On Mac, the video-capture and audio services require a CFRunLoop, provided // by a UI message loop, to run AVFoundation and CoreAudio code. // See https://crbug.com/834581 - if (identity.name() == video_capture::mojom::kServiceName || - identity.name() == audio::mojom::kServiceName) + if (identity.name() == audio::mojom::kServiceName) command_line->AppendSwitch(switches::kMessageLoopTypeUi); #endif } @@ -1022,7 +1014,7 @@ void CefContentBrowserClient::AllowCertificateError( } } -void CefContentBrowserClient::SelectClientCertificate( +base::OnceClosure CefContentBrowserClient::SelectClientCertificate( content::WebContents* web_contents, net::SSLCertRequestInfo* cert_request_info, net::ClientCertIdentityList client_certs, @@ -1040,7 +1032,7 @@ void CefContentBrowserClient::SelectClientCertificate( if (!handler.get()) { delegate->ContinueWithCertificate(nullptr, nullptr); - return; + return base::OnceClosure(); } CefRequestHandler::X509CertificateList certs; @@ -1060,6 +1052,7 @@ void CefContentBrowserClient::SelectClientCertificate( if (!proceed && !certs.empty()) { callbackImpl->Select(certs[0]); } + return base::OnceClosure(); } bool CefContentBrowserClient::CanCreateWindow( @@ -1154,11 +1147,10 @@ CefContentBrowserClient::CreateThrottlesForNavigation( std::vector> CefContentBrowserClient::CreateURLLoaderThrottles( const network::ResourceRequest& request, - content::ResourceContext* resource_context, + content::BrowserContext* resource_context, const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, int frame_tree_node_id) { - CEF_REQUIRE_IOT(); std::vector> result; // Used to substitute View ID for PDF contents when using the PDF plugin. @@ -1308,15 +1300,20 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory( bool is_navigation, bool is_download, const url::Origin& request_initiator, - network::mojom::URLLoaderFactoryRequest* factory_request, + mojo::PendingReceiver* factory_receiver, network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, bool* bypass_redirect_checks) { auto request_handler = net_service::CreateInterceptedRequestHandler( browser_context, frame, render_process_id, is_navigation, is_download, request_initiator); + auto proxied_receiver = std::move(*factory_receiver); + network::mojom::URLLoaderFactoryPtrInfo target_factory_info; + *factory_receiver = mojo::MakeRequest(&target_factory_info); + net_service::ProxyURLLoaderFactory::CreateProxy( - browser_context, factory_request, header_client, + browser_context, std::move(proxied_receiver), + std::move(target_factory_info), header_client, std::move(request_handler)); return true; } @@ -1371,8 +1368,7 @@ bool CefContentBrowserClient::HandleExternalProtocol( bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - network::mojom::URLLoaderFactoryRequest* factory_request, - network::mojom::URLLoaderFactory*& out_factory) { + network::mojom::URLLoaderFactoryPtr* out_factory) { // Call the other HandleExternalProtocol variant. return false; } @@ -1381,33 +1377,54 @@ bool CefContentBrowserClient::HandleExternalProtocol( content::ResourceRequestInfo::WebContentsGetter web_contents_getter, int frame_tree_node_id, content::NavigationUIData* navigation_data, - const network::ResourceRequest& request, + const network::ResourceRequest& resource_request, network::mojom::URLLoaderFactoryRequest* factory_request, - network::mojom::URLLoaderFactory*& out_factory) { + network::mojom::URLLoaderFactoryPtr* out_factory) { + auto request = mojo::MakeRequest(out_factory); // CefBrowserPlatformDelegate::HandleExternalProtocol may be called if // nothing handles the request. - auto request_handler = net_service::CreateInterceptedRequestHandler( - web_contents_getter, frame_tree_node_id, request); - out_factory = net_service::ProxyURLLoaderFactory::CreateProxy( - web_contents_getter, factory_request, std::move(request_handler)); + if (CEF_CURRENTLY_ON_IOT()) { + auto request_handler = net_service::CreateInterceptedRequestHandler( + web_contents_getter, frame_tree_node_id, resource_request); + net_service::ProxyURLLoaderFactory::CreateProxy( + web_contents_getter, std::move(request), std::move(request_handler)); + } else { + auto request_handler = net_service::CreateInterceptedRequestHandler( + web_contents_getter, frame_tree_node_id, resource_request); + CEF_POST_TASK(CEF_IOT, + base::BindOnce( + [](network::mojom::URLLoaderFactoryRequest request, + std::unique_ptr + request_handler, + content::ResourceRequestInfo::WebContentsGetter + web_contents_getter) { + // Manages its own lifetime. + + net_service::ProxyURLLoaderFactory::CreateProxy( + web_contents_getter, std::move(request), + std::move(request_handler)); + }, + std::move(request), std::move(request_handler), + std::move(web_contents_getter))); + } return true; } -std::string CefContentBrowserClient::GetProduct() const { +std::string CefContentBrowserClient::GetProduct() { // Match the logic in chrome_content_browser_client.cc GetProduct(). return ::GetProduct(); } -std::string CefContentBrowserClient::GetChromeProduct() const { +std::string CefContentBrowserClient::GetChromeProduct() { return version_info::GetProductNameAndVersionForUserAgent(); } -std::string CefContentBrowserClient::GetUserAgent() const { +std::string CefContentBrowserClient::GetUserAgent() { // Match the logic in chrome_content_browser_client.cc GetUserAgent(). return ::GetUserAgent(); } -blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() const { +blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() { blink::UserAgentMetadata metadata; metadata.brand = version_info::GetProductName(); diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 4579d8ab5..c39e8e7d8 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -101,7 +101,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { bool expired_previous_decision, const base::Callback& callback) override; - void SelectClientCertificate( + base::OnceClosure SelectClientCertificate( content::WebContents* web_contents, net::SSLCertRequestInfo* cert_request_info, net::ClientCertIdentityList client_certs, @@ -131,7 +131,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { std::vector> CreateURLLoaderThrottles( const network::ResourceRequest& request, - content::ResourceContext* resource_context, + content::BrowserContext* resource_context, const base::RepeatingCallback& wc_getter, content::NavigationUIData* navigation_ui_data, int frame_tree_node_id) override; @@ -177,7 +177,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { bool is_navigation, bool is_download, const url::Origin& request_initiator, - network::mojom::URLLoaderFactoryRequest* factory_request, + mojo::PendingReceiver* factory_receiver, network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, bool* bypass_redirect_checks) override; void OnNetworkServiceCreated( @@ -195,19 +195,19 @@ class CefContentBrowserClient : public content::ContentBrowserClient { bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture, - network::mojom::URLLoaderFactoryRequest* factory_request, - network::mojom::URLLoaderFactory*& out_factory) override; + network::mojom::URLLoaderFactoryPtr* out_factory) override; bool HandleExternalProtocol( content::ResourceRequestInfo::WebContentsGetter web_contents_getter, int frame_tree_node_id, content::NavigationUIData* navigation_data, const network::ResourceRequest& request, network::mojom::URLLoaderFactoryRequest* factory_request, - network::mojom::URLLoaderFactory*& out_factory) override; - std::string GetProduct() const override; - std::string GetChromeProduct() const override; - std::string GetUserAgent() const override; - blink::UserAgentMetadata GetUserAgentMetadata() const override; + network::mojom::URLLoaderFactoryPtr* out_factory) override; + + std::string GetProduct() override; + std::string GetChromeProduct() override; + std::string GetUserAgent() override; + blink::UserAgentMetadata GetUserAgentMetadata() override; base::flat_set GetPluginMimeTypesWithExternalHandlers( content::ResourceContext* resource_context) override; diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 1be7468d7..c180ef7b6 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -389,8 +389,7 @@ void CefDownloadManagerDelegate::GetNextId( callback.Run(next_id++); } -std::string CefDownloadManagerDelegate::ApplicationClientIdForFileScanning() - const { +std::string CefDownloadManagerDelegate::ApplicationClientIdForFileScanning() { const CefSettings& settings = CefContext::Get()->settings(); if (settings.application_client_id_for_file_scanning.length > 0) { return CefString(&settings.application_client_id_for_file_scanning) diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 058c28301..0a1368834 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -39,7 +39,7 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer, download::DownloadItem* item, const content::DownloadTargetCallback& callback) override; void GetNextId(const content::DownloadIdCallback& callback) override; - std::string ApplicationClientIdForFileScanning() const override; + std::string ApplicationClientIdForFileScanning() override; // CefBrowserHostImpl::Observer methods. void OnBrowserDestroyed(CefBrowserHostImpl* browser) override; diff --git a/libcef/browser/extensions/component_extension_resource_manager.cc b/libcef/browser/extensions/component_extension_resource_manager.cc index fc692ae16..b11a6fffe 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.cc +++ b/libcef/browser/extensions/component_extension_resource_manager.cc @@ -55,7 +55,7 @@ void CefComponentExtensionResourceManager::AddComponentResourceEntries( base::FilePath().AppendASCII(entries[i].name); resource_path = resource_path.NormalizePathSeparators(); - DCHECK(!base::ContainsKey(path_to_resource_info_, resource_path)); + DCHECK(!base::Contains(path_to_resource_info_, resource_path)); path_to_resource_info_[resource_path] = entries[i].value; } } diff --git a/libcef/browser/extensions/extension_host_delegate.cc b/libcef/browser/extensions/extension_host_delegate.cc index b0552784c..998fd9d42 100644 --- a/libcef/browser/extensions/extension_host_delegate.cc +++ b/libcef/browser/extensions/extension_host_delegate.cc @@ -8,6 +8,7 @@ #include "base/logging.h" #include "content/public/browser/web_contents.h" +#include "content/public/browser/web_contents_delegate.h" namespace extensions { @@ -51,7 +52,7 @@ void CefExtensionHostDelegate::ProcessMediaAccessRequest( bool CefExtensionHostDelegate::CheckMediaAccessPermission( content::RenderFrameHost* render_frame_host, const GURL& security_origin, - blink::MediaStreamType type, + blink::mojom::MediaStreamType type, const Extension* extension) { // Never routed here from CefBrowserHostImpl. NOTREACHED(); @@ -62,12 +63,12 @@ ExtensionHostQueue* CefExtensionHostDelegate::GetExtensionHostQueue() const { return CefExtensionsBrowserClient::Get()->GetExtensionHostQueue(); } -gfx::Size CefExtensionHostDelegate::EnterPictureInPicture( +content::PictureInPictureResult CefExtensionHostDelegate::EnterPictureInPicture( content::WebContents* web_contents, const viz::SurfaceId& surface_id, const gfx::Size& natural_size) { NOTREACHED(); - return gfx::Size(); + return content::PictureInPictureResult::kNotSupported; } void CefExtensionHostDelegate::ExitPictureInPicture() { diff --git a/libcef/browser/extensions/extension_host_delegate.h b/libcef/browser/extensions/extension_host_delegate.h index ac3e36bc4..c30c93c2d 100644 --- a/libcef/browser/extensions/extension_host_delegate.h +++ b/libcef/browser/extensions/extension_host_delegate.h @@ -32,12 +32,13 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate { const Extension* extension) override; bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, - blink::MediaStreamType type, + blink::mojom::MediaStreamType type, const Extension* extension) override; ExtensionHostQueue* GetExtensionHostQueue() const override; - gfx::Size EnterPictureInPicture(content::WebContents* web_contents, - const viz::SurfaceId& surface_id, - const gfx::Size& natural_size) override; + content::PictureInPictureResult EnterPictureInPicture( + content::WebContents* web_contents, + const viz::SurfaceId& surface_id, + const gfx::Size& natural_size) override; void ExitPictureInPicture() override; private: diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 5ea947936..12ef49235 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -366,10 +366,6 @@ void CefExtensionSystem::InitForRegularProfile(bool extensions_enabled) { app_sorting_.reset(new NullAppSorting); } -void CefExtensionSystem::InitForIncognitoProfile() { - NOTREACHED(); -} - ExtensionService* CefExtensionSystem::extension_service() { return nullptr; } diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index 473d0133e..3d555e548 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -89,7 +89,6 @@ class CefExtensionSystem : public ExtensionSystem { // ExtensionSystem implementation: void InitForRegularProfile(bool extensions_enabled) override; - void InitForIncognitoProfile() override; ExtensionService* extension_service() override; RuntimeData* runtime_data() override; ManagementPolicy* management_policy() override; diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index 5c2d6acea..3b902f823 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -107,17 +107,6 @@ bool CefExtensionsBrowserClient::CanExtensionCrossIncognito( return false; } -net::URLRequestJob* -CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob( - net::URLRequest* request, - net::NetworkDelegate* network_delegate, - const base::FilePath& directory_path, - const std::string& content_security_policy, - bool send_cors_header) { - NOTREACHED(); - return nullptr; -} - base::FilePath CefExtensionsBrowserClient::GetBundleResourcePath( const network::ResourceRequest& request, const base::FilePath& extension_resources_path, diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index 1044e38d7..c6faacff0 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -43,12 +43,6 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { bool CanExtensionCrossIncognito( const Extension* extension, content::BrowserContext* context) const override; - net::URLRequestJob* MaybeCreateResourceBundleRequestJob( - net::URLRequest* request, - net::NetworkDelegate* network_delegate, - const base::FilePath& directory_path, - const std::string& content_security_policy, - bool send_cors_header) override; base::FilePath GetBundleResourcePath( const network::ResourceRequest& request, const base::FilePath& extension_resources_path, diff --git a/libcef/browser/media_capture_devices_dispatcher.cc b/libcef/browser/media_capture_devices_dispatcher.cc index 032b5f949..e9b2662f2 100644 --- a/libcef/browser/media_capture_devices_dispatcher.cc +++ b/libcef/browser/media_capture_devices_dispatcher.cc @@ -103,7 +103,7 @@ void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged( int render_frame_id, int page_request_id, const GURL& security_origin, - blink::MediaStreamType stream_type, + blink::mojom::MediaStreamType stream_type, content::MediaRequestState state) {} void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream( @@ -114,7 +114,7 @@ void CefMediaCaptureDevicesDispatcher::OnSetCapturingLinkSecured( int render_process_id, int render_frame_id, int page_request_id, - blink::MediaStreamType stream_type, + blink::mojom::MediaStreamType stream_type, bool is_secure) {} const MediaStreamDevices& diff --git a/libcef/browser/media_capture_devices_dispatcher.h b/libcef/browser/media_capture_devices_dispatcher.h index 6b4ff4f3a..110420614 100644 --- a/libcef/browser/media_capture_devices_dispatcher.h +++ b/libcef/browser/media_capture_devices_dispatcher.h @@ -47,14 +47,14 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver { int render_frame_id, int page_request_id, const GURL& security_origin, - blink::MediaStreamType stream_type, + blink::mojom::MediaStreamType stream_type, content::MediaRequestState state) override; void OnCreatingAudioStream(int render_process_id, int render_view_id) override; void OnSetCapturingLinkSecured(int render_process_id, int render_frame_id, int page_request_id, - blink::MediaStreamType stream_type, + blink::mojom::MediaStreamType stream_type, bool is_secure) override; private: diff --git a/libcef/browser/native/window_delegate_view.cc b/libcef/browser/native/window_delegate_view.cc index 2470aa355..d3489c636 100644 --- a/libcef/browser/native/window_delegate_view.cc +++ b/libcef/browser/native/window_delegate_view.cc @@ -50,7 +50,8 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget, // CefBrowserHostImpl::PlatformSetFocus. params.activatable = views::Widget::InitParams::ACTIVATABLE_YES; - params.keep_on_top = always_on_top_; + params.z_order = always_on_top_ ? ui::ZOrderLevel::kFloatingWindow + : ui::ZOrderLevel::kNormal; // Results in a call to InitContent(). widget->Init(params); diff --git a/libcef/browser/net/chrome_scheme_handler.cc b/libcef/browser/net/chrome_scheme_handler.cc index 9e4a8f431..d9e7bc0c6 100644 --- a/libcef/browser/net/chrome_scheme_handler.cc +++ b/libcef/browser/net/chrome_scheme_handler.cc @@ -458,7 +458,7 @@ class CefURLDataSource : public content::URLDataSource { ~CefURLDataSource() override = default; // content::URLDataSource implementation. - std::string GetSource() const override { return host_; } + std::string GetSource() override { return host_; } void StartDataRequest( const std::string& path, @@ -467,11 +467,11 @@ class CefURLDataSource : public content::URLDataSource { callback.Run(output_); } - std::string GetMimeType(const std::string& path) const override { + std::string GetMimeType(const std::string& path) override { return mime_type_; } - bool AllowCaching() const override { return false; } + bool AllowCaching() override { return false; } private: const std::string host_; @@ -531,7 +531,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { std::unique_ptr CreateWebUIControllerForURL( content::WebUI* web_ui, - const GURL& url) const override { + const GURL& url) override { std::unique_ptr controller; if (!AllowWebUIForURL(url)) return controller; @@ -551,7 +551,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { } content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context, - const GURL& url) const override { + const GURL& url) override { content::WebUI::TypeID type = content::WebUI::kNoWebUI; if (!AllowWebUIForURL(url)) return type; @@ -575,7 +575,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { } bool UseWebUIForURL(content::BrowserContext* browser_context, - const GURL& url) const override { + const GURL& url) override { if (!AllowWebUIForURL(url)) return false; @@ -595,7 +595,7 @@ class CefWebUIControllerFactory : public content::WebUIControllerFactory { } bool UseWebUIBindingsForURL(content::BrowserContext* browser_context, - const GURL& url) const override { + const GURL& url) override { if (!AllowWebUIForURL(url)) return false; diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 07398daf1..2bb50310e 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -274,7 +274,7 @@ class CefBrowserURLRequest::Context } loader_ = network::SimpleURLLoader::Create(std::move(resource_request), - NO_TRAFFIC_ANNOTATION_YET); + MISSING_TRAFFIC_ANNOTATION); // Associate the request with |request_id|. request_id_ = request_id; diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index c16a7bcf1..3046e7fbf 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -644,8 +644,8 @@ void InterceptedRequest::InterceptResponseReceived( network::cors::header_names::kAccessControlAllowOrigin, origin)); } - if (request_.fetch_credentials_mode == - network::mojom::FetchCredentialsMode::kInclude) { + if (request_.credentials_mode == + network::mojom::CredentialsMode::kInclude) { head.headers->AddHeader(MakeHeader( network::cors::header_names::kAccessControlAllowCredentials, "true")); } @@ -1045,9 +1045,11 @@ ProxyURLLoaderFactory::ProxyURLLoaderFactory( DCHECK(request_handler_); // Actual creation of the factory. - target_factory_.Bind(std::move(target_factory_info)); - target_factory_.set_connection_error_handler(base::BindOnce( - &ProxyURLLoaderFactory::OnTargetFactoryError, base::Unretained(this))); + if (target_factory_info) { + target_factory_.Bind(std::move(target_factory_info)); + target_factory_.set_connection_error_handler(base::BindOnce( + &ProxyURLLoaderFactory::OnTargetFactoryError, base::Unretained(this))); + } proxy_bindings_.AddBinding(this, std::move(loader_request)); proxy_bindings_.set_connection_error_handler(base::BindRepeating( &ProxyURLLoaderFactory::OnProxyBindingError, base::Unretained(this))); @@ -1085,16 +1087,13 @@ void ProxyURLLoaderFactory::SetDisconnectCallback( // static void ProxyURLLoaderFactory::CreateProxy( content::BrowserContext* browser_context, - network::mojom::URLLoaderFactoryRequest* factory_request, + network::mojom::URLLoaderFactoryRequest loader_request, + network::mojom::URLLoaderFactoryPtrInfo target_factory_info, network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, std::unique_ptr request_handler) { CEF_REQUIRE_UIT(); DCHECK(request_handler); - auto proxied_request = std::move(*factory_request); - network::mojom::URLLoaderFactoryPtrInfo target_factory_info; - *factory_request = mojo::MakeRequest(&target_factory_info); - network::mojom::TrustedURLLoaderHeaderClientRequest header_client_request; if (header_client) header_client_request = mojo::MakeRequest(header_client); @@ -1106,7 +1105,7 @@ void ProxyURLLoaderFactory::CreateProxy( CEF_POST_TASK( CEF_IOT, base::BindOnce( - &ProxyURLLoaderFactory::CreateOnIOThread, std::move(proxied_request), + &ProxyURLLoaderFactory::CreateOnIOThread, std::move(loader_request), std::move(target_factory_info), std::move(header_client_request), base::Unretained(resource_context), std::move(request_handler))); } @@ -1114,17 +1113,12 @@ void ProxyURLLoaderFactory::CreateProxy( // static ProxyURLLoaderFactory* ProxyURLLoaderFactory::CreateProxy( content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - network::mojom::URLLoaderFactoryRequest* factory_request, + network::mojom::URLLoaderFactoryRequest loader_request, std::unique_ptr request_handler) { CEF_REQUIRE_IOT(); DCHECK(request_handler); - auto proxied_request = std::move(*factory_request); - network::mojom::URLLoaderFactoryPtrInfo target_factory_info; - *factory_request = mojo::MakeRequest(&target_factory_info); - - auto proxy = new ProxyURLLoaderFactory(std::move(proxied_request), - std::move(target_factory_info), + auto proxy = new ProxyURLLoaderFactory(std::move(loader_request), nullptr, nullptr, std::move(request_handler)); CEF_POST_TASK(CEF_UIT, base::BindOnce(ResourceContextData::AddProxyOnUIThread, @@ -1141,7 +1135,6 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart( network::mojom::URLLoaderClientPtr client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { CEF_REQUIRE_IOT(); - if (!CONTEXT_STATE_VALID()) { // Don't start a request while we're shutting down. return; @@ -1157,7 +1150,8 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart( } network::mojom::URLLoaderFactoryPtr target_factory_clone; - target_factory_->Clone(MakeRequest(&target_factory_clone)); + if (target_factory_) + target_factory_->Clone(MakeRequest(&target_factory_clone)); InterceptedRequest* req = new InterceptedRequest( this, RequestId(request_id, routing_id), options, request, diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 8828f2da7..124e217dd 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -137,14 +137,15 @@ class ProxyURLLoaderFactory // Create a proxy object on the UI thread. static void CreateProxy( content::BrowserContext* browser_context, - network::mojom::URLLoaderFactoryRequest* factory_request, + network::mojom::URLLoaderFactoryRequest loader_request, + network::mojom::URLLoaderFactoryPtrInfo target_factory_info, network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client, std::unique_ptr request_handler); // Create a proxy object on the IO thread. static ProxyURLLoaderFactory* CreateProxy( content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - network::mojom::URLLoaderFactoryRequest* factory_request, + network::mojom::URLLoaderFactoryRequest loader_request, std::unique_ptr request_handler); // mojom::URLLoaderFactory methods: diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index 42393b76a..629672856 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -1303,7 +1303,6 @@ std::unique_ptr CreateInterceptedRequestHandler( content::ResourceRequestInfo::WebContentsGetter web_contents_getter, int frame_tree_node_id, const network::ResourceRequest& request) { - CEF_REQUIRE_IOT(); auto wrapper = std::make_unique(); CEF_POST_TASK(CEF_UIT, base::BindOnce(InitOnUIThread, wrapper->init_helper(), web_contents_getter, frame_tree_node_id, diff --git a/libcef/browser/net_service/response_filter_wrapper.cc b/libcef/browser/net_service/response_filter_wrapper.cc index 9b451b8b7..770286884 100644 --- a/libcef/browser/net_service/response_filter_wrapper.cc +++ b/libcef/browser/net_service/response_filter_wrapper.cc @@ -7,7 +7,7 @@ #include #include "mojo/public/cpp/system/simple_watcher.h" -#include "mojo/public/cpp/system/string_data_pipe_producer.h" +#include "mojo/public/cpp/system/string_data_source.h" namespace net_service { @@ -39,7 +39,7 @@ class ResponseFilterWrapper { mojo::ScopedDataPipeConsumerHandle source_handle_; base::OnceClosure error_callback_; - std::unique_ptr forwarder_; + std::unique_ptr forwarder_; mojo::SimpleWatcher source_watcher_; bool read_pending_ = false; @@ -73,8 +73,8 @@ bool ResponseFilterWrapper::CreateOutputHandle( return false; } - forwarder_ = std::make_unique( - std::move(forwarding_handle)); + forwarder_ = + std::make_unique(std::move(forwarding_handle)); source_watcher_.Watch( source_handle_.get(), @@ -213,9 +213,9 @@ void ResponseFilterWrapper::Write(std::unique_ptr data) { write_pending_ = true; base::StringPiece string_piece(*data); - forwarder_->Write(string_piece, - mojo::StringDataPipeProducer::AsyncWritingMode:: - STRING_STAYS_VALID_UNTIL_COMPLETION, + forwarder_->Write(std::make_unique( + string_piece, mojo::StringDataSource::AsyncWritingMode:: + STRING_STAYS_VALID_UNTIL_COMPLETION), base::BindOnce(&ResponseFilterWrapper::OnWriteComplete, base::Unretained(this), std::move(data))); } diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index ef20b7dcb..f57dba0ea 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -41,8 +41,8 @@ scoped_refptr URLLoaderFactoryGetter::Create( // Create an intermediate pipe that can be used to proxy the request's // URLLoaderFactory. network::mojom::URLLoaderFactoryPtrInfo maybe_proxy_factory_ptr_info; - network::mojom::URLLoaderFactoryRequest maybe_proxy_factory_request = - MakeRequest(&maybe_proxy_factory_ptr_info); + mojo::PendingReceiver + maybe_proxy_factory_request = MakeRequest(&maybe_proxy_factory_ptr_info); bool should_proxy = false; int render_process_id = -1; diff --git a/libcef/browser/osr/host_display_client_osr.cc b/libcef/browser/osr/host_display_client_osr.cc index b634c1704..ee8b01be2 100644 --- a/libcef/browser/osr/host_display_client_osr.cc +++ b/libcef/browser/osr/host_display_client_osr.cc @@ -35,16 +35,15 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater { gfx::Size GetPixelSize() const; // viz::mojom::LayeredWindowUpdater implementation. - void OnAllocatedSharedMemory( - const gfx::Size& pixel_size, - mojo::ScopedSharedBufferHandle scoped_buffer_handle) override; + void OnAllocatedSharedMemory(const gfx::Size& pixel_size, + base::UnsafeSharedMemoryRegion region) override; void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override; private: CefRenderWidgetHostViewOSR* const view_; mojo::Binding binding_; bool active_ = false; - base::ReadOnlySharedMemoryMapping shared_memory_; + base::WritableSharedMemoryMapping shared_memory_; gfx::Size pixel_size_; DISALLOW_COPY_AND_ASSIGN(CefLayeredWindowUpdaterOSR); @@ -71,7 +70,7 @@ gfx::Size CefLayeredWindowUpdaterOSR::GetPixelSize() const { void CefLayeredWindowUpdaterOSR::OnAllocatedSharedMemory( const gfx::Size& pixel_size, - mojo::ScopedSharedBufferHandle scoped_buffer_handle) { + base::UnsafeSharedMemoryRegion region) { // Make sure |pixel_size| is sane. size_t expected_bytes; bool size_result = viz::ResourceSizes::MaybeSizeInBytes( @@ -79,28 +78,8 @@ void CefLayeredWindowUpdaterOSR::OnAllocatedSharedMemory( if (!size_result) return; -#if !defined(OS_WIN) - base::ReadOnlySharedMemoryRegion shm = - mojo::UnwrapReadOnlySharedMemoryRegion(std::move(scoped_buffer_handle)); - if (!shm.IsValid()) { - LOG(ERROR) << "Shared memory region is invalid"; - return; - } -#else // !defined(OS_WIN) - base::SharedMemoryHandle shm_handle; - MojoResult unwrap_result = mojo::UnwrapSharedMemoryHandle( - std::move(scoped_buffer_handle), &shm_handle, nullptr, nullptr); - if (unwrap_result != MOJO_RESULT_OK) - return; - - base::ReadOnlySharedMemoryRegion shm = - base::ReadOnlySharedMemoryRegion::Deserialize( - base::subtle::PlatformSharedMemoryRegion::TakeFromSharedMemoryHandle( - shm_handle, - base::subtle::PlatformSharedMemoryRegion::Mode::kReadOnly)); -#endif // !defined(OS_WIN) pixel_size_ = pixel_size; - shared_memory_ = shm.Map(); + shared_memory_ = region.Map(); DCHECK(shared_memory_.IsValid()); } diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index fab60fd46..f15b61ebb 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -208,8 +208,11 @@ struct PopulateAxNodeAttributes { attributes->SetString(ToString(attr.first), ToString(state)); } } break; + case ax::mojom::IntAttribute::kAriaCellColumnSpan: + case ax::mojom::IntAttribute::kAriaCellRowSpan: case ax::mojom::IntAttribute::kImageAnnotationStatus: { - // TODO(cef): Implement support for Image Annotation Status + // TODO(cef): Implement support for Image Annotation Status, + // kAriaCellColumnSpan and kAriaCellRowSpan } break; } } diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 0760e1dae..c61a1f896 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -47,6 +47,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/common/content_switches.h" #include "media/base/video_frame.h" +#include "ui/base/cursor/types/cursor_types.h" #include "ui/compositor/compositor.h" #include "ui/events/blink/blink_event_util.h" #include "ui/events/gesture_detection/gesture_provider_config_helper.h" @@ -142,7 +143,7 @@ ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) { base::TimeTicks time = event.TimeStamp(); if (!time.is_null()) { latency_info.AddLatencyNumberWithTimestamp( - ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, time, 1); + ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, time); } return latency_info; } @@ -520,7 +521,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor( const cef_cursor_type_t cursor_type = static_cast(cursor_info.type); CefCursorInfo custom_cursor_info; - if (cursor_info.type == blink::WebCursorInfo::kTypeCustom) { + if (cursor_info.type == ui::CursorType::kCustom) { custom_cursor_info.hotspot.x = cursor_info.hotspot.x(); custom_cursor_info.hotspot.y = cursor_info.hotspot.y(); custom_cursor_info.image_scale_factor = cursor_info.image_scale_factor; @@ -533,7 +534,7 @@ void CefRenderWidgetHostViewOSR::UpdateCursor( content::WebCursor web_cursor(cursor_info); ui::PlatformCursor platform_cursor; - if (cursor_info.type == blink::WebCursorInfo::kTypeCustom) { + if (cursor_info.type == ui::CursorType::kCustom) { ui::Cursor ui_cursor(ui::CursorType::kCustom); SkBitmap bitmap; gfx::Point hotspot; @@ -821,24 +822,6 @@ void CefRenderWidgetHostViewOSR::SetWantsAnimateOnlyBeginFrames() { } } -bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpaceLegacy( - const gfx::PointF& point, - const viz::SurfaceId& original_surface, - gfx::PointF* transformed_point) { - // Transformations use physical pixels rather than DIP, so conversion - // is necessary. - gfx::PointF point_in_pixels = - gfx::ConvertPointToPixel(current_device_scale_factor_, point); - if (!GetDelegatedFrameHost()->TransformPointToLocalCoordSpaceLegacy( - point_in_pixels, original_surface, transformed_point)) { - return false; - } - - *transformed_point = - gfx::ConvertPointToDIP(current_device_scale_factor_, *transformed_point); - return true; -} - bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView( const gfx::PointF& point, RenderWidgetHostViewBase* target_view, diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 67185dde9..44c987412 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -25,6 +25,7 @@ #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/text_input_manager.h" #include "content/public/common/widget_type.h" +#include "ui/base/cursor/types/cursor_types.h" #include "ui/compositor/compositor.h" #include "ui/compositor/external_begin_frame_client.h" #include "ui/events/base_event_utils.h" @@ -175,10 +176,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, CreateSyntheticGestureTarget() override; void SetNeedsBeginFrames(bool enabled) override; void SetWantsAnimateOnlyBeginFrames() override; - bool TransformPointToLocalCoordSpaceLegacy( - const gfx::PointF& point, - const viz::SurfaceId& original_surface, - gfx::PointF* transformed_point) override; bool TransformPointToCoordSpaceForView( const gfx::PointF& point, RenderWidgetHostViewBase* target_view, @@ -304,7 +301,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, void UpdateBackgroundColorFromRenderer(SkColor color); #if defined(USE_AURA) - ui::PlatformCursor GetPlatformCursor(blink::WebCursorInfo::Type type); + ui::PlatformCursor GetPlatformCursor(ui::CursorType type); #endif // The background color of the web content. 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 655be2200..7b622a862 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_linux.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_linux.cc @@ -25,94 +25,108 @@ namespace { using blink::WebCursorInfo; -int ToCursorID(WebCursorInfo::Type type) { +int ToCursorID(ui::CursorType type) { switch (type) { - case WebCursorInfo::kTypePointer: + case ui::CursorType::kPointer: return XC_left_ptr; - case WebCursorInfo::kTypeCross: + case ui::CursorType::kCross: return XC_crosshair; - case WebCursorInfo::kTypeHand: + case ui::CursorType::kHand: return XC_hand2; - case WebCursorInfo::kTypeIBeam: + case ui::CursorType::kIBeam: return XC_xterm; - case WebCursorInfo::kTypeWait: + case ui::CursorType::kWait: return XC_watch; - case WebCursorInfo::kTypeHelp: + case ui::CursorType::kHelp: return XC_question_arrow; - case WebCursorInfo::kTypeEastResize: + case ui::CursorType::kEastResize: return XC_right_side; - case WebCursorInfo::kTypeNorthResize: + case ui::CursorType::kNorthResize: return XC_top_side; - case WebCursorInfo::kTypeNorthEastResize: + case ui::CursorType::kNorthEastResize: return XC_top_right_corner; - case WebCursorInfo::kTypeNorthWestResize: + case ui::CursorType::kNorthWestResize: return XC_top_left_corner; - case WebCursorInfo::kTypeSouthResize: + case ui::CursorType::kSouthResize: return XC_bottom_side; - case WebCursorInfo::kTypeSouthEastResize: + case ui::CursorType::kSouthEastResize: return XC_bottom_right_corner; - case WebCursorInfo::kTypeSouthWestResize: + case ui::CursorType::kSouthWestResize: return XC_bottom_left_corner; - case WebCursorInfo::kTypeWestResize: + case ui::CursorType::kWestResize: return XC_left_side; - case WebCursorInfo::kTypeNorthSouthResize: + case ui::CursorType::kNorthSouthResize: return XC_sb_v_double_arrow; - case WebCursorInfo::kTypeEastWestResize: + case ui::CursorType::kEastWestResize: return XC_sb_h_double_arrow; - case WebCursorInfo::kTypeNorthEastSouthWestResize: + case ui::CursorType::kNorthEastSouthWestResize: return XC_left_ptr; - case WebCursorInfo::kTypeNorthWestSouthEastResize: + case ui::CursorType::kNorthWestSouthEastResize: return XC_left_ptr; - case WebCursorInfo::kTypeColumnResize: + case ui::CursorType::kColumnResize: return XC_sb_h_double_arrow; - case WebCursorInfo::kTypeRowResize: + case ui::CursorType::kRowResize: return XC_sb_v_double_arrow; - case WebCursorInfo::kTypeMiddlePanning: + case ui::CursorType::kMiddlePanning: return XC_fleur; - case WebCursorInfo::kTypeEastPanning: + case ui::CursorType::kEastPanning: return XC_sb_right_arrow; - case WebCursorInfo::kTypeNorthPanning: + case ui::CursorType::kNorthPanning: return XC_sb_up_arrow; - case WebCursorInfo::kTypeNorthEastPanning: + case ui::CursorType::kNorthEastPanning: return XC_top_right_corner; - case WebCursorInfo::kTypeNorthWestPanning: + case ui::CursorType::kNorthWestPanning: return XC_top_left_corner; - case WebCursorInfo::kTypeSouthPanning: + case ui::CursorType::kSouthPanning: return XC_sb_down_arrow; - case WebCursorInfo::kTypeSouthEastPanning: + case ui::CursorType::kSouthEastPanning: return XC_bottom_right_corner; - case WebCursorInfo::kTypeSouthWestPanning: + case ui::CursorType::kSouthWestPanning: return XC_bottom_left_corner; - case WebCursorInfo::kTypeWestPanning: + case ui::CursorType::kWestPanning: return XC_sb_left_arrow; - case WebCursorInfo::kTypeMove: + case ui::CursorType::kMove: return XC_fleur; - case WebCursorInfo::kTypeVerticalText: + case ui::CursorType::kVerticalText: return XC_left_ptr; - case WebCursorInfo::kTypeCell: + case ui::CursorType::kCell: return XC_left_ptr; - case WebCursorInfo::kTypeContextMenu: + case ui::CursorType::kContextMenu: return XC_left_ptr; - case WebCursorInfo::kTypeAlias: + case ui::CursorType::kAlias: return XC_left_ptr; - case WebCursorInfo::kTypeProgress: + case ui::CursorType::kProgress: return XC_left_ptr; - case WebCursorInfo::kTypeNoDrop: + case ui::CursorType::kNoDrop: return XC_left_ptr; - case WebCursorInfo::kTypeCopy: + case ui::CursorType::kCopy: return XC_left_ptr; - case WebCursorInfo::kTypeNotAllowed: + case ui::CursorType::kNotAllowed: return XC_left_ptr; - case WebCursorInfo::kTypeZoomIn: + case ui::CursorType::kZoomIn: return XC_left_ptr; - case WebCursorInfo::kTypeZoomOut: + case ui::CursorType::kZoomOut: return XC_left_ptr; - case WebCursorInfo::kTypeGrab: + case ui::CursorType::kGrab: return XC_left_ptr; - case WebCursorInfo::kTypeGrabbing: + case ui::CursorType::kGrabbing: return XC_left_ptr; - case WebCursorInfo::kTypeCustom: - case WebCursorInfo::kTypeNone: + case ui::CursorType::kMiddlePanningVertical: + return XC_left_ptr; + case ui::CursorType::kMiddlePanningHorizontal: + return XC_left_ptr; + case ui::CursorType::kDndNone: + return XC_left_ptr; + case ui::CursorType::kDndMove: + return XC_left_ptr; + case ui::CursorType::kDndCopy: + return XC_left_ptr; + case ui::CursorType::kDndLink: + return XC_left_ptr; + case ui::CursorType::kNull: + return XC_left_ptr; + case ui::CursorType::kCustom: + case ui::CursorType::kNone: break; } NOTREACHED(); @@ -170,9 +184,9 @@ XCursorCache* cursor_cache = nullptr; #endif // defined(USE_X11) ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor( - blink::WebCursorInfo::Type type) { + ui::CursorType type) { #if defined(USE_X11) - if (type == WebCursorInfo::kTypeNone) { + if (type == ui::CursorType::kNone) { if (!invisible_cursor_) { invisible_cursor_.reset(new ui::XScopedCursor(ui::CreateInvisibleCursor(), gfx::GetXDisplay())); 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 48569030c..2837ce356 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_win.cc +++ b/libcef/browser/osr/render_widget_host_view_osr_win.cc @@ -41,95 +41,110 @@ class CefCompositorHostWin : public gfx::WindowImpl { using blink::WebCursorInfo; -LPCWSTR ToCursorID(WebCursorInfo::Type type) { +LPCWSTR ToCursorID(ui::CursorType type) { switch (type) { - case WebCursorInfo::kTypePointer: + case ui::CursorType::kPointer: return IDC_ARROW; - case WebCursorInfo::kTypeCross: + case ui::CursorType::kCross: return IDC_CROSS; - case WebCursorInfo::kTypeHand: + case ui::CursorType::kHand: return IDC_HAND; - case WebCursorInfo::kTypeIBeam: + case ui::CursorType::kIBeam: return IDC_IBEAM; - case WebCursorInfo::kTypeWait: + case ui::CursorType::kWait: return IDC_WAIT; - case WebCursorInfo::kTypeHelp: + case ui::CursorType::kHelp: return IDC_HELP; - case WebCursorInfo::kTypeEastResize: + case ui::CursorType::kEastResize: return IDC_SIZEWE; - case WebCursorInfo::kTypeNorthResize: + case ui::CursorType::kNorthResize: return IDC_SIZENS; - case WebCursorInfo::kTypeNorthEastResize: + case ui::CursorType::kNorthEastResize: return IDC_SIZENESW; - case WebCursorInfo::kTypeNorthWestResize: + case ui::CursorType::kNorthWestResize: return IDC_SIZENWSE; - case WebCursorInfo::kTypeSouthResize: + case ui::CursorType::kSouthResize: return IDC_SIZENS; - case WebCursorInfo::kTypeSouthEastResize: + case ui::CursorType::kSouthEastResize: return IDC_SIZENWSE; - case WebCursorInfo::kTypeSouthWestResize: + case ui::CursorType::kSouthWestResize: return IDC_SIZENESW; - case WebCursorInfo::kTypeWestResize: + case ui::CursorType::kWestResize: return IDC_SIZEWE; - case WebCursorInfo::kTypeNorthSouthResize: + case ui::CursorType::kNorthSouthResize: return IDC_SIZENS; - case WebCursorInfo::kTypeEastWestResize: + case ui::CursorType::kEastWestResize: return IDC_SIZEWE; - case WebCursorInfo::kTypeNorthEastSouthWestResize: + case ui::CursorType::kNorthEastSouthWestResize: return IDC_SIZENESW; - case WebCursorInfo::kTypeNorthWestSouthEastResize: + case ui::CursorType::kNorthWestSouthEastResize: return IDC_SIZENWSE; - case WebCursorInfo::kTypeColumnResize: + case ui::CursorType::kColumnResize: return MAKEINTRESOURCE(IDC_COLRESIZE); - case WebCursorInfo::kTypeRowResize: + case ui::CursorType::kRowResize: return MAKEINTRESOURCE(IDC_ROWRESIZE); - case WebCursorInfo::kTypeMiddlePanning: + case ui::CursorType::kMiddlePanning: return MAKEINTRESOURCE(IDC_PAN_MIDDLE); - case WebCursorInfo::kTypeEastPanning: + case ui::CursorType::kEastPanning: return MAKEINTRESOURCE(IDC_PAN_EAST); - case WebCursorInfo::kTypeNorthPanning: + case ui::CursorType::kNorthPanning: return MAKEINTRESOURCE(IDC_PAN_NORTH); - case WebCursorInfo::kTypeNorthEastPanning: + case ui::CursorType::kNorthEastPanning: return MAKEINTRESOURCE(IDC_PAN_NORTH_EAST); - case WebCursorInfo::kTypeNorthWestPanning: + case ui::CursorType::kNorthWestPanning: return MAKEINTRESOURCE(IDC_PAN_NORTH_WEST); - case WebCursorInfo::kTypeSouthPanning: + case ui::CursorType::kSouthPanning: return MAKEINTRESOURCE(IDC_PAN_SOUTH); - case WebCursorInfo::kTypeSouthEastPanning: + case ui::CursorType::kSouthEastPanning: return MAKEINTRESOURCE(IDC_PAN_SOUTH_EAST); - case WebCursorInfo::kTypeSouthWestPanning: + case ui::CursorType::kSouthWestPanning: return MAKEINTRESOURCE(IDC_PAN_SOUTH_WEST); - case WebCursorInfo::kTypeWestPanning: + case ui::CursorType::kWestPanning: return MAKEINTRESOURCE(IDC_PAN_WEST); - case WebCursorInfo::kTypeMove: + case ui::CursorType::kMove: return IDC_SIZEALL; - case WebCursorInfo::kTypeVerticalText: + case ui::CursorType::kVerticalText: return MAKEINTRESOURCE(IDC_VERTICALTEXT); - case WebCursorInfo::kTypeCell: + case ui::CursorType::kCell: return MAKEINTRESOURCE(IDC_CELL); - case WebCursorInfo::kTypeContextMenu: + case ui::CursorType::kContextMenu: return IDC_ARROW; - case WebCursorInfo::kTypeAlias: + case ui::CursorType::kAlias: return MAKEINTRESOURCE(IDC_ALIAS); - case WebCursorInfo::kTypeProgress: + case ui::CursorType::kProgress: return IDC_APPSTARTING; - case WebCursorInfo::kTypeNoDrop: + case ui::CursorType::kNoDrop: return IDC_NO; - case WebCursorInfo::kTypeCopy: + case ui::CursorType::kCopy: return MAKEINTRESOURCE(IDC_COPYCUR); - case WebCursorInfo::kTypeNone: + case ui::CursorType::kNone: return MAKEINTRESOURCE(IDC_CURSOR_NONE); - case WebCursorInfo::kTypeNotAllowed: + case ui::CursorType::kNotAllowed: return IDC_NO; - case WebCursorInfo::kTypeZoomIn: + case ui::CursorType::kZoomIn: return MAKEINTRESOURCE(IDC_ZOOMIN); - case WebCursorInfo::kTypeZoomOut: + case ui::CursorType::kZoomOut: return MAKEINTRESOURCE(IDC_ZOOMOUT); - case WebCursorInfo::kTypeGrab: + case ui::CursorType::kGrab: return MAKEINTRESOURCE(IDC_HAND_GRAB); - case WebCursorInfo::kTypeGrabbing: + case ui::CursorType::kGrabbing: return MAKEINTRESOURCE(IDC_HAND_GRABBING); - case WebCursorInfo::kTypeCustom: + case ui::CursorType::kNull: + return IDC_NO; + case ui::CursorType::kMiddlePanningVertical: + return MAKEINTRESOURCE(IDC_PAN_MIDDLE_VERTICAL); + case ui::CursorType::kMiddlePanningHorizontal: + return MAKEINTRESOURCE(IDC_PAN_MIDDLE_HORIZONTAL); + // TODO(cef): Find better cursors for these things + case ui::CursorType::kDndNone: + return IDC_ARROW; + case ui::CursorType::kDndMove: + return IDC_ARROW; + case ui::CursorType::kDndCopy: + return IDC_ARROW; + case ui::CursorType::kDndLink: + return IDC_ARROW; + case ui::CursorType::kCustom: break; } NOTREACHED(); @@ -143,7 +158,7 @@ bool IsSystemCursorID(LPCWSTR cursor_id) { } // namespace ui::PlatformCursor CefRenderWidgetHostViewOSR::GetPlatformCursor( - blink::WebCursorInfo::Type type) { + ui::CursorType type) { HMODULE module_handle = NULL; const wchar_t* cursor_id = ToCursorID(type); if (!IsSystemCursorID(cursor_id)) { diff --git a/libcef/browser/osr/software_output_device_proxy.cc b/libcef/browser/osr/software_output_device_proxy.cc index 60088a4ec..d56c2cdeb 100644 --- a/libcef/browser/osr/software_output_device_proxy.cc +++ b/libcef/browser/osr/software_output_device_proxy.cc @@ -65,6 +65,13 @@ void SoftwareOutputDeviceProxy::Resize(const gfx::Size& viewport_pixel_size, return; } + base::UnsafeSharedMemoryRegion region = + base::UnsafeSharedMemoryRegion::Create(required_bytes); + if (!region.IsValid()) { + DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes"; + return; + } + #if !defined(OS_WIN) auto shm = mojo::CreateReadOnlySharedMemoryRegion(required_bytes); if (!shm.IsValid()) { @@ -72,7 +79,7 @@ void SoftwareOutputDeviceProxy::Resize(const gfx::Size& viewport_pixel_size, return; } - shm_ = std::move(shm.mapping); + shm_ = region.Map(); if (!shm_.IsValid()) { DLOG(ERROR) << "Failed to map " << required_bytes << " bytes"; return; @@ -81,27 +88,15 @@ void SoftwareOutputDeviceProxy::Resize(const gfx::Size& viewport_pixel_size, canvas_ = skia::CreatePlatformCanvasWithPixels( viewport_pixel_size_.width(), viewport_pixel_size_.height(), false, static_cast(shm_.memory()), skia::CRASH_ON_FAILURE); - - mojo::ScopedSharedBufferHandle scoped_handle = - mojo::WrapReadOnlySharedMemoryRegion(std::move(shm.region)); #else - base::SharedMemory shm; - if (!shm.CreateAnonymous(required_bytes)) { - DLOG(ERROR) << "Failed to allocate " << required_bytes << " bytes"; - return; - } canvas_ = skia::CreatePlatformCanvasWithSharedSection( viewport_pixel_size_.width(), viewport_pixel_size_.height(), false, - shm.handle().GetHandle(), skia::CRASH_ON_FAILURE); - - // Transfer handle ownership to the browser process. - mojo::ScopedSharedBufferHandle scoped_handle = mojo::WrapSharedMemoryHandle( - shm.GetReadOnlyHandle(), required_bytes, - mojo::UnwrappedSharedMemoryHandleProtection::kReadOnly); + region.GetPlatformHandle(), skia::CRASH_ON_FAILURE); #endif + // Transfer region ownership to the browser process. layered_window_updater_->OnAllocatedSharedMemory(viewport_pixel_size_, - std::move(scoped_handle)); + std::move(region)); } SkCanvas* SoftwareOutputDeviceProxy::BeginPaint(const gfx::Rect& damage_rect) { diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index fac0f2373..e3ef85870 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -240,7 +240,6 @@ std::unique_ptr CreatePrefService(Profile* profile, // Based on ProfileImpl::RegisterProfilePrefs. registry->RegisterFilePathPref(prefs::kDiskCacheDir, cache_path); registry->RegisterIntegerPref(prefs::kDiskCacheSize, 0); - registry->RegisterIntegerPref(prefs::kMediaCacheSize, 0); // Spell checking preferences. // Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs. diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index 9001c940f..3a23fa250 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -134,12 +134,12 @@ void StopWorker(int document_cookie) { return; scoped_refptr queue = g_browser_process->print_job_manager()->queue(); - scoped_refptr printer_query = + std::unique_ptr printer_query = queue->PopPrinterQuery(document_cookie); if (printer_query.get()) { base::PostTaskWithTraits( FROM_HERE, {BrowserThread::IO}, - base::Bind(&PrinterQuery::StopWorker, printer_query)); + base::BindOnce(&PrinterQuery::StopWorker, std::move(printer_query))); } } diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 0997fdd57..1d597ce02 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -79,7 +79,7 @@ CefPrintingMessageFilter::CefPrintingMessageFilter(int render_process_id, ->Subscribe(base::Bind(&CefPrintingMessageFilter::ShutdownOnUIThread, base::Unretained(this))); is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs()); - is_printing_enabled_.MoveToThread( + is_printing_enabled_.MoveToSequence( base::CreateSingleThreadTaskRunnerWithTraits({BrowserThread::IO})); } @@ -124,10 +124,10 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings( reply_msg->routing_id()); #endif - scoped_refptr printer_query; + std::unique_ptr printer_query; if (!is_printing_enabled_.GetValue()) { // Reply with NULL query. - OnGetDefaultPrintSettingsReply(printer_query, reply_msg); + OnGetDefaultPrintSettingsReply(std::move(printer_query), reply_msg); return; } printer_query = queue_->PopPrinterQuery(0); @@ -138,15 +138,16 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettings( // Loads default settings. This is asynchronous, only the IPC message sender // will hang until the settings are retrieved. - printer_query->GetSettings( + auto* printer_query_ptr = printer_query.get(); + printer_query_ptr->GetSettings( PrinterQuery::GetSettingsAskParam::DEFAULTS, 0, false, DEFAULT_MARGINS, false, false, - base::Bind(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply, - this, printer_query, reply_msg)); + base::BindOnce(&CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply, + this, std::move(printer_query), reply_msg)); } void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply( - scoped_refptr printer_query, + std::unique_ptr printer_query, IPC::Message* reply_msg) { PrintMsg_Print_Params params; if (!printer_query.get() || @@ -162,7 +163,7 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply( if (printer_query.get()) { // If user hasn't cancelled. if (printer_query->cookie() && printer_query->settings().dpi()) { - queue_->QueuePrinterQuery(printer_query.get()); + queue_->QueuePrinterQuery(std::move(printer_query)); } else { printer_query->StopWorker(); } @@ -172,7 +173,7 @@ void CefPrintingMessageFilter::OnGetDefaultPrintSettingsReply( void CefPrintingMessageFilter::OnScriptedPrint( const PrintHostMsg_ScriptedPrint_Params& params, IPC::Message* reply_msg) { - scoped_refptr printer_query = + std::unique_ptr printer_query = queue_->PopPrinterQuery(params.cookie); if (!printer_query.get()) { printer_query = @@ -182,12 +183,12 @@ void CefPrintingMessageFilter::OnScriptedPrint( PrinterQuery::GetSettingsAskParam::ASK_USER, params.expected_pages_count, params.has_selection, params.margin_type, params.is_scripted, params.is_modifiable, - base::Bind(&CefPrintingMessageFilter::OnScriptedPrintReply, this, - printer_query, reply_msg)); + base::BindOnce(&CefPrintingMessageFilter::OnScriptedPrintReply, this, + std::move(printer_query), reply_msg)); } void CefPrintingMessageFilter::OnScriptedPrintReply( - scoped_refptr printer_query, + std::unique_ptr printer_query, IPC::Message* reply_msg) { PrintMsg_PrintPages_Params params; if (printer_query->last_status() != PrintingContext::OK || @@ -201,7 +202,7 @@ void CefPrintingMessageFilter::OnScriptedPrintReply( PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params); Send(reply_msg); if (!params.params.dpi.IsEmpty() && params.params.document_cookie) { - queue_->QueuePrinterQuery(printer_query.get()); + queue_->QueuePrinterQuery(std::move(printer_query)); } else { printer_query->StopWorker(); } @@ -210,10 +211,10 @@ void CefPrintingMessageFilter::OnScriptedPrintReply( void CefPrintingMessageFilter::OnUpdatePrintSettings(int document_cookie, base::Value job_settings, IPC::Message* reply_msg) { - scoped_refptr printer_query; + std::unique_ptr printer_query; if (!is_printing_enabled_.GetValue()) { // Reply with NULL query. - OnUpdatePrintSettingsReply(printer_query, reply_msg); + OnUpdatePrintSettingsReply(std::move(printer_query), reply_msg); return; } printer_query = queue_->PopPrinterQuery(document_cookie); @@ -223,12 +224,12 @@ void CefPrintingMessageFilter::OnUpdatePrintSettings(int document_cookie, } printer_query->SetSettings( std::move(job_settings), - base::Bind(&CefPrintingMessageFilter::OnUpdatePrintSettingsReply, this, - printer_query, reply_msg)); + base::BindOnce(&CefPrintingMessageFilter::OnUpdatePrintSettingsReply, + this, std::move(printer_query), reply_msg)); } void CefPrintingMessageFilter::OnUpdatePrintSettingsReply( - scoped_refptr printer_query, + std::unique_ptr printer_query, IPC::Message* reply_msg) { PrintMsg_PrintPages_Params params; if (!printer_query.get() || @@ -247,7 +248,7 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply( // If user hasn't cancelled. if (printer_query.get()) { if (printer_query->cookie() && printer_query->settings().dpi()) { - queue_->QueuePrinterQuery(printer_query.get()); + queue_->QueuePrinterQuery(std::move(printer_query)); } else { printer_query->StopWorker(); } diff --git a/libcef/browser/printing/printing_message_filter.h b/libcef/browser/printing/printing_message_filter.h index a71bfb0a1..d6d889b01 100644 --- a/libcef/browser/printing/printing_message_filter.h +++ b/libcef/browser/printing/printing_message_filter.h @@ -49,15 +49,16 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter { // Get the default print setting. void OnGetDefaultPrintSettings(IPC::Message* reply_msg); - void OnGetDefaultPrintSettingsReply(scoped_refptr printer_query, - IPC::Message* reply_msg); + void OnGetDefaultPrintSettingsReply( + std::unique_ptr printer_query, + IPC::Message* reply_msg); // The renderer host have to show to the user the print dialog and returns // the selected print settings. The task is handled by the print worker // thread and the UI thread. The reply occurs on the IO thread. void OnScriptedPrint(const PrintHostMsg_ScriptedPrint_Params& params, IPC::Message* reply_msg); - void OnScriptedPrintReply(scoped_refptr printer_query, + void OnScriptedPrintReply(std::unique_ptr printer_query, IPC::Message* reply_msg); // Modify the current print settings based on |job_settings|. The task is @@ -66,7 +67,7 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter { void OnUpdatePrintSettings(int document_cookie, base::Value job_settings, IPC::Message* reply_msg); - void OnUpdatePrintSettingsReply(scoped_refptr printer_query, + void OnUpdatePrintSettingsReply(std::unique_ptr printer_query, IPC::Message* reply_msg); // Check to see if print preview has been cancelled. diff --git a/libcef/browser/server_impl.cc b/libcef/browser/server_impl.cc index a42fa232d..b978f99f6 100644 --- a/libcef/browser/server_impl.cc +++ b/libcef/browser/server_impl.cc @@ -237,7 +237,7 @@ void CefServerImpl::SendHttp404Response(int connection_id) { return; } - server_->Send404(connection_id, NO_TRAFFIC_ANNOTATION_YET); + server_->Send404(connection_id, MISSING_TRAFFIC_ANNOTATION); server_->Close(connection_id); } @@ -262,7 +262,7 @@ void CefServerImpl::SendHttp500Response(int connection_id, return; } - server_->Send500(connection_id, error_message, NO_TRAFFIC_ANNOTATION_YET); + server_->Send500(connection_id, error_message, MISSING_TRAFFIC_ANNOTATION); server_->Close(connection_id); } @@ -305,7 +305,7 @@ void CefServerImpl::SendHttpResponse(int connection_id, base::StringPrintf("%" PRIuS, static_cast(content_length))); } - server_->SendResponse(connection_id, response, NO_TRAFFIC_ANNOTATION_YET); + server_->SendResponse(connection_id, response, MISSING_TRAFFIC_ANNOTATION); if (content_length == 0) { server_->Close(connection_id); } @@ -367,7 +367,7 @@ void CefServerImpl::ContinueWebSocketRequest( if (allow) { server_->AcceptWebSocket(connection_id, request_info, - NO_TRAFFIC_ANNOTATION_YET); + MISSING_TRAFFIC_ANNOTATION); handler_->OnWebSocketConnected(this, connection_id); } else { server_->Close(connection_id); @@ -399,7 +399,7 @@ void CefServerImpl::SendHttp200ResponseInternal( } server_->Send200(connection_id, *data, content_type, - NO_TRAFFIC_ANNOTATION_YET); + MISSING_TRAFFIC_ANNOTATION); server_->Close(connection_id); } @@ -418,7 +418,7 @@ void CefServerImpl::SendRawDataInternal(int connection_id, if (!GetConnectionInfo(connection_id)) return; - server_->SendRaw(connection_id, *data, NO_TRAFFIC_ANNOTATION_YET); + server_->SendRaw(connection_id, *data, MISSING_TRAFFIC_ANNOTATION); } void CefServerImpl::SendWebSocketMessageInternal( @@ -444,7 +444,7 @@ void CefServerImpl::SendWebSocketMessageInternal( return; } - server_->SendOverWebSocket(connection_id, *data, NO_TRAFFIC_ANNOTATION_YET); + server_->SendOverWebSocket(connection_id, *data, MISSING_TRAFFIC_ANNOTATION); } void CefServerImpl::OnConnect(int connection_id) { diff --git a/libcef/browser/ssl_host_state_delegate.cc b/libcef/browser/ssl_host_state_delegate.cc index 07a8966aa..67c44332b 100644 --- a/libcef/browser/ssl_host_state_delegate.cc +++ b/libcef/browser/ssl_host_state_delegate.cc @@ -50,7 +50,7 @@ void CefSSLHostStateDelegate::HostRanInsecureContent( bool CefSSLHostStateDelegate::DidHostRunInsecureContent( const std::string& host, int child_id, - InsecureContentType content_type) const { + InsecureContentType content_type) { // Intentional no-op. return false; } @@ -94,7 +94,7 @@ void CefSSLHostStateDelegate::RevokeUserAllowExceptions( cert_policy_for_host_.erase(host); } -bool CefSSLHostStateDelegate::HasAllowException(const std::string& host) const { +bool CefSSLHostStateDelegate::HasAllowException(const std::string& host) { auto policy_iterator = cert_policy_for_host_.find(host); return policy_iterator != cert_policy_for_host_.end() && policy_iterator->second.HasAllowException(); diff --git a/libcef/browser/ssl_host_state_delegate.h b/libcef/browser/ssl_host_state_delegate.h index 40bdec88f..f8c3c57cd 100644 --- a/libcef/browser/ssl_host_state_delegate.h +++ b/libcef/browser/ssl_host_state_delegate.h @@ -60,12 +60,11 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override; - bool DidHostRunInsecureContent( - const std::string& host, - int child_id, - InsecureContentType content_type) const override; + bool DidHostRunInsecureContent(const std::string& host, + int child_id, + InsecureContentType content_type) override; void RevokeUserAllowExceptions(const std::string& host) override; - bool HasAllowException(const std::string& host) const override; + bool HasAllowException(const std::string& host) override; private: // Certificate policies for each host. diff --git a/libcef/browser/views/box_layout_impl.cc b/libcef/browser/views/box_layout_impl.cc index a588d5fda..42e375fbe 100644 --- a/libcef/browser/views/box_layout_impl.cc +++ b/libcef/browser/views/box_layout_impl.cc @@ -54,8 +54,8 @@ CefBoxLayoutImpl::CefBoxLayoutImpl(const CefBoxLayoutSettings& settings) views::BoxLayout* CefBoxLayoutImpl::CreateLayout() { views::BoxLayout* layout = new views::BoxLayout( - settings_.horizontal ? views::BoxLayout::kHorizontal - : views::BoxLayout::kVertical, + settings_.horizontal ? views::BoxLayout::Orientation::kHorizontal + : views::BoxLayout::Orientation::kVertical, gfx::Insets(settings_.inside_border_vertical_spacing, settings_.inside_border_horizontal_spacing), settings_.between_child_spacing); diff --git a/libcef/browser/views/window_impl.cc b/libcef/browser/views/window_impl.cc index 20cadc071..9c2ec6856 100644 --- a/libcef/browser/views/window_impl.cc +++ b/libcef/browser/views/window_impl.cc @@ -178,14 +178,17 @@ void CefWindowImpl::BringToTop() { void CefWindowImpl::SetAlwaysOnTop(bool on_top) { CEF_REQUIRE_VALID_RETURN_VOID(); - if (widget_ && on_top != widget_->IsAlwaysOnTop()) - widget_->SetAlwaysOnTop(on_top); + if (widget_ && on_top != (widget_->GetZOrderLevel() == + ui::ZOrderLevel::kFloatingWindow)) { + widget_->SetZOrderLevel(on_top ? ui::ZOrderLevel::kFloatingWindow + : ui::ZOrderLevel::kNormal); + } } bool CefWindowImpl::IsAlwaysOnTop() { CEF_REQUIRE_VALID_RETURN(false); if (widget_) - return widget_->IsAlwaysOnTop(); + return widget_->GetZOrderLevel() == ui::ZOrderLevel::kFloatingWindow; return false; } diff --git a/libcef/common/base_impl.cc b/libcef/common/base_impl.cc index 8228fb427..085cbd326 100644 --- a/libcef/common/base_impl.cc +++ b/libcef/common/base_impl.cc @@ -82,9 +82,10 @@ CEF_EXPORT void cef_trace_event_begin(const char* /* category */, if (copy) { if (arg1_name == NULL && arg2_name == NULL) { - TRACE_EVENT_COPY_BEGIN0(kCategory, name); + TRACE_EVENT_BEGIN_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY); } else if (arg2_name == NULL) { - TRACE_EVENT_COPY_BEGIN1(kCategory, name, arg1_name, arg1_val); + TRACE_EVENT_BEGIN_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY, + arg1_name, arg1_val); } else { TRACE_EVENT_COPY_BEGIN2(kCategory, name, arg1_name, arg1_val, arg2_name, arg2_val); @@ -114,9 +115,10 @@ CEF_EXPORT void cef_trace_event_end(const char* /* category */, if (copy) { if (arg1_name == NULL && arg2_name == NULL) { - TRACE_EVENT_COPY_END0(kCategory, name); + TRACE_EVENT_END_WITH_FLAGS0(kCategory, name, TRACE_EVENT_FLAG_COPY); } else if (arg2_name == NULL) { - TRACE_EVENT_COPY_END1(kCategory, name, arg1_name, arg1_val); + TRACE_EVENT_END_WITH_FLAGS1(kCategory, name, TRACE_EVENT_FLAG_COPY, + arg1_name, arg1_val); } else { TRACE_EVENT_COPY_END2(kCategory, name, arg1_name, arg1_val, arg2_name, arg2_val); diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index e01ece7fe..504d22402 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -188,7 +188,8 @@ CefContentClient::CefContentClient(CefRefPtr application) : application_(application), pack_loading_disabled_(false), allow_pack_file_load_(false), - scheme_info_list_locked_(false) { + scheme_info_list_locked_(false), + resource_bundle_delegate_(this) { DCHECK(!g_content_client); g_content_client = this; } @@ -236,7 +237,7 @@ void CefContentClient::AddAdditionalSchemes(Schemes* schemes) { scheme_info_list_locked_ = true; } -base::string16 CefContentClient::GetLocalizedString(int message_id) const { +base::string16 CefContentClient::GetLocalizedString(int message_id) { base::string16 value = ui::ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); if (value.empty()) @@ -247,7 +248,7 @@ base::string16 CefContentClient::GetLocalizedString(int message_id) const { base::string16 CefContentClient::GetLocalizedString( int message_id, - const base::string16& replacement) const { + const base::string16& replacement) { base::string16 value = l10n_util::GetStringFUTF16(message_id, replacement); if (value.empty()) LOG(ERROR) << "No localized string available for id " << message_id; @@ -257,7 +258,7 @@ base::string16 CefContentClient::GetLocalizedString( base::StringPiece CefContentClient::GetDataResource( int resource_id, - ui::ScaleFactor scale_factor) const { + ui::ScaleFactor scale_factor) { base::StringPiece value = ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); @@ -268,7 +269,7 @@ base::StringPiece CefContentClient::GetDataResource( } base::RefCountedMemory* CefContentClient::GetDataResourceBytes( - int resource_id) const { + int resource_id) { base::RefCountedMemory* value = ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( resource_id); @@ -278,11 +279,11 @@ base::RefCountedMemory* CefContentClient::GetDataResourceBytes( return value; } -bool CefContentClient::IsDataResourceGzipped(int resource_id) const { +bool CefContentClient::IsDataResourceGzipped(int resource_id) { return ui::ResourceBundle::GetSharedInstance().IsGzipped(resource_id); } -gfx::Image& CefContentClient::GetNativeImageNamed(int resource_id) const { +gfx::Image& CefContentClient::GetNativeImageNamed(int resource_id) { gfx::Image& value = ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); if (value.IsEmpty()) @@ -329,73 +330,3 @@ void CefContentClient::SetPDFEntryFunctions( g_pdf_initialize_module = initialize_module; g_pdf_shutdown_module = shutdown_module; } - -base::FilePath CefContentClient::GetPathForResourcePack( - const base::FilePath& pack_path, - ui::ScaleFactor scale_factor) { - // Only allow the cef pack file to load. - if (!pack_loading_disabled_ && allow_pack_file_load_) - return pack_path; - return base::FilePath(); -} - -base::FilePath CefContentClient::GetPathForLocalePack( - const base::FilePath& pack_path, - const std::string& locale) { - if (!pack_loading_disabled_) - return pack_path; - return base::FilePath(); -} - -gfx::Image CefContentClient::GetImageNamed(int resource_id) { - return gfx::Image(); -} - -gfx::Image CefContentClient::GetNativeImageNamed(int resource_id) { - return gfx::Image(); -} - -base::RefCountedStaticMemory* CefContentClient::LoadDataResourceBytes( - int resource_id, - ui::ScaleFactor scale_factor) { - return NULL; -} - -bool CefContentClient::GetRawDataResource(int resource_id, - ui::ScaleFactor scale_factor, - base::StringPiece* value) { - if (application_.get()) { - CefRefPtr handler = - application_->GetResourceBundleHandler(); - if (handler.get()) { - void* data = NULL; - size_t data_size = 0; - if (scale_factor != ui::SCALE_FACTOR_NONE) { - if (handler->GetDataResourceForScale( - resource_id, static_cast(scale_factor), - data, data_size)) { - *value = base::StringPiece(static_cast(data), data_size); - } - } else if (handler->GetDataResource(resource_id, data, data_size)) { - *value = base::StringPiece(static_cast(data), data_size); - } - } - } - - return (pack_loading_disabled_ || !value->empty()); -} - -bool CefContentClient::GetLocalizedString(int message_id, - base::string16* value) { - if (application_.get()) { - CefRefPtr handler = - application_->GetResourceBundleHandler(); - if (handler.get()) { - CefString cef_str; - if (handler->GetLocalizedString(message_id, cef_str)) - *value = cef_str; - } - } - - return (pack_loading_disabled_ || !value->empty()); -} diff --git a/libcef/common/content_client.h b/libcef/common/content_client.h index 86d03e2d8..65f1a3371 100644 --- a/libcef/common/content_client.h +++ b/libcef/common/content_client.h @@ -12,15 +12,14 @@ #include #include "include/cef_app.h" +#include "libcef/common/resource_bundle_delegate.h" #include "base/compiler_specific.h" #include "content/public/common/content_client.h" #include "content/public/common/pepper_plugin_info.h" -#include "ui/base/resource/resource_bundle.h" #include "url/url_util.h" -class CefContentClient : public content::ContentClient, - public ui::ResourceBundle::Delegate { +class CefContentClient : public content::ContentClient { public: static const char kPDFPluginPath[]; @@ -37,16 +36,14 @@ class CefContentClient : public content::ContentClient, std::vector* cdms, std::vector* cdm_host_file_paths) override; void AddAdditionalSchemes(Schemes* schemes) override; - base::string16 GetLocalizedString(int message_id) const override; - base::string16 GetLocalizedString( - int message_id, - const base::string16& replacement) const override; - base::StringPiece GetDataResource( - int resource_id, - ui::ScaleFactor scale_factor) const override; - base::RefCountedMemory* GetDataResourceBytes(int resource_id) const override; - bool IsDataResourceGzipped(int resource_id) const override; - gfx::Image& GetNativeImageNamed(int resource_id) const override; + base::string16 GetLocalizedString(int message_id) override; + base::string16 GetLocalizedString(int message_id, + const base::string16& replacement) override; + base::StringPiece GetDataResource(int resource_id, + ui::ScaleFactor scale_factor) override; + base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; + bool IsDataResourceGzipped(int resource_id) override; + gfx::Image& GetNativeImageNamed(int resource_id) override; // Values are registered with all processes (url/url_util.h) and with Blink // (SchemeRegistry) unless otherwise indicated. @@ -104,28 +101,18 @@ class CefContentClient : public content::ContentClient, void set_pack_loading_disabled(bool val) { pack_loading_disabled_ = val; } bool pack_loading_disabled() const { return pack_loading_disabled_; } void set_allow_pack_file_load(bool val) { allow_pack_file_load_ = val; } + bool allow_pack_file_load() { return allow_pack_file_load_; } static void SetPDFEntryFunctions( content::PepperPluginInfo::GetInterfaceFunc get_interface, content::PepperPluginInfo::PPP_InitializeModuleFunc initialize_module, content::PepperPluginInfo::PPP_ShutdownModuleFunc shutdown_module); - private: - // ui::ResourceBundle::Delegate methods. - base::FilePath GetPathForResourcePack(const base::FilePath& pack_path, - ui::ScaleFactor scale_factor) override; - base::FilePath GetPathForLocalePack(const base::FilePath& pack_path, - const std::string& locale) override; - gfx::Image GetImageNamed(int resource_id) override; - gfx::Image GetNativeImageNamed(int resource_id) override; - base::RefCountedStaticMemory* LoadDataResourceBytes( - int resource_id, - ui::ScaleFactor scale_factor) override; - bool GetRawDataResource(int resource_id, - ui::ScaleFactor scale_factor, - base::StringPiece* value) override; - bool GetLocalizedString(int message_id, base::string16* value) override; + CefResourceBundleDelegate* GetCefResourceBundleDelegate() { + return &resource_bundle_delegate_; + } + private: CefRefPtr application_; bool pack_loading_disabled_; bool allow_pack_file_load_; @@ -133,6 +120,8 @@ class CefContentClient : public content::ContentClient, // Custom schemes handled by the client. SchemeInfoList scheme_info_list_; bool scheme_info_list_locked_; + + CefResourceBundleDelegate resource_bundle_delegate_; }; #endif // CEF_LIBCEF_COMMON_CONTENT_CLIENT_H_ diff --git a/libcef/common/extensions/api/_api_features.json b/libcef/common/extensions/api/_api_features.json index 565166262..551fe2864 100644 --- a/libcef/common/extensions/api/_api_features.json +++ b/libcef/common/extensions/api/_api_features.json @@ -22,19 +22,21 @@ "channel": "stable", "matches": [""] }, - "resourcesPrivate": [{ - "dependencies": ["permission:resourcesPrivate"], - "contexts": ["blessed_extension"] - }, { - "channel": "stable", - "contexts": ["webui"], - "matches": [ - "chrome://print/*" - ] - }], + "resourcesPrivate": [ + { + "dependencies": ["permission:resourcesPrivate"], + "contexts": ["blessed_extension"] + }, + { + "channel": "stable", + "contexts": ["webui"], + "matches": ["chrome://print/*"] + } + ], "tabs": { "channel": "stable", "extension_types": ["extension", "legacy_packaged_app"], - "contexts": ["blessed_extension", "extension_service_worker"] + "contexts": ["blessed_extension"], + "disallow_for_service_workers": false } } diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index bd8c5ce97..d14ae4137 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -599,6 +599,13 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) { features::kMimeHandlerViewInCrossProcessFrame.name); } + if (features::kAudioServiceAudioStreams.default_state == + base::FEATURE_ENABLED_BY_DEFAULT) { + // TODO: Add support for audio service (see issue #2755) + disable_features.push_back( + features::kAudioServiceAudioStreams.name); + } + if (!disable_features.empty()) { DCHECK(!base::FeatureList::GetInstance()); std::string disable_features_str = @@ -862,7 +869,8 @@ void CefMainDelegate::InitializeResourceBundle() { const std::string loaded_locale = ui::ResourceBundle::InitSharedInstanceWithLocale( - locale, &content_client_, ui::ResourceBundle::LOAD_COMMON_RESOURCES); + locale, content_client_.GetCefResourceBundleDelegate(), + ui::ResourceBundle::LOAD_COMMON_RESOURCES); if (!loaded_locale.empty() && g_browser_process) g_browser_process->SetApplicationLocale(loaded_locale); diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc new file mode 100644 index 000000000..96ef23cef --- /dev/null +++ b/libcef/common/resource_bundle_delegate.cc @@ -0,0 +1,75 @@ +#include "libcef/common/resource_bundle_delegate.h" + +#include "libcef/common/content_client.h" + +base::FilePath CefResourceBundleDelegate::GetPathForResourcePack( + const base::FilePath& pack_path, + ui::ScaleFactor scale_factor) { + // Only allow the cef pack file to load. + if (!content_client_->pack_loading_disabled() && + content_client_->allow_pack_file_load()) { + return pack_path; + } + return base::FilePath(); +} + +base::FilePath CefResourceBundleDelegate::GetPathForLocalePack( + const base::FilePath& pack_path, + const std::string& locale) { + if (!content_client_->pack_loading_disabled()) + return pack_path; + return base::FilePath(); +} + +gfx::Image CefResourceBundleDelegate::GetImageNamed(int resource_id) { + return gfx::Image(); +} + +gfx::Image CefResourceBundleDelegate::GetNativeImageNamed(int resource_id) { + return gfx::Image(); +} + +base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes( + int resource_id, + ui::ScaleFactor scale_factor) { + return NULL; +} + +bool CefResourceBundleDelegate::GetRawDataResource(int resource_id, + ui::ScaleFactor scale_factor, + base::StringPiece* value) { + if (content_client_->application().get()) { + CefRefPtr handler = + content_client_->application()->GetResourceBundleHandler(); + if (handler.get()) { + void* data = NULL; + size_t data_size = 0; + if (scale_factor != ui::SCALE_FACTOR_NONE) { + if (handler->GetDataResourceForScale( + resource_id, static_cast(scale_factor), + data, data_size)) { + *value = base::StringPiece(static_cast(data), data_size); + } + } else if (handler->GetDataResource(resource_id, data, data_size)) { + *value = base::StringPiece(static_cast(data), data_size); + } + } + } + + return (content_client_->pack_loading_disabled() || !value->empty()); +} + +bool CefResourceBundleDelegate::GetLocalizedString(int message_id, + base::string16* value) { + if (content_client_->application().get()) { + CefRefPtr handler = + content_client_->application()->GetResourceBundleHandler(); + if (handler.get()) { + CefString cef_str; + if (handler->GetLocalizedString(message_id, cef_str)) + *value = cef_str; + } + } + + return (content_client_->pack_loading_disabled() || !value->empty()); +} diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h new file mode 100644 index 000000000..ca6d5fd7c --- /dev/null +++ b/libcef/common/resource_bundle_delegate.h @@ -0,0 +1,39 @@ +// Copyright 2019 The Chromium Embedded Framework Authors. +// Portions copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_ +#define CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_ +#pragma once + +#include "ui/base/resource/resource_bundle.h" + +class CefContentClient; + +class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { + public: + CefResourceBundleDelegate(CefContentClient* content_client) + : content_client_(content_client) {} + + private: + // ui::ResourceBundle::Delegate methods. + base::FilePath GetPathForResourcePack(const base::FilePath& pack_path, + ui::ScaleFactor scale_factor) override; + base::FilePath GetPathForLocalePack(const base::FilePath& pack_path, + const std::string& locale) override; + gfx::Image GetImageNamed(int resource_id) override; + gfx::Image GetNativeImageNamed(int resource_id) override; + base::RefCountedStaticMemory* LoadDataResourceBytes( + int resource_id, + ui::ScaleFactor scale_factor) override; + bool GetRawDataResource(int resource_id, + ui::ScaleFactor scale_factor, + base::StringPiece* value) override; + bool GetLocalizedString(int message_id, base::string16* value) override; + + private: + CefContentClient* content_client_; +}; + +#endif // CEF_LIBCEF_COMMON_RESOURCE_BUNDLE_DELEGATE_H_ diff --git a/libcef/common/service_manifests/builtin_service_manifests.cc b/libcef/common/service_manifests/builtin_service_manifests.cc index b2c7af66e..283383cbf 100644 --- a/libcef/common/service_manifests/builtin_service_manifests.cc +++ b/libcef/common/service_manifests/builtin_service_manifests.cc @@ -14,7 +14,7 @@ #include "components/startup_metric_utils/common/startup_metric.mojom.h" #include "extensions/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h" -#include "services/proxy_resolver/public/cpp/manifest.h" +#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #include "services/service_manager/public/cpp/manifest_builder.h" #if defined(OS_MACOSX) @@ -56,7 +56,6 @@ const service_manager::Manifest& GetCefManifest() { const std::vector& GetBuiltinServiceManifests() { static base::NoDestructor> manifests{{ GetCefManifest(), - proxy_resolver::GetManifest(), printing::GetPdfCompositorManifest(), GetChromePrintingManifest(), }}; diff --git a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc b/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc index 4e0125df8..91f2a3559 100644 --- a/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc +++ b/libcef/common/service_manifests/cef_content_browser_overlay_manifest.cc @@ -11,7 +11,7 @@ #include "components/services/heap_profiling/public/mojom/heap_profiling_client.mojom.h" #include "extensions/buildflags/buildflags.h" #include "extensions/common/api/mime_handler.mojom.h" // nogncheck -#include "extensions/common/mojo/keep_alive.mojom.h" // nogncheck +#include "extensions/common/mojom/keep_alive.mojom.h" // nogncheck #include "services/service_manager/public/cpp/manifest_builder.h" #if defined(OS_WIN) diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index aeea980f2..8f2f926f3 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -121,6 +121,14 @@ void CefExtensionsRendererClient::OnExtensionUnloaded( resource_request_policy_->OnExtensionUnloaded(extension_id); } +bool CefExtensionsRendererClient::ExtensionAPIEnabledForServiceWorkerScript( + const GURL& scope, + const GURL& script_url) const { + // TODO(extensions): Implement to support background sevice worker scripts + // in extensions + return false; +} + void CefExtensionsRendererClient::RenderThreadStarted() { content::RenderThread* thread = content::RenderThread::Get(); diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index 68c20c78a..c2f95763a 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -51,6 +51,9 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { void OnExtensionLoaded(const extensions::Extension& extension) override; void OnExtensionUnloaded( const extensions::ExtensionId& extension_id) override; + bool ExtensionAPIEnabledForServiceWorkerScript( + const GURL& scope, + const GURL& script_url) const override; // See CefContentRendererClient methods with the same names. void RenderThreadStarted(); diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index 17df9e36b..73a5428e0 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -50,7 +50,7 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient { int64_t total_encoded_body_length, int64_t total_decoded_body_length, bool should_report_corb_blocking, - const std::vector&) override; + const blink::WebVector&) override; void DidFail(const WebURLError&, int64_t total_encoded_data_length, int64_t total_encoded_body_length, @@ -117,6 +117,7 @@ class CefRenderURLRequest::Context WebURLRequest urlRequest; static_cast(request_.get()) ->Get(urlRequest, upload_data_size_); + urlRequest.SetPriority(blink::WebURLRequest::Priority::kMedium); // Set the origin to match the request. The requirement for an origin is // DCHECK'd in ResourceDispatcherHostImpl::ContinuePendingBeginRequest. @@ -379,7 +380,7 @@ void CefWebURLLoaderClient::DidFinishLoading( int64_t total_encoded_body_length, int64_t total_decoded_body_length, bool should_report_corb_blocking, - const std::vector&) { + const blink::WebVector&) { context_->OnComplete(); } diff --git a/libcef/utility/content_utility_client.cc b/libcef/utility/content_utility_client.cc index 3ef26c06a..427c1fcfd 100644 --- a/libcef/utility/content_utility_client.cc +++ b/libcef/utility/content_utility_client.cc @@ -11,15 +11,15 @@ #include "chrome/services/printing/printing_service.h" #include "chrome/services/printing/public/mojom/constants.mojom.h" #include "components/services/pdf_compositor/public/cpp/pdf_compositor_service_factory.h" -#include "components/services/pdf_compositor/public/interfaces/pdf_compositor.mojom.h" +#include "components/services/pdf_compositor/public/mojom/pdf_compositor.mojom.h" #include "content/public/child/child_thread.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/simple_connection_filter.h" #include "content/public/utility/utility_thread.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "services/network/url_request_context_builder_mojo.h" -#include "services/proxy_resolver/proxy_resolver_service.h" // nogncheck -#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" // nogncheck +#include "services/proxy_resolver/proxy_resolver_factory_impl.h" // nogncheck +#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" #include "services/service_manager/public/cpp/binder_registry.h" #if defined(OS_WIN) @@ -34,31 +34,6 @@ void RunServiceAsyncThenTerminateProcess( base::BindOnce([] { content::UtilityThread::Get()->ReleaseProcess(); })); } -#if !defined(OS_ANDROID) -std::unique_ptr CreateProxyResolverService( - service_manager::mojom::ServiceRequest request) { - return std::make_unique( - std::move(request)); -} -#endif - -using ServiceFactory = - base::OnceCallback()>; -void RunServiceOnIOThread(ServiceFactory factory) { - base::OnceClosure terminate_process = base::BindOnce( - base::IgnoreResult(&base::SequencedTaskRunner::PostTask), - base::SequencedTaskRunnerHandle::Get(), FROM_HERE, - base::BindOnce([] { content::UtilityThread::Get()->ReleaseProcess(); })); - content::ChildThread::Get()->GetIOTaskRunner()->PostTask( - FROM_HERE, - base::BindOnce( - [](ServiceFactory factory, base::OnceClosure terminate_process) { - service_manager::Service::RunAsyncUntilTermination( - std::move(factory).Run(), std::move(terminate_process)); - }, - std::move(factory), std::move(terminate_process))); -} - } // namespace CefContentUtilityClient::CefContentUtilityClient() { @@ -95,6 +70,16 @@ bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) { return handled; } +void CefContentUtilityClient::RunIOThreadService( + mojo::GenericPendingReceiver* receiver) { + if (auto factory_receiver = + receiver->As()) { + static base::NoDestructor factory( + std::move(factory_receiver)); + return; + } +} + std::unique_ptr CefContentUtilityClient::MaybeCreateMainThreadService( const std::string& service_name, @@ -111,11 +96,6 @@ CefContentUtilityClient::MaybeCreateMainThreadService( bool CefContentUtilityClient::HandleServiceRequest( const std::string& service_name, service_manager::mojom::ServiceRequest request) { - if (service_name == proxy_resolver::mojom::kProxyResolverServiceName) { - RunServiceOnIOThread( - base::BindOnce(&CreateProxyResolverService, std::move(request))); - return true; - } auto service = MaybeCreateMainThreadService(service_name, std::move(request)); if (service) { RunServiceAsyncThenTerminateProcess(std::move(service)); diff --git a/libcef/utility/content_utility_client.h b/libcef/utility/content_utility_client.h index 3b3ab4953..beb325d23 100644 --- a/libcef/utility/content_utility_client.h +++ b/libcef/utility/content_utility_client.h @@ -27,6 +27,7 @@ class CefContentUtilityClient : public content::ContentUtilityClient { bool HandleServiceRequest( const std::string& service_name, service_manager::mojom::ServiceRequest request) override; + void RunIOThreadService(mojo::GenericPendingReceiver* receiver) override; private: std::unique_ptr MaybeCreateMainThreadService( diff --git a/patch/patch.cfg b/patch/patch.cfg index 8502cae70..952cfea12 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -157,13 +157,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/1501 'name': 'font_family_cache_1501', }, - { - # Fix crash while printing on Windows by properly initializing V8 in the PDF - # module. - # https://bugs.chromium.org/p/chromium/issues/detail?id=549365#c17 - 'name': 'pdfium_print_549365', - 'path': 'third_party/pdfium/', - }, { # Modify views::View to extend SupportsUserData. # https://bitbucket.org/chromiumembedded/cef/issues/1749 @@ -404,11 +397,6 @@ patches = [ # http://crrev.com/3955c9f9eb 'name': 'set_resize_background_color', }, - { - # Remove requirement that enforces component builds - # http://crrev.com/567d828446 - 'name': 'remove_component_build_check', - }, { # Restore WebUrlLoader Cancel method. # https://chromium-review.googlesource.com/c/chromium/src/+/1617042 @@ -442,5 +430,11 @@ patches = [ # - Remove unsupported print preview UI options. # https://bitbucket.org/chromiumembedded/cef/issues/123 'name': 'print_preview_123', + }, + { + # Fix execution of OnAccessibilityLocationChange by adding the following + # Chromium change: + # https://chromium.googlesource.com/chromium/src/+/7952ae45c4 + 'name': 'render_accessibility_1675917', } ] diff --git a/patch/patches/base_value_646113.patch b/patch/patches/base_value_646113.patch index a65916bad..8e1a6436b 100644 --- a/patch/patches/base_value_646113.patch +++ b/patch/patches/base_value_646113.patch @@ -1,5 +1,5 @@ diff --git base/values.cc base/values.cc -index 03acb86bbc04..b65a6d542987 100644 +index 7d042cdcd459..09eb01af5745 100644 --- base/values.cc +++ base/values.cc @@ -23,20 +23,6 @@ diff --git a/patch/patches/browser_child_frame_2507.patch b/patch/patches/browser_child_frame_2507.patch index 6cacb1939..03aaad799 100644 --- a/patch/patches/browser_child_frame_2507.patch +++ b/patch/patches/browser_child_frame_2507.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc -index a04ca1926622..705cc77ccee0 100644 +index fbb86a38a7ac..bd1c70e53371 100644 --- content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ content/browser/renderer_host/render_widget_host_view_child_frame.cc -@@ -614,6 +614,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame( +@@ -613,6 +613,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame( "RenderWidgetHostViewChildFrame::OnSwapCompositorFrame"); support_->SubmitCompositorFrame(local_surface_id, std::move(frame), std::move(hit_test_region_list)); @@ -10,7 +10,7 @@ index a04ca1926622..705cc77ccee0 100644 } void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame( -@@ -622,6 +623,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame( +@@ -621,6 +622,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame( support_->DidNotProduceFrame(ack); } @@ -26,7 +26,7 @@ index a04ca1926622..705cc77ccee0 100644 void RenderWidgetHostViewChildFrame::TransformPointToRootSurface( gfx::PointF* point) { // This function is called by RenderWidgetHostInputEventRouter only for -@@ -806,6 +816,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() { +@@ -818,6 +828,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() { void RenderWidgetHostViewChildFrame::SpeakSelection() {} #endif // defined(OS_MACOSX) diff --git a/patch/patches/browser_plugin_guest_1565.patch b/patch/patches/browser_plugin_guest_1565.patch index f48da2333..01116777b 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 dfd38d5252a5..6c178ff2a8f4 100644 +index ddb17ac729df..255d2ec9729d 100644 --- content/browser/browser_plugin/browser_plugin_guest.cc +++ content/browser/browser_plugin/browser_plugin_guest.cc -@@ -308,8 +308,11 @@ void BrowserPluginGuest::InitInternal( +@@ -307,8 +307,11 @@ void BrowserPluginGuest::InitInternal( static_cast(GetWebContents()->GetView()); } @@ -15,7 +15,7 @@ index dfd38d5252a5..6c178ff2a8f4 100644 // Once a BrowserPluginGuest has an embedder WebContents, it's considered to // be attached. -@@ -822,10 +825,19 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -821,10 +824,19 @@ void BrowserPluginGuest::OnWillAttachComplete( static_cast(GetWebContents()->GetView()); if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { web_contents_view->CreateViewForWidget( @@ -37,10 +37,10 @@ index dfd38d5252a5..6c178ff2a8f4 100644 attached_ = true; diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc -index 106239c65d0e..b3b3121dec54 100644 +index 875ec8ce299b..a8e1119d4b03 100644 --- content/browser/frame_host/interstitial_page_impl.cc +++ content/browser/frame_host/interstitial_page_impl.cc -@@ -632,7 +632,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { +@@ -624,7 +624,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { WebContentsView* wcv = static_cast(web_contents())->GetView(); RenderWidgetHostViewBase* view = @@ -79,10 +79,10 @@ index bfb918a2cba3..a193b5a0fed8 100644 // Creates a new View that holds a non-top-level widget and receives messages // for it. diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc -index ee5760ecbe0f..73521279a506 100644 +index ab27502c3509..282985c05c45 100644 --- content/browser/web_contents/web_contents_view_aura.cc +++ content/browser/web_contents/web_contents_view_aura.cc -@@ -946,7 +946,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size, +@@ -947,7 +947,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size, } RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( @@ -92,7 +92,7 @@ index ee5760ecbe0f..73521279a506 100644 if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the // test view, so we don't want to clobber it with a real one. To verify that -@@ -958,6 +959,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( +@@ -959,6 +960,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( render_widget_host->GetView()); } @@ -101,10 +101,10 @@ index ee5760ecbe0f..73521279a506 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 46ca496af77b..cd6ad38ab5ae 100644 +index 9be20d50ba4b..84c5106d15f2 100644 --- content/browser/web_contents/web_contents_view_aura.h +++ content/browser/web_contents/web_contents_view_aura.h -@@ -121,7 +121,7 @@ class CONTENT_EXPORT WebContentsViewAura +@@ -122,7 +122,7 @@ class CONTENT_EXPORT WebContentsViewAura gfx::NativeView context) override; RenderWidgetHostViewBase* CreateViewForWidget( RenderWidgetHost* render_widget_host, @@ -208,10 +208,10 @@ index 913fbc4bb00e..731a81c72803 100644 RenderWidgetHost* render_widget_host) override; void SetPageTitle(const base::string16& title) override; diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h -index 1b577eacbcc2..f614825b14a6 100644 +index 35da7e53b6a6..df938f455be2 100644 --- content/browser/web_contents/web_contents_view_mac.h +++ content/browser/web_contents/web_contents_view_mac.h -@@ -74,7 +74,7 @@ class WebContentsViewMac : public WebContentsView, +@@ -77,7 +77,7 @@ class WebContentsViewMac : public WebContentsView, gfx::NativeView context) override; RenderWidgetHostViewBase* CreateViewForWidget( RenderWidgetHost* render_widget_host, @@ -221,10 +221,10 @@ index 1b577eacbcc2..f614825b14a6 100644 RenderWidgetHost* render_widget_host) override; void SetPageTitle(const base::string16& title) override; diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm -index c6adcdd2b33e..a77289b96036 100644 +index 1d1f44d6a943..275e928d6bd1 100644 --- content/browser/web_contents/web_contents_view_mac.mm +++ content/browser/web_contents/web_contents_view_mac.mm -@@ -323,7 +323,8 @@ void WebContentsViewMac::CreateView( +@@ -327,7 +327,8 @@ void WebContentsViewMac::CreateView( } RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( @@ -234,7 +234,7 @@ index c6adcdd2b33e..a77289b96036 100644 if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the // test view, so we don't want to clobber it with a real one. To verify that -@@ -335,6 +336,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( +@@ -339,6 +340,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( render_widget_host->GetView()); } @@ -243,7 +243,7 @@ index c6adcdd2b33e..a77289b96036 100644 g_create_render_widget_host_view ? g_create_render_widget_host_view(render_widget_host, diff --git content/public/browser/browser_plugin_guest_delegate.h content/public/browser/browser_plugin_guest_delegate.h -index b7db83c24fc5..edf379709ec0 100644 +index ea12af6b86b8..f1211f374328 100644 --- content/public/browser/browser_plugin_guest_delegate.h +++ content/public/browser/browser_plugin_guest_delegate.h @@ -20,6 +20,7 @@ class GuestHost; @@ -266,10 +266,10 @@ index b7db83c24fc5..edf379709ec0 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 cf367d30422b..619c14dc05a1 100644 +index b7cb9fc9df13..a4a81ee1c863 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 -@@ -233,6 +233,8 @@ void MimeHandlerViewGuest::CreateWebContents( +@@ -212,6 +212,8 @@ void MimeHandlerViewGuest::CreateWebContents( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; @@ -278,7 +278,7 @@ index cf367d30422b..619c14dc05a1 100644 // TODO(erikchen): Fix ownership semantics for guest views. // https://crbug.com/832879. std::move(callback).Run( -@@ -277,6 +279,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { +@@ -256,6 +258,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { return true; } @@ -298,10 +298,10 @@ index cf367d30422b..619c14dc05a1 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 7cdbfafb8b38..be080396eaae 100644 +index a608b0f31be0..025e4ed3af85 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 -@@ -131,6 +131,10 @@ class MimeHandlerViewGuest +@@ -125,6 +125,10 @@ class MimeHandlerViewGuest bool ZoomPropagatesFromEmbedderToGuest() const final; bool ShouldDestroyOnDetach() const final; diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 441748111..93654755b 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,8 +1,8 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index d8739b1f3110..987472561468 100644 +index 3025bd308a4a..f7fb156a75d8 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc -@@ -133,10 +133,11 @@ void BrowserTaskExecutor::PostFeatureListSetup() { +@@ -135,10 +135,11 @@ void BrowserTaskExecutor::PostFeatureListSetup() { // static void BrowserTaskExecutor::Shutdown() { diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 8d81fbf02..08d05afcb 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index a3f21b7ef850..882b4a38d14c 100644 +index 66f3b325be58..b3bdbd5c39d9 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -157,7 +157,7 @@ declare_args() { +@@ -160,7 +160,7 @@ declare_args() { !use_clang_coverage && !(is_android && use_order_profiling) && (use_lld || (use_gold && @@ -11,7 +11,7 @@ index a3f21b7ef850..882b4a38d14c 100644 !(current_cpu == "x86" || current_cpu == "x64")))) } -@@ -1703,8 +1703,6 @@ config("thin_archive") { +@@ -1734,8 +1734,6 @@ config("thin_archive") { # archive names to 16 characters, which is not what we want). if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 4aa3d94c7..2a4ad9bb4 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 04aff03b621d..7e887b89a6d8 100644 +index 8ce5e842bbb2..95b0356cab27 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -9,6 +9,7 @@ import("//build/config/jumbo.gni") @@ -10,15 +10,15 @@ index 04aff03b621d..7e887b89a6d8 100644 import("//chrome/common/features.gni") import("//components/feature_engagement/features.gni") import("//components/feed/features.gni") -@@ -1849,6 +1850,7 @@ jumbo_split_static_library("browser") { - "//base/allocator:buildflags", +@@ -1889,6 +1890,7 @@ jumbo_split_static_library("browser") { "//base/util/values:values_util", + "//build:branding_buildflags", "//cc", + "//cef/libcef/features", "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2154,6 +2156,10 @@ jumbo_split_static_library("browser") { +@@ -2192,6 +2194,10 @@ jumbo_split_static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 7cfd2f194..1ca139579 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 bcc5cfe3b483..7798026b7a3a 100644 +index a3797e6705b8..6b7fe2e20a3f 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 @@ @@ -36,7 +36,7 @@ index bcc5cfe3b483..7798026b7a3a 100644 #endif } -@@ -89,10 +100,16 @@ scoped_refptr +@@ -85,10 +96,16 @@ scoped_refptr base::FeatureList::IsEnabled(features::kPermissionDelegation))); #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index f16687a1b..3c6df5542 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 6bd5bea7ddb0..076306275b5b 100644 +index 50f7329cca40..c6cae9beda15 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -10,6 +10,7 @@ import("//build/config/jumbo.gni") @@ -10,7 +10,7 @@ index 6bd5bea7ddb0..076306275b5b 100644 import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") import("//components/feature_engagement/features.gni") -@@ -357,6 +358,10 @@ jumbo_split_static_library("ui") { +@@ -368,6 +369,10 @@ jumbo_split_static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index 6bd5bea7ddb0..076306275b5b 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -374,6 +379,7 @@ jumbo_split_static_library("ui") { +@@ -385,6 +390,7 @@ jumbo_split_static_library("ui") { "//base:i18n", "//base/allocator:buildflags", "//cc/paint", @@ -30,17 +30,16 @@ index 6bd5bea7ddb0..076306275b5b 100644 "//chrome:resources", "//chrome:strings", diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc -index 1b9b3d857f47..85e2d1e5a5d5 100644 +index c50cd8b8f779..31aa7a2a696b 100644 --- chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc -@@ -20,14 +20,13 @@ +@@ -20,13 +20,12 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/download/download_prefs.h" - #include "chrome/browser/io_thread.h" #include "chrome/browser/net/net_export_helper.h" #include "chrome/browser/net/system_network_context_manager.h" #include "chrome/browser/platform_util.h" @@ -49,7 +48,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 #include "chrome/common/channel_info.h" #include "chrome/common/url_constants.h" #include "components/grit/components_resources.h" -@@ -42,7 +41,14 @@ +@@ -41,7 +40,14 @@ #include "content/public/browser/web_ui_message_handler.h" #include "extensions/buildflags/buildflags.h" #include "net/log/net_log_capture_mode.h" @@ -64,7 +63,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 #if defined(OS_ANDROID) #include "chrome/browser/android/intent_helper.h" -@@ -68,6 +74,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() { +@@ -67,6 +73,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() { return source; } @@ -72,7 +71,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 void SetIfNotNull(base::DictionaryValue* dict, const base::StringPiece& path, std::unique_ptr in_value) { -@@ -75,6 +82,7 @@ void SetIfNotNull(base::DictionaryValue* dict, +@@ -74,6 +81,7 @@ void SetIfNotNull(base::DictionaryValue* dict, dict->Set(path, std::move(in_value)); } } @@ -80,7 +79,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 // This class receives javascript messages from the renderer. // Note that the WebUI infrastructure runs on the UI thread, therefore all of -@@ -82,7 +90,9 @@ void SetIfNotNull(base::DictionaryValue* dict, +@@ -81,7 +89,9 @@ void SetIfNotNull(base::DictionaryValue* dict, class NetExportMessageHandler : public WebUIMessageHandler, public base::SupportsWeakPtr, @@ -90,7 +89,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 public net_log::NetExportFileWriter::StateObserver { public: NetExportMessageHandler(); -@@ -98,11 +108,13 @@ class NetExportMessageHandler +@@ -97,11 +107,13 @@ class NetExportMessageHandler void OnSendNetLog(const base::ListValue* list); void OnShowFile(const base::ListValue* list); @@ -104,7 +103,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 // net_log::NetExportFileWriter::StateObserver implementation. void OnNewState(const base::DictionaryValue& state) override; -@@ -132,9 +144,16 @@ class NetExportMessageHandler +@@ -131,9 +143,16 @@ class NetExportMessageHandler // renderer. void NotifyUIWithState(std::unique_ptr state); @@ -121,7 +120,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 // Cached pointer to SystemNetworkContextManager's NetExportFileWriter. net_log::NetExportFileWriter* file_writer_; -@@ -150,7 +169,9 @@ class NetExportMessageHandler +@@ -149,7 +168,9 @@ class NetExportMessageHandler net::NetLogCaptureMode capture_mode_; uint64_t max_log_file_size_; @@ -129,9 +128,9 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 scoped_refptr select_file_dialog_; +#endif - base::WeakPtrFactory weak_ptr_factory_; + base::WeakPtrFactory weak_ptr_factory_{this}; -@@ -168,8 +189,10 @@ NetExportMessageHandler::NetExportMessageHandler() +@@ -166,8 +187,10 @@ NetExportMessageHandler::NetExportMessageHandler() NetExportMessageHandler::~NetExportMessageHandler() { // There may be a pending file dialog, it needs to be told that the user // has gone away so that it doesn't try to call back. @@ -142,7 +141,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 file_writer_->StopNetLog(nullptr); } -@@ -232,6 +255,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { +@@ -230,6 +253,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { if (UsingMobileUI()) { StartNetLog(base::FilePath()); } else { @@ -150,7 +149,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 base::FilePath initial_dir = last_save_dir.Pointer()->empty() ? DownloadPrefs::FromBrowserContext( web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() : -@@ -239,6 +263,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { +@@ -237,6 +261,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { base::FilePath initial_path = initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json")); ShowSelectFileDialog(initial_path); @@ -160,7 +159,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 } } -@@ -248,6 +275,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -246,6 +273,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { std::unique_ptr ui_thread_polled_data( new base::DictionaryValue()); @@ -168,7 +167,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 Profile* profile = Profile::FromWebUI(web_ui()); SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo", chrome_browser_net::GetPrerenderInfo(profile)); -@@ -257,6 +285,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -255,6 +283,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders", chrome_browser_net::GetWindowsServiceProviders()); #endif @@ -176,7 +175,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 file_writer_->StopNetLog(std::move(ui_thread_polled_data)); } -@@ -273,6 +302,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) { +@@ -271,6 +300,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) { base::Bind(&NetExportMessageHandler::ShowFileInShell, AsWeakPtr())); } @@ -184,7 +183,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 void NetExportMessageHandler::FileSelected(const base::FilePath& path, int index, void* params) { -@@ -291,6 +321,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) { +@@ -289,6 +319,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) { DCHECK(select_file_dialog_); select_file_dialog_ = nullptr; } @@ -192,7 +191,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 void NetExportMessageHandler::OnNewState(const base::DictionaryValue& state) { NotifyUIWithState(state.CreateDeepCopy()); -@@ -355,6 +386,7 @@ void NetExportMessageHandler::NotifyUIWithState( +@@ -353,6 +384,7 @@ void NetExportMessageHandler::NotifyUIWithState( *state); } @@ -200,7 +199,7 @@ index 1b9b3d857f47..85e2d1e5a5d5 100644 void NetExportMessageHandler::ShowSelectFileDialog( const base::FilePath& default_path) { // User may have clicked more than once before the save dialog appears. -@@ -373,6 +405,43 @@ void NetExportMessageHandler::ShowSelectFileDialog( +@@ -371,6 +403,43 @@ void NetExportMessageHandler::ShowSelectFileDialog( ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), default_path, &file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr); } diff --git a/patch/patches/chrome_browser_product_override.patch b/patch/patches/chrome_browser_product_override.patch index 01eeee04e..5d1286548 100644 --- a/patch/patches/chrome_browser_product_override.patch +++ b/patch/patches/chrome_browser_product_override.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index b5c53b099bb2..56aa2e75b114 100644 +index 0b29bc11f07c..9c0ffba4dc20 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -1079,10 +1079,6 @@ void LaunchURL( +@@ -1067,10 +1067,6 @@ void LaunchURL( } } @@ -13,7 +13,7 @@ index b5c53b099bb2..56aa2e75b114 100644 void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { // |allowlist| combines pref/policy + cmdline switch in the browser process. // For renderer and utility (e.g. NetworkService) processes the switch is the -@@ -1100,6 +1096,14 @@ void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { +@@ -1088,6 +1084,14 @@ void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { } // namespace @@ -29,11 +29,11 @@ index b5c53b099bb2..56aa2e75b114 100644 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUserAgent)) { diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index 499af0b670a1..dc6247946b8a 100644 +index 069f597633a2..e81d7718cfca 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -79,7 +79,8 @@ class Origin; - +@@ -84,7 +84,8 @@ enum class Channel; + class ChromeHidDelegate; class ChromeSerialDelegate; -// Returns the user agent of Chrome. diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index d7d12463f..3b1539b29 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 4cce9ca9fbf1..b1d578c0f8c2 100644 +index bd2715738d89..a61a0765301f 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -388,7 +388,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -375,7 +375,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -12,10 +12,10 @@ index 4cce9ca9fbf1..b1d578c0f8c2 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 257e27caed9f..4d0c4fe116c6 100644 +index 985c64458bdf..f46ddbb8c05d 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -92,7 +92,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. @@ -24,7 +24,7 @@ index 257e27caed9f..4d0c4fe116c6 100644 // Returns total number of profiles available on this machine. size_t GetNumberOfProfiles(); -@@ -122,7 +122,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -124,7 +124,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -33,7 +33,7 @@ index 257e27caed9f..4d0c4fe116c6 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -131,7 +131,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -133,7 +133,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 27698c434..2414ca1f0 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index daf826ece047..615200c4b41c 100644 +index f2223e24ec7c..8374b7f0d56d 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -51,7 +51,7 @@ index daf826ece047..615200c4b41c 100644 + allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated, profile->GetPrefs()); - allow_outdated_plugins_.MoveToThread( + allow_outdated_plugins_.MoveToSequence( @@ -234,6 +247,7 @@ void PluginInfoHostImpl::PluginsLoaded( plugin_metadata->identifier(), &output->status); } @@ -125,7 +125,7 @@ index daf826ece047..615200c4b41c 100644 // If we broke out of the loop, we have found an enabled plugin. bool enabled = i < matching_plugins.size(); diff --git chrome/browser/plugins/plugin_utils.cc chrome/browser/plugins/plugin_utils.cc -index 01ea0ba7f0cb..f573503df5c4 100644 +index 73d60aa7f77c..89bff0de7186 100644 --- chrome/browser/plugins/plugin_utils.cc +++ chrome/browser/plugins/plugin_utils.cc @@ -5,6 +5,7 @@ @@ -146,49 +146,45 @@ index 01ea0ba7f0cb..f573503df5c4 100644 +#endif + #if BUILDFLAG(ENABLE_EXTENSIONS) - #include "extensions/browser/info_map.h" - #include "extensions/common/constants.h" -@@ -180,10 +186,26 @@ PluginUtils::GetMimeTypeToExtensionIdMap( + #include "chrome/common/pref_names.h" + #include "components/prefs/pref_service.h" +@@ -251,12 +257,29 @@ base::flat_map + PluginUtils::GetMimeTypeToExtensionIdMap( content::ResourceContext* resource_context) { - base::flat_map mime_type_to_extension_id_map; #if BUILDFLAG(ENABLE_EXTENSIONS) + +#if BUILDFLAG(ENABLE_CEF) + if (!extensions::ExtensionsEnabled()) -+ return mime_type_to_extension_id_map; ++ return {}; + + CefResourceContext* context = + static_cast(resource_context); + bool profile_is_off_the_record = context->IsOffTheRecord(); -+ const scoped_refptr extension_info_map( -+ context->GetExtensionInfoMap()); ++ scoped_refptr extension_info_map( ++ const_cast(context->GetExtensionInfoMap())); + bool always_open_pdf_externally = !extensions::PdfExtensionEnabled(); +#else ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); - bool profile_is_off_the_record = io_data->IsOffTheRecord(); - const scoped_refptr extension_info_map( + scoped_refptr extension_info_map( io_data->GetExtensionInfoMap()); ++ bool profile_is_off_the_record = io_data->IsOffTheRecord(); + bool always_open_pdf_externally = + io_data->always_open_pdf_externally()->GetValue(); +#endif + - std::vector whitelist = MimeTypesHandler::GetMIMETypeWhitelist(); - // Go through the white-listed extensions and try to use them to intercept - // the URL request. -@@ -198,7 +220,7 @@ PluginUtils::GetMimeTypeToExtensionIdMap( - } - - if (extension_id == extension_misc::kPdfExtensionId && -- io_data->always_open_pdf_externally()->GetValue()) { -+ always_open_pdf_externally) { - continue; - } - + return GetMimeTypeToExtensionIdMapInternal( +- io_data->IsOffTheRecord(), +- io_data->always_open_pdf_externally()->GetValue(), ++ profile_is_off_the_record, ++ always_open_pdf_externally, + base::BindRepeating( + [](const scoped_refptr& info_map, + const std::string& extension_id) { diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index 4f04b84e4899..e4f6ee474393 100644 +index ae7e07340ea4..f193040e8bca 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -775,6 +775,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -794,6 +794,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -196,7 +192,7 @@ index 4f04b84e4899..e4f6ee474393 100644 observer->IsPluginTemporarilyAllowed(identifier)) { status = chrome::mojom::PluginStatus::kAllowed; } -@@ -967,7 +968,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -994,7 +995,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( &plugin_auth_host); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -206,7 +202,7 @@ index 4f04b84e4899..e4f6ee474393 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -976,7 +978,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1003,7 +1005,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -216,7 +212,7 @@ index 4f04b84e4899..e4f6ee474393 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -986,7 +989,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1013,7 +1016,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -226,7 +222,7 @@ index 4f04b84e4899..e4f6ee474393 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -994,7 +998,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1021,7 +1025,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); diff --git a/patch/patches/chrome_pref_watcher.patch b/patch/patches/chrome_pref_watcher.patch index 368cf6c12..5e9b717e5 100644 --- a/patch/patches/chrome_pref_watcher.patch +++ b/patch/patches/chrome_pref_watcher.patch @@ -13,4 +13,4 @@ index b5ccdc521a36..716117c141cc 100644 + private: void UpdateRendererPreferences(); void OnWebPrefChanged(const std::string& pref_name); - + diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index abcde8298..0bb135131 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 e5f98be28775..a1d2697affc8 100644 +index 4f3ed79d0500..357a0b260e85 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -4,6 +4,7 @@ @@ -10,7 +10,7 @@ index e5f98be28775..a1d2697affc8 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -127,6 +128,7 @@ jumbo_static_library("renderer") { +@@ -125,6 +126,7 @@ jumbo_static_library("renderer") { defines = [] deps = [ @@ -18,7 +18,7 @@ index e5f98be28775..a1d2697affc8 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -193,6 +195,10 @@ jumbo_static_library("renderer") { +@@ -190,6 +192,10 @@ jumbo_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 74cbe8bb7..8611c9f37 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 1db1b55b6da0..41187edcf3e1 100644 +index 1e9bc3b924db..eaf4ac0f22f8 100644 --- chrome/common/chrome_content_client.cc +++ chrome/common/chrome_content_client.cc -@@ -97,7 +97,8 @@ +@@ -92,7 +92,8 @@ // Registers Widevine CDM if Widevine is enabled, the Widevine CDM is // bundled and not a component. When the Widevine CDM is a component, it is // registered in widevine_cdm_component_installer.cc. diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 6c7c5a047..5c7c83f77 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -13,7 +13,7 @@ index 864f2a5a315a..78b71d523e86 100644 explicit ContentServiceManagerMainDelegate(const ContentMainParams& params); ~ContentServiceManagerMainDelegate() override; diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 0ef3544d94bd..b27ea95697fb 100644 +index 2207045d28b6..b87d28e8e618 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h @@ -12,6 +12,7 @@ @@ -23,8 +23,8 @@ index 0ef3544d94bd..b27ea95697fb 100644 +#include "content/common/content_export.h" #include "content/common/navigation_params.mojom.h" #include "content/public/browser/certificate_request_result_type.h" - #include "services/network/public/mojom/url_loader_factory.mojom.h" -@@ -49,7 +50,7 @@ void ApplyNetworkRequestOverrides(FrameTreeNode* frame_tree_node, + #include "services/network/public/mojom/network_service.mojom.h" +@@ -52,7 +53,7 @@ void ApplyNetworkRequestOverrides(FrameTreeNode* frame_tree_node, mojom::BeginNavigationParams* begin_params, bool* report_raw_headers); @@ -69,7 +69,7 @@ index 886bdf0edf8f..1d714000cce5 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index 1abc6a3a8e11..e885e78c4d54 100644 +index 45c823a5f5cd..e8f82939e163 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -26,6 +26,7 @@ jumbo_component("controller") { diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 31823a789..9013e2c97 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 3947d9d92ab4..00b5b3edf84a 100644 +index e0d2c5c42517..0849c5bf6b7e 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -634,8 +634,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context, +@@ -631,8 +631,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 3947d9d92ab4..00b5b3edf84a 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 5c2a2d0adf1c..54fc2db321e9 100644 +index 55801ac0fee7..8e993e959ca2 100644 --- chrome/browser/plugins/chrome_plugin_service_filter.cc +++ chrome/browser/plugins/chrome_plugin_service_filter.cc -@@ -168,6 +168,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( +@@ -167,6 +167,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( int render_frame_id, const void* context, const GURL& plugin_content_url, @@ -53,7 +53,7 @@ index 2eb7f21919fd..4218d3352d70 100644 } #endif diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index 39f6dcaf9fce..faf7bd250c3c 100644 +index 786365927e71..27d32872d8d0 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc @@ -70,7 +70,7 @@ void OnFindURLMimeType(const GURL& url, @@ -66,7 +66,7 @@ index 39f6dcaf9fce..faf7bd250c3c 100644 } diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 30b2a43959da..7dbe5aad8bd2 100644 +index 83772ae8cca7..0eadd7c9a37a 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc @@ -572,7 +572,7 @@ void DevToolsHttpHandler::OnJsonRequest( @@ -79,10 +79,10 @@ index 30b2a43959da..7dbe5aad8bd2 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index 3bdd59c38012..9df67bd208b9 100644 +index 5815fdfd6259..307c222c0d40 100644 --- content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc -@@ -809,6 +809,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, +@@ -493,6 +493,7 @@ void RenderFrameMessageFilter::OnAre3DAPIsBlocked(int render_frame_id, void RenderFrameMessageFilter::OnGetPluginInfo( int render_frame_id, const GURL& url, @@ -90,7 +90,7 @@ index 3bdd59c38012..9df67bd208b9 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool* found, -@@ -820,8 +821,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( +@@ -504,8 +505,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( bool allow_wildcard = true; *found = plugin_service_->GetPluginInfo( render_process_id_, render_frame_id, resource_context_, url, @@ -102,10 +102,10 @@ index 3bdd59c38012..9df67bd208b9 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 641c7bcbf1b8..3faf6a6452c4 100644 +index e7900ef22a0d..f05d2ee128bd 100644 --- content/browser/frame_host/render_frame_message_filter.h +++ content/browser/frame_host/render_frame_message_filter.h -@@ -146,6 +146,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter +@@ -113,6 +113,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter { #if BUILDFLAG(ENABLE_PLUGINS) void OnGetPluginInfo(int render_frame_id, const GURL& url, @@ -114,10 +114,10 @@ index 641c7bcbf1b8..3faf6a6452c4 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 7b73b2a8a838..da5aacc31910 100644 +index b0458c1168d9..98f7ae7b7899 100644 --- content/browser/loader/mime_sniffing_resource_handler.cc +++ content/browser/loader/mime_sniffing_resource_handler.cc -@@ -512,8 +512,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler( +@@ -510,8 +510,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler( WebPluginInfo plugin; bool has_plugin = plugin_service_->GetPluginInfo( info->GetChildID(), info->GetRenderFrameID(), info->GetContext(), @@ -129,23 +129,24 @@ index 7b73b2a8a838..da5aacc31910 100644 if (stale) { // Refresh the plugins asynchronously. diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 052c66044997..9501b0c242cb 100644 +index 7dafa5c27290..14d97d465f2c 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -905,6 +905,12 @@ class NavigationURLLoaderImpl::URLLoaderRequestController +@@ -1061,6 +1061,13 @@ class NavigationURLLoaderImpl::URLLoaderRequestController static_cast(resource_request_->transition_type), - resource_request_->has_user_gesture, &proxied_factory_request_, - external_protocol_factory); + resource_request_->has_user_gesture, &loader_factory); + + if (!handled) { + handled = GetContentClient()->browser()->HandleExternalProtocol( + web_contents_getter_, frame_tree_node_id_, + navigation_ui_data_.get(), *resource_request_, -+ &proxied_factory_request_, external_protocol_factory); ++ &proxied_factory_request_, &loader_factory); + } - - if (external_protocol_factory) { ++ + if (loader_factory) { factory = -@@ -1146,7 +1152,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController + base::MakeRefCounted( +@@ -1310,7 +1317,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController // path does as well for navigations. bool has_plugin = PluginService::GetInstance()->GetPluginInfo( -1 /* render_process_id */, -1 /* render_frame_id */, resource_context_, @@ -177,7 +178,7 @@ index a599f989065f..115867edec92 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 cb19abcd26b8..12d66dd7db6e 100644 +index c4c0ed551697..b234e239bba4 100644 --- content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h @@ -57,6 +57,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { @@ -189,7 +190,7 @@ index cb19abcd26b8..12d66dd7db6e 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc -index 8dd463f4165f..e0d0e951ec8b 100644 +index 717db1507d66..d44142b67ff7 100644 --- content/browser/renderer_host/plugin_registry_impl.cc +++ content/browser/renderer_host/plugin_registry_impl.cc @@ -27,6 +27,7 @@ void PluginRegistryImpl::Bind(blink::mojom::PluginRegistryRequest request) { @@ -232,7 +233,7 @@ index 8dd463f4165f..e0d0e951ec8b 100644 plugin_blink->name = plugin.name; plugin_blink->description = plugin.desc; diff --git content/browser/renderer_host/plugin_registry_impl.h content/browser/renderer_host/plugin_registry_impl.h -index 3009401dac6b..b4c5a9e2db50 100644 +index 061dd21cbbd1..a418b8d08091 100644 --- content/browser/renderer_host/plugin_registry_impl.h +++ content/browser/renderer_host/plugin_registry_impl.h @@ -24,17 +24,24 @@ class PluginRegistryImpl : public blink::mojom::PluginRegistry { @@ -258,14 +259,14 @@ index 3009401dac6b..b4c5a9e2db50 100644 mojo::BindingSet bindings_; base::TimeTicks last_plugin_refresh_time_; + int render_process_id_ = -1; - base::WeakPtrFactory weak_factory_; + base::WeakPtrFactory weak_factory_{this}; }; diff --git content/common/frame_messages.h content/common/frame_messages.h -index c81c9fb4251c..3f266302f4e0 100644 +index 60077e7ec11a..1e703ba07b4d 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -1266,9 +1266,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -1228,9 +1228,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -278,12 +279,12 @@ index c81c9fb4251c..3f266302f4e0 100644 std::string /* mime_type */, bool /* found */, diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 1a16897afa44..12439a93b151 100644 +index a14b357dca01..780861333a4b 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -1437,6 +1437,15 @@ class CONTENT_EXPORT ContentBrowserClient { - network::mojom::URLLoaderFactoryRequest* factory_request, - network::mojom::URLLoaderFactory*& out_factory); +@@ -1492,6 +1492,15 @@ class CONTENT_EXPORT ContentBrowserClient { + bool has_user_gesture, + network::mojom::URLLoaderFactoryPtr* out_factory); + // Same as above, but exposing the whole ResourceRequest object. + virtual bool HandleExternalProtocol( @@ -292,27 +293,27 @@ index 1a16897afa44..12439a93b151 100644 + NavigationUIData* navigation_data, + const network::ResourceRequest& request, + network::mojom::URLLoaderFactoryRequest* factory_request, -+ network::mojom::URLLoaderFactory*& out_factory) { return false; } ++ network::mojom::URLLoaderFactoryPtr* out_factory) { return false; } + // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1504,6 +1513,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1562,6 +1571,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. - virtual std::string GetProduct() const; + virtual std::string GetProduct(); + // Returns the Chrome-specific product string. This is used for compatibility + // purposes with external tools like Selenium. -+ virtual std::string GetChromeProduct() const { return GetProduct(); } ++ virtual std::string GetChromeProduct() { return GetProduct(); } + // Returns the user agent. Content may cache this value. - virtual std::string GetUserAgent() const; + virtual std::string GetUserAgent(); diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h -index aed3085c7794..3b31542094d4 100644 +index 7646bdad2061..887ac022f2a1 100644 --- content/public/browser/plugin_service.h +++ content/public/browser/plugin_service.h -@@ -73,6 +73,7 @@ class CONTENT_EXPORT PluginService { +@@ -75,6 +75,7 @@ class CONTENT_EXPORT PluginService { int render_frame_id, ResourceContext* context, const GURL& url, @@ -333,7 +334,7 @@ index 3b610b1f554e..7c439e060779 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 31fcd7d89bf8..9421e8a5db77 100644 +index bfc62d176668..b9f695eaad5a 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h @@ -74,6 +74,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -346,7 +347,7 @@ index 31fcd7d89bf8..9421e8a5db77 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -333,6 +336,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -326,6 +329,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -358,10 +359,10 @@ index 31fcd7d89bf8..9421e8a5db77 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h -index 14f7e7a34e2b..573bd466effe 100644 +index 0e2e86e6a2af..b44e90f69263 100644 --- content/public/renderer/render_frame_observer.h +++ content/public/renderer/render_frame_observer.h -@@ -201,6 +201,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, +@@ -214,6 +214,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, virtual void DidReceiveTransferSizeUpdate(int resource_id, int received_data_length) {} @@ -372,10 +373,10 @@ index 14f7e7a34e2b..573bd466effe 100644 virtual void FocusedElementChanged(const blink::WebElement& element) {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 2ab1163b56da..329e435a479d 100644 +index e2a9d4a370f3..2919772fef77 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -4031,7 +4031,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -4095,7 +4095,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -385,7 +386,7 @@ index 2ab1163b56da..329e435a479d 100644 params.mime_type.Utf8(), &found, &info, &mime_type)); if (!found) return nullptr; -@@ -4464,6 +4465,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { +@@ -4510,6 +4511,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { void RenderFrameImpl::FrameFocused() { Send(new FrameHostMsg_FrameFocused(routing_id_)); @@ -395,10 +396,10 @@ index 2ab1163b56da..329e435a479d 100644 void RenderFrameImpl::DidChangeName(const blink::WebString& name) { diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index a908f83034f5..6a61c2ec8e63 100644 +index f2d4f932341e..409eabcdabc3 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -796,6 +796,8 @@ void RenderThreadImpl::Init() { +@@ -786,6 +786,8 @@ void RenderThreadImpl::Init() { StartServiceManagerConnection(); @@ -408,31 +409,32 @@ index a908f83034f5..6a61c2ec8e63 100644 &RenderThreadImpl::OnRendererInterfaceRequest, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 32f5e253cee8..aaa73a259771 100644 +index a89a61d35a4b..5d8369cc2eda 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1069,6 +1069,14 @@ void RendererBlinkPlatformImpl::RecordMetricsForBackgroundedRendererPurge() { +@@ -949,6 +949,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() { //------------------------------------------------------------------------------ +void RendererBlinkPlatformImpl::DevToolsAgentAttached() { + GetContentClient()->renderer()->DevToolsAgentAttached(); +} -+ +void RendererBlinkPlatformImpl::DevToolsAgentDetached() { + GetContentClient()->renderer()->DevToolsAgentDetached(); +} + - void RendererBlinkPlatformImpl::InitializeWebDatabaseHostIfNeeded() { - if (!web_database_host_) { - web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create( ++//------------------------------------------------------------------------------ ++ + blink::mojom::CodeCacheHost& RendererBlinkPlatformImpl::GetCodeCacheHost() { + if (!code_cache_host_) { + code_cache_host_ = blink::mojom::ThreadSafeCodeCacheHostPtr::Create( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index ba77a976729d..8c4153718c0b 100644 +index f1bc21b53606..0706ff050349 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -226,6 +226,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { - std::unique_ptr WrapSharedURLLoaderFactory( - scoped_refptr factory) override; +@@ -211,6 +211,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { + + media::GpuVideoAcceleratorFactories* GetGpuFactories() override; + void DevToolsAgentAttached() override; + void DevToolsAgentDetached() override; diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 601c418c9..aaad13e1e 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -81,7 +81,7 @@ index 381322aca895..a5622ddfe66d 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index e0a839813a07..5c0d05bcc78c 100644 +index 8072b8aa696e..e15894ca788f 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -93,16 +93,16 @@ index e0a839813a07..5c0d05bcc78c 100644 #include "base/base_switches.h" #include "base/command_line.h" #include "base/logging.h" -@@ -26,7 +28,7 @@ - +@@ -27,7 +29,7 @@ namespace crash_keys { + // Return true if we DON'T want to upload this flag to the crash server. -static bool IsBoringSwitch(const std::string& flag) { +bool IsBoringChromeSwitch(const std::string& flag) { static const char* const kIgnoreSwitches[] = { switches::kEnableLogging, switches::kFlagSwitchesBegin, -@@ -77,7 +79,7 @@ static bool IsBoringSwitch(const std::string& flag) { +@@ -82,7 +84,7 @@ static bool IsBoringSwitch(const std::string& flag) { } void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) { @@ -127,7 +127,7 @@ index bcf172e645a2..f879aa745adf 100644 // on the given |command_line|. void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc -index 3ab8ad2c5aad..ba4a353c370b 100644 +index bb5ee46d3f2b..639958e189ad 100644 --- components/crash/content/app/breakpad_linux.cc +++ components/crash/content/app/breakpad_linux.cc @@ -28,6 +28,7 @@ @@ -138,15 +138,15 @@ index 3ab8ad2c5aad..ba4a353c370b 100644 #include "base/files/file_path.h" #include "base/lazy_instance.h" #include "base/linux_util.h" -@@ -89,6 +90,7 @@ namespace { - - #if !defined(OS_CHROMEOS) +@@ -101,6 +102,7 @@ namespace { + uint64_t g_crash_loop_before_time = 0; + #else const char kUploadURL[] = "https://clients2.google.com/cr/report"; +const char* g_crash_server_url = kUploadURL; #endif bool g_is_crash_reporter_enabled = false; -@@ -702,7 +704,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, +@@ -714,7 +716,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 3ab8ad2c5aad..ba4a353c370b 100644 info.process_start_time = g_process_start_time; info.oom_size = base::g_oom_size; info.pid = g_pid; -@@ -1357,7 +1359,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, +@@ -1400,7 +1402,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, header_content_encoding, header_content_type, post_file, @@ -164,7 +164,7 @@ index 3ab8ad2c5aad..ba4a353c370b 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. -@@ -1697,10 +1699,19 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1740,10 +1742,19 @@ void HandleCrashDump(const BreakpadInfo& info) { GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); writer.AddBoundary(); @@ -186,7 +186,7 @@ index 3ab8ad2c5aad..ba4a353c370b 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -1817,10 +1828,20 @@ void HandleCrashDump(const BreakpadInfo& info) { +@@ -1860,10 +1871,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 3ab8ad2c5aad..ba4a353c370b 100644 writer.AddBoundary(); writer.Flush(); } -@@ -2032,6 +2053,17 @@ void SetChannelCrashKey(const std::string& channel) { +@@ -2075,6 +2096,17 @@ void SetChannelCrashKey(const std::string& channel) { channel_key.Set(channel); } @@ -227,7 +227,7 @@ index 3ab8ad2c5aad..ba4a353c370b 100644 void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { SanitizationInfo sanitization_info; diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h -index 6e95af6ca7f5..061fb189d60f 100644 +index fb7f0a8af261..0d25d227fb8a 100644 --- components/crash/content/app/breakpad_linux.h +++ components/crash/content/app/breakpad_linux.h @@ -20,6 +20,9 @@ extern void InitCrashReporter(const std::string& process_type); @@ -597,18 +597,3 @@ index 8f55759a6f4a..5d60fc3f84eb 100644 std::vector arguments(start_arguments); if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) { -diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc -index 59396b7f26e3..31491e1b5d20 100644 ---- content/browser/frame_host/debug_urls.cc -+++ content/browser/frame_host/debug_urls.cc -@@ -136,7 +136,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) { - cc::switches::kEnableGpuBenchmarking) && - (PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED)); - -- if (!(transition & ui::PAGE_TRANSITION_FROM_ADDRESS_BAR) && -+ // CEF does not use PAGE_TRANSITION_FROM_ADDRESS_BAR. -+ if (!(transition & (ui::PAGE_TRANSITION_TYPED | -+ ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)) && - !is_telemetry_navigation) - return false; - diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index 31f3fc0ef..5b5f84916 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -146,7 +146,7 @@ index a2b0c74636f4..01370fdc20d9 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index dc32b94e651c..100a52ce25f9 100644 +index b841b0ccd3a2..94ff9177d842 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -184,10 +184,10 @@ index dc32b94e651c..100a52ce25f9 100644 if (crashpad_is_win) { diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -index 205d860f9139..e077a835a19e 100644 +index e144bddc67d1..f3d727d0b247 100644 --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc -@@ -268,6 +268,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( +@@ -262,6 +262,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport( if (minidump_process_snapshot.Initialize(reader)) { parameters = BreakpadHTTPFormParametersFromMinidump(&minidump_process_snapshot); @@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644 //! \brief Calls ProcessPendingReports() in response to ReportPending() having //! been called on any thread, as well as periodically on a timer. diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc -index 724168ee9657..ae31efb356a1 100644 +index 05a2e7b44e41..6e72c17a57e6 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc @@ -36,8 +36,10 @@ @@ -262,7 +262,7 @@ index 724168ee9657..ae31efb356a1 100644 #include "client/crash_report_database.h" #include "client/crashpad_client.h" #include "client/crashpad_info.h" -@@ -93,6 +95,10 @@ +@@ -96,6 +98,10 @@ #include "handler/linux/exception_handler_server.h" #endif // OS_MACOSX @@ -273,7 +273,7 @@ index 724168ee9657..ae31efb356a1 100644 namespace crashpad { namespace { -@@ -185,6 +191,9 @@ struct Options { +@@ -188,6 +194,9 @@ struct Options { bool periodic_tasks; bool rate_limit; bool upload_gzip; @@ -283,7 +283,7 @@ index 724168ee9657..ae31efb356a1 100644 }; // Splits |key_value| on '=' and inserts the resulting key and value into |map|. -@@ -562,6 +571,9 @@ int HandlerMain(int argc, +@@ -553,6 +562,9 @@ int HandlerMain(int argc, kOptionTraceParentWithException, #endif kOptionURL, @@ -293,7 +293,7 @@ index 724168ee9657..ae31efb356a1 100644 // Standard options. kOptionHelp = -2, -@@ -629,6 +641,9 @@ int HandlerMain(int argc, +@@ -620,6 +632,9 @@ int HandlerMain(int argc, {"url", required_argument, nullptr, kOptionURL}, {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, @@ -303,7 +303,7 @@ index 724168ee9657..ae31efb356a1 100644 {nullptr, 0, nullptr, 0}, }; -@@ -768,6 +783,27 @@ int HandlerMain(int argc, +@@ -759,6 +774,27 @@ int HandlerMain(int argc, options.url = optarg; break; } @@ -331,7 +331,7 @@ index 724168ee9657..ae31efb356a1 100644 case kOptionHelp: { Usage(me); MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly); -@@ -888,8 +924,14 @@ int HandlerMain(int argc, +@@ -879,8 +915,14 @@ int HandlerMain(int argc, upload_thread_options.upload_gzip = options.upload_gzip; upload_thread_options.watch_pending_reports = options.periodic_tasks; @@ -346,7 +346,7 @@ index 724168ee9657..ae31efb356a1 100644 upload_thread.Get()->Start(); } -@@ -917,7 +959,8 @@ int HandlerMain(int argc, +@@ -908,7 +950,8 @@ int HandlerMain(int argc, ScopedStoppable prune_thread; if (options.periodic_tasks) { prune_thread.Reset(new PruneCrashReportThread( diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index a91fb52e9..0a7feda07 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc -index 9e81f0a33ede..b796e79ae7ef 100644 +index 3841b7adf65d..41ca32ea5e2f 100644 --- chrome/browser/extensions/api/streams_private/streams_private_api.cc +++ chrome/browser/extensions/api/streams_private/streams_private_api.cc @@ -6,6 +6,7 @@ @@ -10,7 +10,7 @@ index 9e81f0a33ede..b796e79ae7ef 100644 #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/prerender/prerender_contents.h" #include "content/public/browser/browser_thread.h" -@@ -42,6 +43,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( +@@ -40,6 +41,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( if (!web_contents) return; @@ -18,7 +18,7 @@ index 9e81f0a33ede..b796e79ae7ef 100644 // If the request was for a prerender, abort the prerender and do not // continue. This is because plugins cancel prerender, see // http://crbug.com/343590. -@@ -51,6 +53,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( +@@ -49,6 +51,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( prerender_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD); return; } @@ -27,7 +27,7 @@ index 9e81f0a33ede..b796e79ae7ef 100644 auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 8cc9503fc131..b74c385b40a2 100644 +index 5dc2d564c85a..864f2f12657c 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -67,11 +67,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -97,7 +97,7 @@ index 8cc9503fc131..b74c385b40a2 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index 4027505469b8..de8258562bb2 100644 +index c0f80fd848d6..75b0e53ae68e 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost, @@ -121,7 +121,7 @@ index 4027505469b8..de8258562bb2 100644 content::RenderViewHost* render_view_host() const; content::RenderProcessHost* render_process_host() const; bool has_loaded_once() const { return has_loaded_once_; } -@@ -180,7 +186,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -181,7 +187,8 @@ class ExtensionHost : public DeferredStartRenderHost, content::BrowserContext* browser_context_; // The host for our HTML content. @@ -132,10 +132,10 @@ index 4027505469b8..de8258562bb2 100644 // A weak pointer to the current or pending RenderViewHost. We don't access // this through the host_contents because we want to deal with the pending diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 3ed389242f67..4cc4d2a5bed8 100644 +index 2f4890b54897..84164c1170a3 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h -@@ -60,6 +60,7 @@ class ComponentExtensionResourceManager; +@@ -54,6 +54,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -143,7 +143,7 @@ index 3ed389242f67..4cc4d2a5bed8 100644 class ExtensionHostDelegate; class ExtensionApiFrameIdMap; class ExtensionApiFrameIdMapHelper; -@@ -213,6 +214,14 @@ class ExtensionsBrowserClient { +@@ -195,6 +196,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; @@ -159,10 +159,10 @@ index 3ed389242f67..4cc4d2a5bed8 100644 // once each time the extensions system is loaded per browser_context. The // implementation may wish to use the BrowserContext to record the current diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc -index b203c136597a..4967c176f9b8 100644 +index e0f053ce45bd..3bf13bc0ad03 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc -@@ -383,9 +383,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, +@@ -382,9 +382,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, return true; // TODO(kalman): return false here? It might break things... DVLOG(1) << "CreateBackgroundHost " << extension->id(); diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index e0b1aeff6..db49a8bae 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,10 +1,10 @@ diff --git .gn .gn -index 01085ea84619..b79158a1a962 100644 +index 70856f65e720..649c347a899b 100644 --- .gn +++ .gn -@@ -666,6 +666,8 @@ exec_script_whitelist = - # in the Chromium repo outside of //build. - "//build_overrides/build.gni", +@@ -670,6 +670,8 @@ exec_script_whitelist = + + "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", + "//cef/BUILD.gn", + @@ -12,10 +12,10 @@ index 01085ea84619..b79158a1a962 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 8209523bebe9..84137b1a5cca 100644 +index 19fd588dfed1..30d3a9774eb3 100644 --- BUILD.gn +++ BUILD.gn -@@ -202,6 +202,7 @@ group("gn_all") { +@@ -204,6 +204,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ @@ -100,7 +100,7 @@ index ef8aeda56458..5b7f057311b9 100644 diff --git build/vs_toolchain.py build/vs_toolchain.py -index 6a0dcbdb4fe2..9902f5da105a 100755 +index 97f503bff408..fe1f0344dd77 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py @@ -81,11 +81,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): @@ -123,10 +123,10 @@ index 6a0dcbdb4fe2..9902f5da105a 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 8ff44c72636e..bb5e1a42aed4 100644 +index 93af4dcd03bb..e1a8543a5f14 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni -@@ -275,7 +275,7 @@ template("chrome_paks") { +@@ -271,7 +271,7 @@ template("chrome_paks") { } input_locales = locales @@ -136,10 +136,10 @@ index 8ff44c72636e..bb5e1a42aed4 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 397c151b160b..adfc8c0e27b2 100644 +index 7a779fc3ce1a..2ba4d85fa276 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn -@@ -134,7 +134,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 d063cf5f1..f174584df 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 2a7cb2dcb562..3fef6b5dee49 100644 +index 7ac3cf37b481..0ad6d1b8c31d 100644 --- tools/gritsettings/resource_ids +++ tools/gritsettings/resource_ids -@@ -459,4 +459,11 @@ +@@ -466,4 +466,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 e0f8876f3..f399ac87e 100644 --- a/patch/patches/ime_1610.patch +++ b/patch/patches/ime_1610.patch @@ -1,8 +1,8 @@ diff --git ui/base/ime/win/input_method_win_base.cc ui/base/ime/win/input_method_win_base.cc -index 2627f1eae901..80c00fc9752a 100644 +index 9d014932e5cd..8fcf988f5897 100644 --- ui/base/ime/win/input_method_win_base.cc +++ ui/base/ime/win/input_method_win_base.cc -@@ -266,8 +266,9 @@ bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { +@@ -264,8 +264,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. diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 67a1ea583..081ab5917 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -12,10 +12,10 @@ index a277ffa5eb59..3935b9f8c17c 100644 if (base::PathExists(sandbox_candidate)) sandbox_binary = sandbox_candidate; diff --git ui/gl/init/gl_initializer_x11.cc ui/gl/init/gl_initializer_x11.cc -index e3c481b97d89..5fde4a0bb388 100644 +index 3fc37d1c06bd..becd622d631e 100644 --- ui/gl/init/gl_initializer_x11.cc +++ ui/gl/init/gl_initializer_x11.cc -@@ -88,7 +88,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) { +@@ -86,7 +86,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) { if (implementation == kGLImplementationSwiftShaderGL) { #if BUILDFLAG(ENABLE_SWIFTSHADER) base::FilePath module_path; @@ -24,9 +24,9 @@ index e3c481b97d89..5fde4a0bb388 100644 return false; module_path = module_path.Append("swiftshader/"); -@@ -100,7 +100,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) { - } else if (cmd->GetSwitchValueASCII(switches::kUseGL) == - kGLImplementationANGLEName) { +@@ -97,7 +97,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) { + #endif + } else if (implementation == kGLImplementationEGLANGLE) { base::FilePath module_path; - if (!base::PathService::Get(base::DIR_MODULE, &module_path)) + if (!base::PathService::Get(base::DIR_ASSETS, &module_path)) diff --git a/patch/patches/linux_gtk_2014.patch b/patch/patches/linux_gtk_2014.patch index ee65da2f7..1ed311970 100644 --- a/patch/patches/linux_gtk_2014.patch +++ b/patch/patches/linux_gtk_2014.patch @@ -39,10 +39,10 @@ index 07f06ac694f5..831fd9f82dbe 100644 void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() { diff --git chrome/test/BUILD.gn chrome/test/BUILD.gn -index 1fb3cf77f01c..dbb03ffe3333 100644 +index f60af132bcdd..626c0081b78a 100644 --- chrome/test/BUILD.gn +++ chrome/test/BUILD.gn -@@ -4286,7 +4286,7 @@ test("unit_tests") { +@@ -4457,7 +4457,7 @@ test("unit_tests") { if (use_gio) { configs += [ "//build/linux:gio_config" ] } @@ -51,7 +51,7 @@ index 1fb3cf77f01c..dbb03ffe3333 100644 deps += [ "//chrome/browser/ui/libgtkui" ] } -@@ -5286,7 +5286,7 @@ if (!is_android) { +@@ -5471,7 +5471,7 @@ if (!is_android) { # suites, it seems like one or another starts timing out too. "../browser/ui/views/keyboard_access_browsertest.cc", ] diff --git a/patch/patches/linux_poll_2466.patch b/patch/patches/linux_poll_2466.patch index 662c2017b..5840b9a0e 100644 --- a/patch/patches/linux_poll_2466.patch +++ b/patch/patches/linux_poll_2466.patch @@ -1,5 +1,5 @@ diff --git base/files/file_path_watcher_linux.cc base/files/file_path_watcher_linux.cc -index 0ff8924fed4d..6c079b38e730 100644 +index 4b727c37c4f3..ba97a9e38ae7 100644 --- base/files/file_path_watcher_linux.cc +++ base/files/file_path_watcher_linux.cc @@ -5,6 +5,7 @@ diff --git a/patch/patches/mac_gpu.patch b/patch/patches/mac_gpu.patch index aa68bdb5f..f3379d100 100644 --- a/patch/patches/mac_gpu.patch +++ b/patch/patches/mac_gpu.patch @@ -1,5 +1,5 @@ diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc -index 8d690474060f..03059842b1a4 100644 +index cadd51581c1b..d266c9ddc225 100644 --- ui/gl/init/gl_initializer_mac.cc +++ ui/gl/init/gl_initializer_mac.cc @@ -46,11 +46,8 @@ bool InitializeOneOffForSandbox() { diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 2ed08f93c..6e6bf8761 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -25,7 +25,7 @@ index a1d6acc4e78d..f9518bc96ce4 100644 #if defined(OS_IOS) // On iOS, the main message loop cannot be Run(). Instead call Attach(), diff --git base/message_loop/message_loop_current.cc base/message_loop/message_loop_current.cc -index 71a45d077a6a..fded5cf39adc 100644 +index 54e2d2b41dbd..cd299c90618b 100644 --- base/message_loop/message_loop_current.cc +++ base/message_loop/message_loop_current.cc @@ -47,6 +47,8 @@ void MessageLoopCurrent::AddDestructionObserver( @@ -38,10 +38,10 @@ index 71a45d077a6a..fded5cf39adc 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/message_loop/message_loop_current.h base/message_loop/message_loop_current.h -index f259d89d429c..ffcc61ee95c2 100644 +index 08a1c5e36735..48c5f8d102d0 100644 --- base/message_loop/message_loop_current.h +++ base/message_loop/message_loop_current.h -@@ -129,6 +129,12 @@ class BASE_EXPORT MessageLoopCurrent { +@@ -124,6 +124,12 @@ class BASE_EXPORT MessageLoopCurrent { // posted tasks. void SetAddQueueTimeToTasks(bool enable); @@ -54,7 +54,7 @@ index f259d89d429c..ffcc61ee95c2 100644 // Enables or disables the recursive task processing. This happens in the case // of recursive message loops. Some unwanted message loops may occur when // using common controls or printer functions. By default, recursive task -@@ -199,6 +205,13 @@ class BASE_EXPORT MessageLoopCurrent { +@@ -194,6 +200,13 @@ class BASE_EXPORT MessageLoopCurrent { friend class web::TestWebThreadBundle; sequence_manager::internal::SequenceManagerImpl* current_; diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch deleted file mode 100644 index 17c3dd3a6..000000000 --- a/patch/patches/pdfium_print_549365.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git BUILD.gn BUILD.gn -index 42f20931a..2a14a60e7 100644 ---- BUILD.gn -+++ BUILD.gn -@@ -199,6 +199,10 @@ jumbo_component("pdfium") { - if (is_component_build) { - deps += [ "testing/fuzzers:fuzzer_impls" ] - } -+ -+ include_dirs = [ -+ "//v8/include", -+ ] - } - - # Targets below this are only visible within this file (and to the -diff --git fpdfsdk/fpdf_view.cpp fpdfsdk/fpdf_view.cpp -index 63374d2e9..7e9c32146 100644 ---- fpdfsdk/fpdf_view.cpp -+++ fpdfsdk/fpdf_view.cpp -@@ -39,6 +39,7 @@ - #include "fpdfsdk/cpdfsdk_helpers.h" - #include "fpdfsdk/cpdfsdk_pageview.h" - #include "fpdfsdk/ipdfsdk_pauseadapter.h" -+#include "fxjs/cfxjs_engine.h" - #include "fxjs/ijs_runtime.h" - #include "public/fpdf_formfill.h" - #include "third_party/base/ptr_util.h" -@@ -184,6 +185,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { - - CPDF_ModuleMgr::Destroy(); - CFX_GEModule::Destroy(); -+ FXJS_Release(); - - IJS_Runtime::Destroy(); - diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index 11c267482..aa3cca1c2 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 9ad8ad0bfa50..2724dab2f003 100644 +index c0c22fa5429f..f0a6215f3f54 100644 --- content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h -@@ -188,6 +188,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -191,6 +191,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,11 +11,11 @@ index 9ad8ad0bfa50..2724dab2f003 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 e2f3d5b5e1f9..3bf01af841ac 100644 +index 678bd07c0753..1ae838c3de32 100644 --- content/public/common/web_preferences.cc +++ content/public/common/web_preferences.cc -@@ -168,6 +168,7 @@ WebPreferences::WebPreferences() - spatial_navigation_enabled(false), +@@ -169,6 +169,7 @@ WebPreferences::WebPreferences() + caret_browsing_enabled(false), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), + base_background_color(0xFFFFFFFF), // Color::white @@ -23,11 +23,11 @@ index e2f3d5b5e1f9..3bf01af841ac 100644 record_whole_document(false), cookie_enabled(true), diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h -index f9a996476d5d..09d69329e037 100644 +index ca883e52fee0..0bc16d1e8330 100644 --- content/public/common/web_preferences.h +++ content/public/common/web_preferences.h -@@ -184,6 +184,7 @@ struct CONTENT_EXPORT WebPreferences { - bool spatial_navigation_enabled; +@@ -186,6 +186,7 @@ struct CONTENT_EXPORT WebPreferences { + bool caret_browsing_enabled; bool use_solid_color_scrollbars; bool navigate_on_drag_drop; + uint32_t base_background_color; @@ -35,10 +35,10 @@ index f9a996476d5d..09d69329e037 100644 bool record_whole_document; diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index 1aa52af90279..e3107e93c866 100644 +index d0ca81590d2b..8f2f30878650 100644 --- content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc -@@ -1012,6 +1012,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, +@@ -1018,6 +1018,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, #endif WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 32014ff9d..fabf0c7b4 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -34,18 +34,18 @@ index 323534a720c1..72b232f0ed85 100644 bool DownloadPrefs::IsFromTrustedSource(const download::DownloadItem& item) { diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc -index c26ddaa9aa12..ad181fdc7478 100644 +index d2a3be7590a0..883825bfc996 100644 --- chrome/browser/printing/print_preview_dialog_controller.cc +++ chrome/browser/printing/print_preview_dialog_controller.cc -@@ -16,6 +16,7 @@ +@@ -15,6 +15,7 @@ #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/browser_process.h" - #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" -@@ -420,8 +421,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( + #include "chrome/browser/printing/print_view_manager.h" +@@ -440,8 +441,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( content::HostZoomMap::Get(preview_dialog->GetSiteInstance()) ->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0); PrintViewManager::CreateForWebContents(preview_dialog); @@ -58,22 +58,22 @@ index c26ddaa9aa12..ad181fdc7478 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html -index 624b32bd370e..69b6134bcc41 100644 +index a941dae7276b..73e875985b8e 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html +++ chrome/browser/resources/print_preview/ui/destination_dialog.html -@@ -180,9 +180,7 @@ +@@ -182,9 +182,7 @@
-- +- - $i18n{manage} -- +- +
- + $i18n{cancel} - + diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html -index d8369b509661..a0791e34b570 100644 +index 2b7cb3cec173..af79ac632cb4 100644 --- chrome/browser/resources/print_preview/ui/destination_select.html +++ chrome/browser/resources/print_preview/ui/destination_select.html @@ -47,10 +47,6 @@ @@ -112,11 +112,11 @@ index 12f77178ea92..470b13bd7879 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index e0d6a9034332..250cbeedd842 100644 +index 6147b07f6dad..a68b5bfaf193 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -@@ -144,8 +144,10 @@ PdfPrinterHandler::PdfPrinterHandler(Profile* profile, - weak_ptr_factory_(this) {} +@@ -143,8 +143,10 @@ PdfPrinterHandler::PdfPrinterHandler(Profile* profile, + sticky_settings_(sticky_settings) {} PdfPrinterHandler::~PdfPrinterHandler() { +#if !BUILDFLAG(ENABLE_CEF) @@ -126,7 +126,7 @@ index e0d6a9034332..250cbeedd842 100644 } void PdfPrinterHandler::Reset() { -@@ -180,12 +182,14 @@ void PdfPrinterHandler::StartPrint( +@@ -179,12 +181,14 @@ void PdfPrinterHandler::StartPrint( return; } @@ -141,7 +141,7 @@ index e0d6a9034332..250cbeedd842 100644 DCHECK(!print_callback_); print_callback_ = std::move(callback); -@@ -324,7 +328,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -323,7 +327,11 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -153,7 +153,7 @@ index e0d6a9034332..250cbeedd842 100644 return; } -@@ -334,8 +342,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -333,8 +341,14 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, base::PostTaskWithTraitsAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -168,7 +168,7 @@ index e0d6a9034332..250cbeedd842 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -351,6 +365,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) { +@@ -350,6 +364,7 @@ void PdfPrinterHandler::OnGotUniqueFileName(const base::FilePath& path) { FileSelected(path, 0, nullptr); } @@ -176,7 +176,7 @@ index e0d6a9034332..250cbeedd842 100644 void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, const base::FilePath& directory) { base::FilePath path = directory.Append(filename); -@@ -375,5 +390,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -374,5 +389,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, &file_type_info, 0, base::FilePath::StringType(), platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -214,7 +214,7 @@ index e0d6a9034332..250cbeedd842 100644 } // namespace printing diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.h chrome/browser/ui/webui/print_preview/pdf_printer_handler.h -index eae9098f2136..1a4c4419e736 100644 +index 06f5799efbb9..6119691b2700 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.h +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.h @@ -11,9 +11,14 @@ @@ -262,7 +262,7 @@ index eae9098f2136..1a4c4419e736 100644 Profile* const profile_; StickySettings* const sticky_settings_; diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index 47528eaccd78..2ecd9e3d5c03 100644 +index e3d7c5f14cd5..70d1b47d35c9 100644 --- chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -26,6 +26,7 @@ @@ -273,7 +273,7 @@ index 47528eaccd78..2ecd9e3d5c03 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" #include "chrome/browser/browser_process.h" -@@ -1243,6 +1244,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1226,6 +1227,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -283,7 +283,7 @@ index 47528eaccd78..2ecd9e3d5c03 100644 #endif if (printer_type == PrinterType::kPdfPrinter) { if (!pdf_printer_handler_) { -@@ -1325,6 +1329,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, +@@ -1308,6 +1312,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, } void PrintPreviewHandler::RegisterForGaiaCookieChanges() { @@ -291,7 +291,7 @@ index 47528eaccd78..2ecd9e3d5c03 100644 DCHECK(!identity_manager_); cloud_print_enabled_ = GetPrefs()->GetBoolean(prefs::kCloudPrintSubmitEnabled); -@@ -1340,6 +1345,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { +@@ -1323,6 +1328,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); identity_manager_->AddObserver(this); @@ -300,7 +300,7 @@ index 47528eaccd78..2ecd9e3d5c03 100644 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index f90198efcf2a..d866bf90c13a 100644 +index 2dfc91469b8e..c6fd71452fb9 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -25,6 +25,7 @@ @@ -311,7 +311,7 @@ index f90198efcf2a..d866bf90c13a 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/background_printing_manager.h" #include "chrome/browser/printing/print_preview_data_service.h" -@@ -73,12 +74,16 @@ namespace printing { +@@ -72,12 +73,16 @@ namespace printing { namespace { diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index 63324bc56..d8590387f 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,10 +1,10 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index 691c476708b6..f198e2d0584f 100644 +index 63f432b58371..fe664e69427a 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc -@@ -148,6 +148,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, - thread_("Printing_Worker"), - weak_factory_(this) { +@@ -130,6 +130,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, int render_frame_id) + PrintingContext::Create(printing_context_delegate_.get())), + thread_("Printing_Worker") { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + printing_context_->set_render_ids(render_process_id, render_frame_id); } diff --git a/patch/patches/remove_component_build_check.patch b/patch/patches/remove_component_build_check.patch deleted file mode 100644 index 98b35c6eb..000000000 --- a/patch/patches/remove_component_build_check.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git build/config/compiler/compiler.gni build/config/compiler/compiler.gni -index c351d6babb8d..db5b4f0b973a 100644 ---- build/config/compiler/compiler.gni -+++ build/config/compiler/compiler.gni -@@ -248,18 +248,6 @@ if (symbol_level == -1) { - } - } - --# Non-component debug builds with symbol_level = 2 are an undesirable (very slow --# build times) and unsupported (some test binaries will fail with > 4 GB PDBs) --# combination. This is only checked when current_toolchain == default_toolchain --# because the is_component_build flag is set to false in various components of --# the build (like nacl) and we don't want to assert on those. --# iOS does not support component builds so add an exception for this platform. --if (build_with_chromium) { -- assert(symbol_level != 2 || current_toolchain != default_toolchain || -- is_component_build || !is_debug || is_ios, -- "Can't do non-component debug builds at symbol_level=2") --} -- - # Assert that the configuration isn't going to hit https://crbug.com/648948. - # An exception is made when target_os == "chromeos" as we only use the Android - # toolchain there to build relatively small binaries. diff --git a/patch/patches/render_accessibility_1675917.patch b/patch/patches/render_accessibility_1675917.patch new file mode 100644 index 000000000..70b03e14a --- /dev/null +++ b/patch/patches/render_accessibility_1675917.patch @@ -0,0 +1,51 @@ +diff --git content/renderer/accessibility/render_accessibility_impl.cc content/renderer/accessibility/render_accessibility_impl.cc +index 96ac02ca4dda..8812c390b681 100644 +--- content/renderer/accessibility/render_accessibility_impl.cc ++++ content/renderer/accessibility/render_accessibility_impl.cc +@@ -194,7 +194,6 @@ void RenderAccessibilityImpl::DidCreateNewDocument() { + void RenderAccessibilityImpl::DidCommitProvisionalLoad( + bool is_same_document_navigation, + ui::PageTransition transition) { +- is_initial_load_processed_ = false; + has_injected_stylesheet_ = false; + // Remove the image annotator if the page is loading and it was added for + // the one-shot image annotation (i.e. AXMode for image annotation is not +@@ -642,8 +641,6 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() { + // ids to locations. + for (size_t j = 0; j < update.nodes.size(); ++j) { + ui::AXNodeData& src = update.nodes[j]; +- // TODO(accessibility) What if location hasn't been set yet? +- // Get cached location for this node or create a new entry if none exists. + ui::AXRelativeBounds& dst = locations_[update.nodes[j].id]; + dst = src.relative_bounds; + } +@@ -663,13 +660,11 @@ void RenderAccessibilityImpl::SendPendingAccessibilityEvents() { + ack_token_)); + reset_token_ = 0; + +- if (had_layout_complete_messages && is_initial_load_processed_) ++ if (had_layout_complete_messages) + SendLocationChanges(); + +- if (had_load_complete_messages) { ++ if (had_load_complete_messages) + has_injected_stylesheet_ = false; +- is_initial_load_processed_ = true; +- } + + if (image_annotation_debugging_) + AddImageAnnotationDebuggingAttributes(bundle.updates); +diff --git content/renderer/accessibility/render_accessibility_impl.h content/renderer/accessibility/render_accessibility_impl.h +index e5e6325c1cf6..ebc2db666772 100644 +--- content/renderer/accessibility/render_accessibility_impl.h ++++ content/renderer/accessibility/render_accessibility_impl.h +@@ -238,9 +238,6 @@ class CONTENT_EXPORT RenderAccessibilityImpl + // for debugging. + bool image_annotation_debugging_ = false; + +- // Has all data related to the initial page load been processed. +- bool is_initial_load_processed_ = false; +- + // So we can queue up tasks to be executed later. + base::WeakPtrFactory weak_factory_{this}; + diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 9123fe7b4..c5f0dc3f4 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,8 +1,8 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index ab883f7cb8bb..ca12051438e2 100644 +index fa666755d5f3..779ebb5949cf 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -725,6 +725,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) +@@ -809,6 +809,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) : delegate_(delegate), locale_resources_data_lock_(new base::Lock), max_scale_factor_(SCALE_FACTOR_100P) { @@ -15,7 +15,7 @@ index ab883f7cb8bb..ca12051438e2 100644 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -734,6 +740,11 @@ ResourceBundle::~ResourceBundle() { +@@ -818,6 +824,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } @@ -28,10 +28,10 @@ index ab883f7cb8bb..ca12051438e2 100644 void ResourceBundle::InitSharedInstance(Delegate* delegate) { DCHECK(g_shared_instance_ == NULL) << "ResourceBundle initialized twice"; diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h -index 23005f6da221..3c87746c5a3d 100644 +index f5a09173007e..36734b2ed811 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h -@@ -150,6 +150,11 @@ class UI_BASE_EXPORT ResourceBundle { +@@ -155,6 +155,11 @@ class UI_BASE_EXPORT ResourceBundle { // Return the global resource loader instance. static ResourceBundle& GetSharedInstance(); diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index fe7c1c592..d5c3da1cf 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index b54aedcb4282..ea7de4d815ab 100644 +index 7bea1b72e4d0..a0c6c00d48a7 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -700,10 +700,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -696,10 +696,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,7 +19,7 @@ index b54aedcb4282..ea7de4d815ab 100644 } void RenderWidgetHostViewAura::WindowTitleChanged() { -@@ -2037,6 +2039,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2024,6 +2026,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // Init(), because it needs to have the layer. if (frame_sink_id_.is_valid()) window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/service_manager_654986.patch b/patch/patches/service_manager_654986.patch index 68d7de149..7c48733ba 100644 --- a/patch/patches/service_manager_654986.patch +++ b/patch/patches/service_manager_654986.patch @@ -1,5 +1,5 @@ diff --git services/service_manager/embedder/main.cc services/service_manager/embedder/main.cc -index 0d1fa74a3f43..11c7b62ac2ad 100644 +index 0d1fa74a3f43..c06c98acffb2 100644 --- services/service_manager/embedder/main.cc +++ services/service_manager/embedder/main.cc @@ -240,22 +240,36 @@ int RunService(MainDelegate* delegate) { @@ -115,7 +115,7 @@ index 0d1fa74a3f43..11c7b62ac2ad 100644 if (process_type == ProcessType::kEmbedder) delegate->ShutDownEmbedderProcess(); +} - ++ +int Main(MainParams& params) { +#if defined(OS_MACOSX) + // We need this pool for all the objects created before we get to the event @@ -125,7 +125,7 @@ index 0d1fa74a3f43..11c7b62ac2ad 100644 + params.autorelease_pool = + std::make_unique(); +#endif -+ + + int exit_code = MainInitialize(params); + if (exit_code >= 0) + return exit_code; diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index c951943bf..af55dc1a6 100644 --- a/patch/patches/services_network_2622.patch +++ b/patch/patches/services_network_2622.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/net/profile_network_context_service.cc chrome/browser/net/profile_network_context_service.cc -index 2b24d1ac1b5b..6577495d87a9 100644 +index 27ebbc3dd176..063ba271c51e 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -14,6 +14,7 @@ @@ -8,11 +8,11 @@ index 2b24d1ac1b5b..6577495d87a9 100644 #include "base/task/post_task.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/browser_process.h" + #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" - #include "chrome/browser/data_reduction_proxy/data_reduction_proxy_chrome_settings.h" -@@ -411,16 +412,23 @@ ProfileNetworkContextService::CreateNetworkContextParams( - CONTENT_SETTINGS_TYPE_COOKIES, std::string(), &settings); - network_context_params->cookie_manager_params->settings = std::move(settings); +@@ -427,16 +428,23 @@ ProfileNetworkContextService::CreateNetworkContextParams( + network_context_params->cookie_manager_params = + CreateCookieManagerParams(profile_, *cookie_settings_); + network_context_params->cookieable_schemes = profile_->GetCookieableSchemes(); + @@ -35,10 +35,10 @@ index 2b24d1ac1b5b..6577495d87a9 100644 base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index 15d2512dbeaa..04a34b73876b 100644 +index e47a8949199f..c713ada1b206 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -352,6 +352,11 @@ class Profile : public content::BrowserContext { +@@ -365,6 +365,11 @@ class Profile : public content::BrowserContext { virtual bool ShouldRestoreOldSessionCookies(); virtual bool ShouldPersistSessionCookies(); @@ -51,10 +51,10 @@ index 15d2512dbeaa..04a34b73876b 100644 // itself, if |relative_path| is empty). virtual network::mojom::NetworkContextPtr CreateNetworkContext( diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 5772e2ac6eb7..86053af86f14 100644 +index 83a309d40b1b..7d93f7891426 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -510,6 +510,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -509,6 +509,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -81,10 +81,10 @@ index 5772e2ac6eb7..86053af86f14 100644 void CookieMonster::SetPersistSessionCookies(bool persist_session_cookies) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git net/cookies/cookie_monster.h net/cookies/cookie_monster.h -index 9b7dbbe4f644..da5ee7fe3f28 100644 +index 913737e78194..05ad0e8deffd 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h -@@ -176,6 +176,8 @@ class NET_EXPORT CookieMonster : public CookieStore { +@@ -180,6 +180,8 @@ class NET_EXPORT CookieMonster : public CookieStore { CookieChangeDispatcher& GetChangeDispatcher() override; void SetCookieableSchemes(const std::vector& schemes, SetCookieableSchemesCallback callback) override; @@ -110,10 +110,10 @@ index d6299f543edd..ac8edd449452 100644 virtual void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, const std::string& parent_absolute_name) const; diff --git services/network/cookie_manager.cc services/network/cookie_manager.cc -index 8be1b9dea5f7..30f23449ac51 100644 +index a73b9f31cf17..4e0d4b4b4746 100644 --- services/network/cookie_manager.cc +++ services/network/cookie_manager.cc -@@ -214,14 +214,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) { +@@ -206,14 +206,9 @@ void CookieManager::FlushCookieStore(FlushCookieStoreCallback callback) { void CookieManager::AllowFileSchemeCookies( bool allow, AllowFileSchemeCookiesCallback callback) { @@ -132,18 +132,18 @@ index 8be1b9dea5f7..30f23449ac51 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index 6082e82d5854..b68b48eda578 100644 +index dffa1299b1cf..169ea2925274 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -1700,6 +1700,7 @@ URLRequestContextOwner NetworkContext::ApplyContextParamsToBuilder( +@@ -1726,6 +1726,7 @@ URLRequestContextOwner NetworkContext::ApplyContextParamsToBuilder( } scoped_refptr session_cleanup_cookie_store; + std::unique_ptr cookie_store; if (params_->cookie_path) { scoped_refptr client_task_runner = - base::MessageLoopCurrent::Get()->task_runner(); -@@ -1727,18 +1728,27 @@ URLRequestContextOwner NetworkContext::ApplyContextParamsToBuilder( + base::ThreadTaskRunnerHandle::Get(); +@@ -1753,18 +1754,27 @@ URLRequestContextOwner NetworkContext::ApplyContextParamsToBuilder( session_cleanup_cookie_store = base::MakeRefCounted(sqlite_store); @@ -175,10 +175,10 @@ index 6082e82d5854..b68b48eda578 100644 std::make_unique( params_->accept_language, params_->user_agent); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 482ec3cd0ba7..d135f0f19046 100644 +index 58b18e0c3c2b..38020694872a 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -205,6 +205,9 @@ struct NetworkContextParams { +@@ -206,6 +206,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_request_id_2718.patch b/patch/patches/services_network_request_id_2718.patch index 61c00673c..956f76a66 100644 --- a/patch/patches/services_network_request_id_2718.patch +++ b/patch/patches/services_network_request_id_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/network_service_client.cc content/browser/network_service_client.cc -index 2c2795aeaf51..7cded67a3fe3 100644 +index b89e764feb03..0bb056852db2 100644 --- content/browser/network_service_client.cc +++ content/browser/network_service_client.cc -@@ -205,10 +205,6 @@ class LoginHandlerDelegate { +@@ -207,10 +207,6 @@ class LoginHandlerDelegate { } WebContents* web_contents = web_contents_getter_.Run(); @@ -13,20 +13,20 @@ index 2c2795aeaf51..7cded67a3fe3 100644 // WeakPtr is not strictly necessary here due to OnRequestCancelled. creating_login_delegate_ = true; -@@ -500,11 +496,6 @@ void NetworkServiceClient::OnAuthRequired( - base::RepeatingCallback web_contents_getter = - base::BindRepeating(GetWebContents, process_id, routing_id); - +@@ -332,10 +328,7 @@ void OnAuthRequiredContinuation( + web_contents_getter = + base::BindRepeating(GetWebContents, process_id, routing_id); + } - if (!web_contents_getter.Run()) { - std::move(auth_challenge_responder)->OnAuthCredentials(base::nullopt); - return; - } -- - bool is_request_for_main_frame = IsMainFrameRequest(process_id, routing_id); ++ new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, + is_request_for_main_frame, process_id, routing_id, diff --git services/network/public/cpp/simple_url_loader.cc services/network/public/cpp/simple_url_loader.cc -index 068b86169fab..b8488726b6a7 100644 +index b575b0bb3a35..a04e74d5896f 100644 --- services/network/public/cpp/simple_url_loader.cc +++ services/network/public/cpp/simple_url_loader.cc @@ -227,6 +227,7 @@ class SimpleURLLoaderImpl : public SimpleURLLoader, @@ -46,7 +46,7 @@ index 068b86169fab..b8488726b6a7 100644 // Populated in the constructor, and cleared once no longer needed, when no // more retries are possible. std::unique_ptr resource_request_; -@@ -1368,6 +1371,12 @@ void SimpleURLLoaderImpl::SetTimeoutDuration(base::TimeDelta timeout_duration) { +@@ -1363,6 +1366,12 @@ void SimpleURLLoaderImpl::SetTimeoutDuration(base::TimeDelta timeout_duration) { timeout_duration_ = timeout_duration; } @@ -59,7 +59,7 @@ index 068b86169fab..b8488726b6a7 100644 int SimpleURLLoaderImpl::NetError() const { // Should only be called once the request is compelete. DCHECK(request_state_->finished); -@@ -1516,7 +1525,7 @@ void SimpleURLLoaderImpl::StartRequest( +@@ -1511,7 +1520,7 @@ void SimpleURLLoaderImpl::StartRequest( string_upload_data_pipe_getter_->GetPtrForNewUpload()); } url_loader_factory->CreateLoaderAndStart( diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index 316522ef4..f6449a866 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -1,8 +1,8 @@ diff --git ui/views/controls/native/native_view_host.cc ui/views/controls/native/native_view_host.cc -index 9d2c42e2ef46..e1b89a6a5d25 100644 +index d6116fdbdd09..99191c7e46a9 100644 --- ui/views/controls/native/native_view_host.cc +++ ui/views/controls/native/native_view_host.cc -@@ -151,7 +151,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { +@@ -150,7 +150,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) { // It would be nice if this used some approximation of the page's // current background color. if (native_wrapper_->HasInstalledClip()) @@ -12,10 +12,10 @@ index 9d2c42e2ef46..e1b89a6a5d25 100644 void NativeViewHost::VisibilityChanged(View* starting_from, bool is_visible) { diff --git ui/views/controls/native/native_view_host.h ui/views/controls/native/native_view_host.h -index c64341390fc4..6b2491ef4827 100644 +index 2a6cfc54d866..48623ab5d672 100644 --- ui/views/controls/native/native_view_host.h +++ ui/views/controls/native/native_view_host.h -@@ -86,6 +86,12 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -85,6 +85,12 @@ class VIEWS_EXPORT NativeViewHost : public View { void set_fast_resize(bool fast_resize) { fast_resize_ = fast_resize; } bool fast_resize() const { return fast_resize_; } @@ -28,7 +28,7 @@ index c64341390fc4..6b2491ef4827 100644 gfx::NativeView native_view() const { return native_view_; } void NativeViewDestroyed(); -@@ -133,6 +139,9 @@ class VIEWS_EXPORT NativeViewHost : public View { +@@ -131,6 +137,9 @@ class VIEWS_EXPORT NativeViewHost : public View { // in the setter/accessor above. bool fast_resize_ = false; @@ -39,10 +39,10 @@ index c64341390fc4..6b2491ef4827 100644 }; diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 85a5587f4c5e..5621deed9417 100644 +index 805703d5f79a..4f86e1982a8e 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -121,6 +121,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, +@@ -112,6 +112,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, MaybeEnableAutoResize(); } @@ -54,10 +54,10 @@ index 85a5587f4c5e..5621deed9417 100644 if (crashed_overlay_view_ == crashed_overlay_view) return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 2d358a9d028f..2a4b4937c160 100644 +index 9872ad3c2f42..d71c546d1a38 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h -@@ -81,6 +81,10 @@ class WEBVIEW_EXPORT WebView : public View, +@@ -80,6 +80,10 @@ class WEBVIEW_EXPORT WebView : public View, void EnableSizingFromWebContents(const gfx::Size& min_size, const gfx::Size& max_size); diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 643f8bd9c..c4aecca18 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -1,5 +1,5 @@ diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc -index 94588aa5822d..1c16a71c4524 100644 +index 859cf37ae470..ddf7c87e9327 100644 --- content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc @@ -117,7 +117,8 @@ ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor( @@ -13,10 +13,10 @@ index 94588aa5822d..1c16a71c4524 100644 {base::MayBlock(), base::TaskPriority::BEST_EFFORT, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 0d95af0ef882..463709a9152f 100644 +index 5fbd75f67fb7..b92df84a2abf 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -57,6 +57,7 @@ +@@ -58,6 +58,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" @@ -24,7 +24,7 @@ index 0d95af0ef882..463709a9152f 100644 #include "media/base/media_switches.h" #include "media/capabilities/in_memory_video_decode_stats_db_impl.h" #include "media/capabilities/video_decode_stats_db_impl.h" -@@ -213,7 +214,7 @@ StoragePartition* GetStoragePartitionFromConfig( +@@ -214,7 +215,7 @@ StoragePartition* GetStoragePartitionFromConfig( StoragePartitionImplMap* partition_map = GetStoragePartitionMap(browser_context); @@ -33,7 +33,7 @@ index 0d95af0ef882..463709a9152f 100644 in_memory = true; return partition_map->Get(partition_domain, partition_name, in_memory, -@@ -795,7 +796,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { +@@ -798,7 +799,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { kUseInMemoryDBDefault); std::unique_ptr stats_db; @@ -43,10 +43,10 @@ index 0d95af0ef882..463709a9152f 100644 std::make_unique(nullptr); } else { diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index 1aa874a2cf34..ff3279cbc323 100644 +index c49bdcea4b64..a578f26a7aa7 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -2178,6 +2178,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { +@@ -2213,6 +2213,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { plugin_registry_.reset( new PluginRegistryImpl(GetBrowserContext()->GetResourceContext())); } diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index 4ff1eda3e..f71fd0c77 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,5 +1,5 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index 97055b4bdaf0..10a59fc71431 100644 +index 7c0723ffd493..96e2af4c0588 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -47,6 +47,8 @@ diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 8dc9bc6b6..f553da490 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -39,10 +39,10 @@ index cce16a111356..9f0a8b73adb5 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 87fd6313f5d8..42f58e7c13c9 100644 +index 2ed814d50a9b..4a1fec248663 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc -@@ -532,6 +532,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) { +@@ -539,6 +539,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { } } @@ -57,7 +57,7 @@ index 87fd6313f5d8..42f58e7c13c9 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -1638,6 +1646,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -1661,6 +1669,19 @@ void RenderText::OnTextAttributeChanged() { if (!multiline_ && replace_newline_chars_with_symbols_) base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_); @@ -78,12 +78,12 @@ index 87fd6313f5d8..42f58e7c13c9 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 5c3985176054..ceab2a4fd9ba 100644 +index 3c3fc3e8eb16..c6e46c0082d8 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -310,6 +310,10 @@ class GFX_EXPORT RenderText { - void SetElideBehavior(ElideBehavior elide_behavior); - ElideBehavior elide_behavior() const { return elide_behavior_; } +@@ -318,6 +318,10 @@ class GFX_EXPORT RenderText { + return whitespace_elision_; + } + // Get or set the flags that control display of accelerator characters. + void SetDrawStringsFlags(int flags); @@ -92,7 +92,7 @@ index 5c3985176054..ceab2a4fd9ba 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -956,6 +960,8 @@ class GFX_EXPORT RenderText { +@@ -977,6 +981,8 @@ class GFX_EXPORT RenderText { // The cursor position in view space, used to traverse lines of varied widths. base::Optional cached_cursor_x_; @@ -102,10 +102,10 @@ index 5c3985176054..ceab2a4fd9ba 100644 }; diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index 308797385683..c0d0ac3bb496 100644 +index c410d9fb249e..3b84416e3e6d 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h -@@ -120,6 +120,8 @@ class VIEWS_EXPORT InkDropHostView : public View { +@@ -132,6 +132,8 @@ class VIEWS_EXPORT InkDropHostView : public View { // them. void AnimateInkDrop(InkDropState state, const ui::LocatedEvent* event); @@ -115,10 +115,10 @@ index 308797385683..c0d0ac3bb496 100644 // Size used for the default SquareInkDropRipple. static constexpr int kDefaultInkDropSize = 24; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 90e6f9e1b003..756202fdaa6d 100644 +index 214b1a74c5b2..fd15c4dfcb50 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -469,6 +469,12 @@ void LabelButton::OnThemeChanged() { +@@ -462,6 +462,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -132,10 +132,10 @@ index 90e6f9e1b003..756202fdaa6d 100644 const gfx::Size previous_image_size(image_->GetPreferredSize()); UpdateImage(); diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h -index 93538c101aa0..4dec84140c5f 100644 +index c183274ec443..63fee0c613ab 100644 --- ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h -@@ -110,6 +110,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { +@@ -107,6 +107,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ui::NativeTheme::State GetForegroundThemeState( ui::NativeTheme::ExtraParams* params) const override; @@ -146,14 +146,13 @@ index 93538c101aa0..4dec84140c5f 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 24d08c798ce7..4245b08cc743 100644 +index e2d51fc87b23..258b50c8ea11 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -44,6 +44,22 @@ bool IsOpaque(SkColor color) { +@@ -40,6 +40,20 @@ bool IsOpaque(SkColor color) { + return SkColorGetA(color) == SK_AlphaOPAQUE; + } - namespace views { - -+namespace { +// Strips accelerator character prefixes in |text| if needed, based on |flags|. +// Returns a range in |text| to underline or Range::InvalidRange() if +// underlining is not needed. @@ -165,15 +164,14 @@ index 24d08c798ce7..4245b08cc743 100644 + if ((flags & gfx::Canvas::SHOW_PREFIX) && char_pos != -1) + return gfx::Range(char_pos, char_pos + char_span); + } -+ return gfx::Range::InvalidRange(); ++ return gfx::Range::InvalidRange(); +} -+} // namespace + - const char Label::kViewClassName[] = "Label"; + } // namespace - Label::Label() : Label(base::string16()) { -@@ -205,6 +221,14 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { - ResetLayout(); + namespace views { +@@ -271,6 +285,14 @@ base::string16 Label::GetTooltipText() const { + return tooltip_text_; } +void Label::SetDrawStringsFlags(int flags) { @@ -186,15 +184,15 @@ index 24d08c798ce7..4245b08cc743 100644 + void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); - tooltip_text_ = tooltip_text; -@@ -436,7 +460,19 @@ std::unique_ptr Label::CreateRenderText() const { + if (tooltip_text_ == tooltip_text) +@@ -539,7 +561,19 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SetFontList(font_list()); render_text->set_shadows(shadows()); render_text->SetCursorEnabled(false); -- render_text->SetText(text()); +- render_text->SetText(GetText()); + + if (draw_strings_flags_ != 0) { -+ base::string16 text_str = text(); ++ base::string16 text_str = GetText(); + gfx::Range range = StripAcceleratorChars(draw_strings_flags_, &text_str); + render_text->SetText(text_str); + if (range.IsValid()) { @@ -202,28 +200,28 @@ index 24d08c798ce7..4245b08cc743 100644 + render_text->ApplyStyle(gfx::TEXT_STYLE_UNDERLINE, true, range); + } + } else { -+ render_text->SetText(text()); ++ render_text->SetText(GetText()); + } + - render_text->SetMultiline(multi_line()); - render_text->SetMaxLines(multi_line() ? max_lines() : 0); + render_text->SetMultiline(GetMultiLine()); + render_text->SetMaxLines(GetMultiLine() ? GetMaxLines() : 0); render_text->SetWordWrapBehavior(full_text_->word_wrap_behavior()); diff --git ui/views/controls/label.h ui/views/controls/label.h -index 50e30e5cf35b..7e774383cdb1 100644 +index ce169b164bc7..743509aa6acb 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -163,6 +163,10 @@ class VIEWS_EXPORT Label : public View, +@@ -164,6 +164,10 @@ class VIEWS_EXPORT Label : public View, + gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); - gfx::ElideBehavior elide_behavior() const { return elide_behavior_; } + // Get or set the flags that control display of accelerator characters. + void SetDrawStringsFlags(int flags); -+ int draw_strings_flags() const { return draw_strings_flags_; } ++ int GetDrawStringsFlags() const { return draw_strings_flags_; } + - // 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 -@@ -391,6 +395,7 @@ class VIEWS_EXPORT Label : public View, + // Gets/Sets the tooltip text. Default behavior for a label (single-line) is + // to show the full text if it is wider than its bounds. Calling this + // overrides the default behavior and lets you set a custom tooltip. To +@@ -396,6 +400,7 @@ class VIEWS_EXPORT Label : public View, bool collapse_when_hidden_; int fixed_width_; int max_width_; @@ -232,10 +230,10 @@ index 50e30e5cf35b..7e774383cdb1 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 3ae7da55cf15..ba591459649a 100644 +index 354216cafea8..16ec7b4c4c3f 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2561,8 +2561,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2571,8 +2571,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -250,7 +248,7 @@ index 3ae7da55cf15..ba591459649a 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2581,8 +2586,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2591,8 +2596,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -263,7 +261,7 @@ index 3ae7da55cf15..ba591459649a 100644 SetSelection(item, SELECTION_UPDATE_IMMEDIATELY); else if (item->GetParentMenuItem()->GetParentMenuItem()) diff --git ui/views/controls/menu/menu_delegate.h ui/views/controls/menu/menu_delegate.h -index 921aef245bf3..4b7474c01c0e 100644 +index bdbd9c7e37b8..86138fd1d21c 100644 --- ui/views/controls/menu/menu_delegate.h +++ ui/views/controls/menu/menu_delegate.h @@ -81,6 +81,22 @@ class VIEWS_EXPORT MenuDelegate { @@ -302,7 +300,7 @@ index 921aef245bf3..4b7474c01c0e 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 1e27d88823a3..7c9bcd0976ad 100644 +index c8a32b58cf7d..9d67171c89a8 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc @@ -1057,6 +1057,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, @@ -443,7 +441,7 @@ index 78f832fd3acf..cb030c991614 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 7ae246a53bdd..c28d8fe4a727 100644 +index 3e7c6460bc16..84b1aa48d96f 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc @@ -179,6 +179,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) @@ -474,7 +472,7 @@ index 4f865802a6e9..42d047bd68ad 100644 // Move the cursor because EnterNotify/LeaveNotify are generated with the // current mouse position as a result of XGrabPointer() diff --git ui/views/view.h ui/views/view.h -index 3d90ae1c174c..7afa78b18c8a 100644 +index a4f2ba254fb0..8d76cfa46fa6 100644 --- ui/views/view.h +++ ui/views/view.h @@ -22,6 +22,7 @@ @@ -485,7 +483,7 @@ index 3d90ae1c174c..7afa78b18c8a 100644 #include "build/build_config.h" #include "third_party/skia/include/core/SkPath.h" #include "ui/accessibility/ax_enums.mojom.h" -@@ -274,7 +275,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, +@@ -275,7 +276,8 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, public ui::EventTarget, public ui::EventHandler, public ui::PropertyHandler, diff --git a/patch/patches/views_widget_180_1481_1565_1677_1749.patch b/patch/patches/views_widget_180_1481_1565_1677_1749.patch index fcaeed2aa..4ddedc0d2 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 a2902adc59b6..2289ef03efc0 100644 +index f41270e26278..38303c9c3ec8 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -579,6 +579,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -577,6 +577,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,10 +18,10 @@ index a2902adc59b6..2289ef03efc0 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 903131f45d4f..49b0a67cb39e 100644 +index 8e523d78e765..d951d8915864 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -75,6 +75,7 @@ class CursorManager; +@@ -71,6 +71,7 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index 903131f45d4f..49b0a67cb39e 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -96,6 +97,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -91,6 +92,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase float current_device_scale_factor() const { return current_device_scale_factor_; } @@ -39,7 +39,7 @@ index 903131f45d4f..49b0a67cb39e 100644 // Returns the focused RenderWidgetHost inside this |view|'s RWH. RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -130,6 +134,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -125,6 +129,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase void DisableAutoResize(const gfx::Size& new_size) override; bool IsScrollOffsetAtTop() override; float GetDeviceScaleFactor() final; @@ -48,7 +48,7 @@ index 903131f45d4f..49b0a67cb39e 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordTabSwitchTimeRequest(base::TimeTicks start_time, -@@ -491,6 +497,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -479,6 +485,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,7 +61,7 @@ index 903131f45d4f..49b0a67cb39e 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -664,6 +676,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase +@@ -643,6 +655,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase bool is_currently_scrolling_viewport_ = false; @@ -73,7 +73,7 @@ index 903131f45d4f..49b0a67cb39e 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index 4e2075be4cf3..267cacfd285a 100644 +index 21f93de01aa5..8b7ec41d94da 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -32,6 +32,10 @@ @@ -87,7 +87,7 @@ index 4e2075be4cf3..267cacfd285a 100644 #if defined(OS_WIN) #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/public/common/context_menu_params.h" -@@ -879,6 +883,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { +@@ -922,6 +926,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { ::SetFocus(hwnd); } } @@ -121,6 +121,44 @@ index 07d4351d0a8a..4ad78ab76a7c 100644 #if defined(OS_MACOSX) // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; +diff --git ui/base/x/x11_window.cc ui/base/x/x11_window.cc +index 7df0a3a8ed26..4078efb5ad10 100644 +--- ui/base/x/x11_window.cc ++++ ui/base/x/x11_window.cc +@@ -190,8 +190,12 @@ void XWindow::Init(const Configuration& config) { + attribute_mask |= CWBorderPixel; + swa.border_pixel = 0; + ++ gfx::AcceleratedWidget parent_widget = config.parent_widget; ++ if (parent_widget == gfx::kNullAcceleratedWidget) ++ parent_widget = x_root_window_; ++ + bounds_in_pixels_ = SanitizeBounds(config.bounds); +- xwindow_ = XCreateWindow(xdisplay_, x_root_window_, bounds_in_pixels_.x(), ++ xwindow_ = XCreateWindow(xdisplay_, parent_widget, bounds_in_pixels_.x(), + bounds_in_pixels_.y(), bounds_in_pixels_.width(), + bounds_in_pixels_.height(), + 0, // border width +diff --git ui/base/x/x11_window.h ui/base/x/x11_window.h +index 97d8273414fa..b8784d044c61 100644 +--- ui/base/x/x11_window.h ++++ ui/base/x/x11_window.h +@@ -20,6 +20,7 @@ + #include "ui/gfx/geometry/rect.h" + #include "ui/gfx/geometry/size.h" + #include "ui/gfx/geometry/size_f.h" ++#include "ui/gfx/native_widget_types.h" + #include "ui/gfx/x/x11.h" + #include "ui/gfx/x/x11_types.h" + +@@ -86,6 +87,7 @@ class COMPONENT_EXPORT(UI_BASE_X) XWindow { + std::string wm_class_name; + std::string wm_class_class; + std::string wm_role_name; ++ gfx::AcceleratedWidget parent_widget; + }; + + explicit XWindow(Delegate* delegate); diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc index 70553b153c44..ecd99bc78373 100644 --- ui/views/widget/desktop_aura/desktop_screen_win.cc @@ -135,10 +173,10 @@ index 70553b153c44..ecd99bc78373 100644 return host ? host->GetAcceleratedWidget() : nullptr; } 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 c18d5fb9ea58..52b35b90e03d 100644 +index 7e31a1c159af..eb0451b8913a 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -92,6 +92,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( +@@ -95,6 +95,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( should_animate_window_close_(false), pending_close_(false), has_non_client_view_(false), @@ -146,7 +184,7 @@ index c18d5fb9ea58..52b35b90e03d 100644 tooltip_(nullptr) {} DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { -@@ -125,8 +126,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -128,8 +129,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_); HWND parent_hwnd = nullptr; @@ -160,7 +198,7 @@ index c18d5fb9ea58..52b35b90e03d 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -880,11 +885,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -891,11 +896,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -179,7 +217,7 @@ index c18d5fb9ea58..52b35b90e03d 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(ui::MouseEvent* event) { diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.h ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -index 8ac960b083c8..66b6ff2a3259 100644 +index 335db0db49bb..7f60402ed086 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h @@ -288,6 +288,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin @@ -194,89 +232,64 @@ index 8ac960b083c8..66b6ff2a3259 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 81ef38287b65..f0e43abdc143 100644 +index b03a5bc9d509..bcbf960a130e 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -@@ -211,6 +211,8 @@ std::vector DesktopWindowTreeHostX11::GetAllOpenWindows() { +@@ -139,6 +139,7 @@ ui::XWindow::Configuration ConvertInitParamsToX11WindowConfig( + config.wm_class_name = params.wm_class_name; + config.wm_class_class = params.wm_class_class; + config.wm_role_name = params.wm_role_name; ++ config.parent_widget = params.parent_widget; + + return config; + } +@@ -246,6 +247,8 @@ std::vector DesktopWindowTreeHostX11::GetAllOpenWindows() { } gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const { + if (!screen_bounds_.IsEmpty()) + return screen_bounds_; - return bounds_in_pixels_; + return x11_window_->bounds(); } -@@ -519,7 +521,8 @@ void DesktopWindowTreeHostX11::CloseNow() { - // Actually free our native resources. - if (ui::PlatformEventSource::GetInstance()) - ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); -- XDestroyWindow(xdisplay_, xwindow_); -+ if (!xwindow_destroyed_) -+ XDestroyWindow(xdisplay_, xwindow_); - xwindow_ = x11::None; - - if (update_counter_ != x11::None) { -@@ -671,6 +674,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( +@@ -540,6 +543,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( } gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { + if (!screen_bounds_.IsEmpty()) + return screen_bounds_; - return ToDIPRect(bounds_in_pixels_); + gfx::Rect bounds_in_pixels = x11_window_->bounds(); + return ToDIPRect(bounds_in_pixels); } - -@@ -1296,6 +1301,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( +@@ -954,6 +959,9 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( } gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const { + if (!screen_bounds_.IsEmpty()) + return screen_bounds_.origin(); - return bounds_in_pixels_.origin(); ++ + return x11_window_->bounds().origin(); } -@@ -1436,7 +1443,6 @@ void DesktopWindowTreeHostX11::InitX11Window( - XAtom window_type; - switch (params.type) { - case Widget::InitParams::TYPE_MENU: -- swa.override_redirect = x11::True; - window_type = gfx::GetAtom("_NET_WM_WINDOW_TYPE_MENU"); - break; - case Widget::InitParams::TYPE_TOOLTIP: -@@ -1493,9 +1499,15 @@ void DesktopWindowTreeHostX11::InitX11Window( - attribute_mask |= CWBorderPixel; - swa.border_pixel = 0; - -+ gfx::AcceleratedWidget parent_widget = params.parent_widget; -+ if (parent_widget == gfx::kNullAcceleratedWidget) -+ parent_widget = x_root_window_; -+ else +@@ -1280,6 +1288,11 @@ void DesktopWindowTreeHostX11::InitX11Window(const Widget::InitParams& params) { + config.background_color = background_color; + config.prefer_dark_theme = linux_ui && linux_ui->PreferDarkTheme(); + config.icon = ViewsDelegate::GetInstance()->GetDefaultWindowIcon(); ++ ++ gfx::AcceleratedWidget parent_widget = config.parent_widget; ++ if (parent_widget != gfx::kNullAcceleratedWidget) + has_external_parent_ = true; + - bounds_in_pixels_ = ToPixelRect(params.bounds); - bounds_in_pixels_.set_size(AdjustSize(bounds_in_pixels_.size())); -- xwindow_ = XCreateWindow(xdisplay_, x_root_window_, bounds_in_pixels_.x(), -+ xwindow_ = XCreateWindow(xdisplay_, parent_widget, bounds_in_pixels_.x(), - bounds_in_pixels_.y(), bounds_in_pixels_.width(), - bounds_in_pixels_.height(), - 0, // border width -@@ -2157,6 +2169,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( - } - break; - } -+ case DestroyNotify: -+ xwindow_destroyed_ = true; -+ CloseNow(); -+ break; - case x11::FocusIn: - case x11::FocusOut: - OnFocusEvent(xev->type == x11::FocusIn, event->xfocus.mode, + x11_window_->Init(config); + + // Disable compositing on tooltips as a workaround for 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 92f49c677d62..2c1f1f8773e2 100644 +index e32726ad4616..cad33f22bf74 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -@@ -91,6 +91,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 - // Returns a map of KeyboardEvent code to KeyboardEvent key values. - base::flat_map GetKeyboardLayoutMap() override; +@@ -102,6 +102,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 + // be changed after. + void SetVisualId(VisualID visual_id); + void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } + @@ -287,20 +300,13 @@ index 92f49c677d62..2c1f1f8773e2 100644 protected: // Overridden from DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override; -@@ -325,6 +331,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 - // The bounds of |xwindow_|. - gfx::Rect bounds_in_pixels_; +@@ -294,6 +300,13 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 + // behavior if > 0. + ui::ZOrderLevel z_order_ = ui::ZOrderLevel::kNormal; + // Override the screen bounds when the host is a child window. + gfx::Rect screen_bounds_; + - // 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 -@@ -365,6 +374,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 - // Whether we used an ARGB visual for our window. - bool use_argb_visual_ = false; - + // True if the widget has a external parent view/window outside of the + // Chromium-controlled view/window hierarchy. + bool has_external_parent_ = false; @@ -308,21 +314,11 @@ index 92f49c677d62..2c1f1f8773e2 100644 DesktopDragDropClientAuraX11* drag_drop_client_ = nullptr; std::unique_ptr x11_non_client_event_filter_; -@@ -472,6 +485,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 - bool configure_counter_value_is_extended_ = false; - std::unique_ptr compositor_observer_; - -+ // True if the xwindow has already been destroyed. -+ bool xwindow_destroyed_ = false; -+ - base::WeakPtrFactory close_widget_factory_{this}; - base::WeakPtrFactory weak_factory_{this}; - diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 0f01bf0c73c9..29676434c345 100644 +index 0cb75272c2ca..ef79679114d4 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -159,6 +159,7 @@ Widget::InitParams::InitParams(Type type) +@@ -157,6 +157,7 @@ Widget::InitParams::InitParams(Type type) use_system_default_icon(false), show_state(ui::SHOW_STATE_DEFAULT), parent(nullptr), @@ -330,7 +326,7 @@ index 0f01bf0c73c9..29676434c345 100644 native_widget(nullptr), desktop_window_tree_host(nullptr), layer_type(ui::LAYER_TEXTURED), -@@ -311,7 +312,7 @@ void Widget::Init(const InitParams& in_params) { +@@ -325,7 +326,7 @@ void Widget::Init(const InitParams& in_params) { params.name = params.delegate->GetContentsView()->GetClassName(); params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -339,7 +335,7 @@ index 0f01bf0c73c9..29676434c345 100644 if (params.opacity == views::Widget::InitParams::INFER_OPACITY && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -375,7 +376,12 @@ void Widget::Init(const InitParams& in_params) { +@@ -389,7 +390,12 @@ void Widget::Init(const InitParams& in_params) { } } else if (params.delegate) { SetContentsView(params.delegate->GetContentsView()); @@ -353,7 +349,7 @@ index 0f01bf0c73c9..29676434c345 100644 } // TODO(https://crbug.com/953978): Use GetNativeTheme() for all platforms. #if defined(OS_MACOSX) || defined(OS_WIN) -@@ -1165,10 +1171,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1175,10 +1181,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -371,10 +367,10 @@ index 0f01bf0c73c9..29676434c345 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 8a073d74f341..5b2960fe8db5 100644 +index 83ba608199b4..546cbe32020c 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -255,6 +255,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -259,6 +259,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // Whether the widget should be maximized or minimized. ui::WindowShowState show_state; gfx::NativeView parent; @@ -383,7 +379,7 @@ index 8a073d74f341..5b2960fe8db5 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 1f827524f4b4..068af34d3e98 100644 +index 77585733e699..77c5db949902 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h @@ -191,6 +191,10 @@ class VIEWS_EXPORT WidgetDelegate { @@ -398,7 +394,7 @@ index 1f827524f4b4..068af34d3e98 100644 virtual ~WidgetDelegate(); diff --git ui/views/widget/widget_hwnd_utils.cc ui/views/widget/widget_hwnd_utils.cc -index 5bcb8d8b9bae..020fa85573aa 100644 +index 9edfa2c00c4b..8a9217578609 100644 --- ui/views/widget/widget_hwnd_utils.cc +++ ui/views/widget/widget_hwnd_utils.cc @@ -66,7 +66,7 @@ void CalculateWindowStylesFromInitParams( @@ -411,10 +407,10 @@ index 5bcb8d8b9bae..020fa85573aa 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 de88c769b5be..1b642132eb2f 100644 +index 9b683f301913..8609f61ebd0f 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -2903,10 +2903,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2963,10 +2963,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, } else if (event.type() == ui::ET_MOUSEWHEEL) { ui::MouseWheelEvent mouse_wheel_event(msg); // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/viz_osr_2575.patch b/patch/patches/viz_osr_2575.patch index 3de49a4dd..072a267db 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -54,11 +54,11 @@ index 5e5c5da4a3cf..30eca49765bd 100644 #if defined(USE_X11) void DidCompleteSwapWithNewSize(const gfx::Size& size) override; diff --git components/viz/host/layered_window_updater_impl.cc components/viz/host/layered_window_updater_impl.cc -index d3a49ed8be8d..38a927b8f734 100644 +index 65c26e2f7ae8..e0f60e2ac25e 100644 --- components/viz/host/layered_window_updater_impl.cc +++ components/viz/host/layered_window_updater_impl.cc -@@ -47,7 +47,7 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory( - shm_handle.Close(); +@@ -43,7 +43,7 @@ void LayeredWindowUpdaterImpl::OnAllocatedSharedMemory( + // |region|'s handle will close when it goes out of scope. } -void LayeredWindowUpdaterImpl::Draw(DrawCallback draw_callback) { @@ -67,20 +67,20 @@ index d3a49ed8be8d..38a927b8f734 100644 if (!canvas_) { diff --git components/viz/host/layered_window_updater_impl.h components/viz/host/layered_window_updater_impl.h -index 93c52d2b928c..4dc645e770a2 100644 +index d9a9730a78b9..d98426e9f789 100644 --- components/viz/host/layered_window_updater_impl.h +++ components/viz/host/layered_window_updater_impl.h @@ -33,7 +33,7 @@ class VIZ_HOST_EXPORT LayeredWindowUpdaterImpl - void OnAllocatedSharedMemory( - const gfx::Size& pixel_size, - mojo::ScopedSharedBufferHandle scoped_buffer_handle) override; + // mojom::LayeredWindowUpdater implementation. + void OnAllocatedSharedMemory(const gfx::Size& pixel_size, + base::UnsafeSharedMemoryRegion region) override; - void Draw(DrawCallback draw_callback) override; + void Draw(const gfx::Rect& damage_rect, DrawCallback draw_callback) override; private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index f17983a5cc70..4a8f2fd8d415 100644 +index fdd358f741e6..57afa1d3855e 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn @@ -13,6 +13,8 @@ config("viz_service_implementation") { @@ -93,10 +93,10 @@ index f17983a5cc70..4a8f2fd8d415 100644 "display/bsp_tree.h", "display/bsp_walk_action.cc", diff --git components/viz/service/display_embedder/output_surface_provider_impl.cc components/viz/service/display_embedder/output_surface_provider_impl.cc -index 8fe397588eb4..1218985f7310 100644 +index 7f61cb7c847b..f1e3f2fec151 100644 --- components/viz/service/display_embedder/output_surface_provider_impl.cc +++ components/viz/service/display_embedder/output_surface_provider_impl.cc -@@ -11,6 +11,7 @@ +@@ -12,6 +12,7 @@ #include "base/compiler_specific.h" #include "base/threading/thread_task_runner_handle.h" #include "cc/base/switches.h" @@ -104,7 +104,7 @@ index 8fe397588eb4..1218985f7310 100644 #include "components/viz/common/display/renderer_settings.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/service/display_embedder/gl_output_surface.h" -@@ -243,6 +244,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( +@@ -219,6 +220,20 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform( if (headless_) return std::make_unique(); @@ -126,10 +126,10 @@ index 8fe397588eb4..1218985f7310 100644 return CreateSoftwareOutputDeviceWin(surface_handle, &output_device_backing_, display_client); diff --git components/viz/service/display_embedder/software_output_device_win.cc components/viz/service/display_embedder/software_output_device_win.cc -index 4e3f0255d5fe..0de947b54b7c 100644 +index 73ea1986b214..d437e045de2f 100644 --- components/viz/service/display_embedder/software_output_device_win.cc +++ components/viz/service/display_embedder/software_output_device_win.cc -@@ -268,8 +268,9 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( +@@ -265,8 +265,9 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated( if (!canvas_) return; @@ -163,10 +163,10 @@ index 906be544c90f..a110f254d7ec 100644 #if ENABLE_SYNC_CALL_RESTRICTIONS diff --git services/viz/privileged/interfaces/compositing/display_private.mojom services/viz/privileged/interfaces/compositing/display_private.mojom -index deb327b77054..d9926ec35165 100644 +index 8898b9162a65..3a93996f9893 100644 --- services/viz/privileged/interfaces/compositing/display_private.mojom +++ services/viz/privileged/interfaces/compositing/display_private.mojom -@@ -77,12 +77,14 @@ interface DisplayPrivate { +@@ -79,12 +79,14 @@ interface DisplayPrivate { }; interface DisplayClient { @@ -183,10 +183,10 @@ index deb327b77054..d9926ec35165 100644 // Notifies that a swap has occurred and provides information about the pixel diff --git services/viz/privileged/interfaces/compositing/layered_window_updater.mojom services/viz/privileged/interfaces/compositing/layered_window_updater.mojom -index 360cab3eee4c..6834242f23d2 100644 +index 58a7e221eaab..dd141b16eace 100644 --- services/viz/privileged/interfaces/compositing/layered_window_updater.mojom +++ services/viz/privileged/interfaces/compositing/layered_window_updater.mojom -@@ -22,5 +22,5 @@ interface LayeredWindowUpdater { +@@ -26,5 +26,5 @@ interface LayeredWindowUpdater { // Draws to the HWND by copying pixels from shared memory. Callback must be // called after draw operation is complete to signal shared memory can be // modified. @@ -194,7 +194,7 @@ index 360cab3eee4c..6834242f23d2 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index 494241c374b7..1cbfb9cdb683 100644 +index 5158731bd851..07d3bda5f6ff 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h @@ -23,7 +23,9 @@ @@ -207,7 +207,7 @@ index 494241c374b7..1cbfb9cdb683 100644 #include "services/viz/privileged/interfaces/compositing/vsync_parameter_observer.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkMatrix44.h" -@@ -199,6 +201,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -194,6 +196,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual bool SyncTokensRequiredForDisplayCompositor() = 0; }; @@ -222,7 +222,7 @@ index 494241c374b7..1cbfb9cdb683 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -238,6 +248,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -233,6 +243,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -232,7 +232,7 @@ index 494241c374b7..1cbfb9cdb683 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 -@@ -454,6 +467,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -448,6 +461,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ui::ContextFactory* context_factory_; ui::ContextFactoryPrivate* context_factory_private_; @@ -242,7 +242,7 @@ index 494241c374b7..1cbfb9cdb683 100644 Layer* root_layer_ = nullptr; diff --git ui/compositor/host/host_context_factory_private.cc ui/compositor/host/host_context_factory_private.cc -index 0ff1e05244e0..5b8721034296 100644 +index 1c84de621781..3ebde59a8041 100644 --- ui/compositor/host/host_context_factory_private.cc +++ ui/compositor/host/host_context_factory_private.cc @@ -99,8 +99,13 @@ void HostContextFactoryPrivate::ConfigureCompositor( diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index ae142b068..3a69708de 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 f88cff5ab6d1..981a83fdded2 100644 +index ae1bcfa7db7d..0ff65dcfe38f 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2070,21 +2070,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2131,21 +2131,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 f88cff5ab6d1..981a83fdded2 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -2783,6 +2792,15 @@ void WebContentsImpl::CreateNewWindow( +@@ -2844,6 +2853,15 @@ void WebContentsImpl::CreateNewWindow( create_params.renderer_initiated_creation = main_frame_route_id != MSG_ROUTING_NONE; @@ -61,7 +61,7 @@ index f88cff5ab6d1..981a83fdded2 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -2815,7 +2833,7 @@ void WebContentsImpl::CreateNewWindow( +@@ -2876,7 +2894,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 f88cff5ab6d1..981a83fdded2 100644 } // Save the created window associated with the route so we can show it // later. -@@ -6387,7 +6405,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { +@@ -6516,7 +6534,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostViewBase* rwh_view = @@ -95,10 +95,10 @@ index df508da0aef2..f6f4bf42b108 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 6cf2ca2a0ec5..bb29ed68f094 100644 +index 50236e972100..8c09c1b53d27 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -75,9 +75,11 @@ class BrowserPluginGuestDelegate; +@@ -76,9 +76,11 @@ class BrowserPluginGuestDelegate; class InterstitialPage; class RenderFrameHost; class RenderViewHost; @@ -110,7 +110,7 @@ index 6cf2ca2a0ec5..bb29ed68f094 100644 struct CustomContextMenuContext; struct DropData; struct MHTMLGenerationParams; -@@ -216,6 +218,10 @@ class WebContents : public PageNavigator, +@@ -217,6 +219,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. blink::WebSandboxFlags starting_sandbox_flags; @@ -122,10 +122,10 @@ index 6cf2ca2a0ec5..bb29ed68f094 100644 // the value that'll be returned by GetLastActiveTime(). If this is left // default initialized then the value is not passed on to the WebContents diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index e99b9c52101d..ee725bd31948 100644 +index 23c2a2bdaa77..67fd2a66cab4 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -57,10 +57,12 @@ class FileSelectListener; +@@ -59,10 +59,12 @@ class FileSelectListener; class JavaScriptDialogManager; class RenderFrameHost; class RenderProcessHost; @@ -138,7 +138,7 @@ index e99b9c52101d..ee725bd31948 100644 struct ContextMenuParams; struct DropData; struct NativeWebKeyboardEvent; -@@ -323,6 +325,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -334,6 +336,14 @@ class CONTENT_EXPORT WebContentsDelegate { const std::string& partition_id, SessionStorageNamespace* session_storage_namespace); diff --git a/patch/patches/web_url_loader_cancel_1617042.patch b/patch/patches/web_url_loader_cancel_1617042.patch index c6775b43e..d56554751 100644 --- a/patch/patches/web_url_loader_cancel_1617042.patch +++ b/patch/patches/web_url_loader_cancel_1617042.patch @@ -1,8 +1,8 @@ diff --git content/renderer/loader/web_url_loader_impl.h content/renderer/loader/web_url_loader_impl.h -index 9ce1066841fc..b83e4bcc8969 100644 +index c5b971593d0d..760d5841434e 100644 --- content/renderer/loader/web_url_loader_impl.h +++ content/renderer/loader/web_url_loader_impl.h -@@ -86,6 +86,7 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { +@@ -83,6 +83,7 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { blink::WebBlobInfo& downloaded_blob) override; void LoadAsynchronously(const blink::WebURLRequest& request, blink::WebURLLoaderClient* client) override; @@ -10,7 +10,7 @@ index 9ce1066841fc..b83e4bcc8969 100644 void SetDefersLoading(bool value) override; void DidChangePriority(blink::WebURLRequest::Priority new_priority, int intra_priority_value) override; -@@ -96,8 +97,6 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { +@@ -93,8 +94,6 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { class RequestPeerImpl; class SinkPeer; diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index a90685ea0..0fbaa131a 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,10 +10,10 @@ index ff7a8ed89e94..77f44956ff22 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index cd2e8603c391..a0eb460fcae1 100644 +index 9ae02783be95..b64538cbe8b6 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -706,6 +706,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -685,6 +685,11 @@ class BLINK_PLATFORM_EXPORT Platform { // runs during Chromium's build step). virtual bool IsTakingV8ContextSnapshot() { return false; } @@ -26,7 +26,7 @@ index cd2e8603c391..a0eb460fcae1 100644 static void InitializeCommon(Platform* platform, std::unique_ptr main_thread); diff --git third_party/blink/renderer/core/dom/dom_implementation.cc third_party/blink/renderer/core/dom/dom_implementation.cc -index 3de30fbbe096..a7cab9da38f2 100644 +index 80a9ec9bc75b..13cbb056cdfa 100644 --- third_party/blink/renderer/core/dom/dom_implementation.cc +++ third_party/blink/renderer/core/dom/dom_implementation.cc @@ -244,10 +244,11 @@ Document* DOMImplementation::createDocument(const String& type, @@ -44,10 +44,10 @@ index 3de30fbbe096..a7cab9da38f2 100644 .Top() .GetSecurityContext() diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index 4851cb4a227b..cc88dce2db46 100644 +index 60b3fe655dc8..8dedb75b8d8b 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1234,7 +1234,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1182,7 +1182,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) return nullptr; @@ -57,7 +57,7 @@ index 4851cb4a227b..cc88dce2db46 100644 } diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index e839efcfbd0b..1927d8dd2ed0 100644 +index 789b09417ceb..56d60ee8cb70 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -5,6 +5,7 @@ @@ -67,8 +67,8 @@ index e839efcfbd0b..1927d8dd2ed0 100644 +#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/renderer/bindings/core/v8/script_controller.h" #include "third_party/blink/renderer/core/frame/local_frame.h" - #include "third_party/blink/renderer/core/frame/use_counter.h" -@@ -153,6 +154,7 @@ DevToolsSession::DevToolsSession( + #include "third_party/blink/renderer/core/inspector/devtools_agent.h" +@@ -184,6 +185,7 @@ DevToolsSession::DevToolsSession( for (wtf_size_t i = 0; i < agents_.size(); i++) agents_[i]->Restore(); } @@ -76,7 +76,7 @@ index e839efcfbd0b..1927d8dd2ed0 100644 } DevToolsSession::~DevToolsSession() { -@@ -192,6 +194,7 @@ void DevToolsSession::Detach() { +@@ -223,6 +225,7 @@ void DevToolsSession::Detach() { agents_.clear(); v8_session_.reset(); agent_->client_->DebuggerTaskFinished(); @@ -85,7 +85,7 @@ index e839efcfbd0b..1927d8dd2ed0 100644 void DevToolsSession::FlushProtocolNotifications() { diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index bcab9669d29b..9e90c96b29e7 100644 +index d3f15ac9569d..6823265f1ff0 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc @@ -185,7 +185,8 @@ Page::Page(PageClients& page_clients) @@ -98,7 +98,7 @@ index bcab9669d29b..9e90c96b29e7 100644 // TODO(pdr): Initialize |validation_message_client_| lazily. validation_message_client_( MakeGarbageCollected(*this)), -@@ -346,21 +347,40 @@ void Page::InitialStyleChanged() { +@@ -345,21 +346,40 @@ void Page::InitialStyleChanged() { } } @@ -159,10 +159,10 @@ index bcab9669d29b..9e90c96b29e7 100644 visitor->Trace(plugins_changed_observers_); visitor->Trace(next_related_page_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index eb5e930c4653..3a12676266d3 100644 +index cc3fa3e02fad..bfb8986958ba 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h -@@ -140,7 +140,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, +@@ -141,7 +141,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -172,7 +172,7 @@ index eb5e930c4653..3a12676266d3 100644 // Resets the plugin data for all pages in the renderer process and notifies // PluginsChangedObservers. -@@ -366,7 +367,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, +@@ -374,7 +375,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized, const Member link_highlights_; Member spatial_navigation_controller_; @@ -183,7 +183,7 @@ index eb5e930c4653..3a12676266d3 100644 Member validation_message_client_; diff --git third_party/blink/renderer/core/page/plugin_data.cc third_party/blink/renderer/core/page/plugin_data.cc -index 89a12219de60..df47c0efd193 100644 +index 53a380945307..ae05d1ae36ee 100644 --- third_party/blink/renderer/core/page/plugin_data.cc +++ third_party/blink/renderer/core/page/plugin_data.cc @@ -90,10 +90,12 @@ void PluginData::RefreshBrowserSidePluginCache() { diff --git a/patch/patches/webkit_pointer_event_781966.patch b/patch/patches/webkit_pointer_event_781966.patch index aa6b8cb5d..d04c69ecc 100644 --- a/patch/patches/webkit_pointer_event_781966.patch +++ b/patch/patches/webkit_pointer_event_781966.patch @@ -1,5 +1,5 @@ diff --git third_party/blink/renderer/core/input/pointer_event_manager.cc third_party/blink/renderer/core/input/pointer_event_manager.cc -index 4c8debe8c179..29aac92f216a 100644 +index 1ccbd3b948f0..98a67619990d 100644 --- third_party/blink/renderer/core/input/pointer_event_manager.cc +++ third_party/blink/renderer/core/input/pointer_event_manager.cc @@ -312,7 +312,7 @@ void PointerEventManager::HandlePointerInterruption( diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 873ee1a07..3841dbdaa 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/public/web/web_view.h third_party/blink/public/web/web_view.h -index 3b6b9a0bfc70..5ab43573416b 100644 +index 20bd110babb1..4f5301c77bda 100644 --- third_party/blink/public/web/web_view.h +++ third_party/blink/public/web/web_view.h -@@ -363,6 +363,7 @@ class WebView { +@@ -371,6 +371,7 @@ class WebView { // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void SetUseExternalPopupMenus(bool); @@ -11,10 +11,10 @@ index 3b6b9a0bfc70..5ab43573416b 100644 // Cancels and hides the current popup (datetime, select...) if any. virtual void CancelPagePopup() = 0; diff --git third_party/blink/renderer/core/exported/web_view_impl.cc third_party/blink/renderer/core/exported/web_view_impl.cc -index ec827ff90d5d..cd1f822785ae 100644 +index 414e7de22b08..9db9ea786e27 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -234,8 +234,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { +@@ -217,8 +217,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { g_should_use_external_popup_menus = use_external_popup_menus; } @@ -30,7 +30,7 @@ index ec827ff90d5d..cd1f822785ae 100644 } namespace { -@@ -293,6 +298,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, +@@ -276,6 +281,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, chrome_client_(MakeGarbageCollected(this)), minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), maximum_zoom_level_(ZoomFactorToZoomLevel(kMaxTextSizeMultiplier)), @@ -39,10 +39,10 @@ index ec827ff90d5d..cd1f822785ae 100644 fullscreen_controller_(std::make_unique(this)) { if (!AsView().client) { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 218915791efb..a57420b95773 100644 +index 720ea6fcfb7f..9116fbdcf673 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -107,7 +107,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -109,7 +109,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -52,7 +52,7 @@ index 218915791efb..a57420b95773 100644 // Returns whether frames under this WebView are backed by a compositor. When // false there may be no WebWidgetClient present. When true, there must be a -@@ -615,6 +616,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -619,6 +620,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, float fake_page_scale_animation_page_scale_factor_ = 0.f; bool fake_page_scale_animation_use_anchor_ = false; @@ -62,10 +62,10 @@ index 218915791efb..a57420b95773 100644 TransformationMatrix device_emulation_transform_; diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc -index b71a9ad5dba7..5fc52d50d0ad 100644 +index 2df0aefc5764..6ef2dae97acd 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -847,7 +847,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { +@@ -848,7 +848,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 9c1b42368..a43cfee81 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 00fb583bc90e..667ff3497c1c 100644 +index 827f49d3a00f..2ddfbbab1ab7 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -21,6 +21,7 @@ @@ -10,7 +10,7 @@ index 00fb583bc90e..667ff3497c1c 100644 #include "components/prefs/pref_service.h" #include "components/sync/driver/about_sync_util.h" #include "components/sync/driver/sync_service.h" -@@ -275,6 +276,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -267,6 +268,10 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { } void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { @@ -21,7 +21,7 @@ index 00fb583bc90e..667ff3497c1c 100644 // We are only interested in sync logs for the primary user profile. Profile* profile = ProfileManager::GetPrimaryUserProfile(); if (!profile || !ProfileSyncServiceFactory::HasSyncService(profile)) -@@ -317,6 +322,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -309,6 +314,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -34,7 +34,7 @@ index 00fb583bc90e..667ff3497c1c 100644 extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry::Get(profile); std::string extensions_list; -@@ -395,6 +406,8 @@ void ChromeInternalLogSource::PopulateLocalStateSettings( +@@ -387,6 +398,8 @@ void ChromeInternalLogSource::PopulateLocalStateSettings( #if defined(OS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index 2823ecd37..3a5c5ab10 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 af7b8fa63af0..118aea76fe39 100644 +index 0f25c61d5170..201f4d1c1651 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -4654,7 +4654,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -4648,7 +4648,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 9ecbd341d..593a88bec 100644 --- a/patch/patches/win_rt_2274.patch +++ b/patch/patches/win_rt_2274.patch @@ -1,8 +1,8 @@ diff --git services/service_manager/sandbox/win/sandbox_win.cc services/service_manager/sandbox/win/sandbox_win.cc -index b5e74f458898..c0f00b9745df 100644 +index d4370c2797c0..7509eb4d734d 100644 --- services/service_manager/sandbox/win/sandbox_win.cc +++ services/service_manager/sandbox/win/sandbox_win.cc -@@ -931,8 +931,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( +@@ -934,8 +934,11 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( } // TODO(wfh): Relax strict handle checks for network process until root cause // for this crash can be resolved. See https://crbug.com/939590. diff --git a/tests/cefclient/CMakeLists.txt.in b/tests/cefclient/CMakeLists.txt.in index c7ae75a7a..8a9924e85 100644 --- a/tests/cefclient/CMakeLists.txt.in +++ b/tests/cefclient/CMakeLists.txt.in @@ -179,53 +179,88 @@ if(OS_MACOSX) ${CEFCLIENT_MACOSX_HELPER_SRCS} ) - # Output paths for the app bundles. + # Output path for the main app bundle. set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app") - set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app") - # Variable referenced from Info.plist files. + # Variables referenced from the main Info.plist file. + set(EXECUTABLE_NAME "${CEF_TARGET}") set(PRODUCT_NAME "${CEF_TARGET}") - # Helper executable target. - add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${CEFCLIENT_HELPER_SRCS}) - SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) - add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper) - target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) - set_target_properties(${CEF_HELPER_TARGET} PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist - OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME} - ) - if(USE_SANDBOX) # Logical target used to link the cef_sandbox library. ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") - target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) endif() - # Main executable target. + # Main app bundle target. add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFCLIENT_RESOURCES_SRCS} ${CEFCLIENT_SRCS}) SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET}) - add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}") + add_dependencies(${CEF_TARGET} libcef_dll_wrapper) target_link_libraries(${CEF_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS} "-framework OpenGL") set_target_properties(${CEF_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/Info.plist ) - # Copy files into the main app bundle. + # Copy the CEF framework into the Frameworks directory. add_custom_command( TARGET ${CEF_TARGET} POST_BUILD - # Copy the helper app bundle into the Frameworks directory. - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${CEF_HELPER_APP}" - "${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app" - # Copy the CEF framework into the Frameworks directory. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework" "${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework" VERBATIM ) + # Create the multiple Helper app bundle targets. + foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES}) + # Convert to a list and extract the suffix values. + string(REPLACE ":" ";" _suffix_list ${_suffix_list}) + list(GET _suffix_list 0 _name_suffix) + list(GET _suffix_list 1 _target_suffix) + list(GET _suffix_list 2 _plist_suffix) + + # Define Helper target and output names. + set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}") + set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}") + + # Create Helper-specific variants of the helper-Info.plist file. Do this + # manually because the configure_file command (which is executed as part of + # MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the + # wrong values with multiple targets. + set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist" _plist_contents) + string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents}) + file(WRITE ${_helper_info_plist} ${_plist_contents}) + + # Create Helper executable target. + add_executable(${_helper_target} MACOSX_BUNDLE ${CEFCLIENT_HELPER_SRCS}) + SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target}) + add_dependencies(${_helper_target} libcef_dll_wrapper) + target_link_libraries(${_helper_target} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + set_target_properties(${_helper_target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist} + OUTPUT_NAME ${_helper_output_name} + ) + + if(USE_SANDBOX) + target_link_libraries(${_helper_target} cef_sandbox_lib) + endif() + + # Add the Helper as a dependency of the main executable target. + add_dependencies(${CEF_TARGET} "${_helper_target}") + + # Copy the Helper app bundle into the Frameworks directory. + add_custom_command( + TARGET ${CEF_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app" + "${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app" + VERBATIM + ) + endforeach() + # Manually process and copy over resource files. # The Xcode generator can support this via the set_target_properties RESOURCE # directive but that doesn't properly handle nested resource directories. diff --git a/tests/cefclient/browser/views_window.cc b/tests/cefclient/browser/views_window.cc index 3ffcb2ded..06a5d1dac 100644 --- a/tests/cefclient/browser/views_window.cc +++ b/tests/cefclient/browser/views_window.cc @@ -719,7 +719,6 @@ void ViewsWindow::CreateMenuModel() { CefRefPtr ViewsWindow::CreateBrowseButton( const std::string& label, int id) { - CefRefPtr button = CefLabelButton::CreateLabelButton(this, label); button->SetID(id); diff --git a/tests/cefclient/resources/mac/helper-Info.plist b/tests/cefclient/resources/mac/helper-Info.plist index 21c6280ac..43fb55615 100644 --- a/tests/cefclient/resources/mac/helper-Info.plist +++ b/tests/cefclient/resources/mac/helper-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cef.cefclient.helper + org.cef.cefclient.helper${BUNDLE_ID_SUFFIX} CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/tests/cefsimple/CMakeLists.txt.in b/tests/cefsimple/CMakeLists.txt.in index 145327832..12b1c84f5 100644 --- a/tests/cefsimple/CMakeLists.txt.in +++ b/tests/cefsimple/CMakeLists.txt.in @@ -97,53 +97,88 @@ if(OS_MACOSX) ) endif() - # Output paths for the app bundles. + # Output path for the main app bundle. set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app") - set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app") - # Variable referenced from Info.plist files. + # Variables referenced from the main Info.plist file. + set(EXECUTABLE_NAME "${CEF_TARGET}") set(PRODUCT_NAME "${CEF_TARGET}") - # Helper executable target. - add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS}) - SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) - add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper) - target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) - set_target_properties(${CEF_HELPER_TARGET} PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist - OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME} - ) - if(USE_SANDBOX) # Logical target used to link the cef_sandbox library. ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") - target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) endif() - # Main executable target. + # Main app bundle target. add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_RESOURCES_SRCS} ${CEFSIMPLE_SRCS}) SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET}) - add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}") + add_dependencies(${CEF_TARGET} libcef_dll_wrapper) target_link_libraries(${CEF_TARGET} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) set_target_properties(${CEF_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist ) - # Copy files into the main app bundle. + # Copy the CEF framework into the Frameworks directory. add_custom_command( TARGET ${CEF_TARGET} POST_BUILD - # Copy the helper app bundle into the Frameworks directory. - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${CEF_HELPER_APP}" - "${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app" - # Copy the CEF framework into the Frameworks directory. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework" "${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework" VERBATIM ) + # Create the multiple Helper app bundle targets. + foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES}) + # Convert to a list and extract the suffix values. + string(REPLACE ":" ";" _suffix_list ${_suffix_list}) + list(GET _suffix_list 0 _name_suffix) + list(GET _suffix_list 1 _target_suffix) + list(GET _suffix_list 2 _plist_suffix) + + # Define Helper target and output names. + set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}") + set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}") + + # Create Helper-specific variants of the helper-Info.plist file. Do this + # manually because the configure_file command (which is executed as part of + # MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the + # wrong values with multiple targets. + set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist" _plist_contents) + string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents}) + file(WRITE ${_helper_info_plist} ${_plist_contents}) + + # Create Helper executable target. + add_executable(${_helper_target} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS}) + SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target}) + add_dependencies(${_helper_target} libcef_dll_wrapper) + target_link_libraries(${_helper_target} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + set_target_properties(${_helper_target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist} + OUTPUT_NAME ${_helper_output_name} + ) + + if(USE_SANDBOX) + target_link_libraries(${_helper_target} cef_sandbox_lib) + endif() + + # Add the Helper as a dependency of the main executable target. + add_dependencies(${CEF_TARGET} "${_helper_target}") + + # Copy the Helper app bundle into the Frameworks directory. + add_custom_command( + TARGET ${CEF_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app" + "${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app" + VERBATIM + ) + endforeach() + # Manually process and copy over resource files. # The Xcode generator can support this via the set_target_properties RESOURCE # directive but that doesn't properly handle nested resource directories. diff --git a/tests/cefsimple/mac/helper-Info.plist b/tests/cefsimple/mac/helper-Info.plist index e2d512fa1..46c1e2b90 100644 --- a/tests/cefsimple/mac/helper-Info.plist +++ b/tests/cefsimple/mac/helper-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cef.cefsimple.helper + org.cef.cefsimple.helper${BUNDLE_ID_SUFFIX} CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/tests/ceftests/CMakeLists.txt.in b/tests/ceftests/CMakeLists.txt.in index af0403817..cdda2b7be 100644 --- a/tests/ceftests/CMakeLists.txt.in +++ b/tests/ceftests/CMakeLists.txt.in @@ -104,53 +104,88 @@ endif() # if(OS_MACOSX) - # Output paths for the app bundles. + # Output path for the main app bundle. set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app") - set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_OUTPUT_NAME}.app") - # Variable referenced from Info.plist files. + # Variables referenced from the main Info.plist file. + set(EXECUTABLE_NAME "${CEF_TARGET}") set(PRODUCT_NAME "${CEF_TARGET}") - # Helper executable target. - add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${UNITTESTS_HELPER_SRCS}) - SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) - add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper cef_gtest) - target_link_libraries(${CEF_HELPER_TARGET} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS}) - set_target_properties(${CEF_HELPER_TARGET} PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist - OUTPUT_NAME ${CEF_HELPER_OUTPUT_NAME} - ) - if(USE_SANDBOX) # Logical target used to link the cef_sandbox library. ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") - target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) endif() - # Main executable target. + # Main app bundle target. add_executable(${CEF_TARGET} MACOSX_BUNDLE ${UNITTESTS_RESOURCES_SRCS} ${UNITTESTS_SRCS}) SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_TARGET}) - add_dependencies(${CEF_TARGET} libcef_dll_wrapper cef_gtest "${CEF_HELPER_TARGET}") + add_dependencies(${CEF_TARGET} libcef_dll_wrapper cef_gtest) target_link_libraries(${CEF_TARGET} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS}) set_target_properties(${CEF_TARGET} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/Info.plist ) - # Copy files into the main app bundle. + # Copy the CEF framework into the Frameworks directory. add_custom_command( TARGET ${CEF_TARGET} POST_BUILD - # Copy the helper app bundle into the Frameworks directory. - COMMAND ${CMAKE_COMMAND} -E copy_directory - "${CEF_HELPER_APP}" - "${CEF_APP}/Contents/Frameworks/${CEF_HELPER_OUTPUT_NAME}.app" - # Copy the CEF framework into the Frameworks directory. COMMAND ${CMAKE_COMMAND} -E copy_directory "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework" "${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework" VERBATIM ) + # Create the multiple Helper app bundle targets. + foreach(_suffix_list ${CEF_HELPER_APP_SUFFIXES}) + # Convert to a list and extract the suffix values. + string(REPLACE ":" ";" _suffix_list ${_suffix_list}) + list(GET _suffix_list 0 _name_suffix) + list(GET _suffix_list 1 _target_suffix) + list(GET _suffix_list 2 _plist_suffix) + + # Define Helper target and output names. + set(_helper_target "${CEF_HELPER_TARGET}${_target_suffix}") + set(_helper_output_name "${CEF_HELPER_OUTPUT_NAME}${_name_suffix}") + + # Create Helper-specific variants of the helper-Info.plist file. Do this + # manually because the configure_file command (which is executed as part of + # MACOSX_BUNDLE_INFO_PLIST) uses global env variables and would insert the + # wrong values with multiple targets. + set(_helper_info_plist "${CMAKE_CURRENT_BINARY_DIR}/helper-Info${_target_suffix}.plist") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/resources/mac/helper-Info.plist" _plist_contents) + string(REPLACE "\${EXECUTABLE_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${PRODUCT_NAME}" "${_helper_output_name}" _plist_contents ${_plist_contents}) + string(REPLACE "\${BUNDLE_ID_SUFFIX}" "${_plist_suffix}" _plist_contents ${_plist_contents}) + file(WRITE ${_helper_info_plist} ${_plist_contents}) + + # Create Helper executable target. + add_executable(${_helper_target} MACOSX_BUNDLE ${UNITTESTS_HELPER_SRCS}) + SET_EXECUTABLE_TARGET_PROPERTIES(${_helper_target}) + add_dependencies(${_helper_target} libcef_dll_wrapper cef_gtest) + target_link_libraries(${_helper_target} libcef_dll_wrapper cef_gtest ${CEF_STANDARD_LIBS}) + set_target_properties(${_helper_target} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${_helper_info_plist} + OUTPUT_NAME ${_helper_output_name} + ) + + if(USE_SANDBOX) + target_link_libraries(${_helper_target} cef_sandbox_lib) + endif() + + # Add the Helper as a dependency of the main executable target. + add_dependencies(${CEF_TARGET} "${_helper_target}") + + # Copy the Helper app bundle into the Frameworks directory. + add_custom_command( + TARGET ${CEF_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_TARGET_OUT_DIR}/${_helper_output_name}.app" + "${CEF_APP}/Contents/Frameworks/${_helper_output_name}.app" + VERBATIM + ) + endforeach() + # Manually process and copy over resource files. # The Xcode generator can support this via the set_target_properties RESOURCE # directive but that doesn't properly handle nested resource directories. diff --git a/tests/ceftests/audio_output_unittest.cc b/tests/ceftests/audio_output_unittest.cc index bc8db76dd..3b37fb243 100644 --- a/tests/ceftests/audio_output_unittest.cc +++ b/tests/ceftests/audio_output_unittest.cc @@ -907,11 +907,14 @@ class AudioOutputTestHandler : public TestHandler, public CefAudioHandler { } // namespace // Test audio output callbacks called on valid threads +// TODO: Reimplement audio mirroring support (see issue #2755). +/* TEST(AudioOutputTest, AudioOutputTest) { CefRefPtr handler = new AudioOutputTestHandler(); handler->ExecuteTest(); ReleaseAndWaitForDestructor(handler); } +*/ // Entry point for creating audio output test objects. // Called from client_app_delegates.cc. diff --git a/tests/ceftests/os_rendering_unittest.cc b/tests/ceftests/os_rendering_unittest.cc index 75d4e06aa..cae194386 100644 --- a/tests/ceftests/os_rendering_unittest.cc +++ b/tests/ceftests/os_rendering_unittest.cc @@ -823,11 +823,18 @@ class OSRTestHandler : public RoutingTestHandler, const CefRect& expanded_select_rect = GetScaledRect(kExpandedSelectRect); EXPECT_EQ(dirtyRects.size(), 1U); - EXPECT_EQ(0, dirtyRects[0].x); - EXPECT_EQ(0, dirtyRects[0].y); +#if defined(OS_MACOSX) + EXPECT_EQ(GetScaledInt(1), dirtyRects[0].x); + EXPECT_EQ(GetScaledInt(1), dirtyRects[0].y); +#else + EXPECT_EQ(1, dirtyRects[0].x); + EXPECT_EQ(1, dirtyRects[0].y); +#endif if (ExpectComputedPopupSize()) { - EXPECT_EQ(expanded_select_rect.width, dirtyRects[0].width); - EXPECT_EQ(expanded_select_rect.height, dirtyRects[0].height); + EXPECT_EQ(expanded_select_rect.width, + dirtyRects[0].width + GetScaledInt(2)); + EXPECT_EQ(expanded_select_rect.height, + dirtyRects[0].height + GetScaledInt(2)); } else { EXPECT_GT(dirtyRects[0].width, kExpandedSelectRect.width); EXPECT_GT(dirtyRects[0].height, kExpandedSelectRect.height); diff --git a/tests/ceftests/resources/mac/helper-Info.plist b/tests/ceftests/resources/mac/helper-Info.plist index 55fb3ce67..d2359ccba 100644 --- a/tests/ceftests/resources/mac/helper-Info.plist +++ b/tests/ceftests/resources/mac/helper-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - org.cef.ceftests.helper + org.cef.ceftests.helper${BUNDLE_ID_SUFFIX} CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/tests/ceftests/views/test_window_delegate.cc b/tests/ceftests/views/test_window_delegate.cc index 6487c4e6a..e7e7bd77e 100644 --- a/tests/ceftests/views/test_window_delegate.cc +++ b/tests/ceftests/views/test_window_delegate.cc @@ -54,7 +54,7 @@ void TestWindowDelegate::OnWindowCreated(CefRefPtr window) { // Size will come from GetPreferredSize() on initial Window creation. EXPECT_TRUE(got_get_preferred_size_); - CefRect client_bounds = window->GetClientAreaBoundsInScreen(); + CefRect client_bounds = window->GetBounds(); if (config_.frameless) { EXPECT_EQ(config_.window_size, client_bounds.width); EXPECT_EQ(config_.window_size, client_bounds.height); diff --git a/tools/compile_ib_files.py b/tools/compile_ib_files.py new file mode 100644 index 000000000..f81ef602e --- /dev/null +++ b/tools/compile_ib_files.py @@ -0,0 +1,55 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +from __future__ import print_function +import argparse +import logging +import os +import re +import subprocess +import sys + + +def main(): + parser = argparse.ArgumentParser( + description='A script to compile xib and storyboard.', + fromfile_prefix_chars='@') + parser.add_argument( + '-o', '--output', required=True, help='Path to output bundle.') + parser.add_argument( + '-i', '--input', required=True, help='Path to input xib or storyboard.') + parser.add_argument('--developer_dir', required=False, help='Path to Xcode.') + args, unknown_args = parser.parse_known_args() + if args.developer_dir: + os.environ['DEVELOPER_DIR'] = args.developer_dir + ibtool_args = [ + 'xcrun', 'ibtool', '--errors', '--warnings', '--notices', + '--output-format', 'human-readable-text' + ] + ibtool_args += unknown_args + ibtool_args += [ + '--compile', + os.path.abspath(args.output), + os.path.abspath(args.input) + ] + ibtool_section_re = re.compile(r'/\*.*\*/') + ibtool_re = re.compile(r'.*note:.*is clipping its content') + try: + stdout = subprocess.check_output(ibtool_args) + except subprocess.CalledProcessError as e: + print(e.output) + raise + current_section_header = None + for line in stdout.splitlines(): + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + print(current_section_header) + current_section_header = None + print(line) + return 0 + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/gn_args.py b/tools/gn_args.py index 526c920fe..798880c33 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -202,6 +202,9 @@ def GetRecommendedDefaultArgs(): # in faster local builds but False is required to create a CEF binary # distribution. 'is_component_build': False, + + # Don't enforce component builds in debug mode + 'forbid_non_component_debug_builds': False, } if platform == 'linux':