From 25c1947f1d0e60d0ee0f2f35214b6806e4787fbb Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 19 Aug 2021 19:40:49 -0400 Subject: [PATCH] Update to Chromium version 94.0.4606.0 (#911515) --- BUILD.gn | 23 +- CHROMIUM_BUILD_COMPATIBILITY.txt | 2 +- .../browser/alloy/alloy_browser_host_impl.cc | 4 +- .../browser/alloy/alloy_browser_host_impl.h | 2 +- .../alloy/alloy_content_browser_client.cc | 24 ++ .../alloy/alloy_content_browser_client.h | 4 + libcef/browser/browser_contents_delegate.cc | 2 +- libcef/browser/browser_contents_delegate.h | 2 +- .../browser/chrome/chrome_browser_context.cc | 2 +- .../browser/chrome/chrome_browser_delegate.cc | 4 +- .../browser/chrome/chrome_browser_delegate.h | 2 +- .../browser/devtools/devtools_file_manager.cc | 6 +- libcef/browser/devtools/devtools_frontend.cc | 255 +++++++++--------- libcef/browser/devtools/devtools_frontend.h | 13 +- .../browser/extensions/api/tabs/tabs_api.cc | 22 +- libcef/browser/net_service/cookie_helper.cc | 3 +- .../net_service/cookie_manager_impl.cc | 2 +- .../net_service/stream_reader_url_loader.h | 2 + libcef/browser/prefs/renderer_prefs.cc | 5 +- libcef/browser/printing/print_view_manager.cc | 13 + libcef/browser/printing/print_view_manager.h | 5 + libcef/browser/request_context_impl.cc | 1 + libcef/browser/views/window_view.cc | 2 +- libcef/common/alloy/alloy_content_client.cc | 2 +- libcef/common/alloy/alloy_content_client.h | 5 +- libcef/common/alloy/alloy_main_delegate.cc | 32 +-- libcef/common/resource_bundle_delegate.cc | 6 +- libcef/common/resource_bundle_delegate.h | 9 +- libcef/common/resource_bundle_impl.cc | 2 +- libcef/common/resource_util.cc | 5 +- libcef/common/resource_util.h | 2 +- libcef/common/values_impl.cc | 8 +- .../alloy/alloy_render_thread_observer.cc | 4 +- .../alloy/alloy_render_thread_observer.h | 5 +- patch/patch.cfg | 8 - patch/patches/base_sandbox_2743.patch | 36 ++- .../browser_security_policy_1081397.patch | 16 +- patch/patches/build.patch | 4 +- patch/patches/chrome_browser.patch | 4 +- ...rome_browser_background_mode_1100085.patch | 62 +---- patch/patches/chrome_browser_browser.patch | 46 ++-- .../chrome_browser_content_settings.patch | 2 +- .../chrome_browser_context_menus.patch | 20 +- patch/patches/chrome_browser_net_export.patch | 8 +- .../patches/chrome_browser_profile_menu.patch | 2 +- patch/patches/chrome_browser_profiles.patch | 26 +- .../chrome_browser_safe_browsing.patch | 2 +- patch/patches/chrome_browser_themes.patch | 8 +- patch/patches/chrome_plugins.patch | 18 +- patch/patches/chrome_renderer.patch | 4 +- patch/patches/chrome_runtime.patch | 63 ++--- patch/patches/chrome_runtime_views.patch | 40 +-- patch/patches/component_build.patch | 4 +- patch/patches/content_2015.patch | 54 ++-- patch/patches/content_main_654986.patch | 76 +++--- patch/patches/content_mojo_3123.patch | 6 +- patch/patches/crashpad_1995.patch | 23 +- patch/patches/embedder_product_override.patch | 2 +- patch/patches/extensions_1947.patch | 10 +- patch/patches/gn_config.patch | 26 +- patch/patches/gritsettings.patch | 4 +- patch/patches/libxml_visibility.patch | 16 +- .../patches/linux_chrome_widevine_3149.patch | 2 +- patch/patches/message_loop.patch | 2 +- patch/patches/net_cookie_flags.patch | 6 +- patch/patches/osr_fling_2745.patch | 4 +- patch/patches/print_preview_123.patch | 52 +--- patch/patches/renderer_host_1070713.patch | 4 +- patch/patches/resource_bundle_2512.patch | 4 +- patch/patches/runhooks.patch | 13 - patch/patches/rwh_background_color_1984.patch | 4 +- patch/patches/services_network_2622.patch | 24 +- patch/patches/services_network_2718.patch | 12 +- patch/patches/storage_incognito_2289.patch | 10 +- patch/patches/trace_event.patch | 2 +- patch/patches/views_1749_2102.patch | 54 ++-- patch/patches/views_widget.patch | 68 ++--- patch/patches/viz_osr_2575.patch | 14 +- patch/patches/web_contents_1257_1565.patch | 16 +- patch/patches/webkit_plugin_info_2015.patch | 28 +- patch/patches/webkit_popups.patch | 10 +- .../webkit_runtime_enabled_features.patch | 6 +- patch/patches/webview_plugin_2020.patch | 4 +- tests/ceftests/views/button_unittest.cc | 32 ++- tests/ceftests/views/textfield_unittest.cc | 30 ++- 85 files changed, 745 insertions(+), 726 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 33c00847a..5793f124c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -802,9 +802,6 @@ static_library("libcef_static") { configs += [ "libcef/features:config", "//build/config:precompiled_headers", - - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - "//build/config/compiler:no_size_t_to_int_warning", ] public_configs = [ @@ -1237,6 +1234,16 @@ static_library("libcef_static") { # libcef_dll_wrapper static targets. # +# Configuration that will be applied to all targets that build autogen files. +config("libcef_autogen_config") { + if (is_clang) { + cflags = [ + # Disable clang warnings related to CEF's translation layer templates. + "-Wno-undefined-var-template", + ] + } +} + # Configuration that will be applied to all targets that depend on # libcef_dll_wrapper. config("libcef_dll_wrapper_config") { @@ -1247,6 +1254,8 @@ config("libcef_dll_wrapper_config") { # They will be copied to the include/ directory in the binary distribution. "$root_out_dir/includes", ] + + configs = [ ":libcef_autogen_config" ] } # libcef_dll_wrapper target. @@ -1586,6 +1595,10 @@ if (is_mac) { ":libcef_static", ] + configs += [ + ":libcef_autogen_config", + ] + # We don't link the framework so just use the path from the main executable. ldflags = [ "-Wl,-install_name,@executable_path/../Frameworks/$output_name.framework/$output_name", @@ -1621,6 +1634,10 @@ if (is_mac) { ":libcef_static", ] + configs += [ + ":libcef_autogen_config", + ] + if (is_win) { sources += includes_win + [ "libcef_dll/libcef_dll.rc", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 649e5b5be..5d24de2d2 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/93.0.4577.0' + 'chromium_checkout': 'refs/tags/94.0.4606.0' } diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 9bdc4a140..6b5c1b900 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -1316,9 +1316,9 @@ void AlloyBrowserHostImpl::WebContentsCreated( std::move(platform_delegate), /*cef_extension=*/nullptr); } -void AlloyBrowserHostImpl::DidNavigateMainFramePostCommit( +void AlloyBrowserHostImpl::DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) { - contents_delegate_->DidNavigateMainFramePostCommit(web_contents); + contents_delegate_->DidNavigatePrimaryMainFramePostCommit(web_contents); } content::JavaScriptDialogManager* diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index 7ce502574..a82847b0a 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -251,7 +251,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, const std::string& frame_name, const GURL& target_url, content::WebContents* new_contents) override; - void DidNavigateMainFramePostCommit( + void DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) override; content::JavaScriptDialogManager* GetJavaScriptDialogManager( content::WebContents* source) override; diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index 7305e8e08..322ab4e12 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -30,6 +30,7 @@ #include "libcef/browser/net_service/resource_request_handler_wrapper.h" #include "libcef/browser/plugins/plugin_service_filter.h" #include "libcef/browser/prefs/renderer_prefs.h" +#include "libcef/browser/printing/print_view_manager.h" #include "libcef/browser/speech_recognition_manager_delegate.h" #include "libcef/browser/ssl_info_impl.h" #include "libcef/browser/thread_util.h" @@ -103,6 +104,7 @@ #include "extensions/browser/extension_message_filter.h" #include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_registry.h" +#include "extensions/browser/extension_web_contents_observer.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h" @@ -967,6 +969,28 @@ AlloyContentBrowserClient::CreateDevToolsManagerDelegate() { return std::make_unique(); } +bool AlloyContentBrowserClient::BindAssociatedReceiverFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) { + if (interface_name == extensions::mojom::LocalFrameHost::Name_) { + extensions::ExtensionWebContentsObserver::BindLocalFrameHost( + mojo::PendingAssociatedReceiver( + std::move(*handle)), + render_frame_host); + return true; + } + if (interface_name == printing::mojom::PrintManagerHost::Name_) { + printing::CefPrintViewManager::BindPrintManagerHost( + mojo::PendingAssociatedReceiver( + std::move(*handle)), + render_frame_host); + return true; + } + + return false; +} + std::vector> AlloyContentBrowserClient::CreateThrottlesForNavigation( content::NavigationHandle* navigation_handle) { diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 4f71a89c4..e7fb80de3 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -111,6 +111,10 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { void DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host) override; std::unique_ptr CreateDevToolsManagerDelegate() override; + bool BindAssociatedReceiverFromFrame( + content::RenderFrameHost* render_frame_host, + const std::string& interface_name, + mojo::ScopedInterfaceEndpointHandle* handle) override; std::vector> CreateThrottlesForNavigation( content::NavigationHandle* navigation_handle) override; diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index ebfe7893d..08b70a1b0 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -161,7 +161,7 @@ bool CefBrowserContentsDelegate::DidAddMessageToConsole( return false; } -void CefBrowserContentsDelegate::DidNavigateMainFramePostCommit( +void CefBrowserContentsDelegate::DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) { has_document_ = false; OnStateChanged(State::kDocument); diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index a9fc508d3..3bcb12934 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -91,7 +91,7 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, const std::u16string& message, int32_t line_no, const std::u16string& source_id) override; - void DidNavigateMainFramePostCommit( + void DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) override; void EnterFullscreenModeForTab( content::RenderFrameHost* requesting_frame, diff --git a/libcef/browser/chrome/chrome_browser_context.cc b/libcef/browser/chrome/chrome_browser_context.cc index 89bd41083..138ec028a 100644 --- a/libcef/browser/chrome/chrome_browser_context.cc +++ b/libcef/browser/chrome/chrome_browser_context.cc @@ -74,7 +74,7 @@ void ChromeBrowserContext::InitializeAsync(base::OnceClosure initialized_cb) { } // Default to creating a new/unique OffTheRecord profile. - ProfileCreated(nullptr, Profile::CreateStatus::CREATE_STATUS_CANCELED); + ProfileCreated(nullptr, Profile::CreateStatus::CREATE_STATUS_LOCAL_FAIL); } void ChromeBrowserContext::Shutdown() { diff --git a/libcef/browser/chrome/chrome_browser_delegate.cc b/libcef/browser/chrome/chrome_browser_delegate.cc index e26de39e5..f0b490565 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.cc +++ b/libcef/browser/chrome/chrome_browser_delegate.cc @@ -170,10 +170,10 @@ bool ChromeBrowserDelegate::DidAddMessageToConsole( return false; } -void ChromeBrowserDelegate::DidNavigateMainFramePostCommit( +void ChromeBrowserDelegate::DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) { if (auto delegate = GetDelegateForWebContents(web_contents)) { - delegate->DidNavigateMainFramePostCommit(web_contents); + delegate->DidNavigatePrimaryMainFramePostCommit(web_contents); } } diff --git a/libcef/browser/chrome/chrome_browser_delegate.h b/libcef/browser/chrome/chrome_browser_delegate.h index 65e5e78b8..aca06e4a2 100644 --- a/libcef/browser/chrome/chrome_browser_delegate.h +++ b/libcef/browser/chrome/chrome_browser_delegate.h @@ -73,7 +73,7 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate { const std::u16string& message, int32_t line_no, const std::u16string& source_id) override; - void DidNavigateMainFramePostCommit( + void DidNavigatePrimaryMainFramePostCommit( content::WebContents* web_contents) override; void EnterFullscreenModeForTab( content::RenderFrameHost* requesting_frame, diff --git a/libcef/browser/devtools/devtools_file_manager.cc b/libcef/browser/devtools/devtools_file_manager.cc index c68fb5b98..47fb49d59 100644 --- a/libcef/browser/devtools/devtools_file_manager.cc +++ b/libcef/browser/devtools/devtools_file_manager.cc @@ -11,13 +11,13 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/json/json_writer.h" +#include "base/json/values_util.h" #include "base/lazy_instance.h" #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" #include "base/task/thread_pool.h" #include "base/threading/sequenced_task_runner_handle.h" -#include "base/util/values/values_util.h" #include "base/values.h" #include "chrome/common/pref_names.h" #include "components/prefs/scoped_user_pref_update.h" @@ -83,7 +83,7 @@ void CefDevToolsFileManager::Save(const std::string& url, const base::Value* path_value; if (file_map->Get(base::MD5String(url), &path_value)) { - absl::optional path = util::ValueToFilePath(*path_value); + absl::optional path = base::ValueToFilePath(*path_value); if (path) initial_path = std::move(*path); } @@ -145,7 +145,7 @@ void CefDevToolsFileManager::SaveAsFileSelected(const std::string& url, DictionaryPrefUpdate update(prefs_, prefs::kDevToolsEditedFiles); base::DictionaryValue* files_map = update.Get(); - files_map->SetKey(base::MD5String(url), util::FilePathToValue(path)); + files_map->SetKey(base::MD5String(url), base::FilePathToValue(path)); std::string file_system_path = path.AsUTF8Unsafe(); std::move(callback).Run(file_system_path); file_task_runner_->PostTask(FROM_HERE, diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index 61b798031..cda2fa7ea 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -66,17 +66,22 @@ namespace { +// This constant should be in sync with the constant in +// chrome/browser/devtools/devtools_ui_bindings.cc. +constexpr size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; + +constexpr int kMaxLogLineLength = 1024; + static std::string GetFrontendURL() { return base::StringPrintf("%s://%s/devtools_app.html", content::kChromeDevToolsScheme, scheme::kChromeDevToolsHost); } -std::unique_ptr BuildObjectForResponse( - const net::HttpResponseHeaders* rh, - bool success, - int net_error) { - auto response = std::make_unique(); +base::DictionaryValue BuildObjectForResponse(const net::HttpResponseHeaders* rh, + bool success, + int net_error) { + base::DictionaryValue response; int responseCode = 200; if (rh) { responseCode = rh->response_code(); @@ -84,9 +89,9 @@ std::unique_ptr BuildObjectForResponse( // In case of no headers, assume file:// URL and failed to load responseCode = 404; } - response->SetInteger("statusCode", responseCode); - response->SetInteger("netError", net_error); - response->SetString("netErrorName", net::ErrorToString(net_error)); + response.SetInteger("statusCode", responseCode); + response.SetInteger("netError", net_error); + response.SetString("netErrorName", net::ErrorToString(net_error)); auto headers = std::make_unique(); size_t iterator = 0; @@ -97,12 +102,10 @@ std::unique_ptr BuildObjectForResponse( while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value)) headers->SetString(name, value); - response->Set("headers", std::move(headers)); + response.Set("headers", std::move(headers)); return response; } -const int kMaxLogLineLength = 1024; - void WriteTimestamp(std::stringstream& stream) { #if defined(OS_WIN) SYSTEMTIME local_time; @@ -206,15 +209,16 @@ class CefDevToolsFrontend::NetworkResourceLoader base::Value id(stream_id_); base::Value encodedValue(encoded); - bindings_->CallClientFunction("DevToolsAPI.streamWrite", &id, &chunkValue, - &encodedValue); + bindings_->CallClientFunction("DevToolsAPI", "streamWrite", std::move(id), + std::move(chunkValue), + std::move(encodedValue)); std::move(resume).Run(); } void OnComplete(bool success) override { auto response = BuildObjectForResponse(response_headers_.get(), success, loader_->NetError()); - bindings_->SendMessageAck(request_id_, response.get()); + bindings_->SendMessageAck(request_id_, std::move(response)); bindings_->loaders_.erase(bindings_->loaders_.find(this)); } @@ -230,10 +234,6 @@ class CefDevToolsFrontend::NetworkResourceLoader DISALLOW_COPY_AND_ASSIGN(NetworkResourceLoader); }; -// This constant should be in sync with -// the constant at devtools_ui_bindings.cc. -const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; - // static CefDevToolsFrontend* CefDevToolsFrontend::Show( AlloyBrowserHostImpl* inspected_browser, @@ -368,44 +368,53 @@ void CefDevToolsFrontend::WebContentsDestroyed() { void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( base::Value message) { - std::string method; - base::ListValue* params = nullptr; - base::DictionaryValue* dict = nullptr; - if (!message.GetAsDictionary(&dict) || !dict->GetString("method", &method)) { + if (!message.is_dict()) + return; + const std::string* method = message.FindStringKey("method"); + if (!method) return; - } - int request_id = 0; - dict->GetInteger("id", &request_id); - dict->GetList("params", ¶ms); - if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) { - std::string protocol_message; - if (!agent_host_ || !params->GetString(0, &protocol_message)) + int request_id = message.FindIntKey("id").value_or(0); + base::Value* params_value = message.FindListKey("params"); + + // Since we've received message by value, we can take the list. + base::Value::ListStorage params; + if (params_value) { + params = std::move(*params_value).TakeList(); + } + + if (*method == "dispatchProtocolMessage") { + if (params.size() < 1) + return; + const std::string* protocol_message = params[0].GetIfString(); + if (!agent_host_ || !protocol_message) return; if (ProtocolLoggingEnabled()) { - LogProtocolMessage(ProtocolMessageType::METHOD, protocol_message); + LogProtocolMessage(ProtocolMessageType::METHOD, *protocol_message); } agent_host_->DispatchProtocolMessage( - this, base::as_bytes(base::make_span(protocol_message))); - } else if (method == "loadCompleted") { + this, base::as_bytes(base::make_span(*protocol_message))); + } else if (*method == "loadCompleted") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( u"DevToolsAPI.setUseSoftMenu(true);", base::NullCallback()); - } else if (method == "loadNetworkResource" && params->GetSize() == 3) { + } else if (*method == "loadNetworkResource") { + if (params.size() < 3) + return; + // TODO(pfeldman): handle some of the embedder messages in content. - std::string url; - std::string headers; - int stream_id; - if (!params->GetString(0, &url) || !params->GetString(1, &headers) || - !params->GetInteger(2, &stream_id)) { + const std::string* url = params[0].GetIfString(); + const std::string* headers = params[1].GetIfString(); + absl::optional stream_id = params[2].GetIfInt(); + if (!url || !headers || !stream_id.has_value()) { return; } - GURL gurl(url); + GURL gurl(*url); if (!gurl.is_valid()) { base::DictionaryValue response; response.SetInteger("statusCode", 404); response.SetBoolean("urlValid", false); - SendMessageAck(request_id, &response); + SendMessageAck(request_id, std::move(response)); return; } @@ -442,7 +451,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( // implementation. We really need to pass proper first party origin from // the front-end. resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl); - resource_request->headers.AddHeadersFromString(headers); + resource_request->headers.AddHeadersFromString(*headers); scoped_refptr url_loader_factory; if (gurl.SchemeIsFile()) { @@ -456,7 +465,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( } else if (content::HasWebUIScheme(gurl)) { base::DictionaryValue response; response.SetInteger("statusCode", 403); - SendMessageAck(request_id, &response); + SendMessageAck(request_id, std::move(response)); return; } else { auto* partition = @@ -467,64 +476,71 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( auto simple_url_loader = network::SimpleURLLoader::Create( std::move(resource_request), traffic_annotation); auto resource_loader = std::make_unique( - stream_id, this, std::move(simple_url_loader), url_loader_factory.get(), - request_id); + *stream_id, this, std::move(simple_url_loader), + url_loader_factory.get(), request_id); loaders_.insert(std::move(resource_loader)); return; - } else if (method == "getPreferences") { - SendMessageAck(request_id, - GetPrefs()->GetDictionary(prefs::kDevToolsPreferences)); + } else if (*method == "getPreferences") { + SendMessageAck( + request_id, + GetPrefs()->GetDictionary(prefs::kDevToolsPreferences)->Clone()); return; - } else if (method == "setPreference") { - std::string name; - std::string value; - if (!params->GetString(0, &name) || !params->GetString(1, &value)) { + } else if (*method == "setPreference") { + if (params.size() < 2) return; - } + const std::string* name = params[0].GetIfString(); + + // We're just setting params[1] as a value anyways, so just make sure it's + // the type we want, but don't worry about getting it. + if (!name || !params[1].is_string()) + return; + DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences); - update.Get()->SetKey(name, base::Value(value)); - } else if (method == "removePreference") { - std::string name; - if (!params->GetString(0, &name)) + update.Get()->SetKey(*name, std::move(params[1])); + } else if (*method == "removePreference") { + const std::string* name = params[0].GetIfString(); + if (!name) return; DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences); - update.Get()->RemoveWithoutPathExpansion(name, nullptr); - } else if (method == "requestFileSystems") { + update.Get()->RemoveKey(*name); + } else if (*method == "requestFileSystems") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( u"DevToolsAPI.fileSystemsLoaded([]);", base::NullCallback()); - } else if (method == "reattach") { + } else if (*method == "reattach") { if (!agent_host_) return; agent_host_->DetachClient(this); agent_host_->AttachClient(this); - } else if (method == "registerExtensionsAPI") { - std::string origin; - std::string script; - if (!params->GetString(0, &origin) || !params->GetString(1, &script)) + } else if (*method == "registerExtensionsAPI") { + if (params.size() < 2) return; - extensions_api_[origin + "/"] = script; - } else if (method == "save" && params->GetSize() == 3) { - std::string url; - std::string content; - bool save_as; - if (!params->GetString(0, &url) || !params->GetString(1, &content) || - !params->GetBoolean(2, &save_as)) { + const std::string* origin = params[0].GetIfString(); + const std::string* script = params[1].GetIfString(); + if (!origin || !script) return; - } - file_manager_.SaveToFile(url, content, save_as); - } else if (method == "append" && params->GetSize() == 2) { - std::string url; - std::string content; - if (!params->GetString(0, &url) || !params->GetString(1, &content)) { + extensions_api_[*origin + "/"] = *script; + } else if (*method == "save") { + if (params.size() < 3) return; - } - file_manager_.AppendToFile(url, content); + const std::string* url = params[0].GetIfString(); + const std::string* content = params[1].GetIfString(); + absl::optional save_as = params[2].GetIfBool(); + if (!url || !content || !save_as.has_value()) + return; + file_manager_.SaveToFile(*url, *content, *save_as); + } else if (*method == "append") { + if (params.size() < 2) + return; + const std::string* url = params[0].GetIfString(); + const std::string* content = params[1].GetIfString(); + if (!url || !content) + return file_manager_.AppendToFile(*url, *content); } else { return; } if (request_id) - SendMessageAck(request_id, nullptr); + SendMessageAck(request_id, base::Value()); } void CefDevToolsFrontend::DispatchProtocolMessage( @@ -545,57 +561,54 @@ void CefDevToolsFrontend::DispatchProtocolMessage( : ProtocolMessageType::RESULT, str_message); } - if (str_message.length() < kMaxMessageChunkSize) { - std::string param; - base::EscapeJSONString(str_message, true, ¶m); - std::string code = "DevToolsAPI.dispatchMessage(" + param + ");"; - std::u16string javascript = base::UTF8ToUTF16(code); - web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( - javascript, base::NullCallback()); - return; - } - size_t total_size = str_message.length(); - for (size_t pos = 0; pos < str_message.length(); - pos += kMaxMessageChunkSize) { - std::string param; - base::EscapeJSONString(str_message.substr(pos, kMaxMessageChunkSize), true, - ¶m); - std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," + - std::to_string(pos ? 0 : total_size) + ");"; - std::u16string javascript = base::UTF8ToUTF16(code); - web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( - javascript, base::NullCallback()); + if (str_message.length() < kMaxMessageChunkSize) { + CallClientFunction("DevToolsAPI", "dispatchMessage", + base::Value(std::string(str_message))); + } else { + size_t total_size = str_message.length(); + for (size_t pos = 0; pos < str_message.length(); + pos += kMaxMessageChunkSize) { + base::StringPiece str_message_chunk = + str_message.substr(pos, kMaxMessageChunkSize); + + CallClientFunction( + "DevToolsAPI", "dispatchMessageChunk", + base::Value(std::string(str_message_chunk)), + base::Value(base::NumberToString(pos ? 0 : total_size))); + } } } -void CefDevToolsFrontend::CallClientFunction(const std::string& function_name, - const base::Value* arg1, - const base::Value* arg2, - const base::Value* arg3) { - std::string javascript = function_name + "("; - if (arg1) { - std::string json; - base::JSONWriter::Write(*arg1, &json); - javascript.append(json); - if (arg2) { - base::JSONWriter::Write(*arg2, &json); - javascript.append(", ").append(json); - if (arg3) { - base::JSONWriter::Write(*arg3, &json); - javascript.append(", ").append(json); +void CefDevToolsFrontend::CallClientFunction( + const std::string& object_name, + const std::string& method_name, + base::Value arg1, + base::Value arg2, + base::Value arg3, + base::OnceCallback cb) { + std::string javascript; + + web_contents()->GetMainFrame()->AllowInjectingJavaScript(); + + base::Value arguments(base::Value::Type::LIST); + if (!arg1.is_none()) { + arguments.Append(std::move(arg1)); + if (!arg2.is_none()) { + arguments.Append(std::move(arg2)); + if (!arg3.is_none()) { + arguments.Append(std::move(arg3)); } } } - javascript.append(");"); - web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( - base::UTF8ToUTF16(javascript), base::NullCallback()); + web_contents()->GetMainFrame()->ExecuteJavaScriptMethod( + base::ASCIIToUTF16(object_name), base::ASCIIToUTF16(method_name), + std::move(arguments), std::move(cb)); } -void CefDevToolsFrontend::SendMessageAck(int request_id, - const base::Value* arg) { - base::Value id_value(request_id); - CallClientFunction("DevToolsAPI.embedderMessageAck", &id_value, arg, nullptr); +void CefDevToolsFrontend::SendMessageAck(int request_id, base::Value arg) { + CallClientFunction("DevToolsAPI", "embedderMessageAck", + base::Value(request_id), std::move(arg)); } bool CefDevToolsFrontend::ProtocolLoggingEnabled() const { diff --git a/libcef/browser/devtools/devtools_frontend.h b/libcef/browser/devtools/devtools_frontend.h index 1cc83a643..5b89636bd 100644 --- a/libcef/browser/devtools/devtools_frontend.h +++ b/libcef/browser/devtools/devtools_frontend.h @@ -54,10 +54,13 @@ class CefDevToolsFrontend : public content::WebContentsObserver, void InspectElementAt(int x, int y); void Close(); - void CallClientFunction(const std::string& function_name, - const base::Value* arg1, - const base::Value* arg2, - const base::Value* arg3); + void CallClientFunction( + const std::string& object_name, + const std::string& method_name, + const base::Value arg1 = {}, + const base::Value arg2 = {}, + const base::Value arg3 = {}, + base::OnceCallback cb = base::NullCallback()); private: CefDevToolsFrontend(AlloyBrowserHostImpl* frontend_browser, @@ -80,7 +83,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, content::RenderFrameHost* render_frame_host) override; void WebContentsDestroyed() override; - void SendMessageAck(int request_id, const base::Value* arg1); + void SendMessageAck(int request_id, base::Value arg); bool ProtocolLoggingEnabled() const; void LogProtocolMessage(ProtocolMessageType type, diff --git a/libcef/browser/extensions/api/tabs/tabs_api.cc b/libcef/browser/extensions/api/tabs/tabs_api.cc index 5543ef282..a2aa8669f 100644 --- a/libcef/browser/extensions/api/tabs/tabs_api.cc +++ b/libcef/browser/extensions/api/tabs/tabs_api.cc @@ -256,17 +256,27 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() { if (init_result_) return init_result_.value(); - // |tab_id| is optional so it's ok if it's not there. - int tab_id = -1; - if (args_->GetInteger(0, &tab_id) && tab_id < 0) + const auto list_view = args_->GetList(); + if (list_view.size() < 2) return set_init_result(VALIDATION_FAILURE); + const auto& tab_id_value = list_view[0]; + // |tab_id| is optional so it's ok if it's not there. + int tab_id = -1; + if (tab_id_value.is_int()) { + // But if it is present, it needs to be non-negative. + tab_id = tab_id_value.GetInt(); + if (tab_id < 0) { + return set_init_result(VALIDATION_FAILURE); + } + } + // |details| are not optional. - base::DictionaryValue* details_value = nullptr; - if (!args_->GetDictionary(1, &details_value)) + const base::Value& details_value = list_view[1]; + if (!details_value.is_dict()) return set_init_result(VALIDATION_FAILURE); std::unique_ptr details(new InjectDetails()); - if (!InjectDetails::Populate(*details_value, details.get())) + if (!InjectDetails::Populate(details_value, details.get())) return set_init_result(VALIDATION_FAILURE); // Find a browser that we can access, or fail with error. diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index 6a873ead2..67b2643b5 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -237,7 +237,8 @@ void SaveCookies(content::BrowserContext* browser_context, net::CookieInclusionStatus returned_status; std::unique_ptr cookie = net::CanonicalCookie::Create( request.url, cookie_string, base::Time::Now(), - absl::make_optional(response_date), &returned_status); + absl::make_optional(response_date), net::CookiePartitionKey::Todo(), + &returned_status); if (!returned_status.IsInclude()) { continue; } diff --git a/libcef/browser/net_service/cookie_manager_impl.cc b/libcef/browser/net_service/cookie_manager_impl.cc index 3d10142a9..f45de4a02 100644 --- a/libcef/browser/net_service/cookie_manager_impl.cc +++ b/libcef/browser/net_service/cookie_manager_impl.cc @@ -290,7 +290,7 @@ bool CefCookieManagerImpl::SetCookieInternal( expiration_time, base::Time(), // Last access time. cookie.secure ? true : false, cookie.httponly ? true : false, same_site, - priority, /*same_party=*/false); + priority, /*same_party=*/false, net::CookiePartitionKey::Todo()); if (!canonical_cookie) { SetCookieCallbackImpl( diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 4e76010dd..3c36f04b5 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -10,9 +10,11 @@ #include "base/callback.h" #include "base/threading/thread_checker.h" +#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/system/simple_watcher.h" #include "net/http/http_byte_range.h" #include "services/network/public/cpp/net_adapters.h" +#include "services/network/public/cpp/resource_request.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index fc92e1fca..7eadb32e3 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -350,8 +350,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, prefs::kEnableDoNotTrack, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false); - registry->RegisterBooleanPref(prefs::kCloudPrintDeprecationWarningsSuppressed, - false); registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy, blink::kWebRTCIPHandlingDefault); @@ -407,6 +405,9 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, case ui::NativeTheme::PreferredContrast::kLess: web.preferred_contrast = blink::mojom::PreferredContrast::kLess; break; + case ui::NativeTheme::PreferredContrast::kCustom: + web.preferred_contrast = blink::mojom::PreferredContrast::kCustom; + break; } UpdatePreferredColorScheme( diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index d76bb44a7..bd96ef00c 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -182,6 +182,19 @@ CefPrintViewManager::~CefPrintViewManager() { TerminatePdfPrintJob(); } +// static +void CefPrintViewManager::BindPrintManagerHost( + mojo::PendingAssociatedReceiver receiver, + content::RenderFrameHost* rfh) { + auto* web_contents = content::WebContents::FromRenderFrameHost(rfh); + if (!web_contents) + return; + auto* print_manager = CefPrintViewManager::FromWebContents(web_contents); + if (!print_manager) + return; + print_manager->BindReceiver(std::move(receiver), rfh); +} + bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, const base::FilePath& path, const CefPdfPrintSettings& settings, diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index ec912fc9f..4bc0b7f14 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -13,6 +13,7 @@ #include "components/printing/common/print.mojom-forward.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" +#include "printing/mojom/print.mojom.h" namespace content { class RenderFrameHost; @@ -30,6 +31,10 @@ class CefPrintViewManager : public PrintViewManager, public: ~CefPrintViewManager() override; + static void BindPrintManagerHost( + mojo::PendingAssociatedReceiver receiver, + content::RenderFrameHost* rfh); + // Callback executed on PDF printing completion. typedef base::OnceCallback PdfPrintCallback; diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 2b3d0fc2f..398085997 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -21,6 +21,7 @@ #include "content/public/common/child_process_host.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" +#include "net/dns/host_resolver.h" #include "services/network/public/cpp/resolve_host_client_base.h" #include "services/network/public/mojom/network_context.mojom.h" diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc index 625d6b866..e3c2828f5 100644 --- a/libcef/browser/views/window_view.cc +++ b/libcef/browser/views/window_view.cc @@ -341,7 +341,7 @@ CefRefPtr CefWindowView::GetCefWindow() const { void CefWindowView::DeleteDelegate() { // Remove all child Views before deleting the Window so that notifications // resolve correctly. - RemoveAllChildViews(true); + RemoveAllChildViews(); window_delegate_->OnWindowViewDeleted(); } diff --git a/libcef/common/alloy/alloy_content_client.cc b/libcef/common/alloy/alloy_content_client.cc index 80f4dbe96..a264747ed 100644 --- a/libcef/common/alloy/alloy_content_client.cc +++ b/libcef/common/alloy/alloy_content_client.cc @@ -131,7 +131,7 @@ std::u16string AlloyContentClient::GetLocalizedString( base::StringPiece AlloyContentClient::GetDataResource( int resource_id, - ui::ScaleFactor scale_factor) { + ui::ResourceScaleFactor scale_factor) { base::StringPiece value = ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); diff --git a/libcef/common/alloy/alloy_content_client.h b/libcef/common/alloy/alloy_content_client.h index ca8910d14..5897d831d 100644 --- a/libcef/common/alloy/alloy_content_client.h +++ b/libcef/common/alloy/alloy_content_client.h @@ -28,8 +28,9 @@ class AlloyContentClient : public content::ContentClient { std::u16string GetLocalizedString(int message_id) override; std::u16string GetLocalizedString(int message_id, const std::u16string& replacement) override; - base::StringPiece GetDataResource(int resource_id, - ui::ScaleFactor scale_factor) override; + base::StringPiece GetDataResource( + int resource_id, + ui::ResourceScaleFactor scale_factor) override; base::RefCountedMemory* GetDataResourceBytes(int resource_id) override; gfx::Image& GetNativeImageNamed(int resource_id) override; diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index b01e7a001..db7923560 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -23,7 +23,6 @@ #include "base/strings/string_util.h" #include "base/synchronization/waitable_event.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/media/router/media_router_feature.h" #include "chrome/child/pdf_child_init.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -237,16 +236,15 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { base::NumberToString(settings_->uncaught_exception_stack_size)); } +#if defined(OS_WIN) std::vector disable_features; -#if defined(OS_WIN) if (features::kCalculateNativeWinOcclusion.default_state == base::FEATURE_ENABLED_BY_DEFAULT) { // TODO: Add support for occlusion detection in combination with native // parent windows (see issue #2805). disable_features.push_back(features::kCalculateNativeWinOcclusion.name); } -#endif // defined(OS_WIN) if (!disable_features.empty()) { DCHECK(!base::FeatureList::GetInstance()); @@ -260,33 +258,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { command_line->AppendSwitchASCII(switches::kDisableFeatures, disable_features_str); } - - std::vector enable_features; - - if (media_router::kDialMediaRouteProvider.default_state == - base::FEATURE_DISABLED_BY_DEFAULT) { - // Enable discovery of DIAL devices. - enable_features.push_back(media_router::kDialMediaRouteProvider.name); - } - - if (media_router::kCastMediaRouteProvider.default_state == - base::FEATURE_DISABLED_BY_DEFAULT) { - // Enable discovery of Cast devices. - enable_features.push_back(media_router::kCastMediaRouteProvider.name); - } - - if (!enable_features.empty()) { - DCHECK(!base::FeatureList::GetInstance()); - std::string enable_features_str = - command_line->GetSwitchValueASCII(switches::kEnableFeatures); - for (auto feature_str : enable_features) { - if (!enable_features_str.empty()) - enable_features_str += ","; - enable_features_str += feature_str; - } - command_line->AppendSwitchASCII(switches::kEnableFeatures, - enable_features_str); - } +#endif // defined(OS_WIN) } if (application_) { diff --git a/libcef/common/resource_bundle_delegate.cc b/libcef/common/resource_bundle_delegate.cc index 5ccf9e14a..be6600224 100644 --- a/libcef/common/resource_bundle_delegate.cc +++ b/libcef/common/resource_bundle_delegate.cc @@ -4,7 +4,7 @@ base::FilePath CefResourceBundleDelegate::GetPathForResourcePack( const base::FilePath& pack_path, - ui::ScaleFactor scale_factor) { + ui::ResourceScaleFactor scale_factor) { // Only allow the cef pack file to load. if (!pack_loading_disabled_ && allow_pack_file_load_) { return pack_path; @@ -30,7 +30,7 @@ gfx::Image CefResourceBundleDelegate::GetNativeImageNamed(int resource_id) { base::RefCountedStaticMemory* CefResourceBundleDelegate::LoadDataResourceBytes( int resource_id, - ui::ScaleFactor scale_factor) { + ui::ResourceScaleFactor scale_factor) { return nullptr; } @@ -41,7 +41,7 @@ absl::optional CefResourceBundleDelegate::LoadDataResourceString( bool CefResourceBundleDelegate::GetRawDataResource( int resource_id, - ui::ScaleFactor scale_factor, + ui::ResourceScaleFactor scale_factor, base::StringPiece* value) const { auto application = CefAppManager::Get()->GetApplication(); if (application) { diff --git a/libcef/common/resource_bundle_delegate.h b/libcef/common/resource_bundle_delegate.h index ab7221fcf..f3ad50d18 100644 --- a/libcef/common/resource_bundle_delegate.h +++ b/libcef/common/resource_bundle_delegate.h @@ -22,18 +22,19 @@ class CefResourceBundleDelegate : public ui::ResourceBundle::Delegate { private: // ui::ResourceBundle::Delegate methods. - base::FilePath GetPathForResourcePack(const base::FilePath& pack_path, - ui::ScaleFactor scale_factor) override; + base::FilePath GetPathForResourcePack( + const base::FilePath& pack_path, + ui::ResourceScaleFactor 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; + ui::ResourceScaleFactor scale_factor) override; absl::optional LoadDataResourceString(int resource_id) override; bool GetRawDataResource(int resource_id, - ui::ScaleFactor scale_factor, + ui::ResourceScaleFactor scale_factor, base::StringPiece* value) const override; bool GetLocalizedString(int message_id, std::u16string* value) const override; diff --git a/libcef/common/resource_bundle_impl.cc b/libcef/common/resource_bundle_impl.cc index dff6f16e3..014d298c3 100644 --- a/libcef/common/resource_bundle_impl.cc +++ b/libcef/common/resource_bundle_impl.cc @@ -29,7 +29,7 @@ CefRefPtr CefResourceBundleImpl::GetDataResourceForScale( base::RefCountedMemory* result = ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( - resource_id, static_cast(scale_factor)); + resource_id, static_cast(scale_factor)); if (!result) return nullptr; diff --git a/libcef/common/resource_util.cc b/libcef/common/resource_util.cc index d5473d258..e0dbfb704 100644 --- a/libcef/common/resource_util.cc +++ b/libcef/common/resource_util.cc @@ -219,9 +219,8 @@ void OverrideUserDataDir(CefSettings* settings, } // Same as ui::ResourceBundle::IsScaleFactorSupported. -bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) { - const std::vector& supported_scale_factors = - ui::GetSupportedScaleFactors(); +bool IsScaleFactorSupported(ui::ResourceScaleFactor scale_factor) { + const auto& supported_scale_factors = ui::GetSupportedResourceScaleFactors(); return std::find(supported_scale_factors.begin(), supported_scale_factors.end(), scale_factor) != supported_scale_factors.end(); diff --git a/libcef/common/resource_util.h b/libcef/common/resource_util.h index 1275f18a5..8ef371ecf 100644 --- a/libcef/common/resource_util.h +++ b/libcef/common/resource_util.h @@ -30,7 +30,7 @@ void OverrideUserDataDir(CefSettings* settings, const base::CommandLine* command_line); // Returns true if |scale_factor| is supported by this platform. -bool IsScaleFactorSupported(ui::ScaleFactor scale_factor); +bool IsScaleFactorSupported(ui::ResourceScaleFactor scale_factor); #if defined(OS_LINUX) // Look for binary files (*.bin, *.dat, *.pak, chrome-sandbox, libGLESv2.so, diff --git a/libcef/common/values_impl.cc b/libcef/common/values_impl.cc index 4f11201f8..477e10d96 100644 --- a/libcef/common/values_impl.cc +++ b/libcef/common/values_impl.cc @@ -1026,7 +1026,7 @@ CefListValueImpl::CefListValueImpl(base::ListValue* value, base::ListValue* CefListValueImpl::CopyValue() { CEF_VALUE_VERIFY_RETURN(false, nullptr); - return const_value().DeepCopy(); + return static_cast(const_value().DeepCopy()); } base::ListValue* CefListValueImpl::CopyOrDetachValue( @@ -1099,9 +1099,9 @@ bool CefListValueImpl::IsEqual(CefRefPtr that) { CefRefPtr CefListValueImpl::Copy() { CEF_VALUE_VERIFY_RETURN(false, nullptr); - return new CefListValueImpl(const_value().DeepCopy(), nullptr, - CefListValueImpl::kOwnerWillDelete, false, - nullptr); + return new CefListValueImpl( + static_cast(const_value().DeepCopy()), nullptr, + CefListValueImpl::kOwnerWillDelete, false, nullptr); } bool CefListValueImpl::SetSize(size_t size) { diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.cc b/libcef/renderer/alloy/alloy_render_thread_observer.cc index 9393f95ea..dec93f226 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.cc +++ b/libcef/renderer/alloy/alloy_render_thread_observer.cc @@ -50,7 +50,9 @@ void AlloyRenderThreadObserver::UnregisterMojoInterfaces( void AlloyRenderThreadObserver::SetInitialConfiguration( bool is_incognito_process, - mojo::PendingReceiver chromeos_listener) { + mojo::PendingReceiver chromeos_listener, + mojo::PendingRemote + content_settings_manager) { is_incognito_process_ = is_incognito_process; } diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.h b/libcef/renderer/alloy/alloy_render_thread_observer.h index e554d04cc..98821bf43 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.h +++ b/libcef/renderer/alloy/alloy_render_thread_observer.h @@ -37,8 +37,9 @@ class AlloyRenderThreadObserver : public content::RenderThreadObserver, // chrome::mojom::RendererConfiguration: void SetInitialConfiguration( bool is_incognito_process, - mojo::PendingReceiver chromeos_listener) - override; + mojo::PendingReceiver chromeos_listener, + mojo::PendingRemote + content_settings_manager) override; void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override; void SetContentSettingRules( const RendererContentSettingRules& rules) override; diff --git a/patch/patch.cfg b/patch/patch.cfg index f9f055634..1c48eff18 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -39,9 +39,6 @@ patches = [ # # Support custom VS toolchain on Windows. # https://bugs.chromium.org/p/chromium/issues/detail?id=623342 - # - # Update "py" wheel to a version that is compatible with pytest-6.2.2. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1231439 'name': 'runhooks', }, { @@ -542,10 +539,5 @@ patches = [ # Linux: Fix ATK assertion error when generating ARM build config. # https://bugs.chromium.org/p/chromium/issues/detail?id=1123214 'name': 'linux_atk_1123214', - }, - { - # Linux: Fix undefined symbol from ChromeSettingsProto. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1119417#c24 - 'name': 'chrome_browser_privacy_1119417', } ] diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index debf47a7c..78193bc5f 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index 576bd49a6198f..d5872f293f7cc 100644 +index bafc85477602d..7672916319fa9 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index 576bd49a6198f..d5872f293f7cc 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1731,7 +1732,11 @@ component("base") { +@@ -1745,7 +1746,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 576bd49a6198f..d5872f293f7cc 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1978,6 +1983,12 @@ component("base") { +@@ -1993,6 +1998,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } @@ -33,9 +33,9 @@ index 576bd49a6198f..d5872f293f7cc 100644 + defines += [ "_ENABLE_ATOMIC_ALIGNMENT_FIX" ] + } + - # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. - configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] - + libs += [ + "cfgmgr32.lib", + "powrprof.lib", diff --git base/hash/md5.h base/hash/md5.h index 8a49f08dcb04d..2f03d7a6d1b34 100644 --- base/hash/md5.h @@ -66,3 +66,27 @@ index 5bb10fe069850..206344d0fd3b1 100644 #include "base/hash/sha1_nacl.h" #else #include "base/hash/sha1_boringssl.h" +diff --git base/unguessable_token.cc base/unguessable_token.cc +index d156be5597625..fc753a2ceb88a 100644 +--- base/unguessable_token.cc ++++ base/unguessable_token.cc +@@ -9,8 +9,9 @@ + #include "base/format_macros.h" + #include "base/rand_util.h" + #include "build/build_config.h" ++#include "cef/libcef/features/features.h" + +-#if !defined(OS_NACL) ++#if !defined(OS_NACL) && !BUILDFLAG(IS_CEF_SANDBOX_BUILD) + #include "third_party/boringssl/src/include/openssl/mem.h" + #endif + +@@ -41,7 +42,7 @@ UnguessableToken UnguessableToken::Deserialize(uint64_t high, uint64_t low) { + } + + bool UnguessableToken::operator==(const UnguessableToken& other) const { +-#if defined(OS_NACL) ++#if defined(OS_NACL) || BUILDFLAG(IS_CEF_SANDBOX_BUILD) + // BoringSSL is unavailable for NaCl builds so it remains timing dependent. + return token_ == other.token_; + #else diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 10fd31258..c566e4106 100644 --- a/patch/patches/browser_security_policy_1081397.patch +++ b/patch/patches/browser_security_policy_1081397.patch @@ -1,8 +1,8 @@ diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc -index eefad1a677606..7318d223a63d0 100644 +index 8b338161af4bc..e0c4e36f9f140 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1721,6 +1721,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1734,6 +1734,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; @@ -20,11 +20,11 @@ index eefad1a677606..7318d223a63d0 100644 // TODO(wjmaclean): We should update the ProcessLock comparison API diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc -index 5b830ecbb4a47..39b32f681233e 100644 +index b4d827ec6b9ca..5168da29c5d4d 100644 --- content/browser/renderer_host/navigation_request.cc +++ content/browser/renderer_host/navigation_request.cc -@@ -5606,6 +5606,12 @@ url::Origin - NavigationRequest::GetOriginForURLLoaderFactoryWithoutFinalFrameHost() { +@@ -5686,6 +5686,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryWithoutFinalFrameHost( + network::mojom::WebSandboxFlags sandbox_flags) { // Calculate an approximation of the origin. The sandbox/csp are ignored. url::Origin origin = GetOriginForURLLoaderFactoryUnchecked(this); + if (!origin.GetURL().IsStandard()) { @@ -36,7 +36,7 @@ index 5b830ecbb4a47..39b32f681233e 100644 // Apply sandbox flags. // See https://html.spec.whatwg.org/#sandboxed-origin-browsing-context-flag -@@ -5639,6 +5645,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryWithFinalFrameHost() { +@@ -5719,6 +5725,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryWithFinalFrameHost() { if (IsSameDocument() || IsPageActivation()) return GetRenderFrameHost()->GetLastCommittedOrigin(); @@ -49,6 +49,6 @@ index 5b830ecbb4a47..39b32f681233e 100644 + return unchecked_origin.DeriveNewOpaqueOrigin(); + } + - url::Origin origin = GetOriginForURLLoaderFactoryWithoutFinalFrameHost(); + url::Origin origin = GetOriginForURLLoaderFactoryWithoutFinalFrameHost( + sandbox_flags_to_commit_.value()); - // MHTML documents should commit as an opaque origin. They should not be able diff --git a/patch/patches/build.patch b/patch/patches/build.patch index b9c2c4d45..83a4bd1b7 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 13ed917c81281..5f7bf7cbf5ae9 100644 +index d7073ad38f0bf..1e00da32ead45 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1855,8 +1855,6 @@ config("thin_archive") { +@@ -1863,8 +1863,6 @@ config("thin_archive") { # confuses lldb. if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 777377055..25ba7b34c 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 0d81f08e66b1e..eba77d4116945 100644 +index f0fee1d39ff72..bc9b22974d52c 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -13,6 +13,7 @@ import("//build/config/features.gni") @@ -18,7 +18,7 @@ index 0d81f08e66b1e..eba77d4116945 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2471,6 +2473,10 @@ static_library("browser") { +@@ -2485,6 +2487,10 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 8346dd6f8..d3c7e3d72 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,61 +1,3 @@ -diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index dd4c916b7581a..c27d72bf53c9b 100644 ---- chrome/browser/app_controller_mac.mm -+++ chrome/browser/app_controller_mac.mm -@@ -31,6 +31,7 @@ - #include "base/threading/scoped_blocking_call.h" - #include "base/threading/thread_restrictions.h" - #include "build/branding_buildflags.h" -+#include "cef/libcef/features/features.h" - #include "chrome/app/chrome_command_ids.h" - #include "chrome/browser/apps/app_shim/app_shim_manager_mac.h" - #include "chrome/browser/apps/app_shim/app_shim_termination_manager.h" -@@ -1339,6 +1340,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - - // Run a (background) application in a new tab. - - (void)executeApplication:(id)sender { -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - NSInteger tag = [sender tag]; - Profile* profile = [self lastProfile]; - DCHECK(profile); -@@ -1347,6 +1349,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - tag < static_cast(applications.size())); - const extensions::Extension* extension = applications.GetExtension(tag); - BackgroundModeManager::LaunchBackgroundApplication(profile, extension); -+#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE) - } - - // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1702,6 +1705,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - [dockMenu addItem:item]; - } - -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit tests - // which use the mock in place of the profile-initialized model. - BackgroundApplicationListModel applications(profile); -@@ -1726,6 +1730,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - [appMenu addItem:appItem]; - } - } -+#endif // BUILDFLAG(ENABLE_BACKGROUND_MODE) - - return dockMenu; - } -@@ -1963,11 +1968,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; - namespace { - - void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { -+#if !BUILDFLAG(ENABLE_CEF) - if (status == Profile::CREATE_STATUS_INITIALIZED) { - AppController* controller = - base::mac::ObjCCastStrict([NSApp delegate]); - [controller windowChangedToProfile:profile]; - } -+#endif // !BUILDFLAG(ENABLE_CEF) - } - - void OpenUrlsInBrowserWithProfile(const std::vector& urls, diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h index a7657cb6e5d5e..d6c6f3225fcb6 100644 --- chrome/browser/browser_process.h @@ -72,10 +14,10 @@ index a7657cb6e5d5e..d6c6f3225fcb6 100644 std::unique_ptr manager) = 0; #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 1149818336011..0e454299e2622 100644 +index 18620c247548a..bbe2db2355d1e 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -970,18 +970,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -981,18 +981,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index d227098a2..1932d6798 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,7 +13,7 @@ index ba0c5c3fc0446..b4df9af95ecd1 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 8fdddbadf5e9a..4c5ea3c875db2 100644 +index b6a5989bbee66..10c942ddc793c 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc @@ -262,6 +262,20 @@ @@ -37,7 +37,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_browser_window_helper.h" #endif -@@ -491,6 +505,13 @@ Browser::Browser(const CreateParams& params) +@@ -496,6 +510,13 @@ Browser::Browser(const CreateParams& params) tab_strip_model_->AddObserver(this); @@ -51,7 +51,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -1325,6 +1346,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1326,6 +1347,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1332,8 +1361,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1333,8 +1362,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1558,6 +1597,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1559,6 +1598,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1657,6 +1704,15 @@ void Browser::AddNewContents(WebContents* source, +@@ -1658,6 +1705,15 @@ void Browser::AddNewContents(WebContents* source, source, disposition); } @@ -118,7 +118,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 chrome::AddWebContents(this, source, std::move(new_contents), target_url, disposition, initial_rect); } -@@ -1675,6 +1731,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1676,6 +1732,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -127,7 +127,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1702,6 +1760,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1703,6 +1761,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -136,7 +136,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 if (!GetStatusBubble()) return; -@@ -1709,6 +1769,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1710,6 +1770,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -154,7 +154,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1825,6 +1896,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1826,6 +1897,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -165,16 +165,16 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1861,6 +1936,8 @@ void Browser::RendererResponsive( - void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { +@@ -1862,6 +1937,8 @@ void Browser::RendererResponsive( + void Browser::DidNavigatePrimaryMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); + -+ CALL_CEF_DELEGATE(DidNavigateMainFramePostCommit, web_contents); ++ CALL_CEF_DELEGATE(DidNavigatePrimaryMainFramePostCommit, web_contents); } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1907,11 +1984,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1901,11 +1978,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -190,7 +190,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2756,6 +2837,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2750,6 +2831,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveTranslationObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -200,7 +200,7 @@ index 8fdddbadf5e9a..4c5ea3c875db2 100644 void Browser::TabDetachedAtImpl(content::WebContents* contents, diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 2908b4b70815d..9eb3be7b231ad 100644 +index 17c3233034d0e..4052f9c8dfc68 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -21,6 +21,7 @@ @@ -222,7 +222,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -283,6 +288,11 @@ class Browser : public TabStripModelObserver, +@@ -285,6 +290,11 @@ class Browser : public TabStripModelObserver, // maximizable. bool can_maximize = true; @@ -234,7 +234,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -347,6 +357,13 @@ class Browser : public TabStripModelObserver, +@@ -349,6 +359,13 @@ class Browser : public TabStripModelObserver, return creation_source_ == CreationSource::kSessionRestore; } @@ -248,7 +248,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 // Accessors //////////////////////////////////////////////////////////////// const CreateParams& create_params() const { return create_params_; } -@@ -407,6 +424,12 @@ class Browser : public TabStripModelObserver, +@@ -419,6 +436,12 @@ class Browser : public TabStripModelObserver, base::WeakPtr AsWeakPtr(); @@ -261,7 +261,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -789,6 +812,11 @@ class Browser : public TabStripModelObserver, +@@ -784,6 +807,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -273,7 +273,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1180,6 +1208,8 @@ class Browser : public TabStripModelObserver, +@@ -1172,6 +1200,8 @@ class Browser : public TabStripModelObserver, const std::string initial_workspace_; bool initial_visible_on_all_workspaces_state_; @@ -282,7 +282,7 @@ index 2908b4b70815d..9eb3be7b231ad 100644 CreationSource creation_source_ = CreationSource::kUnknown; UnloadController unload_controller_; -@@ -1237,6 +1267,10 @@ class Browser : public TabStripModelObserver, +@@ -1229,6 +1259,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -312,7 +312,7 @@ index a4af0836da1aa..bdf26e401d563 100644 // tab helpers, so the entire set of tab helpers needs to be set up // immediately. diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc -index 72ad734682957..668a1b950df6b 100644 +index 40907675219d3..19e1093947ed0 100644 --- chrome/browser/ui/browser_tabstrip.cc +++ chrome/browser/ui/browser_tabstrip.cc @@ -30,9 +30,13 @@ void AddTabAt(Browser* browser, diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index a2b15a6ed..da61070c6 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -54,7 +54,7 @@ index 173582c7c4904..bbf57904b6de9 100644 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) SupervisedUserSettingsService* supervised_service = diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc -index 610f6d942998c..f822df04ff07d 100644 +index e410df38c0b44..3d5701b9918ac 100644 --- components/content_settings/renderer/content_settings_agent_impl.cc +++ components/content_settings/renderer/content_settings_agent_impl.cc @@ -170,7 +170,7 @@ ContentSetting GetContentSettingFromRulesImpl( diff --git a/patch/patches/chrome_browser_context_menus.patch b/patch/patches/chrome_browser_context_menus.patch index c96b4d027..3918f4649 100644 --- a/patch/patches/chrome_browser_context_menus.patch +++ b/patch/patches/chrome_browser_context_menus.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc -index 408566907e832..1266687ccd665 100644 +index 9e358b1cde224..67ccd6ca0c50d 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ chrome/browser/renderer_context_menu/render_view_context_menu.cc -@@ -273,6 +273,13 @@ base::OnceCallback* GetMenuShownCallback() { +@@ -279,6 +279,13 @@ base::OnceCallback* GetMenuShownCallback() { return callback.get(); } @@ -16,7 +16,7 @@ index 408566907e832..1266687ccd665 100644 enum class UmaEnumIdLookupType { GeneralEnumId, ContextSpecificEnumId, -@@ -484,6 +491,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { +@@ -490,6 +497,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) { if (ContextMenuMatcher::IsExtensionsCustomCommandId(id)) return 1; @@ -27,7 +27,7 @@ index 408566907e832..1266687ccd665 100644 id = CollapseCommandsForUMA(id); const auto& map = GetIdcToUmaMap(type); auto it = map.find(id); -@@ -656,6 +667,14 @@ RenderViewContextMenu::RenderViewContextMenu( +@@ -666,6 +677,14 @@ RenderViewContextMenu::RenderViewContextMenu( system_app_type_ = GetBrowser() && GetBrowser()->app_controller() ? GetBrowser()->app_controller()->system_app_type() : absl::nullopt; @@ -42,7 +42,7 @@ index 408566907e832..1266687ccd665 100644 } RenderViewContextMenu::~RenderViewContextMenu() = default; -@@ -1022,6 +1041,12 @@ void RenderViewContextMenu::InitMenu() { +@@ -1032,6 +1051,12 @@ void RenderViewContextMenu::InitMenu() { // menu, meaning that each menu item added/removed in this function will cause // it to visibly jump on the screen (see b/173569669). AppendQuickAnswersItems(); @@ -55,7 +55,7 @@ index 408566907e832..1266687ccd665 100644 } Profile* RenderViewContextMenu::GetProfile() const { -@@ -2742,6 +2767,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( +@@ -2816,6 +2841,12 @@ void RenderViewContextMenu::RegisterMenuShownCallbackForTesting( *GetMenuShownCallback() = std::move(cb); } @@ -69,10 +69,10 @@ index 408566907e832..1266687ccd665 100644 RenderViewContextMenu::GetHandlersForLinkUrl() { ProtocolHandlerRegistry::ProtocolHandlerList handlers = diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h -index 34b6152a222ec..b03c81bd076b8 100644 +index fbcde566b8c90..261b1b3e05dfc 100644 --- chrome/browser/renderer_context_menu/render_view_context_menu.h +++ chrome/browser/renderer_context_menu/render_view_context_menu.h -@@ -101,6 +101,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, +@@ -106,6 +106,12 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, static void RegisterMenuShownCallbackForTesting( base::OnceCallback cb); @@ -85,7 +85,7 @@ index 34b6152a222ec..b03c81bd076b8 100644 protected: Profile* GetProfile() const; -@@ -296,6 +302,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, +@@ -304,6 +310,9 @@ class RenderViewContextMenu : public RenderViewContextMenuBase, // built. bool is_protocol_submenu_valid_ = false; @@ -110,7 +110,7 @@ index 13a65de79e185..0901c4cade4f1 100644 // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc -index b2513d5ca3ead..f1894f4e05385 100644 +index f40f15c23bfb2..06d4d197ce137 100644 --- components/renderer_context_menu/render_view_context_menu_base.cc +++ components/renderer_context_menu/render_view_context_menu_base.cc @@ -376,6 +376,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const { diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index 3e167269b..c15e7bd09 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 ac4bc7b9021ee..fefdb822c5b71 100644 +index bab9ce1d4662e..afefbe5f25ce2 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -11,6 +11,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index ac4bc7b9021ee..fefdb822c5b71 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -344,6 +345,10 @@ static_library("ui") { +@@ -346,6 +347,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index ac4bc7b9021ee..fefdb822c5b71 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 -@@ -366,6 +371,7 @@ static_library("ui") { +@@ -368,6 +373,7 @@ static_library("ui") { "//build:branding_buildflags", "//build:chromeos_buildflags", "//cc/paint", @@ -29,7 +29,7 @@ index ac4bc7b9021ee..fefdb822c5b71 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -4878,6 +4884,7 @@ static_library("ui") { +@@ -4947,6 +4953,7 @@ static_library("ui") { if (enable_basic_printing) { deps += [ "//components/printing/browser", diff --git a/patch/patches/chrome_browser_profile_menu.patch b/patch/patches/chrome_browser_profile_menu.patch index fa50e4dc3..05e39d2ba 100644 --- a/patch/patches/chrome_browser_profile_menu.patch +++ b/patch/patches/chrome_browser_profile_menu.patch @@ -29,7 +29,7 @@ index 8a93e597977b0..4d0faa950a2af 100644 chrome::RecordDialogCreation( diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc -index e8273f40a6d09..b5b21c30ba780 100644 +index 5b5baee89fc2f..26dc4a9591bf9 100644 --- chrome/browser/ui/views/profiles/profile_menu_view_base.cc +++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc @@ -511,7 +511,9 @@ void ProfileMenuViewBase::ShowBubble(profiles::BubbleViewMode view_mode, diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index ece5154e5..cb5651ab7 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/profiles/off_the_record_profile_impl.cc chrome/browser/profiles/off_the_record_profile_impl.cc -index d4654752a2132..5829ddeaa91a7 100644 +index baef951fe2535..a72b08b21c606 100644 --- chrome/browser/profiles/off_the_record_profile_impl.cc +++ chrome/browser/profiles/off_the_record_profile_impl.cc @@ -628,7 +628,9 @@ std::unique_ptr Profile::CreateOffTheRecordProfile( @@ -14,7 +14,7 @@ index d4654752a2132..5829ddeaa91a7 100644 } diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc -index 01f72891d3035..050f4aa94c6d0 100644 +index 403c59f81857a..d73fb2d6fa88b 100644 --- chrome/browser/profiles/profile.cc +++ chrome/browser/profiles/profile.cc @@ -86,6 +86,7 @@ base::LazyInstance>::Leaky @@ -52,10 +52,10 @@ index 01f72891d3035..050f4aa94c6d0 100644 Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() { return CreateUnique(kDevToolsOTRProfileIDPrefix); diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h -index e3e819d9ecd87..ef8c6ebd1cf2e 100644 +index 4d0cc18bd6a85..76adcbd9b7fcc 100644 --- chrome/browser/profiles/profile.h +++ chrome/browser/profiles/profile.h -@@ -119,6 +119,10 @@ class Profile : public content::BrowserContext { +@@ -112,6 +112,10 @@ class Profile : public content::BrowserContext { // be applicable to run. Please see crbug.com/1098697#c3 for more details. static OTRProfileID CreateUnique(const std::string& profile_id_prefix); @@ -66,7 +66,7 @@ index e3e819d9ecd87..ef8c6ebd1cf2e 100644 // Creates a unique OTR profile id to be used for DevTools browser contexts. static OTRProfileID CreateUniqueForDevTools(); -@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext { +@@ -514,6 +518,8 @@ class Profile : public content::BrowserContext { virtual void RecordMainFrameNavigation() = 0; @@ -75,7 +75,7 @@ index e3e819d9ecd87..ef8c6ebd1cf2e 100644 protected: // Creates an OffTheRecordProfile which points to this Profile. static std::unique_ptr CreateOffTheRecordProfile( -@@ -533,8 +539,6 @@ class Profile : public content::BrowserContext { +@@ -525,8 +531,6 @@ class Profile : public content::BrowserContext { static PrefStore* CreateExtensionPrefStore(Profile*, bool incognito_pref_store); @@ -85,10 +85,10 @@ index e3e819d9ecd87..ef8c6ebd1cf2e 100644 virtual bool IsSignedIn() = 0; diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc -index 5d87d4fff37ab..61d00177e036e 100644 +index 677206fe6701d..50248ef60f428 100644 --- chrome/browser/profiles/profile_impl.cc +++ chrome/browser/profiles/profile_impl.cc -@@ -929,7 +929,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, +@@ -973,7 +973,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id, otr_profiles_[otr_profile_id] = std::move(otr_profile); @@ -100,7 +100,7 @@ index 5d87d4fff37ab..61d00177e036e 100644 return raw_otr_profile; } diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index aef8964db423d..e15bc0dc20285 100644 +index 04aab51e9b179..532e719058f4b 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc @@ -495,7 +495,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) @@ -135,7 +135,7 @@ index 915a95e287c58..0424e8bdd7d84 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 5e71c1f56da15..db5c46cb5f85f 100644 +index 0757d75a24b28..bd916bdaf820f 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -8,6 +8,7 @@ @@ -143,10 +143,10 @@ index 5e71c1f56da15..db5c46cb5f85f 100644 #include "base/bind.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/runtime.h" + #include "chrome/browser/content_settings/content_settings_manager_delegate.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" - #include "chrome/browser/signin/identity_manager_factory.h" -@@ -57,8 +58,12 @@ void GetGuestViewDefaultContentSettingRules( +@@ -60,8 +61,12 @@ void GetGuestViewDefaultContentSettingRules( } // namespace RendererUpdater::RendererUpdater(Profile* profile) : profile_(profile) { @@ -158,4 +158,4 @@ index 5e71c1f56da15..db5c46cb5f85f 100644 + } #if BUILDFLAG(IS_CHROMEOS_ASH) oauth2_login_manager_ = - chromeos::OAuth2LoginManagerFactory::GetForProfile(profile_); + ash::OAuth2LoginManagerFactory::GetForProfile(profile_); diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 48b27111c..56ff72b4c 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 102a18a81e424..c530945922b1d 100644 +index ff31c91fc6f0c..3125b3eaeeae8 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn @@ -27,6 +27,7 @@ static_library("safe_browsing") { diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index a7fbb86c5..f84953a5c 100644 --- a/patch/patches/chrome_browser_themes.patch +++ b/patch/patches/chrome_browser_themes.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/themes/theme_service.cc chrome/browser/themes/theme_service.cc -index ca830ceefd5d5..8b3af9620670d 100644 +index abba09a2eda93..d9e23612dfa0e 100644 --- chrome/browser/themes/theme_service.cc +++ chrome/browser/themes/theme_service.cc -@@ -27,6 +27,7 @@ +@@ -26,6 +26,7 @@ #include "base/task/thread_pool.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" @@ -10,7 +10,7 @@ index ca830ceefd5d5..8b3af9620670d 100644 #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" #include "chrome/browser/profiles/profile.h" -@@ -59,6 +60,10 @@ +@@ -58,6 +59,10 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/layout.h" @@ -21,7 +21,7 @@ index ca830ceefd5d5..8b3af9620670d 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/scoped_observation.h" #include "extensions/browser/extension_registry_observer.h" -@@ -281,11 +286,19 @@ void ThemeService::Init() { +@@ -280,11 +285,19 @@ void ThemeService::Init() { // OnExtensionServiceReady. Otherwise, the ThemeObserver won't be // constructed in time to observe the corresponding events. #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 21c1efc4e..307f44a32 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -151,7 +151,7 @@ index a0b3175223f3e..a1117001ad1fc 100644 Profile* profile = Profile::FromBrowserContext(browser_context); const std::vector& allowlist = diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc -index 88a87fd4d74bb..2815c9897d636 100644 +index 8c2547056ec26..2ab3252dca708 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc @@ -7,6 +7,7 @@ @@ -162,7 +162,7 @@ index 88a87fd4d74bb..2815c9897d636 100644 #include "chrome/common/chrome_features.h" #include "chrome/common/net/safe_search_util.h" #include "components/google/core/common/google_util.h" -@@ -18,6 +19,10 @@ +@@ -19,6 +20,10 @@ #include "ui/base/device_form_factor.h" #endif @@ -173,7 +173,7 @@ index 88a87fd4d74bb..2815c9897d636 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/extension_urls.h" #endif -@@ -157,6 +162,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( +@@ -158,6 +163,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( const GURL& response_url, network::mojom::URLResponseHead* response_head, bool* defer) { @@ -186,10 +186,10 @@ index 88a87fd4d74bb..2815c9897d636 100644 // that the X-Frame-Options protection mechanism is set to either DENY or // SAMEORIGIN. diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index a6e34d86aa11c..1141f02719e9b 100644 +index fc4ae8abac329..73083d8ba64d6 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -919,6 +919,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -931,6 +931,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -197,7 +197,7 @@ index a6e34d86aa11c..1141f02719e9b 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1122,7 +1123,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1134,7 +1135,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -207,7 +207,7 @@ index a6e34d86aa11c..1141f02719e9b 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1131,7 +1133,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1143,7 +1145,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -217,7 +217,7 @@ index a6e34d86aa11c..1141f02719e9b 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1141,7 +1144,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1153,7 +1156,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -227,7 +227,7 @@ index a6e34d86aa11c..1141f02719e9b 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1149,7 +1153,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1161,7 +1165,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index d74124def..90bf56e29 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 02cdf42567745..74fff92e5b6e1 100644 +index dd997e3ccdb03..c9076e263b403 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -18,7 +18,7 @@ index 02cdf42567745..74fff92e5b6e1 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -239,6 +241,10 @@ static_library("renderer") { +@@ -241,6 +243,10 @@ static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_runtime.patch b/patch/patches/chrome_runtime.patch index 1f24df72a..0b2938482 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,5 +1,5 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index 495893eec9704..e967494683f19 100644 +index 73d78a39dacfe..53e0a980ec8a4 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc @@ -29,6 +29,7 @@ @@ -10,7 +10,7 @@ index 495893eec9704..e967494683f19 100644 #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/defaults.h" -@@ -384,6 +385,8 @@ struct MainFunction { +@@ -386,6 +387,8 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -19,7 +19,7 @@ index 495893eec9704..e967494683f19 100644 #if defined(OS_WIN) // Reach out to chrome_elf for the truth on the user data directory. // Note that in tests, this links to chrome_elf_test_stubs. -@@ -675,7 +678,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -708,7 +711,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index 495893eec9704..e967494683f19 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -970,6 +975,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1003,6 +1008,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index 495893eec9704..e967494683f19 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -980,6 +986,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1013,6 +1019,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,7 +45,7 @@ index 495893eec9704..e967494683f19 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1103,6 +1110,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1136,6 +1143,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } @@ -53,7 +53,7 @@ index 495893eec9704..e967494683f19 100644 #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1135,6 +1143,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1168,6 +1176,7 @@ void ChromeMainDelegate::PreSandboxStartup() { // After all the platform Breakpads have been initialized, store the command // line for crash reporting. crash_keys::SetCrashKeysFromCommandLine(command_line); @@ -61,7 +61,7 @@ index 495893eec9704..e967494683f19 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1233,6 +1242,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1266,6 +1275,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index 495893eec9704..e967494683f19 100644 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. const base::CommandLine* command_line = -@@ -1249,6 +1259,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1282,6 +1292,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,10 +78,10 @@ index 495893eec9704..e967494683f19 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index dff0a32062f0e..9378b2a0be47f 100644 +index e07aca88fdf9e..9aa092498c861 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc -@@ -49,6 +49,7 @@ +@@ -50,6 +50,7 @@ #include "build/build_config.h" #include "build/chromeos_buildflags.h" #include "cc/base/switches.h" @@ -89,7 +89,7 @@ index dff0a32062f0e..9378b2a0be47f 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -915,8 +916,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -910,8 +911,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { #if !defined(OS_ANDROID) // Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of // its QuitClosure to the BrowserProcessImpl to call when it is time to exit. @@ -101,7 +101,7 @@ index dff0a32062f0e..9378b2a0be47f 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1689,11 +1692,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1663,11 +1666,14 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. @@ -156,18 +156,18 @@ index 95d1ebc190910..13cdfa52db108 100644 +#endif } diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 8650dd04f9c44..45ab4913bbe04 100644 +index 69b31dd94edae..e5931622edb3c 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -38,6 +38,7 @@ - #include "base/threading/thread_task_runner_handle.h" +@@ -28,6 +28,7 @@ + #include "base/strings/stringprintf.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/accessibility/accessibility_labels_service.h" #include "chrome/browser/accessibility/accessibility_labels_service_factory.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -3562,9 +3563,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( +@@ -3475,9 +3476,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( &search::HandleNewTabURLReverseRewrite); #endif // defined(OS_ANDROID) @@ -179,33 +179,8 @@ index 8650dd04f9c44..45ab4913bbe04 100644 } base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -diff --git chrome/browser/notifications/alert_dispatcher_xpc.mm chrome/browser/notifications/alert_dispatcher_xpc.mm -index ab4c2b03755d3..8e813496f9df6 100644 ---- chrome/browser/notifications/alert_dispatcher_xpc.mm -+++ chrome/browser/notifications/alert_dispatcher_xpc.mm -@@ -19,6 +19,7 @@ - #include "base/mac/scoped_nsobject.h" - #include "base/metrics/histogram_functions.h" - #include "base/strings/sys_string_conversions.h" -+#include "cef/libcef/features/runtime.h" - #include "chrome/browser/notifications/notification_platform_bridge_mac_utils.h" - #import "chrome/browser/ui/cocoa/notifications/notification_delivery.h" - #include "chrome/browser/ui/cocoa/notifications/xpc_mach_port.h" -@@ -179,6 +180,12 @@ void RecordXPCEvent(XPCConnectionEvent event) { - - (id)serviceProxy { - id proxy = [_xpcConnection remoteObjectProxy]; - -+ // Skip exception port configuration when running CEF with crash reporting disabled. -+ if (!_setExceptionPort && cef::IsChromeRuntimeEnabled() && -+ !cef::IsCrashReportingEnabled()) { -+ _setExceptionPort = YES; -+ } -+ - if (!_setExceptionPort) { - base::mac::ScopedMachSendRight exceptionPort( - crash_reporter::GetCrashpadClient().GetHandlerMachPort()); diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc -index 3de6df64935e3..78a2bf3896e72 100644 +index 8fadd3a4d4ebe..2fad4e8704410 100644 --- chrome/browser/prefs/browser_prefs.cc +++ chrome/browser/prefs/browser_prefs.cc @@ -10,6 +10,7 @@ @@ -227,7 +202,7 @@ index 3de6df64935e3..78a2bf3896e72 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/accessibility/animation_policy_prefs.h" #include "chrome/browser/apps/platform_apps/shortcut_manager.h" -@@ -1134,6 +1139,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, +@@ -1147,6 +1152,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, SessionDataService::RegisterProfilePrefs(registry); #endif diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index f07b4e2e2..b35ea6dd3 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/browser_command_controller.cc chrome/browser/ui/browser_command_controller.cc -index 57ef822f46944..06cef42aab9ed 100644 +index 9188154824c4d..d01f610a64135 100644 --- chrome/browser/ui/browser_command_controller.cc +++ chrome/browser/ui/browser_command_controller.cc @@ -351,8 +351,10 @@ bool BrowserCommandController::ExecuteCommandWithDisposition( @@ -14,7 +14,7 @@ index 57ef822f46944..06cef42aab9ed 100644 // No commands are enabled if there is not yet any selected tab. // TODO(pkasting): It seems like we should not need this, because either -@@ -959,11 +961,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( +@@ -962,11 +964,13 @@ void BrowserCommandController::TabRestoreServiceLoaded( // BrowserCommandController, private: bool BrowserCommandController::IsShowingMainUI() { @@ -31,7 +31,7 @@ index 57ef822f46944..06cef42aab9ed 100644 void BrowserCommandController::InitCommandState() { diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index 3fca382fde67e..6adddf506bb16 100644 +index 2c4624fb0cd05..57c087dcbaaee 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc @@ -69,15 +69,23 @@ bool IsUsingGtkTheme(Profile* profile) { @@ -95,7 +95,7 @@ index 3fca382fde67e..6adddf506bb16 100644 browser_frame_view_->OnBrowserViewInitViewsComplete(); } -@@ -341,7 +361,8 @@ void BrowserFrame::SelectNativeTheme() { +@@ -348,7 +368,8 @@ void BrowserFrame::SelectNativeTheme() { // Select between regular, dark and GTK theme. ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi(); @@ -120,10 +120,10 @@ index 0ce7abdeb7d9f..8197a6bb7da98 100644 // Initialize the frame (creates the underlying native window). diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc -index f3239963d569a..2bee32af5a8dd 100644 +index f0b0bd645a3ce..0d8475b411512 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -589,11 +589,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { +@@ -593,11 +593,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { /////////////////////////////////////////////////////////////////////////////// // BrowserView, public: @@ -147,7 +147,7 @@ index f3239963d569a..2bee32af5a8dd 100644 SetShowIcon(::ShouldShowWindowIcon(browser_.get())); // In forced app mode, all size controls are always disabled. Otherwise, use -@@ -607,7 +618,6 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -611,7 +622,6 @@ BrowserView::BrowserView(std::unique_ptr browser) } browser_->tab_strip_model()->AddObserver(this); @@ -155,7 +155,7 @@ index f3239963d569a..2bee32af5a8dd 100644 // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -651,8 +661,15 @@ BrowserView::BrowserView(std::unique_ptr browser) +@@ -655,8 +665,15 @@ BrowserView::BrowserView(std::unique_ptr browser) contents_container->SetLayoutManager(std::make_unique( devtools_web_view_, contents_web_view_)); @@ -173,7 +173,7 @@ index f3239963d569a..2bee32af5a8dd 100644 contents_separator_ = top_container_->AddChildView(std::make_unique()); -@@ -1436,6 +1453,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1440,6 +1457,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -182,7 +182,7 @@ index f3239963d569a..2bee32af5a8dd 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2462,7 +2481,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { +@@ -2482,7 +2501,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { } void BrowserView::ReparentTopContainerForEndOfImmersive() { @@ -192,7 +192,7 @@ index f3239963d569a..2bee32af5a8dd 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -2914,8 +2934,10 @@ void BrowserView::Layout() { +@@ -2934,8 +2954,10 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( @@ -205,7 +205,7 @@ index f3239963d569a..2bee32af5a8dd 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -2978,6 +3000,11 @@ void BrowserView::AddedToWidget() { +@@ -2998,6 +3020,11 @@ void BrowserView::AddedToWidget() { SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); #endif @@ -217,7 +217,7 @@ index f3239963d569a..2bee32af5a8dd 100644 toolbar_->Init(); #if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS) -@@ -3013,13 +3040,9 @@ void BrowserView::AddedToWidget() { +@@ -3033,13 +3060,9 @@ void BrowserView::AddedToWidget() { EnsureFocusOrder(); @@ -234,7 +234,7 @@ index f3239963d569a..2bee32af5a8dd 100644 MaybeInitializeWebUITabStrip(); diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 02f0019d7d324..2bcf69c2098ae 100644 +index 021f04720e567..8c4f2cbf34f25 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h @@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, @@ -247,7 +247,7 @@ index 02f0019d7d324..2bcf69c2098ae 100644 BrowserView(const BrowserView&) = delete; BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; -@@ -661,6 +663,12 @@ class BrowserView : public BrowserWindow, +@@ -668,6 +670,12 @@ class BrowserView : public BrowserWindow, return accessibility_focus_highlight_.get(); } @@ -278,10 +278,10 @@ index 18a85f436bd97..0d6e4c9f916e7 100644 bool toolbar_visible = delegate_->IsToolbarVisible(); int height = toolbar_visible ? toolbar_->GetPreferredSize().height() : 0; diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index bb4f5ff05c72e..2cd5634bc96b6 100644 +index 5e516ea5873ca..b9890fbe050af 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -@@ -586,37 +586,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( +@@ -587,37 +587,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( } bool BrowserTabStripController::IsFrameCondensed() const { @@ -336,10 +336,10 @@ index bb4f5ff05c72e..2cd5634bc96b6 100644 } diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc -index 9fe383741657c..39b7adae6cfaf 100644 +index 7bc5cd3dabf7d..ea706584db609 100644 --- chrome/browser/ui/views/toolbar/toolbar_view.cc +++ chrome/browser/ui/views/toolbar/toolbar_view.cc -@@ -161,12 +161,13 @@ auto& GetViewCommandMap() { +@@ -162,12 +162,13 @@ auto& GetViewCommandMap() { //////////////////////////////////////////////////////////////////////////////// // ToolbarView, public: @@ -355,7 +355,7 @@ index 9fe383741657c..39b7adae6cfaf 100644 SetID(VIEW_ID_TOOLBAR); UpgradeDetector::GetInstance()->AddObserver(this); -@@ -201,7 +202,7 @@ void ToolbarView::Init() { +@@ -202,7 +203,7 @@ void ToolbarView::Init() { #endif auto location_bar = std::make_unique( browser_, browser_->profile(), browser_->command_controller(), this, diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 7b5e44824..87300a154 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,8 +1,8 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index eec7a23a657a4..982efc615ab06 100644 +index 2619022a1d89c..572a495004def 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h -@@ -87,7 +87,7 @@ bool ApplyUserAgentMetadataOverrides( +@@ -89,7 +89,7 @@ bool ApplyUserAgentMetadataOverrides( FrameTreeNode* frame_tree_node, absl::optional* override_out); diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index 484bafd79..0540bad58 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -62,7 +62,7 @@ index 6e2d09885b457..da23a0211754b 100644 #endif diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 38f24359a5a25..3c724e29facbd 100644 +index dc4db573977d6..489ed518257c3 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc @@ -575,7 +575,7 @@ void DevToolsHttpHandler::OnJsonRequest( @@ -75,10 +75,10 @@ index 38f24359a5a25..3c724e29facbd 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index 4d0c1a27449d5..34bb0372c7f8f 100644 +index 42f62ccb3830b..5471182793dee 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -631,6 +631,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -636,6 +636,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -92,7 +92,7 @@ index 4d0c1a27449d5..34bb0372c7f8f 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -863,7 +870,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -873,7 +880,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -102,10 +102,10 @@ index 4d0c1a27449d5..34bb0372c7f8f 100644 if (stale) { diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 9be14f9a03219..00e2520112d81 100644 +index 493e9a31c983d..c468cb87a541f 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -270,6 +270,7 @@ bool PluginServiceImpl::GetPluginInfoArray( +@@ -269,6 +269,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -113,7 +113,7 @@ index 9be14f9a03219..00e2520112d81 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -287,7 +288,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -286,7 +287,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->IsPluginAvailable(render_process_id, render_frame_id, url, @@ -188,10 +188,10 @@ index 632ae86c6fd69..55b749ec12421 100644 const std::vector& all_plugins); diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc -index d3401f43eadaf..582486dad6500 100644 +index 714fd5889f254..9dc0414f02c55 100644 --- content/browser/renderer_host/render_frame_host_impl.cc +++ content/browser/renderer_host/render_frame_host_impl.cc -@@ -11827,6 +11827,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( +@@ -12008,6 +12008,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( } void RenderFrameHostImpl::GetPluginInfo(const GURL& url, @@ -199,7 +199,7 @@ index d3401f43eadaf..582486dad6500 100644 const url::Origin& main_frame_origin, const std::string& mime_type, GetPluginInfoCallback callback) { -@@ -11834,7 +11835,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, +@@ -12015,7 +12016,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, WebPluginInfo info; std::string actual_mime_type; bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( @@ -210,10 +210,10 @@ index d3401f43eadaf..582486dad6500 100644 std::move(callback).Run(found, info, actual_mime_type); } diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h -index 275239e659e11..514bfa186c70b 100644 +index 8b5fc66305083..efe1b8ebc0549 100644 --- content/browser/renderer_host/render_frame_host_impl.h +++ content/browser/renderer_host/render_frame_host_impl.h -@@ -2530,6 +2530,7 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2559,6 +2559,7 @@ class CONTENT_EXPORT RenderFrameHostImpl int32_t plugin_child_id, const base::FilePath& path) override; void GetPluginInfo(const GURL& url, @@ -234,7 +234,7 @@ index a544bfed7ed85..60aad01350c2f 100644 string mime_type) => (bool found, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index b5022114e4e19..7d8f17f9e39ac 100644 +index 997125e855c0f..c74b5c7f0d3a8 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ @@ -247,18 +247,18 @@ index b5022114e4e19..7d8f17f9e39ac 100644 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 799490ac3f7c0..fe921248a0818 100644 +index 65638e207d6bf..b53028afd7809 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -32,6 +32,7 @@ - #include "content/public/browser/generated_code_cache_settings.h" +@@ -33,6 +33,7 @@ + #include "content/public/browser/login_delegate.h" #include "content/public/browser/mojo_binder_policy_map.h" #include "content/public/browser/storage_partition_config.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" #include "device/vr/buildflags/buildflags.h" -@@ -1762,6 +1763,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1766,6 +1767,14 @@ class CONTENT_EXPORT ContentBrowserClient { const absl::optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -273,7 +273,7 @@ index 799490ac3f7c0..fe921248a0818 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1835,6 +1844,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1839,6 +1848,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -281,7 +281,7 @@ index 799490ac3f7c0..fe921248a0818 100644 + // purposes with external tools like Selenium. + virtual std::string GetChromeProduct() { return GetProduct(); } + - // Returns the user agent. Content may cache this value. + // Returns the user agent.Content may cache this value. virtual std::string GetUserAgent(); diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h @@ -334,10 +334,10 @@ index 7ec0901cf6ba2..db5b5529a4cda 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 21a03f22e32f6..e550d97161ee4 100644 +index 9ba385b9f541d..859f9aa88f1e8 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3304,7 +3304,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3307,7 +3307,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( WebPluginInfo info; std::string mime_type; bool found = false; @@ -348,10 +348,10 @@ index 21a03f22e32f6..e550d97161ee4 100644 &mime_type); if (!found) diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index d372704f462dc..29fc97bd3e48b 100644 +index 7e1d2199e024d..1a25e37314c8c 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -607,6 +607,8 @@ void RenderThreadImpl::Init() { +@@ -609,6 +609,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( blink::URLLoaderThrottleProviderType::kFrame); @@ -361,10 +361,10 @@ index d372704f462dc..29fc97bd3e48b 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 2ca27e17e9e10..e4b443d28af38 100644 +index 272d5c2d7aa76..08cc3b31c2c4a 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -1107,6 +1107,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { +@@ -1115,6 +1115,15 @@ SkBitmap* RendererBlinkPlatformImpl::GetSadPageBitmap() { //------------------------------------------------------------------------------ @@ -381,10 +381,10 @@ index 2ca27e17e9e10..e4b443d28af38 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index cb8770a47a808..34df834f31b83 100644 +index 918400762b2bf..1a8f737074c61 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -258,6 +258,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -259,6 +259,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { const blink::WebURL& url, blink::WebVector* csp) override; diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index d0db3e164..3646741a3 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -1,13 +1,16 @@ diff --git content/app/content_main.cc content/app/content_main.cc -index df88067d61a6d..cf0c735c8d3d9 100644 +index a26c5c2e053ed..c88c4c1b81f9b 100644 --- content/app/content_main.cc +++ content/app/content_main.cc -@@ -215,15 +215,10 @@ void InitializeMojo(mojo::core::Configuration* config) { +@@ -216,18 +216,10 @@ void InitializeMojo(mojo::core::Configuration* config) { } // namespace --int RunContentProcess(const ContentMainParams& params, -- ContentMainRunner* content_main_runner) { +-// This function must be marked with NO_STACK_PROTECTOR or it may crash on +-// return, see the --change-stack-guard-on-fork command line flag. +-int NO_STACK_PROTECTOR +-RunContentProcess(const ContentMainParams& params, +- ContentMainRunner* content_main_runner) { - ContentMainParams content_main_params(params); - +int ContentMainInitialize(ContentMainParams& params, @@ -20,7 +23,7 @@ index df88067d61a6d..cf0c735c8d3d9 100644 // A flag to indicate whether Main() has been called before. On Android, we // may re-run Main() without restarting the browser process. This flag -@@ -305,12 +300,6 @@ int RunContentProcess(const ContentMainParams& params, +@@ -309,12 +301,6 @@ RunContentProcess(const ContentMainParams& params, #endif #if defined(OS_MAC) @@ -33,7 +36,7 @@ index df88067d61a6d..cf0c735c8d3d9 100644 InitializeMac(); #endif -@@ -324,7 +313,7 @@ int RunContentProcess(const ContentMainParams& params, +@@ -328,7 +314,7 @@ RunContentProcess(const ContentMainParams& params, ui::RegisterPathProvider(); tracker = base::debug::GlobalActivityTracker::Get(); @@ -42,7 +45,7 @@ index df88067d61a6d..cf0c735c8d3d9 100644 if (exit_code >= 0) { if (tracker) { -@@ -383,8 +372,16 @@ int RunContentProcess(const ContentMainParams& params, +@@ -387,8 +373,19 @@ RunContentProcess(const ContentMainParams& params, if (IsSubprocess()) CommonSubprocessInit(); @@ -51,8 +54,11 @@ index df88067d61a6d..cf0c735c8d3d9 100644 + return exit_code; +} + -+int ContentMainRun(ContentMainParams& params, -+ ContentMainRunner* content_main_runner) { ++// This function must be marked with NO_STACK_PROTECTOR or it may crash on ++// return, see the --change-stack-guard-on-fork command line flag. ++int NO_STACK_PROTECTOR ++ContentMainRun(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { + int exit_code = content_main_runner->Run(params.minimal_browser_mode); + + base::debug::GlobalActivityTracker* tracker = @@ -60,25 +66,31 @@ index df88067d61a6d..cf0c735c8d3d9 100644 if (tracker) { if (exit_code == 0) { tracker->SetProcessPhaseIfEnabled( -@@ -395,19 +392,45 @@ int RunContentProcess(const ContentMainParams& params, - tracker->process_data().SetInt("exit-code", exit_code); +@@ -400,20 +397,51 @@ RunContentProcess(const ContentMainParams& params, } } -+ + +-#if defined(OS_MAC) +- autorelease_pool.reset(); +-#endif + return exit_code; +} ++// This function must be marked with NO_STACK_PROTECTOR or it may crash on ++// return, see the --change-stack-guard-on-fork command line flag. +void ContentMainShutdown(ContentMainParams& params, + ContentMainRunner* content_main_runner) { -+#if !defined(OS_ANDROID) -+ content_main_runner->Shutdown(); -+#endif + #if !defined(OS_ANDROID) + content_main_runner->Shutdown(); + #endif +} + -+int RunContentProcess(ContentMainParams& params, -+ ContentMainRunner* content_main_runner) { - #if defined(OS_MAC) -- autorelease_pool.reset(); ++// This function must be marked with NO_STACK_PROTECTOR or it may crash on ++// return, see the --change-stack-guard-on-fork command line flag. ++int NO_STACK_PROTECTOR ++RunContentProcess(ContentMainParams& params, ++ ContentMainRunner* content_main_runner) { ++#if defined(OS_MAC) + // We need this pool for all the objects created before we get to the event + // loop, but we don't want to leave them hanging around until the app quits. + // Each "main" needs to flush this pool right before it goes into its main @@ -86,10 +98,8 @@ index df88067d61a6d..cf0c735c8d3d9 100644 + std::unique_ptr autorelease_pool = + std::make_unique(); + params.autorelease_pool = autorelease_pool.get(); - #endif - --#if !defined(OS_ANDROID) -- content_main_runner->Shutdown(); ++#endif ++ + int exit_code = ContentMainInitialize(params, content_main_runner); + if (exit_code >= 0) + return exit_code; @@ -98,23 +108,25 @@ index df88067d61a6d..cf0c735c8d3d9 100644 +#if defined(OS_MAC) + params.autorelease_pool = nullptr; + autorelease_pool.reset(); - #endif - -+ ContentMainShutdown(params, content_main_runner); ++#endif + ++ ContentMainShutdown(params, content_main_runner); + return exit_code; } --int ContentMain(const ContentMainParams& params) { -+int ContentMain(ContentMainParams& params) { + // This function must be marked with NO_STACK_PROTECTOR or it may crash on + // return, see the --change-stack-guard-on-fork command line flag. +-int NO_STACK_PROTECTOR ContentMain(const ContentMainParams& params) { ++int NO_STACK_PROTECTOR ContentMain(ContentMainParams& params) { auto runner = ContentMainRunner::Create(); return RunContentProcess(params, runner.get()); } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 81638b94331aa..3a36c1629b158 100644 +index 095bc943529c3..a8c1febd913f8 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -43,6 +43,7 @@ +@@ -45,6 +45,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/hang_watcher.h" #include "base/threading/platform_thread.h" @@ -122,7 +134,7 @@ index 81638b94331aa..3a36c1629b158 100644 #include "base/time/time.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -@@ -1114,6 +1115,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1134,6 +1135,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -135,7 +147,7 @@ index 81638b94331aa..3a36c1629b158 100644 std::unique_ptr ContentMainRunner::Create() { return ContentMainRunnerImpl::Create(); diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index 86c624e53cf99..090171f7db228 100644 +index 5dbc33d943de2..4238219a05773 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h @@ -39,7 +39,7 @@ class ContentMainDelegate; diff --git a/patch/patches/content_mojo_3123.patch b/patch/patches/content_mojo_3123.patch index 32994dc26..0e9d47a89 100644 --- a/patch/patches/content_mojo_3123.patch +++ b/patch/patches/content_mojo_3123.patch @@ -1,8 +1,8 @@ diff --git content/public/browser/document_service_base.h content/public/browser/document_service_base.h -index a7d9457f7561a..3296e65dcb0f5 100644 +index e92c412a44c62..520338835afa8 100644 --- content/public/browser/document_service_base.h +++ content/public/browser/document_service_base.h -@@ -83,6 +83,8 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { +@@ -80,6 +80,8 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { void DidFinishNavigation(NavigationHandle* navigation_handle) final { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); @@ -11,7 +11,7 @@ index a7d9457f7561a..3296e65dcb0f5 100644 if (!navigation_handle->HasCommitted() || navigation_handle->IsSameDocument() || -@@ -96,6 +98,9 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { +@@ -98,6 +100,9 @@ class DocumentServiceBase : public Interface, public WebContentsObserver { } } diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 82d86612d..7b3349bc4 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -81,7 +81,7 @@ index 886372e114899..ad3bc2242883b 100644 g_crash_helper_enabled = true; return true; diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index 41cb4fdea7320..7bca01cf303c8 100644 +index 68ddd337e4dfa..687e869afd5c7 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -93,21 +93,30 @@ index 41cb4fdea7320..7bca01cf303c8 100644 #include "base/base_switches.h" #include "base/command_line.h" #include "base/cxx17_backports.h" -@@ -28,7 +30,7 @@ - namespace crash_keys { +@@ -46,8 +48,10 @@ void HandleEnableDisableFeatures(const base::CommandLine& command_line) { + } + #endif ++} // namespace ++ // Return true if we DON'T want to upload this flag to the crash server. --static bool IsBoringSwitch(const std::string& flag) { +-bool IsBoringSwitch(const std::string& flag) { +bool IsBoringChromeSwitch(const std::string& flag) { static const char* const kIgnoreSwitches[] = { switches::kEnableLogging, switches::kFlagSwitchesBegin, -@@ -81,7 +83,7 @@ static bool IsBoringSwitch(const std::string& flag) { +@@ -107,13 +111,11 @@ bool IsBoringSwitch(const std::string& flag) { + return false; } +-} // namespace +- void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) { -- return SetSwitchesFromCommandLine(command_line, &IsBoringSwitch); -+ return SetSwitchesFromCommandLine(command_line, &IsBoringChromeSwitch); + #if defined(OS_CHROMEOS) + HandleEnableDisableFeatures(command_line); + #endif +- SetSwitchesFromCommandLine(command_line, &IsBoringSwitch); ++ SetSwitchesFromCommandLine(command_line, &IsBoringChromeSwitch); } void SetActiveExtensions(const std::set& extensions) { diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch index 4bb5caae1..173588b5c 100644 --- a/patch/patches/embedder_product_override.patch +++ b/patch/patches/embedder_product_override.patch @@ -1,5 +1,5 @@ diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc -index 46f67d07365ca..069b96b9b4b8b 100644 +index d9cd3f7c287ad..834c345710aaf 100644 --- components/embedder_support/user_agent_utils.cc +++ components/embedder_support/user_agent_utils.cc @@ -10,6 +10,7 @@ diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index 1930b4447..4c4073f36 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -60,7 +60,7 @@ index 5c903a13a14ed..c85964a7bab17 100644 std::unique_ptr stream_container( new StreamContainer(tab_id, embedded, handler_url, extension_id, diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 7e38155c3b695..78768b28d8c99 100644 +index 3f78873130d14..07159e4524155 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -63,11 +63,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -125,7 +125,7 @@ index 7e38155c3b695..78768b28d8c99 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index 305726557f2ea..caa4b798a013e 100644 +index e8b4ce11bcd00..617de0d501fdd 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -53,13 +53,19 @@ class ExtensionHost : public DeferredStartRenderHost, @@ -149,7 +149,7 @@ index 305726557f2ea..caa4b798a013e 100644 content::RenderFrameHost* main_frame_host() const { return main_frame_host_; } content::RenderProcessHost* render_process_host() const; bool has_loaded_once() const { return has_loaded_once_; } -@@ -182,7 +188,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -184,7 +190,8 @@ class ExtensionHost : public DeferredStartRenderHost, content::BrowserContext* browser_context_; // The host for our HTML content. @@ -160,7 +160,7 @@ index 305726557f2ea..caa4b798a013e 100644 // A pointer to the current or speculative main frame in `host_contents_`. We // can't access this frame through the `host_contents_` directly as it does diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 530de7eea3649..3af4fb0179aa1 100644 +index 0d21ebc927042..a08ebcbafc252 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h @@ -27,6 +27,7 @@ @@ -179,7 +179,7 @@ index 530de7eea3649..3af4fb0179aa1 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -207,6 +209,14 @@ class ExtensionsBrowserClient { +@@ -206,6 +208,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index f8eea4598..ddbc68e30 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 1c7897a648315..39324a6c6c6f2 100644 +index 64dbcb82086d9..2527fd74ed4b1 100644 --- .gn +++ .gn -@@ -150,6 +150,8 @@ exec_script_whitelist = +@@ -144,6 +144,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,7 +12,7 @@ index 1c7897a648315..39324a6c6c6f2 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index aa2cb7b4583a3..260067ac3c871 100644 +index 3bb7c2579c19c..8562b4bb02806 100644 --- BUILD.gn +++ BUILD.gn @@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,7 +23,7 @@ index aa2cb7b4583a3..260067ac3c871 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/media/router/features.gni") import("//components/nacl/features.gni") -@@ -264,6 +265,9 @@ group("gn_all") { +@@ -263,6 +264,9 @@ group("gn_all") { deps += [ "//chrome/test:telemetry_perf_unittests${_target_suffix}" ] } } @@ -79,7 +79,7 @@ index d2266b28b33f8..a7ff6d9b68f38 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 66084f63cd04a..a4997689c68cd 100644 +index b9dce47a02f58..70b11f9312fc8 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -4,6 +4,7 @@ @@ -89,8 +89,8 @@ index 66084f63cd04a..a4997689c68cd 100644 +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") - import("//extensions/buildflags/buildflags.gni") -@@ -71,6 +72,10 @@ template("chrome_repack_percent") { + import("//chromeos/components/chromebox_for_meetings/buildflags/buildflags.gni") +@@ -72,6 +73,10 @@ template("chrome_repack_percent") { "//ui/chromeos/resources", ] } @@ -102,7 +102,7 @@ index 66084f63cd04a..a4997689c68cd 100644 sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] deps += [ "//extensions:extensions_browser_resources" ] diff --git chrome/chrome_repack_locales.gni chrome/chrome_repack_locales.gni -index 203d54004d324..39ec05bffcf5c 100644 +index e9dfe6bb49914..1d15880a0e8a9 100644 --- chrome/chrome_repack_locales.gni +++ chrome/chrome_repack_locales.gni @@ -6,6 +6,7 @@ import("//build/config/chrome_build.gni") @@ -113,9 +113,9 @@ index 203d54004d324..39ec05bffcf5c 100644 import("//extensions/buildflags/buildflags.gni") import("//tools/grit/repack.gni") -@@ -88,6 +89,10 @@ template("chrome_repack_locales") { - ] - compress = true +@@ -93,6 +94,10 @@ template("chrome_repack_locales") { + [ "${root_gen_dir}/chromeos/strings/chromeos_strings_" ] + deps += [ "//chromeos/strings" ] } + if (enable_cef) { + source_patterns += [ "${root_gen_dir}/cef/cef_strings_" ] @@ -152,7 +152,7 @@ index 51fa0d7f4cf77..2ede68e9377eb 100644 outputs = [ # See also chrome.packed.7z conditionally added below. diff --git tools/grit/grit_defines.gni tools/grit/grit_defines.gni -index 5b92d7a6cd920..ceb274146131c 100644 +index 0039f04a75ef2..32beb70d1b99c 100644 --- tools/grit/grit_defines.gni +++ tools/grit/grit_defines.gni @@ -5,6 +5,7 @@ @@ -163,7 +163,7 @@ index 5b92d7a6cd920..ceb274146131c 100644 import("//build/config/ui.gni") grit_defines = [ -@@ -104,6 +105,13 @@ if (is_android) { +@@ -111,6 +112,13 @@ if (is_android) { ] } diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index ca0231dc2..df73ec9ec 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec -index 2340bedbe4a56..7353775d6fc43 100644 +index 628fa47e4f253..a4dd6e2acfe15 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -820,4 +820,13 @@ +@@ -840,4 +840,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index ae50679bd..748525abe 100644 --- a/patch/patches/libxml_visibility.patch +++ b/patch/patches/libxml_visibility.patch @@ -1,12 +1,12 @@ diff --git third_party/libxml/BUILD.gn third_party/libxml/BUILD.gn -index 8068e573cbd48..2fc10cf03bc50 100644 +index 5ade3efc432df..3f313f9c30aed 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn -@@ -142,6 +142,7 @@ static_library("libxml") { - "//third_party/blink/renderer/*", - "//third_party/fontconfig", - "//third_party/libxslt", +@@ -137,6 +137,7 @@ static_library("libxml") { + ":libxml_utils", + ":xml_reader", + ":xml_writer", + "//cef:*", - ] - if (is_ios) { - foreach(tgt, ios_libxml_visibility_additions) { + "//chromecast/internal", + "//testing/libfuzzer/*", + "//third_party/blink/renderer/*", diff --git a/patch/patches/linux_chrome_widevine_3149.patch b/patch/patches/linux_chrome_widevine_3149.patch index a308a1ce9..65f801847 100644 --- a/patch/patches/linux_chrome_widevine_3149.patch +++ b/patch/patches/linux_chrome_widevine_3149.patch @@ -1,5 +1,5 @@ diff --git chrome/common/media/component_widevine_cdm_hint_file_linux.cc chrome/common/media/component_widevine_cdm_hint_file_linux.cc -index 44a89a2e7f6e..447c1a635ead 100644 +index 44a89a2e7f6e4..447c1a635eadd 100644 --- chrome/common/media/component_widevine_cdm_hint_file_linux.cc +++ chrome/common/media/component_widevine_cdm_hint_file_linux.cc @@ -16,6 +16,7 @@ diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index d815179a4..72d8a5a79 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -1,5 +1,5 @@ diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc -index 04a5dcf91d0ca..935c22f9ee963 100644 +index 2c8d83d2424d9..ae9f7229a51cf 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index f86965cae..6980edac2 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,10 +10,10 @@ index 96d1a51ec1078..e8120a818b1f2 100644 +// This load will not send any cookies. For CEF usage. +LOAD_FLAG(DO_NOT_SEND_COOKIES, 1 << 17) diff --git net/url_request/url_request_http_job.cc net/url_request/url_request_http_job.cc -index 3f7b5bb32fa27..2c092b62f3ce4 100644 +index a6cd1ef45ab03..4c947b9118e52 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc -@@ -566,7 +566,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { +@@ -561,7 +561,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { // Read cookies whenever allow_credentials() is true, even if the PrivacyMode // is being overridden by NetworkDelegate and will eventually block them, as // blocked cookies still need to be logged in that case. @@ -24,7 +24,7 @@ index 3f7b5bb32fa27..2c092b62f3ce4 100644 request_->force_ignore_site_for_cookies(); if (cookie_store->cookie_access_delegate() && diff --git services/network/public/cpp/resource_request.cc services/network/public/cpp/resource_request.cc -index 13c90fe5f838c..ac3a0bc7a2db5 100644 +index e2e170ab85f39..0f4052dcd6767 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc @@ -253,7 +253,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index b0ee7b8fb..81d2cc93d 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c67..84f3b9ed7cf49 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index c2356a3d97bfe..0d9f359886e20 100644 +index ebb771918923b..db13c44cd2738 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -3088,6 +3088,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -3110,6 +3110,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index daade36f8..6a111c282 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc -index d282ff9e1e7be..f698a1b235cca 100644 +index 50aec56adb4b6..c36996e06ebee 100644 --- chrome/browser/download/download_prefs.cc +++ chrome/browser/download/download_prefs.cc @@ -24,6 +24,7 @@ @@ -58,7 +58,7 @@ index 4ff73fd2d9ec3..d56686d8284ba 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/printing/print_view_manager_base.cc chrome/browser/printing/print_view_manager_base.cc -index 867227684ddba..98986fdad1e7f 100644 +index e4cacbf9a82da..3f137e18b8087 100644 --- chrome/browser/printing/print_view_manager_base.cc +++ chrome/browser/printing/print_view_manager_base.cc @@ -21,6 +21,7 @@ @@ -80,7 +80,7 @@ index 867227684ddba..98986fdad1e7f 100644 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) #include "chrome/browser/printing/print_error_dialog.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -215,8 +220,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, +@@ -216,8 +221,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = GetWebContentsForRenderFrame(render_process_id, render_frame_id); @@ -97,10 +97,10 @@ index 867227684ddba..98986fdad1e7f 100644 void NotifySystemDialogCancelled(int render_process_id, int routing_id) { diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h -index 48e2baa05cdf6..b4da112845d86 100644 +index eaa0e162a339b..8e030d2ab3995 100644 --- chrome/browser/printing/print_view_manager_base.h +++ chrome/browser/printing/print_view_manager_base.h -@@ -124,9 +124,6 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -126,9 +126,6 @@ class PrintViewManagerBase : public content::NotificationObserver, // Manages the low-level talk to the printer. scoped_refptr print_job_; @@ -151,7 +151,7 @@ index dd3512b303c40..0627aa331492c 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() = default; diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index 32c3e9c3cb267..011b333602bfb 100644 +index 1b18146a4ba8f..9094f488642fc 100644 --- chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc +++ chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc @@ -21,6 +21,7 @@ @@ -173,7 +173,7 @@ index 32c3e9c3cb267..011b333602bfb 100644 namespace printing { namespace { -@@ -414,16 +419,18 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -411,16 +416,18 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, service->GetRemote() ->GetMountPointPath( base::BindOnce(&PdfPrinterHandler::OnSaveLocationReady, @@ -194,7 +194,7 @@ index 32c3e9c3cb267..011b333602bfb 100644 const base::FilePath& default_filename, bool prompt_user, const base::FilePath& path) { -@@ -441,10 +448,27 @@ void PdfPrinterHandler::OnSaveLocationReady( +@@ -438,10 +445,27 @@ void PdfPrinterHandler::OnSaveLocationReady( // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -222,7 +222,7 @@ index 32c3e9c3cb267..011b333602bfb 100644 // Get default download directory. This will be used as a fallback if the // save directory does not exist. DownloadPrefs* download_prefs = DownloadPrefs::FromBrowserContext(profile_); -@@ -452,8 +476,7 @@ void PdfPrinterHandler::OnSaveLocationReady( +@@ -449,8 +473,7 @@ void PdfPrinterHandler::OnSaveLocationReady( base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -232,7 +232,7 @@ index 32c3e9c3cb267..011b333602bfb 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -499,6 +522,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -496,6 +519,36 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -303,38 +303,8 @@ index e326047aef5e9..4fc8898e95b6f 100644 // Return save location as the Drive mount or fetch from Download Preferences. base::FilePath GetSaveLocation() const; -diff --git chrome/browser/ui/webui/print_preview/print_preview_handler.cc chrome/browser/ui/webui/print_preview/print_preview_handler.cc -index 5cebaa1d75b74..3c2fae113c678 100644 ---- chrome/browser/ui/webui/print_preview/print_preview_handler.cc -+++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc -@@ -25,6 +25,7 @@ - #include "base/values.h" - #include "build/build_config.h" - #include "build/chromeos_buildflags.h" -+#include "cef/libcef/features/runtime.h" - #include "chrome/browser/account_manager_facade_factory.h" - #include "chrome/browser/app_mode/app_mode_utils.h" - #include "chrome/browser/bad_message.h" -@@ -1151,6 +1152,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( - } - #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) - if (printer_type == mojom::PrinterType::kPrivet && -+ !cef::IsAlloyRuntimeEnabled() && - GetPrefs()->GetBoolean(prefs::kForceEnablePrivetPrinting)) { - if (!privet_printer_handler_) { - privet_printer_handler_ = -@@ -1158,6 +1160,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( - } - return privet_printer_handler_.get(); - } -+#else // !BUILDFLAG(ENABLE_SERVICE_DISCOVERY) -+ if (printer_type == PrinterType::kPrivet) -+ return nullptr; - #endif - if (printer_type == mojom::PrinterType::kPdf) { - if (!pdf_printer_handler_) { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index 7d68582201d35..899df572ef835 100644 +index 424ee9168d93a..aa6266ccf443c 100644 --- chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ chrome/browser/ui/webui/print_preview/print_preview_ui.cc @@ -29,6 +29,7 @@ diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index c00a43899..e72feeb72 100644 --- a/patch/patches/renderer_host_1070713.patch +++ b/patch/patches/renderer_host_1070713.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_view_host_impl.cc content/browser/renderer_host/render_view_host_impl.cc -index ce54ce5ee0d4f..43b9c048bb172 100644 +index 9786cb8ef6633..33f8b8bffd127 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -625,6 +625,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -612,6 +612,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index e4035b376..38b1b708a 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,5 +1,5 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 2ecaac520bd2f..25cff6cf13cbd 100644 +index 276ef65251647..bf2a3e07b98ce 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc @@ -838,6 +838,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) @@ -28,7 +28,7 @@ index 2ecaac520bd2f..25cff6cf13cbd 100644 void ResourceBundle::InitSharedInstance(Delegate* delegate) { DCHECK(g_shared_instance_ == nullptr) << "ResourceBundle initialized twice"; diff --git ui/base/resource/resource_bundle.h ui/base/resource/resource_bundle.h -index 61f5b2a2972d1..6b683617a1e67 100644 +index c1aee3d5f8557..215073ae0e712 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h @@ -191,6 +191,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index f11222a6d..48810a544 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,16 +1,3 @@ -diff --git .vpython3 .vpython3 -index 14faab39343e8..0aeeb03f79bdd 100644 ---- .vpython3 -+++ .vpython3 -@@ -204,7 +204,7 @@ wheel < - - wheel < - name: "infra/python/wheels/py-py2_py3" -- version: "version:1.5.3" -+ version: "version:1.10.0" - > - - wheel < diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py index c1d2fa2ce0aa2..d1d215f35ac12 100644 --- build/toolchain/win/setup_toolchain.py diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index 552c304df..1e53abda0 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index 2e653492a9093..05fb213ad423f 100644 +index 9ea3f7da129a0..d0e7f9ffcd10a 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc @@ -645,10 +645,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { @@ -19,7 +19,7 @@ index 2e653492a9093..05fb213ad423f 100644 } absl::optional RenderWidgetHostViewAura::GetDisplayFeature() { -@@ -2087,6 +2089,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2089,6 +2091,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { // This needs to happen only after |window_| has been initialized using // Init(), because it needs to have the layer. window_->SetEmbedFrameSinkId(frame_sink_id_); diff --git a/patch/patches/services_network_2622.patch b/patch/patches/services_network_2622.patch index 6600201a4..3c36cf440 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 bae294fef1f8b..06d2dfcecc956 100644 +index 77573496f3548..2ac1f3ea101f9 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -21,6 +21,7 @@ @@ -10,7 +10,7 @@ index bae294fef1f8b..06d2dfcecc956 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" -@@ -670,7 +671,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -673,7 +674,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( // Configure on-disk storage for non-OTR profiles. OTR profiles just use // default behavior (in memory storage, default sizes). @@ -31,7 +31,7 @@ index bae294fef1f8b..06d2dfcecc956 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -683,7 +696,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -686,7 +699,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -42,7 +42,7 @@ index bae294fef1f8b..06d2dfcecc956 100644 // change. network_context_params->http_server_properties_path = diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index e2e1e9acb3605..f0b22ab2dce9d 100644 +index f13f2ce613379..729c48c808342 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc @@ -506,6 +506,25 @@ void CookieMonster::SetCookieableSchemes( @@ -72,10 +72,10 @@ index e2e1e9acb3605..f0b22ab2dce9d 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 4b24d429aabb4..fbfa765aba86a 100644 +index 8439ba30a162d..6170ffa6110ff 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h -@@ -182,6 +182,8 @@ class NET_EXPORT CookieMonster : public CookieStore { +@@ -181,6 +181,8 @@ class NET_EXPORT CookieMonster : public CookieStore { CookieChangeDispatcher& GetChangeDispatcher() override; void SetCookieableSchemes(const std::vector& schemes, SetCookieableSchemesCallback callback) override; @@ -85,10 +85,10 @@ index 4b24d429aabb4..fbfa765aba86a 100644 // Enables writing session cookies into the cookie database. If this this // method is called, it must be called before first use of the instance diff --git net/cookies/cookie_store.h net/cookies/cookie_store.h -index afa99e255bdf1..5e8201696c613 100644 +index 0642e632dedce..1e8be4703de44 100644 --- net/cookies/cookie_store.h +++ net/cookies/cookie_store.h -@@ -156,6 +156,11 @@ class NET_EXPORT CookieStore { +@@ -155,6 +155,11 @@ class NET_EXPORT CookieStore { // Transfer ownership of a CookieAccessDelegate. void SetCookieAccessDelegate(std::unique_ptr delegate); @@ -123,10 +123,10 @@ index a397306372054..8a1bacea8d70c 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index a38eeaf6e58af..02ec2034afc8a 100644 +index 7c64f63ad0661..fc7c495dedd62 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2052,16 +2052,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2054,16 +2054,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -157,10 +157,10 @@ index a38eeaf6e58af..02ec2034afc8a 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 25d6c99d4f6be..2c6cf5a907d16 100644 +index 409b43c0bf005..fcc1a0a15a8f7 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -249,6 +249,9 @@ struct NetworkContextParams { +@@ -250,6 +250,9 @@ struct NetworkContextParams { // cookies. Otherwise it should be false. bool persist_session_cookies = false; diff --git a/patch/patches/services_network_2718.patch b/patch/patches/services_network_2718.patch index d2f2828c4..d8b672076 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,8 +1,8 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index a7584ed4201ec..7cf54d07d0954 100644 +index 5edf24182bc5a..8fed55299bacf 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc -@@ -494,10 +494,6 @@ class LoginHandlerDelegate { +@@ -500,10 +500,6 @@ class LoginHandlerDelegate { } WebContents* web_contents = web_contents_getter_.Run(); @@ -13,7 +13,7 @@ index a7584ed4201ec..7cf54d07d0954 100644 // WeakPtr is not strictly necessary here due to OnRequestCancelled. creating_login_delegate_ = true; -@@ -550,12 +546,6 @@ void OnAuthRequiredContinuation( +@@ -556,12 +552,6 @@ void OnAuthRequiredContinuation( mojo::PendingRemote auth_challenge_responder, base::RepeatingCallback web_contents_getter) { @@ -26,7 +26,7 @@ index a7584ed4201ec..7cf54d07d0954 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2598,8 +2588,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2712,8 +2702,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,9 +40,9 @@ index a7584ed4201ec..7cf54d07d0954 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2612,6 +2606,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2726,6 +2720,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( - browser_context_, is_in_memory_, relative_partition_path_, + browser_context_, is_in_memory(), relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); + if (context_params->context_name && + *context_params->context_name == "magic_shutting_down") { diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 93475911f..ca35fe135 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -13,10 +13,10 @@ index 4960b1067e1c4..2686fa5bc550b 100644 {base::MayBlock(), base::TaskPriority::USER_VISIBLE, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 42f3b85ab0485..d8b50c18afd0e 100644 +index f7a2f30d3748a..098ff6540d8ea 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -136,7 +136,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -137,7 +137,7 @@ StoragePartition* BrowserContext::GetStoragePartition( StoragePartition* BrowserContext::GetStoragePartition( const StoragePartitionConfig& storage_partition_config, bool can_create) { @@ -25,7 +25,7 @@ index 42f3b85ab0485..d8b50c18afd0e 100644 // An off the record profile MUST only use in memory storage partitions. CHECK(storage_partition_config.in_memory()); } -@@ -386,7 +386,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { +@@ -387,7 +387,8 @@ BrowserContext::CreateVideoDecodePerfHistory() { const bool kUseInMemoryDBDefault = false; bool use_in_memory_db = base::GetFieldTrialParamByFeatureAsBool( media::kMediaCapabilitiesWithParameters, kUseInMemoryDBParamName, @@ -36,7 +36,7 @@ index 42f3b85ab0485..d8b50c18afd0e 100644 std::unique_ptr stats_db; if (use_in_memory_db) { diff --git content/public/browser/storage_partition_config.cc content/public/browser/storage_partition_config.cc -index 0095de1d05fd1..0e651cbcbe541 100644 +index b430ebb66bb5f..8fc54d2e7d713 100644 --- content/public/browser/storage_partition_config.cc +++ content/public/browser/storage_partition_config.cc @@ -7,6 +7,7 @@ @@ -47,7 +47,7 @@ index 0095de1d05fd1..0e651cbcbe541 100644 #include "base/strings/string_number_conversions.h" #include "content/public/browser/browser_context.h" #include "url/gurl.h" -@@ -36,7 +37,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=( +@@ -37,7 +38,8 @@ StoragePartitionConfig& StoragePartitionConfig::operator=( // static StoragePartitionConfig StoragePartitionConfig::CreateDefault( BrowserContext* browser_context) { diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index a08c8cb88..291c3ed13 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 a9616406d4d37..178e4bdad971c 100644 +index 81dea0e4a02ae..01a63782f6713 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h @@ -61,6 +61,8 @@ diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 0512fa4ec..5453b9e4d 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -1,5 +1,5 @@ diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h -index 279be87a33e9e..f295fdac67165 100644 +index f095bfc301151..f4eab5e49b61c 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h @@ -14,8 +14,11 @@ @@ -14,7 +14,7 @@ index 279be87a33e9e..f295fdac67165 100644 } namespace ui { -@@ -143,6 +146,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel +@@ -146,6 +149,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel // |event_flags| is a bit mask of ui::EventFlags. virtual void ActivatedAt(int index, int event_flags); @@ -43,7 +43,7 @@ index 279be87a33e9e..f295fdac67165 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 988159e708dcc..3d957f7ea966e 100644 +index 32efa9df61814..3b06181586935 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc @@ -650,6 +650,14 @@ void RenderText::SetWhitespaceElision(absl::optional whitespace_elision) { @@ -61,7 +61,7 @@ index 988159e708dcc..3d957f7ea966e 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -2036,6 +2044,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2035,6 +2043,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -82,10 +82,10 @@ index 988159e708dcc..3d957f7ea966e 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 36811695d23a5..db6b5f8bb08a4 100644 +index 78e0d9ca85c02..937e627edc00a 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -342,6 +342,10 @@ class GFX_EXPORT RenderText { +@@ -343,6 +343,10 @@ class GFX_EXPORT RenderText { return whitespace_elision_; } @@ -96,7 +96,7 @@ index 36811695d23a5..db6b5f8bb08a4 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -1048,6 +1052,8 @@ class GFX_EXPORT RenderText { +@@ -1049,6 +1053,8 @@ class GFX_EXPORT RenderText { // Tell whether or not the |layout_text_| needs an update or is up to date. mutable bool layout_text_up_to_date_ = false; @@ -106,10 +106,10 @@ index 36811695d23a5..db6b5f8bb08a4 100644 } // namespace gfx diff --git ui/views/animation/ink_drop_host_view.h ui/views/animation/ink_drop_host_view.h -index bd0975b485de4..6e853e7018e9b 100644 +index 7ff4204a36c35..6094f15b36470 100644 --- ui/views/animation/ink_drop_host_view.h +++ ui/views/animation/ink_drop_host_view.h -@@ -184,6 +184,8 @@ class VIEWS_EXPORT InkDropHost { +@@ -174,6 +174,8 @@ class VIEWS_EXPORT InkDropHost { View* host_view() { return host_view_; } const View* host_view() const { return host_view_; } @@ -119,7 +119,7 @@ index bd0975b485de4..6e853e7018e9b 100644 friend class test::InkDropHostTestApi; diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 9d12e8a9f7487..442f45617e275 100644 +index dbc9ca7ccb3e4..5546dc83a2de9 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc @@ -509,6 +509,12 @@ void LabelButton::OnThemeChanged() { @@ -238,10 +238,10 @@ index 5bad0a8cd8cbc..da57021f0cefa 100644 std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 8ba686c398002..7842a7c8936cb 100644 +index 84332b5e94401..cf92a29a823c9 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2795,8 +2795,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2804,8 +2804,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -256,7 +256,7 @@ index 8ba686c398002..7842a7c8936cb 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2815,8 +2820,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2824,8 +2829,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -269,12 +269,12 @@ index 8ba686c398002..7842a7c8936cb 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 b47a61998daaa..e6f1b862838b9 100644 +index 9c1542e1f4f0f..548fc8e87d520 100644 --- ui/views/controls/menu/menu_delegate.h +++ ui/views/controls/menu/menu_delegate.h -@@ -80,6 +80,22 @@ class VIEWS_EXPORT MenuDelegate { - // parts of |style| or leave it unmodified. - virtual void GetLabelStyle(int id, LabelStyle* style) const; +@@ -73,6 +73,22 @@ class VIEWS_EXPORT MenuDelegate { + virtual const gfx::FontList* GetLabelFontList(int id) const; + virtual absl::optional GetLabelColor(int id) const; + // Override the text color of a given menu item dependent on the |command_id| + // and its |is_hovered| state. |is_minor| will be true for accelerator text. @@ -295,7 +295,7 @@ index b47a61998daaa..e6f1b862838b9 100644 // The tooltip shown for the menu item. This is invoked when the user // hovers over the item, and no tooltip text has been set for that item. virtual std::u16string GetTooltipText(int id, -@@ -218,6 +234,11 @@ class VIEWS_EXPORT MenuDelegate { +@@ -211,6 +227,11 @@ class VIEWS_EXPORT MenuDelegate { bool* has_mnemonics, MenuButton** button); @@ -308,10 +308,10 @@ index b47a61998daaa..e6f1b862838b9 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 039cbc90f0eed..09f16763f7581 100644 +index 9e5fb8d852607..a0106ee33b1f3 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1080,6 +1080,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1072,6 +1072,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, spilling_rect.set_y(spilling_rect.y() - corner_radius_); spilling_rect.set_height(spilling_rect.height() + corner_radius_); canvas->DrawRoundRect(spilling_rect, corner_radius_, flags); @@ -327,7 +327,7 @@ index 039cbc90f0eed..09f16763f7581 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1148,6 +1157,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1138,6 +1147,13 @@ void MenuItemView::PaintMinorIconAndText(gfx::Canvas* canvas, SkColor color) { } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -342,10 +342,10 @@ index 039cbc90f0eed..09f16763f7581 100644 GetMenuController() && GetMenuController()->use_touchable_layout() ? style::CONTEXT_TOUCH_MENU diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc -index 895745cf0f7e5..28c24b1b007c9 100644 +index fb5d5e6a79a3f..a336b5a74d6a1 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc -@@ -246,6 +246,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { +@@ -245,6 +245,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { return false; } @@ -424,7 +424,7 @@ index 895745cf0f7e5..28c24b1b007c9 100644 // Look up the menu model for this menu. const std::map::const_iterator map_iterator = diff --git ui/views/controls/menu/menu_model_adapter.h ui/views/controls/menu/menu_model_adapter.h -index 76a9001061649..c5026f9241334 100644 +index 380794d989adf..b7c06c8a30102 100644 --- ui/views/controls/menu/menu_model_adapter.h +++ ui/views/controls/menu/menu_model_adapter.h @@ -84,6 +84,20 @@ class VIEWS_EXPORT MenuModelAdapter : public MenuDelegate, @@ -449,10 +449,10 @@ index 76a9001061649..c5026f9241334 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 979682ad5d7aa..a819da9125eb7 100644 +index 713b41c83e923..6f5502a98ea65 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -239,6 +239,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -240,6 +240,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = AddChildView(std::make_unique(content_view, false)); @@ -480,7 +480,7 @@ index 64e09ff4359a8..714e8e9ff6610 100644 x11_ui_controls_test_helper_.ButtonDownMask() == 0) { // Move the cursor because EnterNotify/LeaveNotify are generated with the diff --git ui/views/view.h ui/views/view.h -index 2c7cbb21185ab..304a1b0e5df97 100644 +index e18f104b8c075..2f2e22dc97910 100644 --- ui/views/view.h +++ ui/views/view.h @@ -20,6 +20,7 @@ diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 858a8cc1c..a99546ed5 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index c31a2b532540b..a27dfc0173d73 100644 +index beaa6476fe5d8..beb1179214223 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -622,6 +622,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -638,6 +638,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,7 +18,7 @@ index c31a2b532540b..a27dfc0173d73 100644 if (!GetMouseWheelPhaseHandler()) return; diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index 17803f43ea181..15ce076ba78a6 100644 +index 21669355ec8d1..e0dd842c5a69c 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h @@ -67,6 +67,7 @@ class CursorManager; @@ -38,7 +38,7 @@ index 17803f43ea181..15ce076ba78a6 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordContentToVisibleTimeRequest( -@@ -424,6 +427,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -426,6 +429,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds) = 0; @@ -51,7 +51,7 @@ index 17803f43ea181..15ce076ba78a6 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -611,6 +620,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -613,6 +622,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { TooltipObserver* tooltip_observer_for_testing_ = nullptr; @@ -111,7 +111,7 @@ index 9043a181d4c04..a72a96e015e9d 100644 if (host_ && set_focus_on_mouse_down_or_key_event_) { set_focus_on_mouse_down_or_key_event_ = false; diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h -index 2486758e79114..3ef43f47b62e3 100644 +index 7a8ceb1916434..01d0ca9a19316 100644 --- content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h @@ -249,6 +249,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -130,10 +130,10 @@ index 2486758e79114..3ef43f47b62e3 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index 21f7e7bfc0e75..11163b3ef0144 100644 +index 9d0bc6966680f..152c6f01059b6 100644 --- ui/platform_window/x11/x11_window.cc +++ ui/platform_window/x11/x11_window.cc -@@ -1665,7 +1665,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { +@@ -1671,7 +1671,8 @@ void X11Window::CreateXWindow(const PlatformWindowInitProperties& properties) { req.border_pixel = 0; bounds_in_pixels_ = SanitizeBounds(bounds); @@ -152,15 +152,15 @@ index 7c352dd0d992d..cf1a0c3e6db63 100644 HWND DesktopScreenWin::GetHWNDFromNativeWindow(gfx::NativeWindow window) const { + if (!window) -+ return nullptr; ++ return nullptr; aura::WindowTreeHost* host = window->GetHost(); return host ? host->GetAcceleratedWidget() : nullptr; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -index 3f3917338dbd8..ddedabd555a5a 100644 +index 6e09038a0fffa..0400f99c5de22 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.cc -@@ -215,6 +215,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( +@@ -226,6 +226,18 @@ Widget::MoveLoopResult DesktopWindowTreeHostLinux::RunMoveLoop( escape_behavior); } @@ -179,7 +179,7 @@ index 3f3917338dbd8..ddedabd555a5a 100644 void DesktopWindowTreeHostLinux::DispatchEvent(ui::Event* event) { // In Windows, the native events sent to chrome are separated into client // and non-client versions of events, which we record on our LocatedEvent -@@ -345,6 +357,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( +@@ -358,6 +370,8 @@ void DesktopWindowTreeHostLinux::AddAdditionalInitProperties( properties->wm_class_class = params.wm_class_class; properties->wm_role_name = params.wm_role_name; @@ -189,19 +189,19 @@ index 3f3917338dbd8..ddedabd555a5a 100644 properties->x11_extension_delegate = this; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -index 49c2776892f1f..02df1b4bafe17 100644 +index dec3dd21f77b2..5c22c512e002e 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_linux.h -@@ -73,6 +73,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux - ui::WaylandExtension* GetWaylandExtension(); - const ui::WaylandExtension* GetWaylandExtension() const; +@@ -77,6 +77,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux + ui::DeskExtension* GetDeskExtension(); + const ui::DeskExtension* GetDeskExtension() const; + void set_screen_bounds(const gfx::Rect& bounds) { screen_bounds_ = bounds; } + protected: // Overridden from DesktopWindowTreeHost: void Init(const Widget::InitParams& params) override; -@@ -83,6 +85,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -87,6 +89,8 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux const gfx::Vector2d& drag_offset, Widget::MoveLoopSource source, Widget::MoveLoopEscapeBehavior escape_behavior) override; @@ -210,7 +210,7 @@ index 49c2776892f1f..02df1b4bafe17 100644 // PlatformWindowDelegate: void DispatchEvent(ui::Event* event) override; -@@ -138,6 +142,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux +@@ -142,6 +146,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostLinux // destroyed. static std::list* open_windows_; @@ -221,10 +221,10 @@ index 49c2776892f1f..02df1b4bafe17 100644 base::WeakPtrFactory weak_factory_{this}; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 4d986b929bd79..fe188b76db852 100644 +index 042fb2b5d1653..5ee040b8c26f4 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -170,8 +170,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { +@@ -180,8 +180,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { native_widget_delegate_); HWND parent_hwnd = nullptr; @@ -238,7 +238,7 @@ index 4d986b929bd79..fe188b76db852 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -966,11 +970,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -972,11 +976,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -257,10 +257,10 @@ index 4d986b929bd79..fe188b76db852 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 20bcac8ebadfa..f36e48dbf6549 100644 +index db1299089169f..a9c331c37b210 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -294,6 +294,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -317,6 +317,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -272,11 +272,11 @@ index 20bcac8ebadfa..f36e48dbf6549 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index a742d7d7f5d56..ac66f0cb18006 100644 +index 37047c631afc3..aafa6a6fd0b38 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -332,7 +332,8 @@ void Widget::Init(InitParams params) { - parent_ = params.parent ? GetWidgetForNativeView(params.parent) : nullptr; +@@ -359,7 +359,8 @@ void Widget::Init(InitParams params) { + } params.child |= (params.type == InitParams::TYPE_CONTROL); - is_top_level_ = !params.child; @@ -285,7 +285,7 @@ index a742d7d7f5d56..ac66f0cb18006 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -414,7 +415,12 @@ void Widget::Init(InitParams params) { +@@ -441,7 +442,12 @@ void Widget::Init(InitParams params) { } } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); @@ -299,7 +299,7 @@ index a742d7d7f5d56..ac66f0cb18006 100644 } native_theme_observation_.Observe(GetNativeTheme()); -@@ -1357,10 +1363,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1418,10 +1424,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -317,10 +317,10 @@ index a742d7d7f5d56..ac66f0cb18006 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index d6ce8c4934ed1..773125ba2dd5f 100644 +index 6ab943e4b7319..4ab76edb1e39f 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -326,6 +326,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -327,6 +327,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = nullptr; @@ -330,10 +330,10 @@ index d6ce8c4934ed1..773125ba2dd5f 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 8accd587315a8..6836cbae3c520 100644 +index 16245ed7e0b44..99592a5359fbd 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -388,6 +388,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -381,6 +381,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -358,10 +358,10 @@ index c23259757d984..450b2610e34d1 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 a221915d4ca70..059aabf614696 100644 +index c471f43c6da9e..251e2b2089bde 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3121,10 +3121,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3117,10 +3117,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 f97f1ae1b..52093bdd9 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -29,10 +29,10 @@ index 3b00759e513dc..90fe332d59f5b 100644 // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch // of lacros-chrome is complete. diff --git components/viz/host/host_display_client.h components/viz/host/host_display_client.h -index 5e260e13762f6..1ccff27f2fdbe 100644 +index 94c5293d528a6..d89a986ed0def 100644 --- components/viz/host/host_display_client.h +++ components/viz/host/host_display_client.h -@@ -32,17 +32,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient { +@@ -31,17 +31,17 @@ class VIZ_HOST_EXPORT HostDisplayClient : public mojom::DisplayClient { mojo::PendingRemote GetBoundRemote( scoped_refptr task_runner); @@ -80,10 +80,10 @@ index 1026b739d283f..fe562ab60ce98 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index 4e93b8609553e..97f52868bb68a 100644 +index f0eb025056501..823b7fcb55efc 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -206,6 +206,8 @@ viz_component("service") { +@@ -208,6 +208,8 @@ viz_component("service") { "transitions/transferable_resource_tracker.cc", "transitions/transferable_resource_tracker.h", "viz_service_export.h", @@ -162,10 +162,10 @@ index 50ff2c9facc2a..c34d1f28d2e90 100644 compositor_data.display_client->GetBoundRemote(resize_task_runner_); diff --git mojo/public/cpp/bindings/sync_call_restrictions.h mojo/public/cpp/bindings/sync_call_restrictions.h -index fd962645ec69c..a29cdd8f86c04 100644 +index fc4142741f793..ae797aaeff5f2 100644 --- mojo/public/cpp/bindings/sync_call_restrictions.h +++ mojo/public/cpp/bindings/sync_call_restrictions.h -@@ -39,6 +39,7 @@ class Compositor; +@@ -43,6 +43,7 @@ class Compositor; } // namespace ui namespace viz { @@ -173,7 +173,7 @@ index fd962645ec69c..a29cdd8f86c04 100644 class GpuHostImpl; class HostFrameSinkManager; class HostGpuMemoryBufferManager; -@@ -97,6 +98,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { +@@ -101,6 +102,8 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) SyncCallRestrictions { // For preventing frame swaps of wrong size during resize on Windows. // (https://crbug.com/811945) friend class ui::Compositor; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index c2623aab8..edc00b55b 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 ce65fbf4c4e62..6b05415374c87 100644 +index 3170d101acf0b..8a15712e741b8 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2878,6 +2878,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2881,6 +2881,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, params.main_frame_name); @@ -15,7 +15,7 @@ index ce65fbf4c4e62..6b05415374c87 100644 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2888,6 +2894,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2891,6 +2897,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -23,7 +23,7 @@ index ce65fbf4c4e62..6b05415374c87 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3719,6 +3726,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -3713,6 +3720,15 @@ FrameTree* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -39,7 +39,7 @@ index ce65fbf4c4e62..6b05415374c87 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -7468,6 +7484,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -7531,6 +7547,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } @@ -62,7 +62,7 @@ index f1dcf53ea481b..192f7c0ddd04f 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 279d292d96507..496e48d666a36 100644 +index 0ccd96cb9b840..26ba3f571e343 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h @@ -85,10 +85,12 @@ class BrowserContext; @@ -90,7 +90,7 @@ index 279d292d96507..496e48d666a36 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 0574d390dc94a..7ad9c7bc6e456 100644 +index a0da74d5cbe4a..1d6e4673a610f 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -59,10 +59,12 @@ class EyeDropperListener; @@ -106,7 +106,7 @@ index 0574d390dc94a..7ad9c7bc6e456 100644 struct ContextMenuParams; struct DropData; struct MediaPlayerWatchTime; -@@ -338,6 +340,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -335,6 +337,14 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionId& partition_id, SessionStorageNamespace* session_storage_namespace); diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index e312c92bd..87afbcc8f 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,10 +10,10 @@ index ff7a8ed89e94a..77f44956ff22f 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 9d96af5c4c9b5..fee49109c35d3 100644 +index 1fc4708c4ac12..db42867e8b130 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -875,6 +875,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -876,6 +876,11 @@ class BLINK_PLATFORM_EXPORT Platform { const WebURL& url, blink::WebVector* csp) {} @@ -44,10 +44,10 @@ index 463e3e5e73419..97aaf0da2b9a5 100644 DocumentInit& DocumentInit::WithTypeFrom(const String& mime_type) { diff --git third_party/blink/renderer/core/frame/local_frame.cc third_party/blink/renderer/core/frame/local_frame.cc -index c0f2ba8de2f77..745dfcb704ad2 100644 +index 16c679be469ab..75985bf7d9c72 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1879,7 +1879,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1853,7 +1853,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins()) return nullptr; @@ -57,7 +57,7 @@ index c0f2ba8de2f77..745dfcb704ad2 100644 } diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index 881b5a6234586..c28e864b98bc1 100644 +index b28a69f901a56..7a04bd07b6b16 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -8,6 +8,7 @@ @@ -68,7 +68,7 @@ index 881b5a6234586..c28e864b98bc1 100644 #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/inspector/devtools_agent.h" -@@ -145,6 +146,7 @@ DevToolsSession::DevToolsSession( +@@ -146,6 +147,7 @@ DevToolsSession::DevToolsSession( for (wtf_size_t i = 0; i < agents_.size(); i++) agents_[i]->Restore(); } @@ -76,7 +76,7 @@ index 881b5a6234586..c28e864b98bc1 100644 } DevToolsSession::~DevToolsSession() { -@@ -185,6 +187,7 @@ void DevToolsSession::Detach() { +@@ -186,6 +188,7 @@ void DevToolsSession::Detach() { agents_.clear(); v8_session_.reset(); agent_->client_->DebuggerTaskFinished(); @@ -184,10 +184,10 @@ index 72e214c315acf..c89b578f7d6d5 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 89beb74dae8a9..63bfa84b45b72 100644 +index c5f0d9c55c56b..83949238bd4dd 100644 --- third_party/blink/renderer/core/page/plugin_data.cc +++ third_party/blink/renderer/core/page/plugin_data.cc -@@ -91,10 +91,12 @@ void PluginData::RefreshBrowserSidePluginCache() { +@@ -96,10 +96,12 @@ void PluginData::RefreshBrowserSidePluginCache() { Platform::Current()->GetBrowserInterfaceBroker()->GetInterface( registry.BindNewPipeAndPassReceiver()); Vector plugins; @@ -199,10 +199,10 @@ index 89beb74dae8a9..63bfa84b45b72 100644 -void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) { +void PluginData::UpdatePluginList(bool is_main_frame, + const SecurityOrigin* main_frame_origin) { + SCOPED_UMA_HISTOGRAM_TIMER("Blink.Plugin.UpdateTime"); ResetPluginData(); main_frame_origin_ = main_frame_origin; - -@@ -102,7 +104,7 @@ void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) { +@@ -108,7 +110,7 @@ void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) { Platform::Current()->GetBrowserInterfaceBroker()->GetInterface( registry.BindNewPipeAndPassReceiver()); Vector plugins; @@ -210,12 +210,12 @@ index 89beb74dae8a9..63bfa84b45b72 100644 + registry->GetPlugins(false, is_main_frame, main_frame_origin_, &plugins); for (const auto& plugin : plugins) { auto* plugin_info = MakeGarbageCollected( - plugin->name, FilePathToWebString(plugin->filename), + std::move(plugin->name), FilePathToWebString(plugin->filename), diff --git third_party/blink/renderer/core/page/plugin_data.h third_party/blink/renderer/core/page/plugin_data.h -index 310319d4595be..491b7705a006c 100644 +index 0d5439e9238aa..89478997bd808 100644 --- third_party/blink/renderer/core/page/plugin_data.h +++ third_party/blink/renderer/core/page/plugin_data.h -@@ -98,7 +98,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { +@@ -101,7 +101,8 @@ class CORE_EXPORT PluginData final : public GarbageCollected { const HeapVector>& Plugins() const { return plugins_; } const HeapVector>& Mimes() const { return mimes_; } const SecurityOrigin* Origin() const { return main_frame_origin_.get(); } diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 110c32354..aebc1601e 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -11,7 +11,7 @@ index f54b993e9fb9f..ec081f68adddb 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 2f9022d37ab98..5637137cafc50 100644 +index 7995eb16a7cf6..1c007cbf08f32 100644 --- third_party/blink/renderer/core/exported/web_view_impl.cc +++ third_party/blink/renderer/core/exported/web_view_impl.cc @@ -244,8 +244,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { @@ -39,7 +39,7 @@ index 2f9022d37ab98..5637137cafc50 100644 fullscreen_controller_(std::make_unique(this)), page_base_background_color_( diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 97e3d30f1427b..284bd30aa95e1 100644 +index e7b0409bd60df..445b9eee5fd71 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h @@ -131,7 +131,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, @@ -52,7 +52,7 @@ index 97e3d30f1427b..284bd30aa95e1 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -789,6 +790,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -791,6 +792,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 97e3d30f1427b..284bd30aa95e1 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 7528cfa4793e9..35a37668930a7 100644 +index fdeb0ffd7c5f5..cc03daf4f705a 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -839,7 +839,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { +@@ -842,7 +842,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webkit_runtime_enabled_features.patch b/patch/patches/webkit_runtime_enabled_features.patch index 19cab1d21..690cba7b8 100644 --- a/patch/patches/webkit_runtime_enabled_features.patch +++ b/patch/patches/webkit_runtime_enabled_features.patch @@ -1,8 +1,8 @@ diff --git third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl -index 602131e3d6407..7791b570547ed 100644 +index 0325bd26a5058..8fec0a124a55c 100644 --- third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl +++ third_party/blink/renderer/build/scripts/templates/runtime_enabled_features.h.tmpl -@@ -11,6 +11,8 @@ +@@ -12,6 +12,8 @@ #include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" @@ -11,7 +11,7 @@ index 602131e3d6407..7791b570547ed 100644 #define ASSERT_ORIGIN_TRIAL(feature) \ static_assert(std::is_same diff --git a/tests/ceftests/views/button_unittest.cc b/tests/ceftests/views/button_unittest.cc index d437d15ce..6afc6f8d3 100644 --- a/tests/ceftests/views/button_unittest.cc +++ b/tests/ceftests/views/button_unittest.cc @@ -115,31 +115,47 @@ class EmptyMenuButtonDelegate : public CefMenuButtonDelegate { DISALLOW_COPY_AND_ASSIGN(EmptyMenuButtonDelegate); }; -void LabelButtonStyle() { +void RunLabelButtonStyle(CefRefPtr window) { CefRefPtr button = CefLabelButton::CreateLabelButton( new EmptyMenuButtonDelegate(), kButtonText); + + // Must be added to a parent window before retrieving the style to avoid + // a CHECK() in View::GetNativeTheme(). See https://crbug.com/1056756. + window->AddChildView(button); + window->Layout(); + VerifyLabelButtonStyle(button); } -void LabelButtonStyleFramelessImpl() { - LabelButtonStyle(); +void LabelButtonStyleImpl(CefRefPtr event) { + auto config = std::make_unique(); + config->on_window_created = base::BindOnce(RunLabelButtonStyle); + TestWindowDelegate::RunTest(event, std::move(config)); } -void MenuButtonStyle() { +void RunMenuButtonStyle(CefRefPtr window) { CefRefPtr button = CefMenuButton::CreateMenuButton( new EmptyMenuButtonDelegate(), kButtonText); + + // Must be added to a parent window before retrieving the style to avoid + // a CHECK() in View::GetNativeTheme(). See https://crbug.com/1056756. + window->AddChildView(button); + window->Layout(); + VerifyMenuButtonStyle(button); } -void MenuButtonStyleFramelessImpl() { - MenuButtonStyle(); +void MenuButtonStyleImpl(CefRefPtr event) { + auto config = std::make_unique(); + config->on_window_created = base::BindOnce(RunMenuButtonStyle); + TestWindowDelegate::RunTest(event, std::move(config)); } } // namespace // Test Button getters/setters. -BUTTON_TEST(LabelButtonStyleFrameless) -BUTTON_TEST(MenuButtonStyleFrameless) +BUTTON_TEST_ASYNC(LabelButtonStyle) +BUTTON_TEST_ASYNC(MenuButtonStyle) namespace { diff --git a/tests/ceftests/views/textfield_unittest.cc b/tests/ceftests/views/textfield_unittest.cc index 77633a7c4..8c08fbfc7 100644 --- a/tests/ceftests/views/textfield_unittest.cc +++ b/tests/ceftests/views/textfield_unittest.cc @@ -31,11 +31,16 @@ namespace { -void TextfieldContentsImpl() { +void RunTextfieldContents(CefRefPtr window) { CefRefPtr textfield = CefTextfield::CreateTextfield(nullptr); EXPECT_TRUE(textfield.get()); EXPECT_TRUE(textfield->AsTextfield().get()); + // Must be added to a parent window before retrieving the style to avoid + // a CHECK() in View::GetNativeTheme(). See https://crbug.com/1056756. + window->AddChildView(textfield); + window->Layout(); + // Test defaults. EXPECT_TRUE(textfield->GetText().empty()); EXPECT_FALSE(textfield->HasSelection()); @@ -107,10 +112,21 @@ void TextfieldContentsImpl() { textfield->ClearEditHistory(); } -void TextfieldStyleImpl() { +void TextfieldContentsImpl(CefRefPtr event) { + auto config = std::make_unique(); + config->on_window_created = base::BindOnce(RunTextfieldContents); + TestWindowDelegate::RunTest(event, std::move(config)); +} + +void RunTextfieldStyle(CefRefPtr window) { CefRefPtr textfield = CefTextfield::CreateTextfield(nullptr); EXPECT_TRUE(textfield.get()); + // Must be added to a parent window before retrieving the style to avoid + // a CHECK() in View::GetNativeTheme(). See https://crbug.com/1056756. + window->AddChildView(textfield); + window->Layout(); + // Test defaults. EXPECT_FALSE(textfield->IsPasswordInput()); EXPECT_FALSE(textfield->IsReadOnly()); @@ -160,11 +176,17 @@ void TextfieldStyleImpl() { textfield->SetAccessibleName("MyTextfield"); } +void TextfieldStyleImpl(CefRefPtr event) { + auto config = std::make_unique(); + config->on_window_created = base::BindOnce(RunTextfieldStyle); + TestWindowDelegate::RunTest(event, std::move(config)); +} + } // namespace // Test Textfield getters/setters. -TEXTFIELD_TEST(TextfieldContents) -TEXTFIELD_TEST(TextfieldStyle) +TEXTFIELD_TEST_ASYNC(TextfieldContents) +TEXTFIELD_TEST_ASYNC(TextfieldStyle) namespace {