diff --git a/BUILD.gn b/BUILD.gn index 184769437..a5743dcf2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1356,14 +1356,10 @@ make_pack_header("resources") { "$root_gen_dir/chrome/grit/common_resources.h", "$root_gen_dir/chrome/grit/component_extension_resources.h", "$root_gen_dir/chrome/grit/dev_ui_browser_resources.h", - "$root_gen_dir/chrome/grit/net_internals_resources.h", - "$root_gen_dir/chrome/grit/pdf_resources.h", - "$root_gen_dir/chrome/grit/print_preview_resources.h", "$root_gen_dir/chrome/grit/renderer_resources.h", "$root_gen_dir/components/grit/components_resources.h", "$root_gen_dir/components/grit/dev_ui_components_resources.h", "$root_gen_dir/content/browser/devtools/grit/devtools_resources.h", - "$root_gen_dir/content/browser/resources/media/grit/media_internals_resources.h", "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h", "$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h", "$root_gen_dir/content/grit/content_resources.h", @@ -1385,15 +1381,11 @@ make_pack_header("resources") { "//chrome/browser:dev_ui_browser_resources", "//chrome/browser:resources", "//chrome/browser/resources:component_extension_resources", - "//chrome/browser/resources/net_internals:net_internals_resources", - "//chrome/browser/resources/pdf:pdf_resources", - "//chrome/browser/resources/print_preview:print_preview_resources", "//chrome/common:resources", "//chrome/renderer:resources", "//components/resources:components_resources", "//components/resources:dev_ui_components_resources", "//content/browser/devtools:devtools_resources", - "//content/browser/resources/media:media_internals_resources", "//content/browser/tracing:resources", "//content/browser/webrtc/resources", "//content:content_resources", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 48b5d1af9..afa56e819 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/89.0.4389.0' + 'chromium_checkout': 'refs/tags/90.0.4430.0' } diff --git a/include/capi/cef_context_menu_handler_capi.h b/include/capi/cef_context_menu_handler_capi.h index ea56d942e..59b1f2878 100644 --- a/include/capi/cef_context_menu_handler_capi.h +++ b/include/capi/cef_context_menu_handler_capi.h @@ -33,7 +33,7 @@ // by hand. See the translator.README.txt file in the tools directory for // more information. // -// $hash=bd04d49bcd5d269f237c92163b40435d5588209b$ +// $hash=175779df75a1405fcc5c337a09e6322c556698ba$ // #ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ @@ -294,11 +294,6 @@ typedef struct _cef_context_menu_params_t { // items). /// int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self); - - /// - // Returns true (1) if the context menu was invoked from a pepper plugin. - /// - int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self); } cef_context_menu_params_t; #ifdef __cplusplus diff --git a/include/cef_api_hash.h b/include/cef_api_hash.h index b72e55869..b92929cec 100644 --- a/include/cef_api_hash.h +++ b/include/cef_api_hash.h @@ -42,13 +42,13 @@ // way that may cause binary incompatibility with other builds. The universal // hash value will change if any platform is affected whereas the platform hash // values will change only if that particular platform is affected. -#define CEF_API_HASH_UNIVERSAL "89715b43c948313782d2546131f510eab1975844" +#define CEF_API_HASH_UNIVERSAL "694bc8d68956bd174529f72fea5710929ac8bbf0" #if defined(OS_WIN) -#define CEF_API_HASH_PLATFORM "80648a2c5a87db1581fdb994b7154ed77d74a3c5" +#define CEF_API_HASH_PLATFORM "597ae4ad020de2665469e7de990d784bfda8d514" #elif defined(OS_MAC) -#define CEF_API_HASH_PLATFORM "3af393a2bf165edd934c5a59f6e6fce8a4bb579c" +#define CEF_API_HASH_PLATFORM "fa3b4a918791bf53a4a8715ac9f0c843a3c08061" #elif defined(OS_LINUX) -#define CEF_API_HASH_PLATFORM "8049cab9a43c1d554ccdd4dd3d5e38ecebce42af" +#define CEF_API_HASH_PLATFORM "83ff6d6fb2e0ac8447f68fa6141091cc9f666ca0" #endif #ifdef __cplusplus diff --git a/include/cef_context_menu_handler.h b/include/cef_context_menu_handler.h index 2a2a73e61..61ff67ab6 100644 --- a/include/cef_context_menu_handler.h +++ b/include/cef_context_menu_handler.h @@ -281,12 +281,6 @@ class CefContextMenuParams : public virtual CefBaseRefCounted { /// /*--cef()--*/ virtual bool IsCustomMenu() = 0; - - /// - // Returns true if the context menu was invoked from a pepper plugin. - /// - /*--cef()--*/ - virtual bool IsPepperMenu() = 0; }; #endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ diff --git a/libcef/browser/alloy/alloy_browser_context.cc b/libcef/browser/alloy/alloy_browser_context.cc index 427271147..87bc0d01b 100644 --- a/libcef/browser/alloy/alloy_browser_context.cc +++ b/libcef/browser/alloy/alloy_browser_context.cc @@ -298,6 +298,7 @@ AlloyBrowserContext::GetClientHintsControllerDelegate() { } void AlloyBrowserContext::SetCorsOriginAccessListForOrigin( + TargetBrowserContexts target_mode, const url::Origin& source_origin, std::vector allow_patterns, std::vector block_patterns, @@ -437,6 +438,11 @@ AlloyBrowserContext::GetProfilePolicyConnector() const { return nullptr; } +bool AlloyBrowserContext::IsNewProfile() const { + NOTREACHED(); + return false; +} + void AlloyBrowserContext::RebuildTable( const scoped_refptr& enumerator) { // Called when visited links will not or cannot be loaded from disk. diff --git a/libcef/browser/alloy/alloy_browser_context.h b/libcef/browser/alloy/alloy_browser_context.h index ce153d3f8..b7b2bf366 100644 --- a/libcef/browser/alloy/alloy_browser_context.h +++ b/libcef/browser/alloy/alloy_browser_context.h @@ -59,6 +59,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy, content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate() override; void SetCorsOriginAccessListForOrigin( + TargetBrowserContexts target_mode, const url::Origin& source_origin, std::vector allow_patterns, std::vector block_patterns, @@ -94,6 +95,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy, policy::ProfilePolicyConnector* GetProfilePolicyConnector() override; const policy::ProfilePolicyConnector* GetProfilePolicyConnector() const override; + bool IsNewProfile() const override; // Values checked in ProfileNetworkContextService::CreateNetworkContextParams // when creating the NetworkContext. diff --git a/libcef/browser/alloy/alloy_browser_host_impl.cc b/libcef/browser/alloy/alloy_browser_host_impl.cc index 90ff20f1e..e96b7bee2 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.cc +++ b/libcef/browser/alloy/alloy_browser_host_impl.cc @@ -1251,6 +1251,11 @@ void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) { // destroyed. CefRefPtr browser(this); + if (source) { + // Try to fast shutdown the associated process. + source->GetMainFrame()->GetProcess()->FastShutdownIfPossible(1, false); + } + // No window exists. Destroy the browser immediately. Don't call other // browser methods after calling DestroyBrowser(). DestroyBrowser(); @@ -1549,11 +1554,13 @@ void AlloyBrowserHostImpl::ExitPictureInPicture() { // content::WebContentsObserver methods. // ----------------------------------------------------------------------------- -void AlloyBrowserHostImpl::RenderViewCreated( - content::RenderViewHost* render_view_host) { - new CefWidgetHostInterceptor(this, render_view_host); - - platform_delegate_->RenderViewCreated(render_view_host); +void AlloyBrowserHostImpl::RenderFrameCreated( + content::RenderFrameHost* render_frame_host) { + if (render_frame_host->GetParent() == nullptr) { + auto render_view_host = render_frame_host->GetRenderViewHost(); + new CefWidgetHostInterceptor(this, render_view_host); + platform_delegate_->RenderViewCreated(render_view_host); + } } void AlloyBrowserHostImpl::RenderViewReady() { @@ -1672,8 +1679,8 @@ AlloyBrowserHostImpl::AlloyBrowserHostImpl( // Associate the platform delegate with this browser. platform_delegate_->BrowserCreated(this); - // Make sure RenderViewCreated is called at least one time. - RenderViewCreated(web_contents->GetRenderViewHost()); + // Make sure RenderFrameCreated is called at least one time. + RenderFrameCreated(web_contents->GetMainFrame()); } bool AlloyBrowserHostImpl::CreateHostWindow() { diff --git a/libcef/browser/alloy/alloy_browser_host_impl.h b/libcef/browser/alloy/alloy_browser_host_impl.h index 45c7e6655..1a0e510e0 100644 --- a/libcef/browser/alloy/alloy_browser_host_impl.h +++ b/libcef/browser/alloy/alloy_browser_host_impl.h @@ -306,7 +306,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase, // content::WebContentsObserver methods. using content::WebContentsObserver::BeforeUnloadFired; - void RenderViewCreated(content::RenderViewHost* render_view_host) override; + void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override; void RenderViewReady() override; void DidFinishNavigation( content::NavigationHandle* navigation_handle) override; diff --git a/libcef/browser/alloy/alloy_browser_main.cc b/libcef/browser/alloy/alloy_browser_main.cc index 7d145334e..f732ae35a 100644 --- a/libcef/browser/alloy/alloy_browser_main.cc +++ b/libcef/browser/alloy/alloy_browser_main.cc @@ -52,7 +52,6 @@ #include "chrome/browser/chrome_browser_main_win.h" #include "chrome/browser/win/parental_controls.h" #include "components/os_crypt/os_crypt.h" -#include "ui/base/cursor/cursor_loader_win.h" #endif #endif // defined(USE_AURA) @@ -97,11 +96,6 @@ void AlloyBrowserMainParts::ToolkitInitialized() { CHECK(aura::Env::GetInstance()); wm_state_.reset(new wm::WMState); - -#if defined(OS_WIN) - ui::CursorLoaderWin::SetCursorResourceModule( - CefAppManager::Get()->GetResourceDllName()); -#endif #endif // defined(USE_AURA) #if defined(TOOLKIT_VIEWS) diff --git a/libcef/browser/alloy/alloy_content_browser_client.cc b/libcef/browser/alloy/alloy_content_browser_client.cc index dc344eba9..9c2ba04c4 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.cc +++ b/libcef/browser/alloy/alloy_content_browser_client.cc @@ -51,7 +51,6 @@ #include "base/threading/thread_restrictions.h" #include "cef/grit/cef_resources.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/content_settings/cookie_settings_factory.h" #include "chrome/browser/net/profile_network_context_service.h" #include "chrome/browser/net/profile_network_context_service_factory.h" @@ -74,6 +73,8 @@ #include "chrome/grit/generated_resources.h" #include "chrome/services/printing/printing_service.h" #include "components/content_settings/core/browser/cookie_settings.h" +#include "components/embedder_support/switches.h" +#include "components/embedder_support/user_agent_utils.h" #include "components/spellcheck/common/spellcheck.mojom.h" #include "components/version_info/version_info.h" #include "content/browser/plugin_service_impl.h" @@ -696,7 +697,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches( switches::kLogSeverity, switches::kProductVersion, switches::kResourcesDirPath, - switches::kUserAgent, + embedder_support::kUserAgent, }; command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames, base::size(kSwitchNames)); @@ -950,8 +951,10 @@ bool AlloyContentBrowserClient::CanCreateWindow( } void AlloyContentBrowserClient::OverrideWebkitPrefs( - content::RenderViewHost* rvh, + content::WebContents* web_contents, blink::web_pref::WebPreferences* prefs) { + auto rvh = web_contents->GetRenderViewHost(); + // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // when this method is called. renderer_prefs::PopulateWebPreferences(rvh, *prefs); @@ -1009,7 +1012,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles( // Used to substitute View ID for PDF contents when using the PDF plugin. result.push_back(std::make_unique( - request.resource_type, frame_tree_node_id)); + request.destination, frame_tree_node_id)); Profile* profile = Profile::FromBrowserContext(browser_context); @@ -1035,13 +1038,6 @@ void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess( } #endif // defined(OS_LINUX) -#if defined(OS_WIN) -bool AlloyContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy, - RendererSpawnFlags flags) { - return true; -} -#endif // defined(OS_WIN) - void AlloyContentBrowserClient::ExposeInterfacesToRenderer( service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry, @@ -1191,7 +1187,8 @@ void AlloyContentBrowserClient::ConfigureNetworkContextParams( bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) { + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) { // This method may be called during shutdown when using multi-threaded // message loop mode. In that case exit early to avoid crashes. if (!SystemNetworkContextManager::GetInstance()) { @@ -1325,8 +1322,7 @@ AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() { } std::string AlloyContentBrowserClient::GetProduct() { - // Match the logic in chrome_content_browser_client.cc GetProduct(). - return ::GetProduct(); + return embedder_support::GetProduct(); } std::string AlloyContentBrowserClient::GetChromeProduct() { @@ -1334,8 +1330,7 @@ std::string AlloyContentBrowserClient::GetChromeProduct() { } std::string AlloyContentBrowserClient::GetUserAgent() { - // Match the logic in chrome_content_browser_client.cc GetUserAgent(). - return ::GetUserAgent(); + return embedder_support::GetUserAgent(); } blink::UserAgentMetadata AlloyContentBrowserClient::GetUserAgentMetadata() { diff --git a/libcef/browser/alloy/alloy_content_browser_client.h b/libcef/browser/alloy/alloy_content_browser_client.h index 6b42f42e8..82a738341 100644 --- a/libcef/browser/alloy/alloy_content_browser_client.h +++ b/libcef/browser/alloy/alloy_content_browser_client.h @@ -101,7 +101,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { bool user_gesture, bool opener_suppressed, bool* no_javascript_access) override; - void OverrideWebkitPrefs(content::RenderViewHost* rvh, + void OverrideWebkitPrefs(content::WebContents* web_contents, blink::web_pref::WebPreferences* prefs) override; bool OverrideWebPreferencesAfterNavigation( content::WebContents* web_contents, @@ -128,11 +128,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { content::PosixFileDescriptorInfo* mappings) override; #endif -#if defined(OS_WIN) - bool PreSpawnRenderer(sandbox::TargetPolicy* policy, - RendererSpawnFlags flags) override; -#endif - void ExposeInterfacesToRenderer( service_manager::BinderRegistry* registry, blink::AssociatedInterfaceRegistry* associated_registry, @@ -177,8 +172,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient { bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) - override; + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) override; std::vector GetNetworkContextsParentDirectory() override; bool HandleExternalProtocol( const GURL& url, diff --git a/libcef/browser/alloy/browser_platform_delegate_alloy.cc b/libcef/browser/alloy/browser_platform_delegate_alloy.cc index 0fa1c1b0e..4c02ce1f9 100644 --- a/libcef/browser/alloy/browser_platform_delegate_alloy.cc +++ b/libcef/browser/alloy/browser_platform_delegate_alloy.cc @@ -206,7 +206,7 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost( extension_host_ = new extensions::CefExtensionViewHost( alloy_browser, extension, web_contents_, url, host_type); // Trigger load of the extension URL. - extension_host_->CreateRenderViewSoon(); + extension_host_->CreateRendererSoon(); } else if (host_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) { is_background_host_ = true; alloy_browser->is_background_host_ = true; diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.cc b/libcef/browser/alloy/chrome_browser_process_alloy.cc index 7873cc3cf..d0630ee15 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.cc +++ b/libcef/browser/alloy/chrome_browser_process_alloy.cc @@ -128,11 +128,6 @@ metrics::MetricsService* ChromeBrowserProcessAlloy::metrics_service() { return nullptr; } -rappor::RapporServiceImpl* ChromeBrowserProcessAlloy::rappor_service() { - // Called from PluginInfoHostImpl::ReportMetrics. - return nullptr; -} - SystemNetworkContextManager* ChromeBrowserProcessAlloy::system_network_context_manager() { DCHECK(SystemNetworkContextManager::GetInstance()); diff --git a/libcef/browser/alloy/chrome_browser_process_alloy.h b/libcef/browser/alloy/chrome_browser_process_alloy.h index fc88d15b3..01460594b 100644 --- a/libcef/browser/alloy/chrome_browser_process_alloy.h +++ b/libcef/browser/alloy/chrome_browser_process_alloy.h @@ -44,7 +44,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess { metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager() override; metrics::MetricsService* metrics_service() override; - rappor::RapporServiceImpl* rappor_service() override; SystemNetworkContextManager* system_network_context_manager() override; network::NetworkQualityTracker* network_quality_tracker() override; WatchDogThread* watchdog_thread() override; diff --git a/libcef/browser/alloy/chrome_profile_alloy.cc b/libcef/browser/alloy/chrome_profile_alloy.cc index 8fdc3e78d..21ecf55fb 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.cc +++ b/libcef/browser/alloy/chrome_profile_alloy.cc @@ -109,10 +109,6 @@ bool ChromeProfileAlloy::IsChild() const { return false; } -bool ChromeProfileAlloy::IsLegacySupervised() const { - return false; -} - ExtensionSpecialStoragePolicy* ChromeProfileAlloy::GetExtensionSpecialStoragePolicy() { NOTREACHED(); diff --git a/libcef/browser/alloy/chrome_profile_alloy.h b/libcef/browser/alloy/chrome_profile_alloy.h index ab81a4171..d6b9b937e 100644 --- a/libcef/browser/alloy/chrome_profile_alloy.h +++ b/libcef/browser/alloy/chrome_profile_alloy.h @@ -37,7 +37,6 @@ class ChromeProfileAlloy : public Profile { const Profile* GetOriginalProfile() const override; bool IsSupervised() const override; bool IsChild() const override; - bool IsLegacySupervised() const override; ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; PrefService* GetOffTheRecordPrefs() override; bool IsSameOrParent(Profile* profile) override; diff --git a/libcef/browser/browser_contents_delegate.cc b/libcef/browser/browser_contents_delegate.cc index 048953a2e..08bdd0bda 100644 --- a/libcef/browser/browser_contents_delegate.cc +++ b/libcef/browser/browser_contents_delegate.cc @@ -41,9 +41,7 @@ void CefBrowserContentsDelegate::ObserveWebContents( content::Source( &new_contents->GetController())); - // Make sure RenderViewCreated is called at least one time. - RenderViewCreated(new_contents->GetRenderViewHost()); - + // Make sure RenderFrameCreated is called at least one time. // Create the frame representation before OnAfterCreated is called for a new // browser. Additionally, RenderFrameCreated is otherwise not called at all // for new popup browsers. @@ -229,6 +227,18 @@ bool CefBrowserContentsDelegate::HandleKeyboardEvent( void CefBrowserContentsDelegate::RenderFrameCreated( content::RenderFrameHost* render_frame_host) { browser_info_->MaybeCreateFrame(render_frame_host, false /* is_guest_view */); + + if (render_frame_host->GetParent() == nullptr) { + // May be already registered if the renderer crashed previously. + auto render_view_host = render_frame_host->GetRenderViewHost(); + if (!registrar_->IsRegistered( + this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, + content::Source(render_view_host))) { + registrar_->Add( + this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, + content::Source(render_view_host)); + } + } } void CefBrowserContentsDelegate::RenderFrameHostChanged( @@ -249,17 +259,6 @@ void CefBrowserContentsDelegate::RenderFrameDeleted( } } -void CefBrowserContentsDelegate::RenderViewCreated( - content::RenderViewHost* render_view_host) { - // May be already registered if the renderer crashed previously. - if (!registrar_->IsRegistered( - this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host))) { - registrar_->Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, - content::Source(render_view_host)); - } -} - void CefBrowserContentsDelegate::RenderViewDeleted( content::RenderViewHost* render_view_host) { if (registrar_->IsRegistered( diff --git a/libcef/browser/browser_contents_delegate.h b/libcef/browser/browser_contents_delegate.h index 7567a3542..c4fc0aad8 100644 --- a/libcef/browser/browser_contents_delegate.h +++ b/libcef/browser/browser_contents_delegate.h @@ -108,7 +108,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate, void RenderFrameHostChanged(content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) override; void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; - void RenderViewCreated(content::RenderViewHost* render_view_host) override; void RenderViewDeleted(content::RenderViewHost* render_view_host) override; void RenderViewReady() override; void RenderProcessGone(base::TerminationStatus status) override; diff --git a/libcef/browser/browser_info_manager.cc b/libcef/browser/browser_info_manager.cc index e445671e2..edd421e1c 100644 --- a/libcef/browser/browser_info_manager.cc +++ b/libcef/browser/browser_info_manager.cc @@ -422,6 +422,8 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed( content::RenderProcessHost* host) { CEF_REQUIRE_UIT(); + host->RemoveObserver(this); + const int render_process_id = host->GetID(); DCHECK_GT(render_process_id, 0); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.cc b/libcef/browser/chrome/chrome_content_browser_client_cef.cc index 69207f236..5a52fbb7c 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.cc +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.cc @@ -249,7 +249,8 @@ void ChromeContentBrowserClientCef::ConfigureNetworkContextParams( bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) { + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) { ChromeContentBrowserClient::ConfigureNetworkContextParams( context, in_memory, relative_partition_path, network_context_params, cert_verifier_creation_params); diff --git a/libcef/browser/chrome/chrome_content_browser_client_cef.h b/libcef/browser/chrome/chrome_content_browser_client_cef.h index ce013666a..8b4b7f5f0 100644 --- a/libcef/browser/chrome/chrome_content_browser_client_cef.h +++ b/libcef/browser/chrome/chrome_content_browser_client_cef.h @@ -80,8 +80,8 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient { bool in_memory, const base::FilePath& relative_partition_path, network::mojom::NetworkContextParams* network_context_params, - network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) - override; + cert_verifier::mojom::CertVerifierCreationParams* + cert_verifier_creation_params) override; std::unique_ptr CreateLoginDelegate( const net::AuthChallengeInfo& auth_info, content::WebContents* web_contents, diff --git a/libcef/browser/context_menu_params_impl.cc b/libcef/browser/context_menu_params_impl.cc index 039c480a0..23e9f076b 100644 --- a/libcef/browser/context_menu_params_impl.cc +++ b/libcef/browser/context_menu_params_impl.cc @@ -5,6 +5,7 @@ #include "libcef/browser/context_menu_params_impl.h" #include "base/logging.h" +#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" CefContextMenuParamsImpl::CefContextMenuParamsImpl( content::ContextMenuParams* value) @@ -146,8 +147,3 @@ bool CefContextMenuParamsImpl::IsCustomMenu() { CEF_VALUE_VERIFY_RETURN(false, false); return !const_value().custom_items.empty(); } - -bool CefContextMenuParamsImpl::IsPepperMenu() { - CEF_VALUE_VERIFY_RETURN(false, false); - return const_value().custom_context.is_pepper_menu; -} diff --git a/libcef/browser/context_menu_params_impl.h b/libcef/browser/context_menu_params_impl.h index 5d28efb7b..c4033c32d 100644 --- a/libcef/browser/context_menu_params_impl.h +++ b/libcef/browser/context_menu_params_impl.h @@ -38,7 +38,6 @@ class CefContextMenuParamsImpl bool IsSpellCheckEnabled() override; EditStateFlags GetEditStateFlags() override; bool IsCustomMenu() override; - bool IsPepperMenu() override; DISALLOW_COPY_AND_ASSIGN(CefContextMenuParamsImpl); }; diff --git a/libcef/browser/extensions/component_extension_resource_manager.cc b/libcef/browser/extensions/component_extension_resource_manager.cc index 1039f6652..d912efa8b 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.cc +++ b/libcef/browser/extensions/component_extension_resource_manager.cc @@ -65,15 +65,15 @@ CefComponentExtensionResourceManager::GetTemplateReplacementsForExtension( } void CefComponentExtensionResourceManager::AddComponentResourceEntries( - const GritResourceMap* entries, + const webui::ResourcePath* entries, size_t size) { for (size_t i = 0; i < size; ++i) { base::FilePath resource_path = - base::FilePath().AppendASCII(entries[i].name); + base::FilePath().AppendASCII(entries[i].path); resource_path = resource_path.NormalizePathSeparators(); DCHECK(!base::Contains(path_to_resource_info_, resource_path)); - path_to_resource_info_[resource_path] = entries[i].value; + path_to_resource_info_[resource_path] = entries[i].id; } } diff --git a/libcef/browser/extensions/component_extension_resource_manager.h b/libcef/browser/extensions/component_extension_resource_manager.h index 38a421e07..90810994c 100644 --- a/libcef/browser/extensions/component_extension_resource_manager.h +++ b/libcef/browser/extensions/component_extension_resource_manager.h @@ -11,7 +11,9 @@ #include "base/macros.h" #include "extensions/browser/component_extension_resource_manager.h" -struct GritResourceMap; +namespace webui { +struct ResourcePath; +} namespace extensions { @@ -29,7 +31,8 @@ class CefComponentExtensionResourceManager const std::string& extension_id) const override; private: - void AddComponentResourceEntries(const GritResourceMap* entries, size_t size); + void AddComponentResourceEntries(const webui::ResourcePath* entries, + size_t size); // A map from a resource path to the resource ID. Used by // IsComponentExtensionResource. diff --git a/libcef/browser/extensions/extension_host_delegate.cc b/libcef/browser/extensions/extension_host_delegate.cc index bb4fa53e8..d973246a7 100644 --- a/libcef/browser/extensions/extension_host_delegate.cc +++ b/libcef/browser/extensions/extension_host_delegate.cc @@ -20,7 +20,7 @@ CefExtensionHostDelegate::~CefExtensionHostDelegate() {} void CefExtensionHostDelegate::OnExtensionHostCreated( content::WebContents* web_contents) {} -void CefExtensionHostDelegate::OnRenderViewCreatedForBackgroundPage( +void CefExtensionHostDelegate::OnMainFrameCreatedForBackgroundPage( ExtensionHost* host) {} content::JavaScriptDialogManager* diff --git a/libcef/browser/extensions/extension_host_delegate.h b/libcef/browser/extensions/extension_host_delegate.h index bc4352679..2596849f9 100644 --- a/libcef/browser/extensions/extension_host_delegate.h +++ b/libcef/browser/extensions/extension_host_delegate.h @@ -19,7 +19,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate { // ExtensionHostDelegate implementation. void OnExtensionHostCreated(content::WebContents* web_contents) override; - void OnRenderViewCreatedForBackgroundPage(ExtensionHost* host) override; + void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override; content::JavaScriptDialogManager* GetJavaScriptDialogManager() override; void CreateTab(std::unique_ptr web_contents, const std::string& extension_id, diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index cb34f8375..d6a538c9e 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -407,7 +407,7 @@ ServiceWorkerManager* CefExtensionSystem::service_worker_manager() { return service_worker_manager_.get(); } -SharedUserScriptManager* CefExtensionSystem::shared_user_script_manager() { +UserScriptManager* CefExtensionSystem::user_script_manager() { return nullptr; } diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index ed2bfb9c4..6d7afdec0 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -87,7 +87,7 @@ class CefExtensionSystem : public ExtensionSystem { RuntimeData* runtime_data() override; ManagementPolicy* management_policy() override; ServiceWorkerManager* service_worker_manager() override; - SharedUserScriptManager* shared_user_script_manager() override; + UserScriptManager* user_script_manager() override; StateStore* state_store() override; StateStore* rules_store() override; scoped_refptr store_factory() override; diff --git a/libcef/browser/menu_manager.cc b/libcef/browser/menu_manager.cc index 13990a2e4..d3e72daf9 100644 --- a/libcef/browser/menu_manager.cc +++ b/libcef/browser/menu_manager.cc @@ -263,7 +263,7 @@ void CefMenuManager::MenuClosed(CefRefPtr source) { // Notify the host after closing the context menu. web_contents()->SetShowingContextMenu(false); - web_contents()->NotifyContextMenuClosed(params_.custom_context); + web_contents()->NotifyContextMenuClosed(params_.link_followed); } bool CefMenuManager::FormatLabel(CefRefPtr source, @@ -287,11 +287,11 @@ void CefMenuManager::CreateDefaultModel() { if (!params_.custom_items.empty()) { // Custom menu items originating from the renderer process. For example, // plugin placeholder menu items. - for (size_t i = 0; i < params_.custom_items.size(); ++i) { - content::MenuItem menu_item = params_.custom_items[i]; - menu_item.action += MENU_ID_CUSTOM_FIRST; - DCHECK_LE(static_cast(menu_item.action), MENU_ID_CUSTOM_LAST); - model_->AddMenuItem(menu_item); + for (auto& item : params_.custom_items) { + auto new_item = item->Clone(); + new_item->action += MENU_ID_CUSTOM_FIRST; + DCHECK_LE(static_cast(new_item->action), MENU_ID_CUSTOM_LAST); + model_->AddMenuItem(*new_item); } return; } @@ -375,7 +375,7 @@ void CefMenuManager::ExecuteDefaultCommand(int command_id) { if (IsCustomContextMenuCommand(command_id)) { if (web_contents()) { web_contents()->ExecuteCustomContextMenuCommand( - command_id - MENU_ID_CUSTOM_FIRST, params_.custom_context); + command_id - MENU_ID_CUSTOM_FIRST, params_.link_followed); } return; } @@ -465,7 +465,7 @@ bool CefMenuManager::IsCustomContextMenuCommand(int command_id) { // Verify that the specific command ID was passed from the renderer process. if (!params_.custom_items.empty()) { for (size_t i = 0; i < params_.custom_items.size(); ++i) { - if (static_cast(params_.custom_items[i].action) == command_id) + if (static_cast(params_.custom_items[i]->action) == command_id) return true; } } diff --git a/libcef/browser/menu_model_impl.cc b/libcef/browser/menu_model_impl.cc index 341f1a72a..9192c0b83 100644 --- a/libcef/browser/menu_model_impl.cc +++ b/libcef/browser/menu_model_impl.cc @@ -12,7 +12,7 @@ #include "base/bind.h" #include "base/logging.h" -#include "content/public/common/menu_item.h" +#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/models/image_model.h" #include "ui/gfx/geometry/point.h" @@ -927,37 +927,40 @@ bool CefMenuModelImpl::VerifyRefCount() { return true; } -void CefMenuModelImpl::AddMenuItem(const content::MenuItem& menu_item) { +void CefMenuModelImpl::AddMenuItem( + const blink::mojom::CustomContextMenuItem& menu_item) { const int command_id = static_cast(menu_item.action); switch (menu_item.type) { - case content::MenuItem::OPTION: + case blink::mojom::CustomContextMenuItemType::kOption: AddItem(command_id, menu_item.label); break; - case content::MenuItem::CHECKABLE_OPTION: + case blink::mojom::CustomContextMenuItemType::kCheckableOption: AddCheckItem(command_id, menu_item.label); break; - case content::MenuItem::GROUP: + case blink::mojom::CustomContextMenuItemType::kGroup: AddRadioItem(command_id, menu_item.label, 0); break; - case content::MenuItem::SEPARATOR: + case blink::mojom::CustomContextMenuItemType::kSeparator: AddSeparator(); break; - case content::MenuItem::SUBMENU: { + case blink::mojom::CustomContextMenuItemType::kSubMenu: { CefRefPtr sub_menu = static_cast( AddSubMenu(command_id, menu_item.label).get()); for (size_t i = 0; i < menu_item.submenu.size(); ++i) - sub_menu->AddMenuItem(menu_item.submenu[i]); + sub_menu->AddMenuItem(*menu_item.submenu[i]); break; } } - if (!menu_item.enabled && menu_item.type != content::MenuItem::SEPARATOR) + if (!menu_item.enabled && + menu_item.type != blink::mojom::CustomContextMenuItemType::kSeparator) SetEnabled(command_id, false); if (menu_item.checked && - (menu_item.type == content::MenuItem::CHECKABLE_OPTION || - menu_item.type == content::MenuItem::GROUP)) { + (menu_item.type == + blink::mojom::CustomContextMenuItemType::kCheckableOption || + menu_item.type == blink::mojom::CustomContextMenuItemType::kGroup)) { SetChecked(command_id, true); } } diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index fa44fbbab..ebe197916 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -13,13 +13,10 @@ #include "include/cef_menu_model_delegate.h" #include "base/threading/platform_thread.h" +#include "third_party/blink/public/mojom/context_menu/context_menu.mojom-forward.h" #include "ui/base/models/menu_model.h" #include "ui/gfx/font_list.h" -namespace content { -struct MenuItem; -} - class CefMenuModelImpl : public CefMenuModel { public: class Delegate { @@ -176,7 +173,7 @@ class CefMenuModelImpl : public CefMenuModel { bool VerifyRefCount(); // Helper for adding custom menu items originating from the renderer process. - void AddMenuItem(const content::MenuItem& menu_item); + void AddMenuItem(const blink::mojom::CustomContextMenuItem& menu_item); ui::MenuModel* model() const { return model_.get(); } diff --git a/libcef/browser/native/cursor_util.cc b/libcef/browser/native/cursor_util.cc index b317bdcf5..64deff52d 100644 --- a/libcef/browser/native/cursor_util.cc +++ b/libcef/browser/native/cursor_util.cc @@ -7,6 +7,7 @@ #include "libcef/browser/browser_host_base.h" #include "content/common/cursors/webcursor.h" +#include "ui/base/cursor/cursor_factory.h" #include "ui/base/cursor/mojom/cursor_type.mojom.h" namespace cursor_util { @@ -34,19 +35,24 @@ bool OnCursorChange(CefBrowserHostBase* browser, const ui::Cursor& ui_cursor) { bool handled = false; #if defined(USE_AURA) - content::WebCursor web_cursor(ui_cursor); - CefCursorHandle platform_cursor; + ui::PlatformCursor image_cursor = nullptr; + if (ui_cursor.type() == ui::mojom::CursorType::kCustom) { - // |web_cursor| owns the resulting |platform_cursor|. - platform_cursor = - cursor_util::ToCursorHandle(web_cursor.GetPlatformCursor(ui_cursor)); + image_cursor = ui::CursorFactory::GetInstance()->CreateImageCursor( + ui::mojom::CursorType::kCustom, ui_cursor.custom_bitmap(), + ui_cursor.custom_hotspot()); + platform_cursor = cursor_util::ToCursorHandle(image_cursor); } else { platform_cursor = cursor_util::GetPlatformCursor(ui_cursor.type()); } handled = handler->OnCursorChange(browser, platform_cursor, cursor_type, custom_cursor_info); + + if (image_cursor) { + ui::CursorFactory::GetInstance()->UnrefImageCursor(image_cursor); + } #elif defined(OS_MAC) // |web_cursor| owns the resulting |native_cursor|. content::WebCursor web_cursor(ui_cursor); diff --git a/libcef/browser/native/cursor_util_win.cc b/libcef/browser/native/cursor_util_win.cc index 39d95328a..112b5f6c6 100644 --- a/libcef/browser/native/cursor_util_win.cc +++ b/libcef/browser/native/cursor_util_win.cc @@ -9,6 +9,7 @@ #include "libcef/common/app_manager.h" #include "ui/base/cursor/mojom/cursor_type.mojom.h" +#include "ui/base/cursor/win/win_cursor.h" #include "ui/resources/grit/ui_unscaled_resources.h" namespace cursor_util { @@ -152,7 +153,7 @@ cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) { } cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor) { - return cursor; + return static_cast(cursor)->hcursor(); } } // namespace cursor_util diff --git a/libcef/browser/native/native_menu_win.cc b/libcef/browser/native/native_menu_win.cc index 6b54369cb..43a23f778 100644 --- a/libcef/browser/native/native_menu_win.cc +++ b/libcef/browser/native/native_menu_win.cc @@ -304,7 +304,7 @@ class CefNativeMenuWin::MenuHostWindow { DCHECK(type != ui::MenuModel::TYPE_CHECK); std::unique_ptr canvas = skia::CreatePlatformCanvas( skia_icon.width(), skia_icon.height(), false); - canvas->drawBitmap(*skia_icon.bitmap(), 0, 0); + canvas->drawImage(skia_icon.bitmap()->asImage(), 0, 0); DrawToNativeContext( canvas.get(), dc, draw_item_struct->rcItem.left + kItemLeftMargin, draw_item_struct->rcItem.top + diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index da5449010..2db6ce212 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -22,6 +22,9 @@ #include "base/logging.h" #include "base/memory/weak_ptr.h" #include "base/strings/string_util.h" +#include "content/browser/renderer_host/render_frame_host_impl.h" +#include "content/browser/storage_partition_impl.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/global_request_id.h" #include "content/public/browser/render_frame_host.h" #include "net/base/mime_util.h" @@ -49,6 +52,10 @@ int32_t MakeRequestID() { return --request_id; } +bool IsValidRequestID(int32_t request_id) { + return request_id < kInitialRequestID; +} + // Manages the mapping of request IDs to request objects. class RequestManager { public: @@ -190,9 +197,16 @@ class CefBrowserURLRequest::Context CefBrowserContext* cef_browser_context = request_context_impl->GetBrowserContext(); DCHECK(cef_browser_context); + auto browser_context = cef_browser_context->AsBrowserContext(); int render_frame_id = MSG_ROUTING_NONE; scoped_refptr loader_factory_getter; + + // Used to route authentication and certificate callbacks through the + // associated StoragePartition instance. + mojo::PendingRemote + auth_cert_observer; + if (frame) { // The request will be associated with this frame/browser if it's valid, // otherwise the request will be canceled. @@ -207,26 +221,35 @@ class CefBrowserURLRequest::Context // network::mojom::kBrowserProcessId (value 0) for these requests. render_frame_id = rfh->GetFrameTreeNodeId(); - loader_factory_getter = net_service::URLLoaderFactoryGetter::Create( - rfh, cef_browser_context->AsBrowserContext()); + loader_factory_getter = + net_service::URLLoaderFactoryGetter::Create(rfh, browser_context); + auth_cert_observer = static_cast(rfh) + ->CreateAuthAndCertObserver(); } } else { - loader_factory_getter = net_service::URLLoaderFactoryGetter::Create( - nullptr, cef_browser_context->AsBrowserContext()); + loader_factory_getter = + net_service::URLLoaderFactoryGetter::Create(nullptr, browser_context); + auth_cert_observer = + static_cast( + content::BrowserContext::GetDefaultStoragePartition( + browser_context)) + ->CreateAuthCertObserverForServiceWorker(); } task_runner->PostTask( FROM_HERE, base::BindOnce( &CefBrowserURLRequest::Context::ContinueOnOriginatingThread, self, - render_frame_id, MakeRequestID(), loader_factory_getter)); + render_frame_id, MakeRequestID(), loader_factory_getter, + std::move(auth_cert_observer))); } void ContinueOnOriginatingThread( int render_frame_id, int32_t request_id, - scoped_refptr - loader_factory_getter) { + scoped_refptr loader_factory_getter, + mojo::PendingRemote + auth_cert_observer) { DCHECK(CalledOnValidThread()); // The request may have been canceled. @@ -268,6 +291,13 @@ class CefBrowserURLRequest::Context net::SiteForCookies::FromOrigin(*resource_request->request_initiator); } + if (auth_cert_observer) { + resource_request->trusted_params = + network::ResourceRequest::TrustedParams(); + resource_request->trusted_params->auth_cert_observer = + std::move(auth_cert_observer); + } + // SimpleURLLoader is picky about the body contents. Try to populate them // correctly below. auto request_body = resource_request->request_body; @@ -573,17 +603,17 @@ class CefBrowserURLRequest::Context // static base::Optional CefBrowserURLRequest::FromRequestID(int32_t request_id) { - return g_manager.Get().Get(request_id); + if (IsValidRequestID(request_id)) { + return g_manager.Get().Get(request_id); + } + return base::nullopt; } // static base::Optional CefBrowserURLRequest::FromRequestID( const content::GlobalRequestID& request_id) { - if (request_id.child_id == network::mojom::kBrowserProcessId) { - return FromRequestID(request_id.request_id); - } - return base::nullopt; + return FromRequestID(request_id.request_id); } CefBrowserURLRequest::CefBrowserURLRequest( diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index 14e044008..f6ab0b8cd 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -36,6 +36,10 @@ net::CookieOptions GetCookieOptions(const network::ResourceRequest& request) { bool should_treat_as_first_party = request.url.SchemeIsCryptographic() && request.site_for_cookies.scheme() == content::kChromeUIScheme; + bool is_main_frame_navigation = + request.trusted_params && + request.trusted_params->isolation_info.request_type() == + net::IsolationInfo::RequestType::kMainFrame; // Match the logic from URLRequestHttpJob::AddCookieHeaderAndStart. net::CookieOptions options; @@ -43,7 +47,8 @@ net::CookieOptions GetCookieOptions(const network::ResourceRequest& request) { options.set_same_site_cookie_context( net::cookie_util::ComputeSameSiteContextForRequest( request.method, request.url, request.site_for_cookies, - request.request_initiator, should_treat_as_first_party)); + request.request_initiator, is_main_frame_navigation, + should_treat_as_first_party)); return options; } diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index c3ae94ebc..36c6cf8c1 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -19,6 +19,7 @@ #include "content/public/browser/resource_context.h" #include "content/public/browser/web_contents.h" #include "mojo/public/cpp/base/big_buffer.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "net/http/http_status_code.h" #include "net/url_request/redirect_util.h" #include "net/url_request/url_request.h" @@ -274,7 +275,7 @@ class InterceptedRequest : public network::mojom::URLLoader, void OnURLLoaderError(uint32_t custom_reason, const std::string& description); // Call OnComplete on |target_client_|. If |wait_for_loader_error| is true - // then this object will wait for |proxied_loader_binding_| to have a + // then this object will wait for |proxied_loader_receiver_| to have a // connection error before destructing. void CallOnComplete(const network::URLLoaderCompletionStatus& status, bool wait_for_loader_error); @@ -319,12 +320,13 @@ class InterceptedRequest : public network::mojom::URLLoader, GURL header_client_redirect_url_; const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; - mojo::Binding proxied_loader_binding_; - network::mojom::URLLoaderClientPtr target_client_; + mojo::Receiver proxied_loader_receiver_; + mojo::Remote target_client_; - mojo::Binding proxied_client_binding_; - network::mojom::URLLoaderPtr target_loader_; - network::mojom::URLLoaderFactoryPtr target_factory_; + mojo::Receiver proxied_client_receiver_{ + this}; + mojo::Remote target_loader_; + mojo::Remote target_factory_; bool current_request_uses_header_client_ = false; OnHeadersReceivedCallback on_headers_received_callback_; @@ -387,9 +389,8 @@ InterceptedRequest::InterceptedRequest( options_(options), request_(request), traffic_annotation_(traffic_annotation), - proxied_loader_binding_(this, std::move(loader_receiver)), + proxied_loader_receiver_(this, std::move(loader_receiver)), target_client_(std::move(client)), - proxied_client_binding_(this), target_factory_(std::move(target_factory)), weak_factory_(this) { status_ = network::URLLoaderCompletionStatus(net::OK); @@ -400,11 +401,10 @@ InterceptedRequest::InterceptedRequest( &removed_headers); // If there is a client error, clean up the request. - target_client_.set_connection_error_handler(base::BindOnce( + target_client_.set_disconnect_handler(base::BindOnce( &InterceptedRequest::OnURLLoaderClientError, base::Unretained(this))); - proxied_loader_binding_.set_connection_error_with_reason_handler( - base::BindOnce(&InterceptedRequest::OnURLLoaderError, - base::Unretained(this))); + proxied_loader_receiver_.set_disconnect_with_reason_handler(base::BindOnce( + &InterceptedRequest::OnURLLoaderError, base::Unretained(this))); } InterceptedRequest::~InterceptedRequest() { @@ -418,8 +418,8 @@ InterceptedRequest::~InterceptedRequest() { void InterceptedRequest::Restart() { stream_loader_ = nullptr; - if (proxied_client_binding_.is_bound()) { - proxied_client_binding_.Unbind(); + if (proxied_client_receiver_.is_bound()) { + proxied_client_receiver_.reset(); target_loader_.reset(); } @@ -427,7 +427,7 @@ void InterceptedRequest::Restart() { ignore_result(header_client_receiver_.Unbind()); current_request_uses_header_client_ = - !!factory_->url_loader_header_client_receiver_; + factory_->url_loader_header_client_receiver_.is_bound(); if (request_.request_initiator && network::cors::ShouldCheckCors(request_.url, request_.request_initiator, @@ -501,8 +501,8 @@ void InterceptedRequest::OnBeforeSendHeaders( std::move(callback).Run(net::OK, base::nullopt); // Resume handling of client messages after continuing from an async callback. - if (proxied_client_binding_) - proxied_client_binding_.ResumeIncomingMethodCallProcessing(); + if (proxied_client_receiver_.is_bound()) + proxied_client_receiver_.Resume(); } void InterceptedRequest::OnHeadersReceived( @@ -661,7 +661,7 @@ void InterceptedRequest::FollowRedirect( &removed_headers); // If |OnURLLoaderClientError| was called then we're just waiting for the - // connection error handler of |proxied_loader_binding_|. Don't restart the + // connection error handler of |proxied_loader_receiver_|. Don't restart the // job since that'll create another URLLoader. if (!target_client_) return; @@ -772,32 +772,26 @@ void InterceptedRequest::InterceptResponseReceived( void InterceptedRequest::ContinueAfterIntercept() { if (!target_loader_ && target_factory_) { - network::mojom::URLLoaderClientPtr proxied_client; - proxied_client_binding_.Bind(mojo::MakeRequest(&proxied_client)); - // Even if this request does not use the header client, future redirects // might, so we need to set the option on the loader. uint32_t options = options_ | network::mojom::kURLLoadOptionUseHeaderClient; target_factory_->CreateLoaderAndStart( - mojo::MakeRequest(&target_loader_), id_.routing_id(), id_.request_id(), - options, request_, proxied_client.PassInterface(), traffic_annotation_); + target_loader_.BindNewPipeAndPassReceiver(), id_.routing_id(), + id_.request_id(), options, request_, + proxied_client_receiver_.BindNewPipeAndPassRemote(), + traffic_annotation_); } } void InterceptedRequest::ContinueAfterInterceptWithOverride( std::unique_ptr response) { - network::mojom::URLLoaderClientPtr proxied_client; - proxied_client_binding_.Bind(mojo::MakeRequest(&proxied_client)); - // StreamReaderURLLoader will synthesize TrustedHeaderClient callbacks to // avoid having Set-Cookie headers stripped by the IPC layer. current_request_uses_header_client_ = true; - network::mojom::TrustedHeaderClientPtr header_client; - header_client_receiver_.Bind(mojo::MakeRequest(&header_client)); stream_loader_ = new StreamReaderURLLoader( - id_, request_, std::move(proxied_client), std::move(header_client), - traffic_annotation_, + id_, request_, proxied_client_receiver_.BindNewPipeAndPassRemote(), + header_client_receiver_.BindNewPipeAndPassRemote(), traffic_annotation_, std::make_unique(std::move(response), weak_factory_.GetWeakPtr())); stream_loader_->Start(); @@ -820,8 +814,8 @@ void InterceptedRequest::HandleResponseOrRedirectHeaders( id_, request_, redirect_url_, headers.get()); // Pause handling of client messages before waiting on an async callback. - if (proxied_client_binding_) - proxied_client_binding_.PauseIncomingMethodCallProcessing(); + if (proxied_client_receiver_.is_bound()) + proxied_client_receiver_.Pause(); factory_->request_handler_->OnRequestResponse( id_, &request_, headers.get(), redirect_info, @@ -872,8 +866,8 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) { redirect_url_ = GURL(); // Resume handling of client messages after continuing from an async callback. - if (proxied_client_binding_) - proxied_client_binding_.ResumeIncomingMethodCallProcessing(); + if (proxied_client_receiver_.is_bound()) + proxied_client_receiver_.Resume(); } net::RedirectInfo InterceptedRequest::MakeRedirectResponseAndInfo( @@ -918,8 +912,8 @@ void InterceptedRequest::ContinueToBeforeRedirect( redirect_url_ = GURL(); // Resume handling of client messages after continuing from an async callback. - if (proxied_client_binding_) - proxied_client_binding_.ResumeIncomingMethodCallProcessing(); + if (proxied_client_receiver_.is_bound()) + proxied_client_receiver_.Resume(); const auto original_url = request_.url; const auto original_method = request_.method; @@ -1023,8 +1017,8 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) { // Resume handling of client messages after continuing from an async // callback. - if (proxied_client_binding_) - proxied_client_binding_.ResumeIncomingMethodCallProcessing(); + if (proxied_client_receiver_.is_bound()) + proxied_client_receiver_.Resume(); target_client_->OnReceiveResponse(std::move(current_response_)); } @@ -1086,9 +1080,9 @@ void InterceptedRequest::CallOnComplete( if (target_client_) target_client_->OnComplete(status); - if (proxied_loader_binding_ && + if (proxied_loader_receiver_.is_bound() && (wait_for_loader_error && !got_loader_error_)) { - // Don't delete |this| yet, in case the |proxied_loader_binding_|'s + // Don't delete |this| yet, in case the |proxied_loader_receiver_|'s // error_handler is called with a reason to indicate an error which we want // to send to the client bridge. Also reset |target_client_| so we don't // get its error_handler called and then delete |this|. @@ -1096,7 +1090,7 @@ void InterceptedRequest::CallOnComplete( // Since the original client is gone no need to continue loading the // request. - proxied_client_binding_.Close(); + proxied_client_receiver_.reset(); header_client_receiver_.reset(); target_loader_.reset(); @@ -1198,11 +1192,11 @@ ProxyURLLoaderFactory::ProxyURLLoaderFactory( // Actual creation of the factory. if (target_factory_info) { target_factory_.Bind(std::move(target_factory_info)); - target_factory_.set_connection_error_handler(base::BindOnce( + target_factory_.set_disconnect_handler(base::BindOnce( &ProxyURLLoaderFactory::OnTargetFactoryError, base::Unretained(this))); } - proxy_bindings_.AddBinding(this, std::move(factory_receiver)); - proxy_bindings_.set_connection_error_handler(base::BindRepeating( + proxy_receivers_.Add(this, std::move(factory_receiver)); + proxy_receivers_.set_disconnect_handler(base::BindRepeating( &ProxyURLLoaderFactory::OnProxyBindingError, base::Unretained(this))); if (header_client_receiver) @@ -1330,7 +1324,7 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart( void ProxyURLLoaderFactory::Clone( mojo::PendingReceiver factory) { CEF_REQUIRE_IOT(); - proxy_bindings_.AddBinding(this, std::move(factory)); + proxy_receivers_.Add(this, std::move(factory)); } void ProxyURLLoaderFactory::OnLoaderCreated( @@ -1352,13 +1346,13 @@ void ProxyURLLoaderFactory::OnLoaderForCorsPreflightCreated( void ProxyURLLoaderFactory::OnTargetFactoryError() { // Stop calls to CreateLoaderAndStart() when |target_factory_| is invalid. target_factory_.reset(); - proxy_bindings_.CloseAllBindings(); + proxy_receivers_.Clear(); MaybeDestroySelf(); } void ProxyURLLoaderFactory::OnProxyBindingError() { - if (proxy_bindings_.empty()) + if (proxy_receivers_.empty()) target_factory_.reset(); MaybeDestroySelf(); diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index 758e81a17..dc384000b 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -16,8 +16,8 @@ #include "base/strings/string_piece.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/web_contents.h" -#include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/receiver_set.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" @@ -203,9 +203,9 @@ class ProxyURLLoaderFactory void RemoveRequest(InterceptedRequest* request); void MaybeDestroySelf(); - mojo::BindingSet proxy_bindings_; - network::mojom::URLLoaderFactoryPtr target_factory_; - mojo::Binding + mojo::ReceiverSet proxy_receivers_; + mojo::Remote target_factory_; + mojo::Receiver url_loader_header_client_receiver_{this}; std::unique_ptr request_handler_; diff --git a/libcef/browser/net_service/response_filter_wrapper.cc b/libcef/browser/net_service/response_filter_wrapper.cc index ec81b92f3..7c189a259 100644 --- a/libcef/browser/net_service/response_filter_wrapper.cc +++ b/libcef/browser/net_service/response_filter_wrapper.cc @@ -68,7 +68,7 @@ bool ResponseFilterWrapper::CreateOutputHandle( } mojo::ScopedDataPipeProducerHandle forwarding_handle; - if (CreateDataPipe(nullptr, &forwarding_handle, output_handle) != + if (CreateDataPipe(nullptr, forwarding_handle, *output_handle) != MOJO_RESULT_OK) { *output_handle = std::move(source_handle_); return false; diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index d5bc082f3..56de5ec99 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -480,8 +480,8 @@ std::ostream& operator<<(std::ostream& out, const RequestId& request_id) { StreamReaderURLLoader::StreamReaderURLLoader( const RequestId& request_id, const network::ResourceRequest& request, - network::mojom::URLLoaderClientPtr client, - network::mojom::TrustedHeaderClientPtr header_client, + mojo::PendingRemote client, + mojo::PendingRemote header_client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, std::unique_ptr response_delegate) : request_id_(request_id), @@ -496,7 +496,7 @@ StreamReaderURLLoader::StreamReaderURLLoader( weak_factory_(this) { DCHECK(response_delegate_); // If there is a client error, clean up the request. - client_.set_connection_error_handler( + client_.set_disconnect_handler( base::BindOnce(&StreamReaderURLLoader::RequestComplete, weak_factory_.GetWeakPtr(), net::ERR_ABORTED)); @@ -734,8 +734,8 @@ void StreamReaderURLLoader::SendBody() { DCHECK(thread_checker_.CalledOnValidThread()); mojo::ScopedDataPipeConsumerHandle consumer_handle; - if (CreateDataPipe(nullptr /*options*/, &producer_handle_, - &consumer_handle) != MOJO_RESULT_OK) { + if (CreateDataPipe(nullptr /*options*/, producer_handle_, consumer_handle) != + MOJO_RESULT_OK) { RequestComplete(net::ERR_FAILED); return; } diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 2080ce57f..b54893fbd 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -160,8 +160,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { StreamReaderURLLoader( const RequestId& request_id, const network::ResourceRequest& request, - network::mojom::URLLoaderClientPtr client, - network::mojom::TrustedHeaderClientPtr header_client, + mojo::PendingRemote client, + mojo::PendingRemote header_client, const net::MutableNetworkTrafficAnnotationTag& traffic_annotation, std::unique_ptr response_delegate); ~StreamReaderURLLoader() override; @@ -214,8 +214,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { net::HttpByteRange byte_range_; network::ResourceRequest request_; - network::mojom::URLLoaderClientPtr client_; - network::mojom::TrustedHeaderClientPtr header_client_; + mojo::Remote client_; + mojo::Remote header_client_; const net::MutableNetworkTrafficAnnotationTag traffic_annotation_; std::unique_ptr response_delegate_; scoped_refptr input_stream_reader_; diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 661dc5d66..f8497b339 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -38,7 +38,6 @@ #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_input_event_router.h" #include "content/common/content_switches_internal.h" -#include "content/common/input_messages.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/context_factory.h" @@ -101,8 +100,9 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { return *view_->GetBackgroundColor(); } - void OnFrameTokenChanged(uint32_t frame_token) override { - view_->render_widget_host()->DidProcessFrame(frame_token); + void OnFrameTokenChanged(uint32_t frame_token, + base::TimeTicks activation_time) override { + view_->render_widget_host()->DidProcessFrame(frame_token, activation_time); } float GetDeviceScaleFactor() const override { @@ -207,7 +207,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( DCHECK(render_widget_host_); DCHECK(!render_widget_host_->GetView()); - current_device_scale_factor_ = kDefaultScaleFactor; + set_current_device_scale_factor(kDefaultScaleFactor); if (parent_host_view_) { browser_impl_ = parent_host_view_->browser_impl(); @@ -667,7 +667,7 @@ void CefRenderWidgetHostViewOSR::SetTooltipText( gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), - current_device_scale_factor_); + current_device_scale_factor()); } uint32_t CefRenderWidgetHostViewOSR::GetCaptureSequenceNumber() const { @@ -903,7 +903,8 @@ void CefRenderWidgetHostViewOSR::OnFrameComplete( // TODO(cef): is there something we need to track with this notification? } -void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation() { +void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation( + base::TimeTicks activation_time) { auto metadata = host_->render_frame_metadata_provider()->LastRenderFrameMetadata(); @@ -1393,7 +1394,7 @@ void CefRenderWidgetHostViewOSR::UpdateFrameRate() { gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() { return gfx::ScaleToCeiledSize(GetViewBounds().size(), - current_device_scale_factor_); + current_device_scale_factor()); } #if defined(OS_MAC) @@ -1480,18 +1481,21 @@ bool CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() { DCHECK(!hold_resize_); const float new_scale_factor = ::GetDeviceScaleFactor(browser_impl_.get()); - if (new_scale_factor == current_device_scale_factor_) + if (new_scale_factor == current_device_scale_factor()) return false; - current_device_scale_factor_ = new_scale_factor; + set_current_device_scale_factor(new_scale_factor); // Notify the guest hosts if any. for (auto guest_host_view : guest_host_views_) { content::RenderWidgetHostImpl* rwhi = guest_host_view->render_widget_host(); if (!rwhi) continue; - if (rwhi->GetView()) - rwhi->GetView()->set_current_device_scale_factor(new_scale_factor); + auto guest_view_osr = + static_cast(rwhi->GetView()); + if (guest_view_osr) { + guest_view_osr->set_current_device_scale_factor(new_scale_factor); + } } return true; @@ -1524,7 +1528,7 @@ bool CefRenderWidgetHostViewOSR::SetRootLayerSize(bool force) { if (compositor_) { compositor_local_surface_id_allocator_.GenerateId(); compositor_->SetScaleAndSize( - current_device_scale_factor_, SizeInPixels(), + current_device_scale_factor(), SizeInPixels(), compositor_local_surface_id_allocator_.GetCurrentLocalSurfaceId()); } diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 10568d9fd..ff0af0ef7 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -183,7 +183,8 @@ class CefRenderWidgetHostViewOSR // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( const cc::RenderFrameMetadata& metadata) override {} - void OnRenderFrameMetadataChangedAfterActivation() override; + void OnRenderFrameMetadataChangedAfterActivation( + base::TimeTicks activation_time) override; void OnRenderFrameSubmission() override {} void OnLocalSurfaceIdChanged( const cc::RenderFrameMetadata& metadata) override {} diff --git a/libcef/browser/osr/synthetic_gesture_target_osr.cc b/libcef/browser/osr/synthetic_gesture_target_osr.cc index a273fea28..1648d5344 100644 --- a/libcef/browser/osr/synthetic_gesture_target_osr.cc +++ b/libcef/browser/osr/synthetic_gesture_target_osr.cc @@ -41,9 +41,9 @@ void CefSyntheticGestureTargetOSR::DispatchWebMouseEventToPlatform( latency_info); } -content::SyntheticGestureParams::GestureSourceType +content::mojom::GestureSourceType CefSyntheticGestureTargetOSR::GetDefaultSyntheticGestureSourceType() const { - return content::SyntheticGestureParams::MOUSE_INPUT; + return content::mojom::GestureSourceType::kMouseInput; } float CefSyntheticGestureTargetOSR::GetTouchSlopInDips() const { diff --git a/libcef/browser/osr/synthetic_gesture_target_osr.h b/libcef/browser/osr/synthetic_gesture_target_osr.h index f6471a563..9c970d4ed 100644 --- a/libcef/browser/osr/synthetic_gesture_target_osr.h +++ b/libcef/browser/osr/synthetic_gesture_target_osr.h @@ -29,8 +29,8 @@ class CefSyntheticGestureTargetOSR const ui::LatencyInfo& latency_info) override; // SyntheticGestureTarget: - content::SyntheticGestureParams::GestureSourceType - GetDefaultSyntheticGestureSourceType() const override; + content::mojom::GestureSourceType GetDefaultSyntheticGestureSourceType() + const override; float GetTouchSlopInDips() const override; float GetSpanSlopInDips() const override; float GetMinScalingSpanInDips() const override; diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 42ca4a725..7e74f640f 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -182,7 +182,7 @@ void SetExtensionPrefs(content::RenderViewHost* rvh, // correct scheme. Without this check, chrome-guest:// schemes used by webview // tags as well as hosts that happen to match the id of an installed extension // would get the wrong preferences. - const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL(); + const GURL& site_url = rvh->GetMainFrame()->GetSiteInstance()->GetSiteURL(); if (!site_url.SchemeIs(extensions::kExtensionScheme)) return; @@ -416,8 +416,8 @@ void PopulateWebPreferences(content::RenderViewHost* rvh, break; } - UpdatePreferredColorScheme(&web, rvh->GetSiteInstance()->GetSiteURL(), - native_theme); + UpdatePreferredColorScheme( + &web, rvh->GetMainFrame()->GetSiteInstance()->GetSiteURL(), native_theme); // Set preferences based on the extension. SetExtensionPrefs(rvh, web); diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index 9ad5a3098..b53d169d8 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -22,12 +22,10 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/printing/print_preview_dialog_controller.h" -#include "chrome/browser/printing/print_preview_message_handler.h" #include "chrome/browser/printing/printer_query.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" #include "components/printing/common/print.mojom.h" -#include "components/printing/common/print_messages.h" #include "content/browser/download/download_manager_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_task_traits.h" @@ -178,9 +176,7 @@ struct CefPrintViewManager::PdfPrintState { }; CefPrintViewManager::CefPrintViewManager(content::WebContents* web_contents) - : PrintViewManager(web_contents) { - PrintPreviewMessageHandler::CreateForWebContents(web_contents); -} + : PrintViewManager(web_contents) {} CefPrintViewManager::~CefPrintViewManager() { TerminatePdfPrintJob(); @@ -209,7 +205,13 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh, FillInDictionaryFromPdfPrintSettings(settings, ++next_pdf_request_id_, pdf_print_state_->settings_); - GetPrintRenderFrame(rfh)->InitiatePrintPreview({}, !!settings.selection_only); + auto& print_render_frame = GetPrintRenderFrame(rfh); + if (!pdf_print_receiver_.is_bound()) { + print_render_frame->SetPrintPreviewUI( + pdf_print_receiver_.BindNewEndpointAndPassRemote()); + } + + print_render_frame->InitiatePrintPreview({}, !!settings.selection_only); return true; } @@ -243,6 +245,59 @@ void CefPrintViewManager::RequestPrintPreview( ->PrintPreview(pdf_print_state_->settings_.Clone()); } +void CefPrintViewManager::CheckForCancel(int32_t preview_ui_id, + int32_t request_id, + CheckForCancelCallback callback) { + if (!pdf_print_state_) { + return PrintViewManager::CheckForCancel(preview_ui_id, request_id, + std::move(callback)); + } + + std::move(callback).Run(/*cancel=*/false); +} + +void CefPrintViewManager::MetafileReadyForPrinting( + mojom::DidPreviewDocumentParamsPtr params, + int32_t request_id) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + StopWorker(params->document_cookie); + + if (!pdf_print_state_) + return; + + GetPrintRenderFrame(pdf_print_state_->printing_rfh_) + ->OnPrintPreviewDialogClosed(); + + auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion( + params->content->metafile_data_region); + if (!shared_buf) { + TerminatePdfPrintJob(); + return; + } + + const base::FilePath output_path = pdf_print_state_->output_path_; + const PdfPrintCallback print_callback = pdf_print_state_->callback_; + + // Reset state information. + pdf_print_state_.reset(); + pdf_print_receiver_.reset(); + + // Save the PDF file to disk and then execute the callback. + CEF_POST_USER_VISIBLE_TASK( + base::Bind(&SavePdfFile, shared_buf, output_path, print_callback)); +} + +void CefPrintViewManager::PrintPreviewFailed(int32_t document_cookie, + int32_t request_id) { + TerminatePdfPrintJob(); +} + +void CefPrintViewManager::PrintPreviewCancelled(int32_t document_cookie, + int32_t request_id) { + // Should never be canceled by CheckForCancel(). + NOTREACHED(); +} + void CefPrintViewManager::RenderFrameDeleted( content::RenderFrameHost* render_frame_host) { if (pdf_print_state_ && @@ -262,25 +317,6 @@ void CefPrintViewManager::RenderProcessGone(base::TerminationStatus status) { PrintViewManager::RenderProcessGone(status); } -bool CefPrintViewManager::OnMessageReceived( - const IPC::Message& message, - content::RenderFrameHost* render_frame_host) { - bool handled = true; - if (!pdf_print_state_) { - return PrintViewManager::OnMessageReceived(message, render_frame_host); - } - - IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefPrintViewManager, message, - render_frame_host) - IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting, - OnMetafileReadyForPrinting_PrintToPdf) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - - return handled || - PrintViewManager::OnMessageReceived(message, render_frame_host); -} - // static void CefPrintViewManager::CreateForWebContents(content::WebContents* contents) { DCHECK(contents); @@ -306,42 +342,6 @@ const CefPrintViewManager* CefPrintViewManager::FromWebContents( contents->GetUserData(PrintViewManager::UserDataKey())); } -void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf( - content::RenderFrameHost* rfh, - const mojom::DidPreviewDocumentParams& params, - const mojom::PreviewIds& ids) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - StopWorker(params.document_cookie); - - if (!pdf_print_state_) - return; - - DCHECK_EQ(pdf_print_state_->printing_rfh_, rfh); - - mojo::AssociatedRemote - print_render_frame_remote; - rfh->GetRemoteAssociatedInterfaces()->GetInterface( - &print_render_frame_remote); - print_render_frame_remote->OnPrintPreviewDialogClosed(); - - auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion( - params.content->metafile_data_region); - if (!shared_buf) { - TerminatePdfPrintJob(); - return; - } - - const base::FilePath output_path = pdf_print_state_->output_path_; - const PdfPrintCallback print_callback = pdf_print_state_->callback_; - - // Reset state information. - pdf_print_state_.reset(); - - // Save the PDF file to disk and then execute the callback. - CEF_POST_USER_VISIBLE_TASK( - base::Bind(&SavePdfFile, shared_buf, output_path, print_callback)); -} - void CefPrintViewManager::TerminatePdfPrintJob() { DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!pdf_print_state_) @@ -355,6 +355,7 @@ void CefPrintViewManager::TerminatePdfPrintJob() { // Reset state information. pdf_print_state_.reset(); + pdf_print_receiver_.reset(); } } // namespace printing diff --git a/libcef/browser/printing/print_view_manager.h b/libcef/browser/printing/print_view_manager.h index 5706242c7..31b9c260f 100644 --- a/libcef/browser/printing/print_view_manager.h +++ b/libcef/browser/printing/print_view_manager.h @@ -26,7 +26,8 @@ struct PrintHostMsg_RequestPrintPreview_Params; namespace printing { // CEF handler for print commands. -class CefPrintViewManager : public PrintViewManager { +class CefPrintViewManager : public PrintViewManager, + public mojom::PrintPreviewUI { public: ~CefPrintViewManager() override; @@ -44,13 +45,35 @@ class CefPrintViewManager : public PrintViewManager { GetDefaultPrintSettingsCallback callback) override; void DidShowPrintDialog() override; void RequestPrintPreview(mojom::RequestPrintPreviewParamsPtr params) override; + void CheckForCancel(int32_t preview_ui_id, + int32_t request_id, + CheckForCancelCallback callback) override; + + // printing::mojo::PrintPreviewUI methods: + void SetOptionsFromDocument(const mojom::OptionsFromDocumentParamsPtr params, + int32_t request_id) override {} + void DidPrepareDocumentForPreview(int32_t document_cookie, + int32_t request_id) override {} + void DidPreviewPage(mojom::DidPreviewPageParamsPtr params, + int32_t request_id) override {} + void MetafileReadyForPrinting(mojom::DidPreviewDocumentParamsPtr params, + int32_t request_id) override; + void PrintPreviewFailed(int32_t document_cookie, int32_t request_id) override; + void PrintPreviewCancelled(int32_t document_cookie, + int32_t request_id) override; + void PrinterSettingsInvalid(int32_t document_cookie, + int32_t request_id) override {} + void DidGetDefaultPageLayout(mojom::PageSizeMarginsPtr page_layout_in_points, + const gfx::Rect& printable_area_in_points, + bool has_custom_page_size_style, + int32_t request_id) override {} + void DidStartPreview(mojom::DidStartPreviewParamsPtr params, + int32_t request_id) override {} // content::WebContentsObserver methods: void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; void NavigationStopped() override; void RenderProcessGone(base::TerminationStatus status) override; - bool OnMessageReceived(const IPC::Message& message, - content::RenderFrameHost* render_frame_host) override; // Inline versions of the content::WebContentsUserData methods to avoid // ambiguous warnings due to the PrintViewManager base class also extending @@ -63,17 +86,13 @@ class CefPrintViewManager : public PrintViewManager { private: explicit CefPrintViewManager(content::WebContents* web_contents); - // IPC Message handlers. - void OnMetafileReadyForPrinting_PrintToPdf( - content::RenderFrameHost* rfh, - const mojom::DidPreviewDocumentParams& params, - const mojom::PreviewIds& ids); void TerminatePdfPrintJob(); // Used for printing to PDF. Only accessed on the browser process UI thread. int next_pdf_request_id_ = content::RenderFrameHost::kNoFrameTreeNodeId; struct PdfPrintState; std::unique_ptr pdf_print_state_; + mojo::AssociatedReceiver pdf_print_receiver_{this}; DISALLOW_COPY_AND_ASSIGN(CefPrintViewManager); }; diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index dfabb99e9..630b5bd25 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -18,7 +18,6 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/plugin_service.h" #include "content/public/browser/ssl_host_state_delegate.h" -#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/cpp/resolve_host_client_base.h" diff --git a/libcef/common/alloy/alloy_main_delegate.cc b/libcef/common/alloy/alloy_main_delegate.cc index 6884682bd..11ef91a9e 100644 --- a/libcef/common/alloy/alloy_main_delegate.cc +++ b/libcef/common/alloy/alloy_main_delegate.cc @@ -30,6 +30,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/utility/chrome_content_utility_client.h" #include "components/content_settings/core/common/content_settings_pattern.h" +#include "components/embedder_support/switches.h" #include "components/viz/common/features.h" #include "content/browser/browser_process_sub_thread.h" #include "content/public/common/content_features.h" @@ -147,7 +148,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) { command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox); if (settings_->user_agent.length > 0) { - command_line->AppendSwitchASCII(switches::kUserAgent, + command_line->AppendSwitchASCII(embedder_support::kUserAgent, CefString(&settings_->user_agent)); } else if (settings_->product_version.length > 0) { command_line->AppendSwitchASCII(switches::kProductVersion, diff --git a/libcef/common/crash_reporter_client.cc b/libcef/common/crash_reporter_client.cc index 20c58b236..23ff7c3cf 100644 --- a/libcef/common/crash_reporter_client.cc +++ b/libcef/common/crash_reporter_client.cc @@ -305,7 +305,7 @@ bool GetDefaultUserDataDirectory(std::wstring* result, // This environment variable should be set on Windows Vista and later // (https://msdn.microsoft.com/library/windows/desktop/dd378457.aspx). std::wstring user_data_dir = - install_static::GetEnvironmentString16(L"LOCALAPPDATA"); + install_static::GetEnvironmentString(L"LOCALAPPDATA"); if (user_data_dir.empty()) { // LOCALAPPDATA was not set; fallback to the temporary files path. @@ -558,11 +558,11 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() { !g_crash_reporter_client->HasCrashExternalHandler(); if (embedded_handler) { crash_reporter::InitializeCrashpadWithEmbeddedHandler( - process_type.empty(), install_static::UTF16ToUTF8(process_type), + process_type.empty(), install_static::WideToUTF8(process_type), std::string(), base::FilePath()); } else { crash_reporter::InitializeCrashpad( - process_type.empty(), install_static::UTF16ToUTF8(process_type)); + process_type.empty(), install_static::WideToUTF8(process_type)); } } } @@ -571,8 +571,7 @@ bool CefCrashReporterClient::GetAlternativeCrashDumpLocation( base::string16* crash_dir) { // By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate // location to write breakpad crash dumps can be set. - *crash_dir = - install_static::GetEnvironmentString16(L"BREAKPAD_DUMP_LOCATION"); + *crash_dir = install_static::GetEnvironmentString(L"BREAKPAD_DUMP_LOCATION"); return !crash_dir->empty(); } @@ -701,14 +700,14 @@ void CefCrashReporterClient::GetCrashOptionalArguments( #if defined(OS_WIN) -base::string16 CefCrashReporterClient::GetCrashExternalHandler( - const base::string16& exe_dir) { +std::wstring CefCrashReporterClient::GetCrashExternalHandler( + const std::wstring& exe_dir) { if (external_handler_.empty()) return CrashReporterClient::GetCrashExternalHandler(exe_dir); if (isAbsolutePath(external_handler_)) - return base::UTF8ToUTF16(external_handler_); + return base::UTF8ToWide(external_handler_); return base::UTF8ToWide( - joinPath(base::UTF16ToUTF8(exe_dir), external_handler_)); + joinPath(base::WideToUTF8(exe_dir), external_handler_)); } bool CefCrashReporterClient::HasCrashExternalHandler() const { diff --git a/libcef/common/crash_reporter_client.h b/libcef/common/crash_reporter_client.h index 27141f910..bcd2586b3 100644 --- a/libcef/common/crash_reporter_client.h +++ b/libcef/common/crash_reporter_client.h @@ -79,8 +79,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient { void GetCrashOptionalArguments(std::vector* arguments) override; #if defined(OS_WIN) - base::string16 GetCrashExternalHandler( - const base::string16& exe_dir) override; + std::wstring GetCrashExternalHandler(const std::wstring& exe_dir) override; bool HasCrashExternalHandler() const; #endif diff --git a/libcef/common/extensions/api/_permission_features.json b/libcef/common/extensions/api/_permission_features.json index 54458e087..1c904b9d6 100644 --- a/libcef/common/extensions/api/_permission_features.json +++ b/libcef/common/extensions/api/_permission_features.json @@ -30,12 +30,7 @@ }, { "channel": "stable", - "extension_types": ["platform_app"], - "whitelist": [ - "AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT. - // TODO(grv): clean up once Apps developer tool is published. - "5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool. - ] + "extension_types": ["platform_app"] } ] } diff --git a/libcef/common/string_types_impl.cc b/libcef/common/string_types_impl.cc index f4bbed750..7e96872b4 100644 --- a/libcef/common/string_types_impl.cc +++ b/libcef/common/string_types_impl.cc @@ -171,10 +171,10 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, if (str1->length == 0 && str2->length == 0) return 0; #if defined(WCHAR_T_IS_UTF32) - int r = - base::c16memcmp(reinterpret_cast(str1->str), - reinterpret_cast(str2->str), - std::min(str1->length, str2->length)); + int r = std::char_traits::compare( + reinterpret_cast(str1->str), + reinterpret_cast(str2->str), + std::min(str1->length, str2->length)); #else int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length)); #endif diff --git a/libcef/renderer/alloy/alloy_content_renderer_client.cc b/libcef/renderer/alloy/alloy_content_renderer_client.cc index b879cbba0..10aa20370 100644 --- a/libcef/renderer/alloy/alloy_content_renderer_client.cc +++ b/libcef/renderer/alloy/alloy_content_renderer_client.cc @@ -237,12 +237,6 @@ void AlloyContentRendererClient::RenderThreadStarted() { pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); } - for (auto& origin_or_hostname_pattern : - network::SecureOriginAllowlist::GetInstance().GetCurrentAllowlist()) { - blink::WebSecurityPolicy::AddOriginToTrustworthySafelist( - blink::WebString::FromUTF8(origin_or_hostname_pattern)); - } - if (extensions::ExtensionsEnabled()) extensions_renderer_client_->RenderThreadStarted(); } diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.cc b/libcef/renderer/alloy/alloy_render_thread_observer.cc index 488eb444c..0a24514fa 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.cc +++ b/libcef/renderer/alloy/alloy_render_thread_observer.cc @@ -8,7 +8,6 @@ #include "libcef/common/net/net_resource_provider.h" #include "base/no_destructor.h" -#include "mojo/public/cpp/bindings/strong_binding.h" #include "net/base/net_module.h" #include "services/service_manager/public/cpp/connector.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" diff --git a/libcef/renderer/alloy/alloy_render_thread_observer.h b/libcef/renderer/alloy/alloy_render_thread_observer.h index 88f7abe40..b75322ede 100644 --- a/libcef/renderer/alloy/alloy_render_thread_observer.h +++ b/libcef/renderer/alloy/alloy_render_thread_observer.h @@ -14,7 +14,6 @@ #include "chrome/common/renderer_configuration.mojom.h" #include "components/content_settings/core/common/content_settings.h" #include "content/public/renderer/render_thread_observer.h" -#include "mojo/public/cpp/bindings/associated_binding_set.h" #include "mojo/public/cpp/bindings/associated_receiver_set.h" // This class sends and receives control messages in the renderer process. diff --git a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc index 4efda94f9..097aef329 100644 --- a/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc +++ b/libcef/renderer/alloy/url_loader_throttle_provider_impl.cc @@ -13,7 +13,6 @@ #include "chrome/common/google_url_loader_throttle.h" #include "content/public/common/content_features.h" #include "content/public/renderer/render_frame.h" -#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h" #include "services/network/public/cpp/features.h" #include "third_party/blink/public/common/loader/resource_type_util.h" #include "third_party/blink/public/platform/web_url.h" @@ -59,23 +58,6 @@ CefURLLoaderThrottleProviderImpl::CreateThrottles( DCHECK(!is_frame_resource || type_ == content::URLLoaderThrottleProviderType::kFrame); - if (extensions::ExtensionsEnabled() && - type_ == content::URLLoaderThrottleProviderType::kFrame && - request_destination == network::mojom::RequestDestination::kObject) { - content::RenderFrame* render_frame = - content::RenderFrame::FromRoutingID(render_frame_id); - auto mime_handlers = - extensions::MimeHandlerViewContainer::FromRenderFrame(render_frame); - GURL gurl(request.Url()); - for (auto* handler : mime_handlers) { - auto throttle = handler->MaybeCreatePluginThrottle(gurl); - if (throttle) { - throttles.push_back(std::move(throttle)); - break; - } - } - } - throttles.push_back(std::make_unique( AlloyRenderThreadObserver::GetDynamicParams())); diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index 4c619bf5c..24b513442 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -30,6 +30,7 @@ #include "third_party/blink/renderer/core/frame/settings.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" #include "third_party/blink/renderer/core/loader/frame_load_request.h" +#include "third_party/blink/renderer/core/script/classic_script.h" #include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h" #include "third_party/blink/renderer/platform/bindings/v8_binding.h" #include "third_party/blink/renderer/platform/loader/fetch/resource_response.h" @@ -101,6 +102,12 @@ std::string DumpDocumentText(blink::WebLocalFrame* frame) { return blink::WebString(web_element->innerText()).Utf8(); } +std::string DumpDocumentMarkup(blink::WebLocalFrame* frame) { + const auto& string = blink::CreateMarkup( + blink::To(frame)->GetFrame()->GetDocument()); + return string.Utf8(); +} + cef_dom_node_type_t GetNodeType(const blink::WebNode& node) { const blink::Node* web_node = node.ConstUnwrap(); switch (web_node->getNodeType()) { @@ -174,11 +181,7 @@ v8::Local ExecuteV8ScriptAndReturnValue( const blink::WebString& source_url, int start_line, v8::Local context, - v8::Isolate* isolate, v8::TryCatch& tryCatch) { - // Based on ScriptController::executeScriptAndReturnValue - DCHECK(isolate); - if (start_line < 1) start_line = 1; @@ -193,12 +196,14 @@ v8::Local ExecuteV8ScriptAndReturnValue( WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), WTF::OrdinalNumber::FromZeroBasedInt(0))); + auto* script = blink::MakeGarbageCollected( + ssc, ssc.Url(), blink::ScriptFetchOptions(), + blink::SanitizeScriptErrors::kDoNotSanitize); + // The Rethrow() message is unused due to kDoNotSanitize but it still needs // to be non-nullopt for exceptions to be re-thrown as expected. auto result = blink::V8ScriptRunner::CompileAndRunScript( - isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc, - ssc.Url(), blink::SanitizeScriptErrors::kDoNotSanitize, - blink::ScriptFetchOptions(), + blink::ScriptState::From(context), script, blink::ExecuteScriptPolicy::kExecuteScriptWhenScriptsDisabled, blink::V8ScriptRunner::RethrowErrorsOption::Rethrow("")); diff --git a/libcef/renderer/blink_glue.h b/libcef/renderer/blink_glue.h index bc67a28ad..a7db3ef45 100644 --- a/libcef/renderer/blink_glue.h +++ b/libcef/renderer/blink_glue.h @@ -42,6 +42,8 @@ BLINK_EXPORT void GoForward(blink::WebView* view); // Returns the text of the document element. BLINK_EXPORT std::string DumpDocumentText(blink::WebLocalFrame* frame); +// Returns the markup of the document element. +BLINK_EXPORT std::string DumpDocumentMarkup(blink::WebLocalFrame* frame); // Expose additional actions on WebNode. BLINK_EXPORT cef_dom_node_type_t GetNodeType(const blink::WebNode& node); @@ -65,7 +67,6 @@ BLINK_EXPORT v8::Local ExecuteV8ScriptAndReturnValue( const blink::WebString& source_url, int start_line, v8::Local context, - v8::Isolate* isolate, v8::TryCatch& tryCatch); BLINK_EXPORT bool IsScriptForbidden(); diff --git a/libcef/renderer/browser_impl.cc b/libcef/renderer/browser_impl.cc index b126b54d2..aafbcfaf8 100644 --- a/libcef/renderer/browser_impl.cc +++ b/libcef/renderer/browser_impl.cc @@ -58,32 +58,32 @@ CefRefPtr CefBrowserImpl::GetHost() { bool CefBrowserImpl::CanGoBack() { CEF_REQUIRE_RT_RETURN(false); - return blink_glue::CanGoBack(render_view()->GetWebView()); + return blink_glue::CanGoBack(GetWebView()); } void CefBrowserImpl::GoBack() { CEF_REQUIRE_RT_RETURN_VOID(); - blink_glue::GoBack(render_view()->GetWebView()); + blink_glue::GoBack(GetWebView()); } bool CefBrowserImpl::CanGoForward() { CEF_REQUIRE_RT_RETURN(false); - return blink_glue::CanGoForward(render_view()->GetWebView()); + return blink_glue::CanGoForward(GetWebView()); } void CefBrowserImpl::GoForward() { CEF_REQUIRE_RT_RETURN_VOID(); - blink_glue::GoForward(render_view()->GetWebView()); + blink_glue::GoForward(GetWebView()); } bool CefBrowserImpl::IsLoading() { CEF_REQUIRE_RT_RETURN(false); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame) return main_frame->ToWebLocalFrame()->IsLoading(); } @@ -93,8 +93,8 @@ bool CefBrowserImpl::IsLoading() { void CefBrowserImpl::Reload() { CEF_REQUIRE_RT_RETURN_VOID(); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { main_frame->ToWebLocalFrame()->StartReload( blink::WebFrameLoadType::kReload); @@ -105,8 +105,8 @@ void CefBrowserImpl::Reload() { void CefBrowserImpl::ReloadIgnoreCache() { CEF_REQUIRE_RT_RETURN_VOID(); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { main_frame->ToWebLocalFrame()->StartReload( blink::WebFrameLoadType::kReloadBypassingCache); @@ -117,8 +117,8 @@ void CefBrowserImpl::ReloadIgnoreCache() { void CefBrowserImpl::StopLoad() { CEF_REQUIRE_RT_RETURN_VOID(); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { main_frame->ToWebLocalFrame()->DeprecatedStopLoading(); } @@ -147,8 +147,8 @@ bool CefBrowserImpl::IsPopup() { bool CefBrowserImpl::HasDocument() { CEF_REQUIRE_RT_RETURN(false); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { return !main_frame->ToWebLocalFrame()->GetDocument().IsNull(); } @@ -159,8 +159,8 @@ bool CefBrowserImpl::HasDocument() { CefRefPtr CefBrowserImpl::GetMainFrame() { CEF_REQUIRE_RT_RETURN(nullptr); - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { return GetWebFrameImpl(main_frame->ToWebLocalFrame()).get(); } @@ -171,9 +171,8 @@ CefRefPtr CefBrowserImpl::GetMainFrame() { CefRefPtr CefBrowserImpl::GetFocusedFrame() { CEF_REQUIRE_RT_RETURN(nullptr); - if (render_view()->GetWebView() && - render_view()->GetWebView()->FocusedFrame()) { - return GetWebFrameImpl(render_view()->GetWebView()->FocusedFrame()).get(); + if (GetWebView() && GetWebView()->FocusedFrame()) { + return GetWebFrameImpl(GetWebView()->FocusedFrame()).get(); } return nullptr; } @@ -187,7 +186,7 @@ CefRefPtr CefBrowserImpl::GetFrame(int64 identifier) { CefRefPtr CefBrowserImpl::GetFrame(const CefString& name) { CEF_REQUIRE_RT_RETURN(nullptr); - blink::WebView* web_view = render_view()->GetWebView(); + blink::WebView* web_view = GetWebView(); if (web_view) { const blink::WebString& frame_name = blink::WebString::FromUTF16(name.ToString16()); @@ -220,9 +219,9 @@ size_t CefBrowserImpl::GetFrameCount() { int count = 0; - if (render_view()->GetWebView()) { - for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame(); - frame; frame = frame->TraverseNext()) { + if (GetWebView()) { + for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame; + frame = frame->TraverseNext()) { count++; } } @@ -236,9 +235,9 @@ void CefBrowserImpl::GetFrameIdentifiers(std::vector& identifiers) { if (identifiers.size() > 0) identifiers.clear(); - if (render_view()->GetWebView()) { - for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame(); - frame; frame = frame->TraverseNext()) { + if (GetWebView()) { + for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame; + frame = frame->TraverseNext()) { if (frame->IsWebLocalFrame()) identifiers.push_back( render_frame_util::GetIdentifier(frame->ToWebLocalFrame())); @@ -252,9 +251,9 @@ void CefBrowserImpl::GetFrameNames(std::vector& names) { if (names.size() > 0) names.clear(); - if (render_view()->GetWebView()) { - for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame(); - frame; frame = frame->TraverseNext()) { + if (GetWebView()) { + for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame; + frame = frame->TraverseNext()) { if (frame->IsWebLocalFrame()) names.push_back(render_frame_util::GetName(frame->ToWebLocalFrame())); } @@ -268,7 +267,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view, int browser_id, bool is_popup, bool is_windowless) - : content::RenderViewObserver(render_view), + : blink::WebViewObserver(render_view->GetWebView()), browser_id_(browser_id), is_popup_(is_popup), is_windowless_(is_windowless) {} @@ -293,8 +292,8 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl( CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) { if (frame_id == blink_glue::kInvalidFrameId) { - if (render_view()->GetWebView()) { - blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame(); + if (GetWebView()) { + blink::WebFrame* main_frame = GetWebView()->MainFrame(); if (main_frame && main_frame->IsWebLocalFrame()) { return GetWebFrameImpl(main_frame->ToWebLocalFrame()); } @@ -307,10 +306,10 @@ CefRefPtr CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) { if (it != frames_.end()) return it->second; - if (render_view()->GetWebView()) { + if (GetWebView()) { // Check if the frame exists but we don't know about it yet. - for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame(); - frame; frame = frame->TraverseNext()) { + for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame; + frame = frame->TraverseNext()) { if (frame->IsWebLocalFrame() && render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) == frame_id) { @@ -379,7 +378,7 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) { if (handler.get()) { CefRefPtr load_handler = handler->GetLoadHandler(); if (load_handler.get()) { - blink::WebView* web_view = render_view()->GetWebView(); + blink::WebView* web_view = GetWebView(); const bool canGoBack = blink_glue::CanGoBack(web_view); const bool canGoForward = blink_glue::CanGoForward(web_view); diff --git a/libcef/renderer/browser_impl.h b/libcef/renderer/browser_impl.h index 23d9fb327..cb422a446 100644 --- a/libcef/renderer/browser_impl.h +++ b/libcef/renderer/browser_impl.h @@ -19,19 +19,23 @@ #include "libcef/common/tracker.h" #include "libcef/renderer/frame_impl.h" -#include "content/public/renderer/render_view_observer.h" +#include "third_party/blink/public/web/web_view_observer.h" namespace blink { class WebFrame; class WebNode; } // namespace blink +namespace content { +class RenderView; +} + // Renderer plumbing for CEF features. There is a one-to-one relationship // between RenderView on the renderer side and RenderViewHost on the browser // side. // // RenderViewObserver: Interface for observing RenderView notifications. -class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver { +class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver { public: // Returns the browser associated with the specified RenderView. static CefRefPtr GetBrowserForView(content::RenderView* view); @@ -78,7 +82,7 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver { bool is_popup() const { return is_popup_; } bool is_windowless() const { return is_windowless_; } - // RenderViewObserver methods. + // blink::WebViewObserver methods. void OnDestruct() override; void FrameDetached(int64_t frame_id); diff --git a/libcef/renderer/browser_manager.cc b/libcef/renderer/browser_manager.cc index 57a1ca994..3657c2e14 100644 --- a/libcef/renderer/browser_manager.cc +++ b/libcef/renderer/browser_manager.cc @@ -33,10 +33,10 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" -#include "content/public/renderer/render_view_observer.h" #include "services/network/public/mojom/cors_origin_pattern.mojom.h" #include "third_party/blink/public/web/web_security_policy.h" #include "third_party/blink/public/web/web_view.h" +#include "third_party/blink/public/web/web_view_observer.h" namespace { @@ -45,12 +45,12 @@ CefBrowserManager* g_manager = nullptr; } // namespace // Placeholder object for guest views. -class CefGuestView : public content::RenderViewObserver { +class CefGuestView : public blink::WebViewObserver { public: CefGuestView(CefBrowserManager* manager, content::RenderView* render_view, bool is_windowless) - : content::RenderViewObserver(render_view), + : blink::WebViewObserver(render_view->GetWebView()), manager_(manager), is_windowless_(is_windowless) {} @@ -138,9 +138,8 @@ CefRefPtr CefBrowserManager::GetBrowserForMainFrame( blink::WebFrame* frame) { BrowserMap::const_iterator it = browsers_.begin(); for (; it != browsers_.end(); ++it) { - content::RenderView* render_view = it->second->render_view(); - if (render_view && render_view->GetWebView() && - render_view->GetWebView()->MainFrame() == frame) { + auto web_view = it->second->GetWebView(); + if (web_view && web_view->MainFrame() == frame) { return it->second; } } diff --git a/libcef/renderer/dom_node_impl.cc b/libcef/renderer/dom_node_impl.cc index 5cf1e8b0d..5bf838382 100644 --- a/libcef/renderer/dom_node_impl.cc +++ b/libcef/renderer/dom_node_impl.cc @@ -390,8 +390,8 @@ CefRect CefDOMNodeImpl::GetElementBounds() { } WebElement element = node_.To(); - blink::WebRect rc = element.BoundsInViewport(); - rect.Set(rc.x, rc.y, rc.width, rc.height); + const auto& rc = element.BoundsInViewport(); + rect.Set(rc.x(), rc.y(), rc.width(), rc.height()); return rect; } diff --git a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc index 40434fb5b..6044850f0 100644 --- a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc +++ b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc @@ -15,7 +15,7 @@ #include "chrome/common/url_constants.h" #include "content/public/renderer/render_frame.h" #include "extensions/common/constants.h" -#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h" +#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/blink/public/web/web_document.h" #include "third_party/blink/public/web/web_element.h" diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index ea6d7dbdc..d02fbb5ea 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -35,6 +35,7 @@ #include "content/public/renderer/render_view.h" #include "content/renderer/render_frame_impl.h" #include "third_party/blink/public/mojom/frame/frame.mojom-blink.h" +#include "third_party/blink/public/platform/web_back_forward_cache_loader_helper.h" #include "third_party/blink/public/platform/web_data.h" #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/platform/web_url.h" @@ -98,8 +99,7 @@ void CefFrameImpl::ViewSource() { void CefFrameImpl::GetSource(CefRefPtr visitor) { CEF_REQUIRE_RT_RETURN_VOID(); if (frame_) { - const CefString& content = - std::string(blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8()); + const CefString& content = blink_glue::DumpDocumentMarkup(frame_); visitor->Visit(content); } } @@ -309,7 +309,7 @@ std::unique_ptr CefFrameImpl::CreateURLLoader() { blink::WebURLRequest(), blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_), blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_), - std::move(keep_alive_handle)); + std::move(keep_alive_handle), blink::WebBackForwardCacheLoaderHelper()); } std::unique_ptr @@ -490,7 +490,7 @@ void CefFrameImpl::OnRequest(const Cef_Request_Params& params) { DCHECK(!command.empty()); if (base::LowerCaseEqualsASCII(command, "getsource")) { - response = blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8(); + response = blink_glue::DumpDocumentMarkup(frame_); success = true; } else if (base::LowerCaseEqualsASCII(command, "gettext")) { response = blink_glue::DumpDocumentText(frame_); diff --git a/libcef/renderer/v8_impl.cc b/libcef/renderer/v8_impl.cc index f10582d94..fd879fa79 100644 --- a/libcef/renderer/v8_impl.cc +++ b/libcef/renderer/v8_impl.cc @@ -1104,7 +1104,7 @@ bool CefV8ContextImpl::Eval(const CefString& code, try_catch.SetVerbose(true); v8::Local func_rv = blink_glue::ExecuteV8ScriptAndReturnValue( - source, source_url, start_line, context, isolate, try_catch); + source, source_url, start_line, context, try_catch); if (try_catch.HasCaught()) { exception = new CefV8ExceptionImpl(context, try_catch.Message()); diff --git a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc index 4fffaaa17..1f0541664 100644 --- a/libcef_dll/cpptoc/context_menu_params_cpptoc.cc +++ b/libcef_dll/cpptoc/context_menu_params_cpptoc.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=a8f51263f539c707f45abb95a6fb1f9f3bfef3b3$ +// $hash=4ff1017b303be65e38e293470384dc891bb26b15$ // #include "libcef_dll/cpptoc/context_menu_params_cpptoc.h" @@ -383,23 +383,6 @@ context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) { return _retval; } -int CEF_CALLBACK -context_menu_params_is_pepper_menu(struct _cef_context_menu_params_t* self) { - shutdown_checker::AssertNotShutdown(); - - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - DCHECK(self); - if (!self) - return 0; - - // Execute - bool _retval = CefContextMenuParamsCppToC::Get(self)->IsPepperMenu(); - - // Return type: bool - return _retval; -} - } // namespace // CONSTRUCTOR - Do not edit by hand. @@ -429,7 +412,6 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() { context_menu_params_is_spell_check_enabled; GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags; GetStruct()->is_custom_menu = context_menu_params_is_custom_menu; - GetStruct()->is_pepper_menu = context_menu_params_is_pepper_menu; } // DESTRUCTOR - Do not edit by hand. diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc index 8083f5078..5a7bb62b7 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.cc +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.cc @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=cc3fb995a3c9384fae1f1bbeb118ff6ff1d78ea2$ +// $hash=dad7a3eb64c0bc6c4eddd2935513af61f7e8b510$ // #include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" @@ -230,7 +230,7 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { NO_SANITIZE("cfi-icall") CefContextMenuParams::MediaStateFlags - CefContextMenuParamsCToCpp::GetMediaStateFlags() { +CefContextMenuParamsCToCpp::GetMediaStateFlags() { shutdown_checker::AssertNotShutdown(); cef_context_menu_params_t* _struct = GetStruct(); @@ -351,7 +351,7 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { NO_SANITIZE("cfi-icall") CefContextMenuParams::EditStateFlags - CefContextMenuParamsCToCpp::GetEditStateFlags() { +CefContextMenuParamsCToCpp::GetEditStateFlags() { shutdown_checker::AssertNotShutdown(); cef_context_menu_params_t* _struct = GetStruct(); @@ -384,22 +384,6 @@ NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsCustomMenu() { return _retval ? true : false; } -NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsPepperMenu() { - shutdown_checker::AssertNotShutdown(); - - cef_context_menu_params_t* _struct = GetStruct(); - if (CEF_MEMBER_MISSING(_struct, is_pepper_menu)) - return false; - - // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING - - // Execute - int _retval = _struct->is_pepper_menu(_struct); - - // Return type: bool - return _retval ? true : false; -} - // CONSTRUCTOR - Do not edit by hand. CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {} diff --git a/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/libcef_dll/ctocpp/context_menu_params_ctocpp.h index f8061f777..679150917 100644 --- a/libcef_dll/ctocpp/context_menu_params_ctocpp.h +++ b/libcef_dll/ctocpp/context_menu_params_ctocpp.h @@ -9,7 +9,7 @@ // implementations. See the translator.README.txt file in the tools directory // for more information. // -// $hash=326bac53cf2af1a1f80e036cbbb3bd643ef6f7dd$ +// $hash=7de11c340a42046de92ca4cb8c5852269f3a3101$ // #ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ @@ -56,7 +56,6 @@ class CefContextMenuParamsCToCpp bool IsSpellCheckEnabled() OVERRIDE; EditStateFlags GetEditStateFlags() OVERRIDE; bool IsCustomMenu() OVERRIDE; - bool IsPepperMenu() OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ diff --git a/patch/patch.cfg b/patch/patch.cfg index f45eb8681..b05af94c3 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -250,11 +250,7 @@ patches = [ # Support override of the User-Agent product component when NetworkService # is enabled. # https://bitbucket.org/chromiumembedded/cef/issues/2622 - # - # Changes to support the Chrome runtime in CEF - # (chrome_content_browser_client.cc). - # https://bitbucket.org/chromiumembedded/cef/issues/2969 - 'name': 'chrome_browser_product_override', + 'name': 'embedder_product_override', }, { # Fix Jumbo/component build dependency issue. @@ -352,11 +348,6 @@ patches = [ # Don't initialize PrerenderContents object in StreamsPrivateAPI. 'name': 'extensions_1947', }, - { - # Don't enable sandbox::MITIGATION_STRICT_HANDLE_CHECKS in WinRT apps. - # https://bitbucket.org/chromiumembedded/cef/issues/2274 - 'name': 'win_rt_2274', - }, { # macOS: Fix undesirable switch to discrete GPU during startup. # https://bitbucket.org/chromiumembedded/cef/issues/2398 @@ -484,6 +475,11 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2819 'name': 'win_cpp17_msvc_sandbox_2819', }, + { + # Fix duplicate symbols in libphonenumber. + 'name': 'libphonenumber', + 'path': 'third_party/libphonenumber/dist', + }, { # libxml access is now limited to targets audited by the Security Team. # https://chromium-review.googlesource.com/c/chromium/src/+/1884750 diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index 01802bc25..6c3c1a8ec 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 4516b3575892..db53b698a7d4 100644 +index 70911a215498..52aea5cc2e70 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -34,6 +34,7 @@ import("//build/config/ui.gni") @@ -10,7 +10,7 @@ index 4516b3575892..db53b698a7d4 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1666,7 +1667,11 @@ component("base") { +@@ -1731,7 +1732,11 @@ component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] @@ -23,7 +23,7 @@ index 4516b3575892..db53b698a7d4 100644 sources += [ "hash/md5_nacl.cc", "hash/md5_nacl.h", -@@ -1867,6 +1872,12 @@ component("base") { +@@ -1938,6 +1943,12 @@ component("base") { defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ] } diff --git a/patch/patches/base_string_piece_1049498.patch b/patch/patches/base_string_piece_1049498.patch index 93d7e92ab..50bf3a638 100644 --- a/patch/patches/base_string_piece_1049498.patch +++ b/patch/patches/base_string_piece_1049498.patch @@ -1,5 +1,5 @@ diff --git base/strings/string_piece.h base/strings/string_piece.h -index b10707d94ef9..1bfa980cbbe6 100644 +index 038165ea1e1c..a559312bba57 100644 --- base/strings/string_piece.h +++ base/strings/string_piece.h @@ -24,6 +24,7 @@ diff --git a/patch/patches/browser_security_policy_1081397.patch b/patch/patches/browser_security_policy_1081397.patch index 867af3c6d..52c6f55a1 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 d403f389af0d..c8ff688fd11f 100644 +index 52ebdbbc7c2e..822f2e41afec 100644 --- content/browser/child_process_security_policy_impl.cc +++ content/browser/child_process_security_policy_impl.cc -@@ -1685,6 +1685,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( +@@ -1706,6 +1706,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin( // DeclarativeApiTest.PersistRules. if (actual_process_lock.matches_scheme(url::kDataScheme)) return true; diff --git a/patch/patches/build.patch b/patch/patches/build.patch index bce3ce688..dd89ad974 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 5928c561b5a3..6f342bb0e036 100644 +index 266b74b3b50a..f242e8b08ec1 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -1779,8 +1779,6 @@ config("thin_archive") { +@@ -1824,8 +1824,6 @@ config("thin_archive") { # archives. if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index ce64d377f..8d718459d 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 40c07e2d724a..1cfe14f8cd6f 100644 +index 72d91d05c23a..bfa8860bcd89 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/crypto.gni") @@ -10,7 +10,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/downgrade/buildflags.gni") import("//chrome/common/features.gni") -@@ -1966,6 +1967,7 @@ static_library("browser") { +@@ -1964,6 +1965,7 @@ static_library("browser") { "//build:chromeos_buildflags", "//build/config/compiler:compiler_buildflags", "//cc", @@ -18,7 +18,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2489,6 +2491,10 @@ static_library("browser") { +@@ -2504,6 +2506,10 @@ static_library("browser") { ] } @@ -29,7 +29,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644 if (is_android) { sources += [ "after_startup_task_utils_android.cc", -@@ -5104,7 +5110,7 @@ static_library("browser") { +@@ -5166,7 +5172,7 @@ static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_background_mode_1100085.patch b/patch/patches/chrome_browser_background_mode_1100085.patch index 2d8653c24..0fc958751 100644 --- a/patch/patches/chrome_browser_background_mode_1100085.patch +++ b/patch/patches/chrome_browser_background_mode_1100085.patch @@ -1,16 +1,16 @@ diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm -index e2eb5c2c73d0..d08b0a9a2a54 100644 +index 596eabd15f44..b9b24760b7c2 100644 --- chrome/browser/app_controller_mac.mm +++ chrome/browser/app_controller_mac.mm -@@ -29,6 +29,7 @@ - #include "base/task/thread_pool.h" +@@ -30,6 +30,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" -@@ -1194,6 +1195,7 @@ - (void)commandDispatch:(id)sender { +@@ -1219,6 +1220,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // Run a (background) application in a new tab. - (void)executeApplication:(id)sender { @@ -18,7 +18,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644 NSInteger tag = [sender tag]; Profile* profile = [self lastProfile]; DCHECK(profile); -@@ -1202,6 +1204,7 @@ - (void)executeApplication:(id)sender { +@@ -1227,6 +1229,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); @@ -26,7 +26,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644 } // Same as |-commandDispatch:|, but executes commands using a disposition -@@ -1599,6 +1602,7 @@ - (NSMenu*)applicationDockMenu:(NSApplication*)sender { +@@ -1614,6 +1617,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; // TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit // tests which use the mock in place of the profile-initialized model. @@ -34,7 +34,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644 // Avoid breaking unit tests which have no profile. if (profile) { BackgroundApplicationListModel applications(profile); -@@ -1625,6 +1629,7 @@ - (NSMenu*)applicationDockMenu:(NSApplication*)sender { +@@ -1640,6 +1644,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; } } } @@ -42,7 +42,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644 return dockMenu; } -@@ -1835,11 +1840,13 @@ - (void)handoffActiveURLChanged:(content::WebContents*)webContents { +@@ -1850,11 +1855,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session; namespace { void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) { @@ -57,69 +57,58 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644 } // namespace diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h -index 1ea08a7ad6ae..473ebde08451 100644 +index 3d634db18900..96e44ad48e5e 100644 --- chrome/browser/browser_process.h +++ chrome/browser/browser_process.h -@@ -202,10 +202,12 @@ class BrowserProcess { +@@ -197,9 +197,9 @@ class BrowserProcess { virtual DownloadStatusUpdater* download_status_updater() = 0; virtual DownloadRequestLimiter* download_request_limiter() = 0; +#if BUILDFLAG(ENABLE_BACKGROUND_MODE) // Returns the object that manages background applications. virtual BackgroundModeManager* background_mode_manager() = 0; +-#if BUILDFLAG(ENABLE_BACKGROUND_MODE) virtual void set_background_mode_manager_for_test( std::unique_ptr manager) = 0; -+#endif - - // Returns the StatusTray, which provides an API for displaying status icons - // in the system status tray. Returns NULL if status icons are not supported + #endif diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc -index 35510d179897..79cdc358903c 100644 +index 067873339ce4..4bc021eb8c9a 100644 --- chrome/browser/browser_process_impl.cc +++ chrome/browser/browser_process_impl.cc -@@ -957,24 +957,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { +@@ -943,18 +943,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { return download_request_limiter_.get(); } -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { +-BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { + #if BUILDFLAG(ENABLE_BACKGROUND_MODE) ++BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); --#if BUILDFLAG(ENABLE_BACKGROUND_MODE) if (!background_mode_manager_) CreateBackgroundModeManager(); return background_mode_manager_.get(); -#else -- NOTIMPLEMENTED(); -- return NULL; +- return nullptr; -#endif } +-#if BUILDFLAG(ENABLE_BACKGROUND_MODE) void BrowserProcessImpl::set_background_mode_manager_for_test( std::unique_ptr manager) { --#if BUILDFLAG(ENABLE_BACKGROUND_MODE) background_mode_manager_ = std::move(manager); --#endif - } -+#endif - - StatusTray* BrowserProcessImpl::status_tray() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h -index 1d3c566cc59b..230c16644234 100644 +index b4ceefbccd08..7d60206c83b1 100644 --- chrome/browser/browser_process_impl.h +++ chrome/browser/browser_process_impl.h -@@ -166,9 +166,11 @@ class BrowserProcessImpl : public BrowserProcess, +@@ -169,8 +169,8 @@ class BrowserProcessImpl : public BrowserProcess, void SetApplicationLocale(const std::string& actual_locale) override; DownloadStatusUpdater* download_status_updater() override; DownloadRequestLimiter* download_request_limiter() override; -+#if BUILDFLAG(ENABLE_BACKGROUND_MODE) - BackgroundModeManager* background_mode_manager() override; +- BackgroundModeManager* background_mode_manager() override; + #if BUILDFLAG(ENABLE_BACKGROUND_MODE) ++ BackgroundModeManager* background_mode_manager() override; void set_background_mode_manager_for_test( std::unique_ptr manager) override; -+#endif - StatusTray* status_tray() override; - safe_browsing::SafeBrowsingService* safe_browsing_service() override; - subresource_filter::RulesetService* subresource_filter_ruleset_service() + #endif diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc index e0cafee5eedd..06ded156be3c 100644 --- chrome/browser/lifetime/browser_close_manager.cc @@ -140,11 +129,11 @@ index e0cafee5eedd..06ded156be3c 100644 // Make a copy of the BrowserList to simplify the case where we need to // destroy a Browser during the loop. diff --git chrome/browser/sessions/session_service.cc chrome/browser/sessions/session_service.cc -index cbddcc52a8f6..02ab085c481c 100644 +index 867da7e78e1a..de849b67b1e3 100644 --- chrome/browser/sessions/session_service.cc +++ chrome/browser/sessions/session_service.cc -@@ -968,12 +968,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { - if (!profile() || profile()->AsTestingProfile()) +@@ -1047,12 +1047,19 @@ void SessionService::MaybeDeleteSessionOnlyData() { + if (profile()->AsTestingProfile()) return; +#if BUILDFLAG(ENABLE_BACKGROUND_MODE) diff --git a/patch/patches/chrome_browser_browser.patch b/patch/patches/chrome_browser_browser.patch index ed6b98bbf..01df5773d 100644 --- a/patch/patches/chrome_browser_browser.patch +++ b/patch/patches/chrome_browser_browser.patch @@ -13,10 +13,10 @@ index ba0c5c3fc044..b4df9af95ecd 100644 return false; } diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc -index 1dc23535c42a..4aae0399346f 100644 +index f225525e74eb..ee5932936215 100644 --- chrome/browser/ui/browser.cc +++ chrome/browser/ui/browser.cc -@@ -257,6 +257,20 @@ +@@ -256,6 +256,20 @@ #include "components/captive_portal/content/captive_portal_tab_helper.h" #endif @@ -51,7 +51,7 @@ index 1dc23535c42a..4aae0399346f 100644 location_bar_model_ = std::make_unique( location_bar_model_delegate_.get(), content::kMaxURLDisplayChars); -@@ -1343,6 +1364,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( +@@ -1310,6 +1331,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent( if (exclusive_access_manager_->HandleUserKeyEvent(event)) return content::KeyboardEventProcessingResult::HANDLED; @@ -66,7 +66,7 @@ index 1dc23535c42a..4aae0399346f 100644 return window()->PreHandleKeyboardEvent(event); } -@@ -1350,8 +1379,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, +@@ -1317,8 +1346,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source, const NativeWebKeyboardEvent& event) { DevToolsWindow* devtools_window = DevToolsWindow::GetInstanceForInspectedWebContents(source); @@ -87,7 +87,7 @@ index 1dc23535c42a..4aae0399346f 100644 } bool Browser::TabsNeedBeforeUnloadFired() { -@@ -1579,6 +1618,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, +@@ -1538,6 +1577,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source, return window->OpenURLFromTab(source, params); } @@ -102,7 +102,7 @@ index 1dc23535c42a..4aae0399346f 100644 NavigateParams nav_params(this, params.url, params.transition); nav_params.FillNavigateParamsFromOpenURLParams(params); nav_params.source_contents = source; -@@ -1692,6 +1739,8 @@ void Browser::LoadingStateChanged(WebContents* source, +@@ -1651,6 +1698,8 @@ void Browser::LoadingStateChanged(WebContents* source, bool to_different_document) { ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD); UpdateWindowForLoadingStateChanged(source, to_different_document); @@ -111,7 +111,7 @@ index 1dc23535c42a..4aae0399346f 100644 } void Browser::CloseContents(WebContents* source) { -@@ -1719,6 +1768,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { +@@ -1678,6 +1727,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) { } void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { @@ -120,7 +120,7 @@ index 1dc23535c42a..4aae0399346f 100644 if (!GetStatusBubble()) return; -@@ -1726,6 +1777,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { +@@ -1685,6 +1736,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) { GetStatusBubble()->SetURL(url); } @@ -138,7 +138,7 @@ index 1dc23535c42a..4aae0399346f 100644 void Browser::ContentsMouseEvent(WebContents* source, bool motion, bool exited) { -@@ -1842,6 +1904,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, +@@ -1801,6 +1863,10 @@ void Browser::WebContentsCreated(WebContents* source_contents, // Make the tab show up in the task manager. task_manager::WebContentsTags::CreateForTabContents(new_contents); @@ -149,7 +149,7 @@ index 1dc23535c42a..4aae0399346f 100644 } void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) { -@@ -1878,6 +1944,8 @@ void Browser::RendererResponsive( +@@ -1837,6 +1903,8 @@ void Browser::RendererResponsive( void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) { if (web_contents == tab_strip_model_->GetActiveWebContents()) UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE); @@ -158,7 +158,7 @@ index 1dc23535c42a..4aae0399346f 100644 } content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager( -@@ -1924,11 +1992,15 @@ void Browser::EnterFullscreenModeForTab( +@@ -1883,11 +1951,15 @@ void Browser::EnterFullscreenModeForTab( const blink::mojom::FullscreenOptions& options) { exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab( requesting_frame, options.display_id); @@ -174,7 +174,7 @@ index 1dc23535c42a..4aae0399346f 100644 } bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) { -@@ -2826,6 +2898,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { +@@ -2730,6 +2802,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) { content_translate_driver->RemoveTranslationObserver(this); BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this); } @@ -184,7 +184,7 @@ index 1dc23535c42a..4aae0399346f 100644 void Browser::CloseFrame() { diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h -index 7287ec00c3f5..93df2551fab7 100644 +index 3a0202c2139b..700de9a44461 100644 --- chrome/browser/ui/browser.h +++ chrome/browser/ui/browser.h @@ -22,6 +22,7 @@ @@ -206,9 +206,9 @@ index 7287ec00c3f5..93df2551fab7 100644 #if defined(OS_ANDROID) #error This file should only be included on desktop. #endif -@@ -269,6 +274,11 @@ class Browser : public TabStripModelObserver, - // User-set title of this browser window, if there is one. - std::string user_title; +@@ -281,6 +286,11 @@ class Browser : public TabStripModelObserver, + // maximizable. + bool can_maximize = true; +#if BUILDFLAG(ENABLE_CEF) + // Opaque CEF-specific configuration. Will be propagated to new Browsers. @@ -218,9 +218,9 @@ index 7287ec00c3f5..93df2551fab7 100644 private: friend class Browser; friend class WindowSizerChromeOSTest; -@@ -386,6 +396,12 @@ class Browser : public TabStripModelObserver, - return &signin_view_controller_; - } +@@ -403,6 +413,12 @@ class Browser : public TabStripModelObserver, + + base::WeakPtr AsWeakPtr(); +#if BUILDFLAG(ENABLE_CEF) + cef::BrowserDelegate* cef_delegate() const { @@ -231,7 +231,7 @@ index 7287ec00c3f5..93df2551fab7 100644 // Get the FindBarController for this browser, creating it if it does not // yet exist. FindBarController* GetFindBarController(); -@@ -770,6 +786,11 @@ class Browser : public TabStripModelObserver, +@@ -783,6 +799,11 @@ class Browser : public TabStripModelObserver, void SetContentsBounds(content::WebContents* source, const gfx::Rect& bounds) override; void UpdateTargetURL(content::WebContents* source, const GURL& url) override; @@ -243,7 +243,7 @@ index 7287ec00c3f5..93df2551fab7 100644 void ContentsMouseEvent(content::WebContents* source, bool motion, bool exited) override; -@@ -1240,6 +1261,10 @@ class Browser : public TabStripModelObserver, +@@ -1242,6 +1263,10 @@ class Browser : public TabStripModelObserver, extension_browser_window_helper_; #endif @@ -253,12 +253,12 @@ index 7287ec00c3f5..93df2551fab7 100644 + const base::ElapsedTimer creation_timer_; - // Stores the list of browser windows showing via a menu. + // The following factory is used for chrome update coalescing. diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc -index 4bf854459b2c..20e348eb9293 100644 +index 019834353c02..894de692f35d 100644 --- chrome/browser/ui/browser_navigator.cc +++ chrome/browser/ui/browser_navigator.cc -@@ -453,6 +453,13 @@ std::unique_ptr CreateTargetContents( +@@ -454,6 +454,13 @@ std::unique_ptr CreateTargetContents( std::unique_ptr target_contents = WebContents::Create(create_params); diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index 005f5c4f4..e88f79020 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc -index cf62b79358e1..4fe90fde38ff 100644 +index c1e6c77a5726..d3c41d3dac05 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -8,6 +8,7 @@ @@ -8,9 +8,9 @@ index cf62b79358e1..4fe90fde38ff 100644 #include "build/buildflag.h" +#include "cef/libcef/features/runtime.h" #include "chrome/browser/content_settings/one_time_geolocation_permission_provider.h" + #include "chrome/browser/permissions/last_tab_standing_tracker_factory.h" #include "chrome/browser/profiles/off_the_record_profile_impl.h" - #include "chrome/browser/profiles/profile.h" -@@ -21,6 +22,10 @@ +@@ -22,6 +23,10 @@ #include "extensions/buildflags/buildflags.h" #include "ui/webui/webui_allowlist_provider.h" @@ -21,7 +21,7 @@ index cf62b79358e1..4fe90fde38ff 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_service.h" #include "extensions/browser/extension_system.h" -@@ -49,8 +54,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() +@@ -51,8 +56,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory() DependsOn(SupervisedUserSettingsServiceFactory::GetInstance()); #endif #if BUILDFLAG(ENABLE_EXTENSIONS) @@ -36,7 +36,7 @@ index cf62b79358e1..4fe90fde38ff 100644 #endif } -@@ -108,10 +119,16 @@ scoped_refptr +@@ -110,10 +121,16 @@ scoped_refptr } #if BUILDFLAG(ENABLE_EXTENSIONS) diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index ad3df2fc8..ae9942eb6 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 afee70a01862..e49e769b6366 100644 +index ea17679df248..fe9280cb59ce 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -12,6 +12,7 @@ import("//build/config/features.gni") @@ -10,7 +10,7 @@ index afee70a01862..e49e769b6366 100644 import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") -@@ -327,6 +328,10 @@ static_library("ui") { +@@ -332,6 +333,10 @@ static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index afee70a01862..e49e769b6366 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 -@@ -349,6 +354,7 @@ static_library("ui") { +@@ -355,6 +360,7 @@ static_library("ui") { "//build:branding_buildflags", "//build:chromeos_buildflags", "//cc/paint", @@ -29,7 +29,7 @@ index afee70a01862..e49e769b6366 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1553,6 +1559,7 @@ static_library("ui") { +@@ -1581,6 +1587,7 @@ static_library("ui") { "//components/page_load_metrics/browser", "//components/performance_manager:site_data_proto", "//components/printing/browser", @@ -37,7 +37,7 @@ index afee70a01862..e49e769b6366 100644 "//components/profile_metrics", "//components/reading_list/features:flags", "//components/safe_browsing/core/common:safe_browsing_policy_handler", -@@ -3370,7 +3377,9 @@ static_library("ui") { +@@ -3392,7 +3399,9 @@ static_library("ui") { "views/frame/browser_desktop_window_tree_host_platform.h", ] } diff --git a/patch/patches/chrome_browser_product_override.patch b/patch/patches/chrome_browser_product_override.patch deleted file mode 100644 index c1171c479..000000000 --- a/patch/patches/chrome_browser_product_override.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 19c5989c8b67..659e6dbebea5 100644 ---- chrome/browser/chrome_content_browser_client.cc -+++ chrome/browser/chrome_content_browser_client.cc -@@ -37,6 +37,7 @@ - #include "base/threading/thread_task_runner_handle.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/accessibility/caption_util.h" -@@ -1067,10 +1068,6 @@ void LaunchURL(const GURL& url, - } - } - --std::string GetProduct() { -- return version_info::GetProductNameAndVersionForUserAgent(); --} -- - void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { - // |allowlist| combines pref/policy + cmdline switch in the browser process. - // For renderer and utility (e.g. NetworkService) processes the switch is the -@@ -1258,6 +1255,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() { - return *greased_brand_version_list; - } - -+std::string GetProduct() { -+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); -+ if (command_line->HasSwitch(switches::kProductVersion)) -+ return command_line->GetSwitchValueASCII(switches::kProductVersion); -+ -+ return version_info::GetProductNameAndVersionForUserAgent(); -+} -+ - std::string GetUserAgent() { - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kUserAgent)) { -@@ -3610,9 +3615,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( - &search::HandleNewTabURLReverseRewrite); - #endif // defined(OS_ANDROID) - -+#if !BUILDFLAG(ENABLE_CEF) - // chrome: & friends. - handler->AddHandlerPair(&ChromeContentBrowserClient::HandleWebUI, - &ChromeContentBrowserClient::HandleWebUIReverse); -+#endif - } - - base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { -diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index 3ef2329ac8a6..3e3ede99e042 100644 ---- chrome/browser/chrome_content_browser_client.h -+++ chrome/browser/chrome_content_browser_client.h -@@ -108,7 +108,8 @@ class ChromeXrIntegrationClient; - } - #endif - --// Returns the user agent of Chrome. -+// Returns the product and user agent of Chrome. -+std::string GetProduct(); - std::string GetUserAgent(); - - blink::UserAgentMetadata GetUserAgentMetadata(); diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index eabce2125..0ae35ff16 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 102a4c5ce183..a6ce775156b4 100644 +index 71730949d2bd..eedcde617f01 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -390,7 +390,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -397,7 +397,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -12,10 +12,10 @@ index 102a4c5ce183..a6ce775156b4 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 1be24b4ee39c..4288383cb2a8 100644 +index 743dccc6ddf4..204be4916f14 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -106,7 +106,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -113,7 +113,7 @@ class ProfileManager : public content::NotificationObserver, // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -24,7 +24,7 @@ index 1be24b4ee39c..4288383cb2a8 100644 // Returns regular or off-the-record profile given its profile key. static Profile* GetProfileFromProfileKey(ProfileKey* profile_key); -@@ -139,7 +139,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -146,7 +146,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -33,7 +33,7 @@ index 1be24b4ee39c..4288383cb2a8 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -148,7 +148,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -155,7 +155,7 @@ class ProfileManager : public content::NotificationObserver, // Get the Profile last used (the Profile to which owns the most recently // focused window) with this Chrome build. If no signed profile has been // stored in Local State, hand back the Default profile. diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index 10a33394f..48d65bac9 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,12 +1,12 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index ae8aef3a076c..f7e6a91047ef 100644 +index a940b0d2a09b..328976b55299 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn -@@ -23,6 +23,7 @@ static_library("safe_browsing") { +@@ -26,6 +26,7 @@ static_library("safe_browsing") { "//chrome/common:constants", "//components/browser_sync", "//components/enterprise/common:strings", + "//components/gcm_driver:gcm_buildflags", "//components/keyed_service/content", "//components/language/core/browser", - "//components/page_info", + "//components/no_state_prefetch/browser", diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index e6721ebb0..425791199 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc -index dfa34db9255e..0a79d11c7e0c 100644 +index 6de814c6ed1e..302d6dcc789a 100644 --- chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc @@ -18,6 +18,7 @@ @@ -56,17 +56,7 @@ index dfa34db9255e..0a79d11c7e0c 100644 } PluginInfoHostImpl::Context::~Context() {} -@@ -207,7 +220,8 @@ void PluginInfoHostImpl::PluginsLoaded( - plugin_metadata->identifier(), &output->status); - } - -- if (output->status == chrome::mojom::PluginStatus::kNotFound) { -+ if (!cef::IsAlloyRuntimeEnabled() && -+ output->status == chrome::mojom::PluginStatus::kNotFound) { - // Check to see if the component updater can fetch an implementation. - std::unique_ptr cus_plugin_info = - g_browser_process->component_updater()->GetComponentForMimeType( -@@ -228,6 +242,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( +@@ -218,6 +231,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( PluginMetadata::SecurityStatus security_status, const std::string& plugin_identifier, chrome::mojom::PluginStatus* status) const { @@ -82,7 +72,7 @@ index dfa34db9255e..0a79d11c7e0c 100644 if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { *status = chrome::mojom::PluginStatus::kAllowed; return; -@@ -344,17 +367,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( +@@ -334,17 +356,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( return false; } @@ -163,7 +153,7 @@ index e547d5f00617..831d5794ecde 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 ce40f0039fe0..c8cbecb61455 100644 +index 6555dfc37d5c..d54030b6f236 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc @@ -7,6 +7,7 @@ @@ -174,9 +164,9 @@ index ce40f0039fe0..c8cbecb61455 100644 #include "chrome/common/chrome_features.h" #include "chrome/common/net/safe_search_util.h" #include "components/google/core/common/google_util.h" -@@ -14,6 +15,10 @@ - #include "services/network/public/mojom/url_response_head.mojom.h" - #include "services/network/public/mojom/x_frame_options.mojom.h" +@@ -18,6 +19,10 @@ + #include "ui/base/device_form_factor.h" + #endif +#if BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/common/extensions/extensions_util.h" @@ -185,7 +175,7 @@ index ce40f0039fe0..c8cbecb61455 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/extension_urls.h" #endif -@@ -153,6 +158,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( +@@ -168,6 +173,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( const GURL& response_url, network::mojom::URLResponseHead* response_head, bool* defer) { @@ -198,10 +188,10 @@ index ce40f0039fe0..c8cbecb61455 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 a1c26dfbd5cc..aaf96b069c32 100644 +index b6fe493a6ddc..bc2f6487044f 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -848,6 +848,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -858,6 +858,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -209,7 +199,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644 content_settings_agent_delegate->IsPluginTemporarilyAllowed( identifier)) { status = chrome::mojom::PluginStatus::kAllowed; -@@ -1046,7 +1047,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1053,7 +1054,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -219,7 +209,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1055,7 +1057,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1062,7 +1064,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -229,7 +219,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1065,7 +1068,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1072,7 +1075,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -239,7 +229,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1073,7 +1077,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1080,7 +1084,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -248,7 +238,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644 + content_settings_agent->DidBlockContentType(content_type); break; } - case chrome::mojom::PluginStatus::kComponentUpdateRequired: { + } diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h index 06b6875bd37e..13c197b532ad 100644 --- content/browser/browser_plugin/browser_plugin_guest.h diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 44cf55a31..13f3f8330 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 6a837ad9df98..7abef83f2a47 100644 +index a69e547cdaa1..5fde8ab27021 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn @@ -5,6 +5,7 @@ @@ -10,7 +10,7 @@ index 6a837ad9df98..7abef83f2a47 100644 import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -145,6 +146,7 @@ static_library("renderer") { +@@ -146,6 +147,7 @@ static_library("renderer") { deps = [ "//base/allocator:buildflags", "//build:chromeos_buildflags", @@ -18,7 +18,7 @@ index 6a837ad9df98..7abef83f2a47 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -226,6 +228,10 @@ static_library("renderer") { +@@ -229,6 +231,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 f23b6f38a..95dd8b169 100644 --- a/patch/patches/chrome_runtime.patch +++ b/patch/patches/chrome_runtime.patch @@ -1,8 +1,8 @@ diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc -index db85b6b2fcf5..bcf6867e8f4e 100644 +index 826ef32f3033..238750f1c2ba 100644 --- chrome/app/chrome_main_delegate.cc +++ chrome/app/chrome_main_delegate.cc -@@ -28,6 +28,7 @@ +@@ -29,6 +29,7 @@ #include "base/trace_event/trace_event_impl.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -10,7 +10,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/chrome_resource_bundle_helper.h" #include "chrome/browser/defaults.h" -@@ -381,6 +382,8 @@ struct MainFunction { +@@ -380,6 +381,8 @@ struct MainFunction { // Initializes the user data dir. Must be called before InitializeLocalState(). void InitializeUserDataDir(base::CommandLine* command_line) { @@ -19,7 +19,7 @@ index db85b6b2fcf5..bcf6867e8f4e 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. -@@ -658,7 +661,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { +@@ -657,7 +660,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() { } #if defined(OS_WIN) @@ -29,7 +29,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 base::sequence_manager::internal::ThreadControllerPowerMonitor:: InitializeOnMainThread(); #endif -@@ -943,6 +948,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -950,6 +955,7 @@ void ChromeMainDelegate::PreSandboxStartup() { std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); @@ -37,7 +37,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 crash_reporter::InitializeCrashKeys(); #if defined(OS_POSIX) -@@ -953,6 +959,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -960,6 +966,7 @@ void ChromeMainDelegate::PreSandboxStartup() { InitMacCrashReporter(command_line, process_type); SetUpInstallerPreferences(command_line); #endif @@ -45,7 +45,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 #if defined(OS_WIN) child_process_logging::Init(); -@@ -1075,6 +1082,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1083,6 +1090,7 @@ void ChromeMainDelegate::PreSandboxStartup() { locale; } @@ -53,7 +53,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 #if defined(OS_POSIX) && !defined(OS_MAC) // Zygote needs to call InitCrashReporter() in RunZygote(). if (process_type != switches::kZygoteProcess) { -@@ -1107,6 +1115,7 @@ void ChromeMainDelegate::PreSandboxStartup() { +@@ -1115,6 +1123,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 db85b6b2fcf5..bcf6867e8f4e 100644 #if BUILDFLAG(ENABLE_PDF) MaybeInitializeGDI(); -@@ -1205,6 +1214,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1213,6 +1222,7 @@ void ChromeMainDelegate::ZygoteForked() { SetUpProfilingShutdownHandler(); } @@ -69,7 +69,7 @@ index db85b6b2fcf5..bcf6867e8f4e 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 = -@@ -1221,6 +1231,7 @@ void ChromeMainDelegate::ZygoteForked() { +@@ -1229,6 +1239,7 @@ void ChromeMainDelegate::ZygoteForked() { // Reset the command line for the newly spawned process. crash_keys::SetCrashKeysFromCommandLine(*command_line); @@ -78,7 +78,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644 #endif // defined(OS_LINUX) || defined(OS_CHROMEOS) diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc -index fee4d5f1a8ca..2e4fb506d851 100644 +index 65465803bd38..b521fd91a93b 100644 --- chrome/browser/chrome_browser_main.cc +++ chrome/browser/chrome_browser_main.cc @@ -49,6 +49,7 @@ @@ -89,7 +89,7 @@ index fee4d5f1a8ca..2e4fb506d851 100644 #include "chrome/browser/about_flags.h" #include "chrome/browser/active_use_util.h" #include "chrome/browser/after_startup_task_utils.h" -@@ -902,8 +903,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() { +@@ -900,8 +901,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 fee4d5f1a8ca..2e4fb506d851 100644 // These members must be initialized before returning from this function. // Android doesn't use StartupBrowserCreator. -@@ -1634,11 +1637,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { +@@ -1633,11 +1636,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { // This step is costly and is already measured in // Startup.StartupBrowserCreator_Start. // See the comment above for an explanation of |process_command_line|. @@ -117,7 +117,7 @@ index fee4d5f1a8ca..2e4fb506d851 100644 // of lacros-chrome is complete. #if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm -index c30b73c2575f..5da45a243f9b 100644 +index 8a33ce57766c..ca69a37eee22 100644 --- chrome/browser/chrome_browser_main_mac.mm +++ chrome/browser/chrome_browser_main_mac.mm @@ -16,6 +16,7 @@ @@ -128,7 +128,7 @@ index c30b73c2575f..5da45a243f9b 100644 #import "chrome/browser/app_controller_mac.h" #include "chrome/browser/apps/app_shim/app_shim_listener.h" #include "chrome/browser/browser_process.h" -@@ -111,6 +112,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { +@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { } } @@ -136,7 +136,7 @@ index c30b73c2575f..5da45a243f9b 100644 // Create the app delegate. This object is intentionally leaked as a global // singleton. It is accessed through -[NSApp delegate]. AppController* app_controller = [[AppController alloc] init]; -@@ -119,6 +121,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { +@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() { chrome::BuildMainMenu(NSApp, app_controller, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false); [app_controller mainMenuCreated]; @@ -144,7 +144,7 @@ index c30b73c2575f..5da45a243f9b 100644 PrefService* local_state = g_browser_process->local_state(); DCHECK(local_state); -@@ -175,7 +178,9 @@ void ChromeBrowserMainPartsMac::PostProfileInit() { +@@ -170,7 +173,9 @@ void ChromeBrowserMainPartsMac::PostProfileInit() { } void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { @@ -154,28 +154,27 @@ index c30b73c2575f..5da45a243f9b 100644 [appController didEndMainMessageLoop]; +#endif } -diff --git chrome/browser/notifications/notification_platform_bridge_mac.mm chrome/browser/notifications/notification_platform_bridge_mac.mm -index 9e8fcb9f9f91..2a9eaca0fb0d 100644 ---- chrome/browser/notifications/notification_platform_bridge_mac.mm -+++ chrome/browser/notifications/notification_platform_bridge_mac.mm -@@ -24,6 +24,7 @@ - #include "base/strings/sys_string_conversions.h" - #include "base/strings/utf_string_conversions.h" - #include "base/system/sys_info.h" -+#include "cef/libcef/features/runtime.h" - #include "chrome/browser/browser_features.h" - #include "chrome/browser/notifications/notification_common.h" - #include "chrome/browser/notifications/notification_display_service_impl.h" -@@ -451,6 +452,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId - - (id)serviceProxy { - id proxy = [_xpcConnection remoteObjectProxy]; +diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc +index 29ba5f21b38f..3ce05420eb78 100644 +--- chrome/browser/chrome_content_browser_client.cc ++++ chrome/browser/chrome_content_browser_client.cc +@@ -37,6 +37,7 @@ + #include "base/threading/thread_task_runner_handle.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/accessibility/caption_util.h" +@@ -3591,9 +3592,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated( + &search::HandleNewTabURLReverseRewrite); + #endif // defined(OS_ANDROID) -+ // 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()); ++#if !BUILDFLAG(ENABLE_CEF) + // chrome: & friends. + handler->AddHandlerPair(&ChromeContentBrowserClient::HandleWebUI, + &ChromeContentBrowserClient::HandleWebUIReverse); ++#endif + } + + base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { diff --git a/patch/patches/chrome_runtime_views.patch b/patch/patches/chrome_runtime_views.patch index 29d3ffdc0..55fe0164d 100644 --- a/patch/patches/chrome_runtime_views.patch +++ b/patch/patches/chrome_runtime_views.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc -index 5c03f250e500..ecfce9c2c7c7 100644 +index 7c0229c202ca..67320e907526 100644 --- chrome/browser/ui/views/frame/browser_frame.cc +++ chrome/browser/ui/views/frame/browser_frame.cc -@@ -63,15 +63,23 @@ bool IsUsingGtkTheme(Profile* profile) { +@@ -64,15 +64,23 @@ bool IsUsingGtkTheme(Profile* profile) { //////////////////////////////////////////////////////////////////////////////// // BrowserFrame, public: @@ -28,7 +28,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644 } BrowserFrame::~BrowserFrame() {} -@@ -133,6 +141,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( +@@ -131,6 +139,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion( } int BrowserFrame::GetTopInset() const { @@ -41,7 +41,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644 return browser_frame_view_->GetTopInset(false); } -@@ -167,15 +181,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, +@@ -165,15 +179,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds, content::KeyboardEventProcessingResult BrowserFrame::PreHandleKeyboardEvent( const content::NativeWebKeyboardEvent& event) { @@ -63,7 +63,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644 browser_frame_view_->OnBrowserViewInitViewsComplete(); } -@@ -208,7 +228,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { +@@ -206,7 +226,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const { } const ui::NativeTheme* BrowserFrame::GetNativeTheme() const { @@ -74,7 +74,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644 ->UsingDefaultTheme()) { return ui::NativeTheme::GetInstanceForDarkUI(); diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h -index 3a1314f21ce4..f9464abc97a7 100644 +index 050c0e05e4e3..0bbcf4af9a92 100644 --- chrome/browser/ui/views/frame/browser_frame.h +++ chrome/browser/ui/views/frame/browser_frame.h @@ -53,7 +53,9 @@ enum class TabDragKind { @@ -88,12 +88,12 @@ index 3a1314f21ce4..f9464abc97a7 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 c4d99326bacf..3c7b45b99186 100644 +index 7d93faeadd2c..9b10c7f86c5c 100644 --- chrome/browser/ui/views/frame/browser_view.cc +++ chrome/browser/ui/views/frame/browser_view.cc -@@ -545,16 +545,26 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { - // static - const char BrowserView::kViewClassName[] = "BrowserView"; +@@ -557,11 +557,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver { + /////////////////////////////////////////////////////////////////////////////// + // BrowserView, public: +BrowserView::BrowserView() : BrowserView(nullptr) {} + @@ -113,14 +113,17 @@ index c4d99326bacf..3c7b45b99186 100644 + immersive_mode_controller_ = chrome::CreateImmersiveModeController(); + SetShowIcon(::ShouldShowWindowIcon(browser_.get())); - SetHasWindowSizeControls(!chrome::IsRunningInForcedAppMode()); + + // In forced app mode, all size controls are always disabled. Otherwise, use +@@ -575,7 +586,6 @@ BrowserView::BrowserView(std::unique_ptr browser) + } browser_->tab_strip_model()->AddObserver(this); - immersive_mode_controller_ = chrome::CreateImmersiveModeController(); // Top container holds tab strip region and toolbar and lives at the front of // the view hierarchy. -@@ -1340,6 +1350,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { +@@ -1368,6 +1378,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const { if (immersive_mode_controller_->IsEnabled()) return false; @@ -129,7 +132,7 @@ index c4d99326bacf..3c7b45b99186 100644 return frame_->GetFrameView()->ShouldHideTopUIForFullscreen(); } -@@ -2357,7 +2369,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { +@@ -2393,7 +2405,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const { } void BrowserView::ReparentTopContainerForEndOfImmersive() { @@ -139,7 +142,7 @@ index c4d99326bacf..3c7b45b99186 100644 top_container()->DestroyLayer(); AddChildViewAt(top_container(), 0); EnsureFocusOrder(); -@@ -2804,7 +2817,8 @@ void BrowserView::Layout() { +@@ -2841,7 +2854,8 @@ void BrowserView::Layout() { // TODO(jamescook): Why was this in the middle of layout code? toolbar_->location_bar()->omnibox_view()->SetFocusBehavior( IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER); @@ -149,7 +152,7 @@ index c4d99326bacf..3c7b45b99186 100644 // Some of the situations when the BrowserView is laid out are: // - Enter/exit immersive fullscreen mode. -@@ -2907,7 +2921,8 @@ void BrowserView::AddedToWidget() { +@@ -2944,7 +2958,8 @@ void BrowserView::AddedToWidget() { SetToolbarButtonProvider(toolbar_); frame_->OnBrowserViewInitViewsComplete(); @@ -160,24 +163,24 @@ index c4d99326bacf..3c7b45b99186 100644 MaybeInitializeWebUITabStrip(); diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h -index 986798357dbc..2793bf7b184e 100644 +index e4955ccbb929..e678754ee361 100644 --- chrome/browser/ui/views/frame/browser_view.h +++ chrome/browser/ui/views/frame/browser_view.h -@@ -117,7 +117,9 @@ class BrowserView : public BrowserWindow, - // The browser view's class name. - static const char kViewClassName[]; - +@@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow, + public webapps::AppBannerManager::Observer { + public: + METADATA_HEADER(BrowserView); + BrowserView(); explicit BrowserView(std::unique_ptr browser); + void InitBrowser(std::unique_ptr browser); + BrowserView(const BrowserView&) = delete; + BrowserView& operator=(const BrowserView&) = delete; ~BrowserView() override; - - void set_frame(BrowserFrame* frame) { frame_ = frame; } diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index 824acb2c7c8a..cd81e0e3f4d3 100644 +index 975817e079eb..f77c24d294bc 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -@@ -578,37 +578,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( +@@ -571,37 +571,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup( } bool BrowserTabStripController::IsFrameCondensed() const { diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 03f299c9a..6c377c1ce 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,9 +1,9 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index 71bc09b46ad6..ddf0da9b330e 100644 +index e5009f30f6f5..8190a72bd450 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn -@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni") - import("//build/config/chrome_build.gni") +@@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni") + import("//build/config/chromeos/ui_mode.gni") import("//build/config/chromeos/ui_mode.gni") import("//build/config/features.gni") +import("//cef/libcef/features/features.gni") diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 21a23b670..8393440d6 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -1,5 +1,5 @@ diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h -index 36ab5d592ecb..e61236132220 100644 +index 572f521ae88c..995d17a90f0d 100644 --- content/browser/devtools/devtools_instrumentation.h +++ content/browser/devtools/devtools_instrumentation.h @@ -12,6 +12,7 @@ @@ -20,7 +20,7 @@ index 36ab5d592ecb..e61236132220 100644 bool is_navigation, bool is_download, diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h -index 4dd9b2645d60..23b46ce1a43a 100644 +index eef661b3e095..6c0dacfa4bc3 100644 --- content/browser/renderer_host/input/synthetic_gesture_target_base.h +++ content/browser/renderer_host/input/synthetic_gesture_target_base.h @@ -9,6 +9,7 @@ diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index d00c5233f..7c00bd271 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index 21ab45886df2..ee7394fd10eb 100644 +index f094105ac70c..b5f4616ff821 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -660,7 +660,7 @@ void IsHandledBySafePlugin(int render_process_id, +@@ -672,7 +672,7 @@ void IsHandledBySafePlugin(int render_process_id, content::PluginService* plugin_service = content::PluginService::GetInstance(); bool plugin_found = plugin_service->GetPluginInfo( @@ -36,7 +36,7 @@ index 937d3d5bc84f..ac327392dcf3 100644 content::WebPluginInfo* plugin) override; diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc -index 5b780f8bf34c..a75d0da983b4 100644 +index d0a5a12620bd..a02e13bbd815 100644 --- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc +++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc @@ -65,7 +65,7 @@ bool IsPDFPluginEnabled(content::NavigationHandle* navigation_handle, @@ -49,10 +49,10 @@ index 5b780f8bf34c..a75d0da983b4 100644 false /* allow_wildcard */, is_stale, &plugin_info, nullptr /* actual_mime_type */); diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index 88fa7da1411e..98d0ea7650ed 100644 +index c2418d12834a..6705fd4c60b3 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc -@@ -77,7 +77,7 @@ void OnFindURLMimeType(const GURL& url, +@@ -81,7 +81,7 @@ void OnFindURLMimeType(const GURL& url, #if BUILDFLAG(ENABLE_PLUGINS) content::WebPluginInfo plugin; result = result || content::PluginService::GetInstance()->GetPluginInfo( @@ -75,10 +75,10 @@ index 962bb7e2de76..40fc7e92c7cb 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 2b0f1c354cf2..2d2dde9412c3 100644 +index 4ff0e88bce7a..abca390b7f82 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -611,6 +611,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( +@@ -628,6 +628,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest( resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -92,7 +92,7 @@ index 2b0f1c354cf2..2d2dde9412c3 100644 if (loader_factory) { factory = base::MakeRefCounted( std::move(loader_factory)); -@@ -814,7 +821,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse( +@@ -831,7 +838,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( @@ -187,73 +187,67 @@ index 632ae86c6fd6..55b749ec1242 100644 GetPluginsCallback callback, const std::vector& all_plugins); -diff --git content/browser/renderer_host/render_frame_message_filter.cc content/browser/renderer_host/render_frame_message_filter.cc -index 9cc3d077d14b..94af64f0c960 100644 ---- content/browser/renderer_host/render_frame_message_filter.cc -+++ content/browser/renderer_host/render_frame_message_filter.cc -@@ -144,6 +144,7 @@ void RenderFrameMessageFilter::OverrideThreadForMessage( - void RenderFrameMessageFilter::OnGetPluginInfo( - int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool* found, -@@ -151,8 +152,9 @@ void RenderFrameMessageFilter::OnGetPluginInfo( - std::string* actual_mime_type) { - bool allow_wildcard = true; - *found = plugin_service_->GetPluginInfo( -- render_process_id_, render_frame_id, url, main_frame_origin, mime_type, -- allow_wildcard, nullptr, info, actual_mime_type); -+ render_process_id_, render_frame_id, url, is_main_frame, -+ main_frame_origin, mime_type, allow_wildcard, nullptr, info, -+ actual_mime_type); +diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc +index ea74ff6875fd..0c14ce034b96 100644 +--- content/browser/renderer_host/render_frame_host_impl.cc ++++ content/browser/renderer_host/render_frame_host_impl.cc +@@ -10452,6 +10452,7 @@ void RenderFrameHostImpl::BindHungDetectorHost( } - void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( -diff --git content/browser/renderer_host/render_frame_message_filter.h content/browser/renderer_host/render_frame_message_filter.h -index 100c3936190c..b6a37c4220d9 100644 ---- content/browser/renderer_host/render_frame_message_filter.h -+++ content/browser/renderer_host/render_frame_message_filter.h -@@ -66,6 +66,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter { - - void OnGetPluginInfo(int render_frame_id, - const GURL& url, -+ bool is_main_frame, - const url::Origin& main_frame_origin, - const std::string& mime_type, - bool* found, -diff --git content/common/frame_messages.h content/common/frame_messages.h -index 4bb04980b544..4e1e448a8bfc 100644 ---- content/common/frame_messages.h -+++ content/common/frame_messages.h -@@ -249,9 +249,10 @@ IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction, - // type. If there is no matching plugin, |found| is false. - // |actual_mime_type| is the actual mime type supported by the - // found plugin. --IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo, -+IPC_SYNC_MESSAGE_CONTROL5_3(FrameHostMsg_GetPluginInfo, - int /* render_frame_id */, - GURL /* url */, -+ bool /* is_main_frame */, - url::Origin /* main_frame_origin */, - std::string /* mime_type */, - bool /* found */, + void RenderFrameHostImpl::GetPluginInfo(const GURL& url, ++ bool is_main_frame, + const url::Origin& main_frame_origin, + const std::string& mime_type, + GetPluginInfoCallback callback) { +@@ -10459,7 +10460,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url, + WebPluginInfo info; + std::string actual_mime_type; + bool found = PluginServiceImpl::GetInstance()->GetPluginInfo( +- GetProcess()->GetID(), routing_id_, url, main_frame_origin, mime_type, ++ GetProcess()->GetID(), routing_id_, url, is_main_frame, ++ main_frame_origin, mime_type, + allow_wildcard, nullptr, &info, &actual_mime_type); + 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 6f7b14d24a4d..8b34229944a8 100644 +--- content/browser/renderer_host/render_frame_host_impl.h ++++ content/browser/renderer_host/render_frame_host_impl.h +@@ -2234,6 +2234,7 @@ class CONTENT_EXPORT RenderFrameHostImpl + int32_t plugin_child_id, + const base::FilePath& path) override; + void GetPluginInfo(const GURL& url, ++ bool is_main_frame, + const url::Origin& main_frame_origin, + const std::string& mime_type, + GetPluginInfoCallback callback) override; +diff --git content/common/pepper_plugin.mojom content/common/pepper_plugin.mojom +index a415743ed665..5115a2407a8b 100644 +--- content/common/pepper_plugin.mojom ++++ content/common/pepper_plugin.mojom +@@ -29,6 +29,7 @@ interface PepperHost { + // found plugin. + [Sync] + GetPluginInfo(url.mojom.Url url, ++ bool is_main_frame, + url.mojom.Origin main_frame_origin, + string mime_type) => + (bool found, diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc -index 4438e0417b3c..cdc59afa7f54 100644 +index c8926e0e832d..d50adb22082e 100644 --- content/public/browser/content_browser_client.cc +++ content/public/browser/content_browser_client.cc @@ -9,7 +9,7 @@ // declarations instead of including more headers. If that is infeasible, adjust // the limit. For more info, see // https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md --#pragma clang max_tokens_here 830000 -+// #pragma clang max_tokens_here 830000 +-#pragma clang max_tokens_here 850000 ++// #pragma clang max_tokens_here 850000 #include diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index df6e463d1518..68ab6d8748eb 100644 +index 3aed911c525b..1ac73a132e3c 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h @@ -32,6 +32,7 @@ @@ -264,7 +258,7 @@ index df6e463d1518..68ab6d8748eb 100644 #include "content/public/common/page_visibility_state.h" #include "content/public/common/window_container_type.mojom-forward.h" #include "device/vr/buildflags/buildflags.h" -@@ -1686,6 +1687,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1731,6 +1732,14 @@ class CONTENT_EXPORT ContentBrowserClient { const base::Optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -279,7 +273,7 @@ index df6e463d1518..68ab6d8748eb 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. -@@ -1757,6 +1766,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1802,6 +1811,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -315,10 +309,10 @@ index 98c59005599e..69752184745d 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index a4695ba832fc..3eb41cb569b1 100644 +index 007e4df297a8..52017e661809 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -85,6 +85,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -83,6 +83,9 @@ class CONTENT_EXPORT ContentRendererClient { // binding requests from RenderProcessHost::BindReceiver(). virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {} @@ -328,7 +322,7 @@ index a4695ba832fc..3eb41cb569b1 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -301,6 +304,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -299,6 +302,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -340,24 +334,24 @@ index a4695ba832fc..3eb41cb569b1 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index fcb99889673b..9d50aa58f325 100644 +index 0c9fc86e80a1..6653b5de4385 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3639,7 +3639,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3564,7 +3564,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( + WebPluginInfo info; std::string mime_type; bool found = false; - Send(new FrameHostMsg_GetPluginInfo( -- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(), -+ routing_id_, params.url, frame_->Parent() == nullptr, -+ frame_->Top()->GetSecurityOrigin(), - params.mime_type.Utf8(), &found, &info, &mime_type)); +- GetPepperHost()->GetPluginInfo(params.url, frame_->Top()->GetSecurityOrigin(), ++ GetPepperHost()->GetPluginInfo(params.url, frame_->Parent() == nullptr, ++ frame_->Top()->GetSecurityOrigin(), + params.mime_type.Utf8(), &found, &info, + &mime_type); if (!found) - return nullptr; diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index aa1fc3821b47..922aacc8f08e 100644 +index ebc8e7006453..51f7d8044925 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -609,6 +609,8 @@ void RenderThreadImpl::Init() { +@@ -608,6 +608,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( URLLoaderThrottleProviderType::kFrame); @@ -367,10 +361,10 @@ index aa1fc3821b47..922aacc8f08e 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index d21f7e95c856..98f3739e60fc 100644 +index c5974db34669..520536f76c72 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -996,6 +996,15 @@ void RendererBlinkPlatformImpl::SetActiveURL(const blink::WebURL& url, +@@ -1026,6 +1026,15 @@ void RendererBlinkPlatformImpl::SetActiveURL(const blink::WebURL& url, //------------------------------------------------------------------------------ @@ -387,10 +381,10 @@ index d21f7e95c856..98f3739e60fc 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 c8470ab1919a..2c000a557a0a 100644 +index bd141ff762ab..857a92a35a84 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -218,6 +218,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -219,6 +219,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void SetActiveURL(const blink::WebURL& url, const blink::WebString& top_url) override; diff --git a/patch/patches/content_main_654986.patch b/patch/patches/content_main_654986.patch index 613eae58b..640600117 100644 --- a/patch/patches/content_main_654986.patch +++ b/patch/patches/content_main_654986.patch @@ -111,18 +111,18 @@ index 2aba28d210db..00edc202e2c4 100644 return RunContentProcess(params, runner.get()); } diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 811017f5d455..57055727e83d 100644 +index 7873fad0a61b..425c30a56699 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc -@@ -48,6 +48,7 @@ - #include "base/task/post_task.h" +@@ -44,6 +44,7 @@ #include "base/task/thread_pool/thread_pool_instance.h" #include "base/threading/hang_watcher.h" + #include "base/threading/platform_thread.h" +#include "base/threading/thread_restrictions.h" + #include "base/time/time.h" #include "base/trace_event/trace_event.h" - #include "components/discardable_memory/service/discardable_shared_memory_manager.h" - #include "components/download/public/common/download_task_runner.h" -@@ -1089,6 +1090,11 @@ void ContentMainRunnerImpl::Shutdown() { + #include "build/build_config.h" +@@ -1092,6 +1093,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 83fb5dd57..797ca7e86 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -209,10 +209,10 @@ index 9ea80370a842..3043f7d32f33 100644 extern void InitCrashKeysForTesting(); diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc -index 1d0fb4f2a633..8226a3d792be 100644 +index 89b4bfccd5d3..7cb0a85470d2 100644 --- components/crash/core/app/crash_reporter_client.cc +++ components/crash/core/app/crash_reporter_client.cc -@@ -88,7 +88,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { +@@ -87,7 +87,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { } #endif @@ -221,7 +221,7 @@ index 1d0fb4f2a633..8226a3d792be 100644 void CrashReporterClient::GetProductNameAndVersion(const char** product_name, const char** version) { } -@@ -97,6 +97,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name, +@@ -96,6 +96,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name, std::string* version, std::string* channel) {} @@ -229,15 +229,15 @@ index 1d0fb4f2a633..8226a3d792be 100644 base::FilePath CrashReporterClient::GetReporterLogFilename() { return base::FilePath(); } -@@ -106,6 +107,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename, +@@ -105,6 +106,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename, return false; } #endif +#endif #if defined(OS_WIN) - bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { -@@ -140,6 +142,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { + bool CrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) { +@@ -139,6 +141,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { return false; } @@ -251,8 +251,8 @@ index 1d0fb4f2a633..8226a3d792be 100644 +} + +#if defined(OS_WIN) -+base::string16 CrashReporterClient::GetCrashExternalHandler( -+ const base::string16& exe_dir) { ++std::wstring CrashReporterClient::GetCrashExternalHandler( ++ const std::wstring& exe_dir) { + return exe_dir + L"\\crashpad_handler.exe"; +} +#endif @@ -266,7 +266,7 @@ index 1d0fb4f2a633..8226a3d792be 100644 #if defined(OS_ANDROID) unsigned int CrashReporterClient::GetCrashDumpPercentage() { return 100; -@@ -202,9 +226,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { +@@ -201,9 +225,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { return false; } @@ -282,7 +282,7 @@ index 1d0fb4f2a633..8226a3d792be 100644 } // namespace crash_reporter diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h -index aaa9ad1d58d7..14b98b2e6598 100644 +index 39557cce4744..236806090021 100644 --- components/crash/core/app/crash_reporter_client.h +++ components/crash/core/app/crash_reporter_client.h @@ -5,7 +5,9 @@ @@ -293,9 +293,9 @@ index aaa9ad1d58d7..14b98b2e6598 100644 #include +#include - #include "base/strings/string16.h" #include "build/build_config.h" -@@ -88,7 +90,7 @@ class CrashReporterClient { + +@@ -87,7 +89,7 @@ class CrashReporterClient { virtual int GetResultCodeRespawnFailed(); #endif @@ -304,7 +304,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644 // Returns a textual description of the product type and version to include // in the crash report. Neither out parameter should be set to NULL. // TODO(jperaza): Remove the 2-parameter overload of this method once all -@@ -99,6 +101,7 @@ class CrashReporterClient { +@@ -98,6 +100,7 @@ class CrashReporterClient { std::string* version, std::string* channel); @@ -312,7 +312,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644 virtual base::FilePath GetReporterLogFilename(); // Custom crash minidump handler after the minidump is generated. -@@ -108,6 +111,7 @@ class CrashReporterClient { +@@ -107,6 +110,7 @@ class CrashReporterClient { // libc nor allocate memory normally. virtual bool HandleCrashDump(const char* crashdump_filename, uint64_t crash_pid); @@ -320,7 +320,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644 #endif // The location where minidump files should be written. Returns true if -@@ -205,6 +209,27 @@ class CrashReporterClient { +@@ -204,6 +208,27 @@ class CrashReporterClient { // Returns true if breakpad should run in the given process type. virtual bool EnableBreakpadForProcess(const std::string& process_type); @@ -330,7 +330,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644 + +#if defined(OS_WIN) + // Returns the absolute path to the external crash handler exe. -+ virtual base::string16 GetCrashExternalHandler(const base::string16& exe_dir); ++ virtual std::wstring GetCrashExternalHandler(const std::wstring& exe_dir); +#endif + +#if defined(OS_MAC) @@ -349,7 +349,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644 } // namespace crash_reporter diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc -index 64ca38330be7..4de20a66cd99 100644 +index 5117ded1e214..0d86e0363315 100644 --- components/crash/core/app/crashpad.cc +++ components/crash/core/app/crashpad.cc @@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -463,23 +463,23 @@ index eb675321436a..4e74af742ed5 100644 handler_path, database_path, metrics_path, url, GetProcessSimpleAnnotations(), arguments, true, false); diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc -index c199b467ffeb..1037a285b74c 100644 +index c66a6dfc6f5d..2d80782ab341 100644 --- components/crash/core/app/crashpad_win.cc +++ components/crash/core/app/crashpad_win.cc @@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations( - base::string16 product_name, version, special_build, channel_name; + std::wstring product_name, version, special_build, channel_name; crash_reporter_client->GetProductNameAndVersion( exe_file, &product_name, &version, &special_build, &channel_name); -- (*annotations)["prod"] = base::UTF16ToUTF8(product_name); -- (*annotations)["ver"] = base::UTF16ToUTF8(version); -+ (*annotations)["product"] = base::UTF16ToUTF8(product_name); -+ (*annotations)["version"] = base::UTF16ToUTF8(version); +- (*annotations)["prod"] = base::WideToUTF8(product_name); +- (*annotations)["ver"] = base::WideToUTF8(version); ++ (*annotations)["product"] = base::WideToUTF8(product_name); ++ (*annotations)["version"] = base::WideToUTF8(version); #if BUILDFLAG(GOOGLE_CHROME_BRANDING) // Empty means stable. const bool allow_empty_channel = true; @@ -49,9 +49,9 @@ void GetPlatformCrashpadAnnotations( if (!special_build.empty()) - (*annotations)["special"] = base::UTF16ToUTF8(special_build); + (*annotations)["special"] = base::WideToUTF8(special_build); #if defined(ARCH_CPU_X86) - (*annotations)["plat"] = std::string("Win32"); + (*annotations)["platform"] = std::string("win32"); diff --git a/patch/patches/embedder_product_override.patch b/patch/patches/embedder_product_override.patch new file mode 100644 index 000000000..8f5676d68 --- /dev/null +++ b/patch/patches/embedder_product_override.patch @@ -0,0 +1,23 @@ +diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc +index cf596ae9aae8..7c1869000cf3 100644 +--- components/embedder_support/user_agent_utils.cc ++++ components/embedder_support/user_agent_utils.cc +@@ -7,6 +7,7 @@ + #include "base/command_line.h" + #include "base/strings/strcat.h" + #include "build/branding_buildflags.h" ++#include "chrome/common/chrome_switches.h" + #include "components/embedder_support/switches.h" + #include "components/version_info/version_info.h" + #include "content/public/browser/web_contents.h" +@@ -20,6 +21,10 @@ + namespace embedder_support { + + std::string GetProduct() { ++ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); ++ if (command_line->HasSwitch(switches::kProductVersion)) ++ return command_line->GetSwitchValueASCII(switches::kProductVersion); ++ + return version_info::GetProductNameAndVersionForUserAgent(); + } + diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index f61c2b109..5a42564a8 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,53 +1,52 @@ diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc -index 3ce42bd3bc3c..e5bda4ae4f1f 100644 +index 5c903a13a14e..d385c6c0c95c 100644 --- chrome/browser/extensions/api/streams_private/streams_private_api.cc +++ chrome/browser/extensions/api/streams_private/streams_private_api.cc @@ -6,6 +6,7 @@ #include -+#include "cef/libcef/features/features.h" ++#include "cef/libcef/features/runtime.h" #include "chrome/browser/extensions/extension_tab_util.h" - #include "chrome/browser/prefetch/no_state_prefetch/chrome_prerender_contents_delegate.h" - #include "components/no_state_prefetch/browser/prerender_contents.h" + #include "chrome/browser/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h" + #include "components/no_state_prefetch/browser/no_state_prefetch_contents.h" @@ -42,6 +43,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( if (!web_contents) return; -+#if !BUILDFLAG(ENABLE_CEF) - // If the request was for a prerender, abort the prerender and do not - // continue. This is because plugins cancel prerender, see ++ if (!cef::IsAlloyRuntimeEnabled()) { + // If the request was for NoStatePrefetch, abort the prefetcher and do not + // continue. This is because plugins cancel NoStatePrefetch, see // http://crbug.com/343590. -@@ -51,6 +53,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( - prerender_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD); +@@ -52,6 +54,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent( + no_state_prefetch_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD); return; } -+#endif // !BUILDFLAG(ENABLE_CEF) ++ } auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 0f588c70627f..a1b9ea21cc72 100644 +index b4878f7497df..8a87d04740b7 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc -@@ -66,11 +66,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, +@@ -61,11 +61,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || host_type == VIEW_TYPE_EXTENSION_DIALOG || host_type == VIEW_TYPE_EXTENSION_POPUP); - host_contents_ = WebContents::Create( -- WebContents::CreateParams(browser_context_, site_instance)), -- content::WebContentsObserver::Observe(host_contents_.get()); + host_contents_owned_ = WebContents::Create( -+ WebContents::CreateParams(browser_context_, site_instance)); + WebContents::CreateParams(browser_context_, site_instance)), +- content::WebContentsObserver::Observe(host_contents_.get()); + host_contents_ = host_contents_owned_.get(); + content::WebContentsObserver::Observe(host_contents_); host_contents_->SetDelegate(this); - SetViewType(host_contents_.get(), host_type); + SetViewType(host_contents_, host_type); + main_frame_host_ = host_contents_->GetMainFrame(); - render_view_host_ = host_contents_->GetRenderViewHost(); - -@@ -85,6 +86,48 @@ ExtensionHost::ExtensionHost(const Extension* extension, + // Listen for when an extension is unloaded from the same profile, as it may +@@ -79,6 +80,44 @@ ExtensionHost::ExtensionHost(const Extension* extension, dispatcher()->set_delegate(this); } @@ -62,10 +61,6 @@ index 0f588c70627f..a1b9ea21cc72 100644 + extension_id_(extension->id()), + browser_context_(browser_context), + host_contents_(host_contents), -+ render_view_host_(nullptr), -+ is_render_view_creation_pending_(false), -+ has_loaded_once_(false), -+ document_element_available_(false), + initial_url_(url), + extension_host_type_(host_type) { + DCHECK(delegate); @@ -80,7 +75,7 @@ index 0f588c70627f..a1b9ea21cc72 100644 + content::WebContentsObserver::Observe(host_contents_); + SetViewType(host_contents_, host_type); + -+ render_view_host_ = host_contents_->GetRenderViewHost(); ++ main_frame_host_ = host_contents_->GetMainFrame(); + + // Listen for when an extension is unloaded from the same profile, as it may + // be the same extension that this points to. @@ -97,10 +92,10 @@ index 0f588c70627f..a1b9ea21cc72 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index 11bfec21cc9f..416de61f85fa 100644 +index 59798a628937..2018abb8324b 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h -@@ -51,13 +51,19 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost, ExtensionHost(const Extension* extension, content::SiteInstance* site_instance, const GURL& url, ViewType host_type); @@ -118,10 +113,10 @@ index 11bfec21cc9f..416de61f85fa 100644 const std::string& extension_id() const { return extension_id_; } - content::WebContents* host_contents() const { return host_contents_.get(); } + content::WebContents* host_contents() const { return host_contents_; } - content::RenderViewHost* render_view_host() const; + 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_; } -@@ -178,7 +184,8 @@ class ExtensionHost : public DeferredStartRenderHost, +@@ -180,7 +186,8 @@ class ExtensionHost : public DeferredStartRenderHost, content::BrowserContext* browser_context_; // The host for our HTML content. @@ -129,8 +124,8 @@ index 11bfec21cc9f..416de61f85fa 100644 + std::unique_ptr host_contents_owned_; + content::WebContents* host_contents_; - // A weak pointer to the current or pending RenderViewHost. We don't access - // this through the host_contents because we want to deal with the pending + // 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 c2d194ec21be..3a7354f648ed 100644 --- extensions/browser/extensions_browser_client.h @@ -167,10 +162,10 @@ index c2d194ec21be..3a7354f648ed 100644 // once each time the extensions system is loaded per browser_context. The // implementation may wish to use the BrowserContext to record the current diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc -index 337921842180..c78e1d114a12 100644 +index 2bc2248ba920..583419786f28 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc -@@ -395,9 +395,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, +@@ -389,9 +389,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, return true; // TODO(kalman): return false here? It might break things... DVLOG(1) << "CreateBackgroundHost " << extension->id(); @@ -187,6 +182,6 @@ index 337921842180..c78e1d114a12 100644 + host = new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url, + VIEW_TYPE_EXTENSION_BACKGROUND_PAGE); + } - host->CreateRenderViewSoon(); + host->CreateRendererSoon(); OnBackgroundHostCreated(host); return true; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index 0d560cf1b..b2b1e047d 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 0c25000917fb..cdaf3a6799c2 100644 +index 01b2f70c1378..a14dd637774e 100644 --- .gn +++ .gn -@@ -275,6 +275,8 @@ exec_script_whitelist = +@@ -190,6 +190,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,7 +12,7 @@ index 0c25000917fb..cdaf3a6799c2 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 86c82ac5cf8a..ea0959f631b4 100644 +index 6df566bd7df4..d8f539493342 100644 --- BUILD.gn +++ BUILD.gn @@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni") @@ -23,8 +23,8 @@ index 86c82ac5cf8a..ea0959f631b4 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/media/router/features.gni") import("//components/nacl/features.gni") -@@ -244,6 +245,9 @@ group("gn_all") { - "//third_party/angle/src/tests:angle_white_box_tests", +@@ -247,6 +248,9 @@ group("gn_all") { + "//media/cast:cast_unittests", "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", ] + if (enable_cef) { @@ -79,7 +79,7 @@ index 839144aa1e9b..29c8ab32398a 100644 +_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow + diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 6ad9c87a3adf..a47694446b9a 100644 +index 63e7ca2c10c1..14f777c10cd6 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni @@ -4,6 +4,7 @@ @@ -90,8 +90,8 @@ index 6ad9c87a3adf..a47694446b9a 100644 import("//chrome/browser/buildflags.gni") import("//chrome/browser/resources/pdf/ink/ink.gni") import("//chrome/common/features.gni") -@@ -255,6 +256,10 @@ template("chrome_extra_paks") { - "//chrome/browser/resources/welcome:welcome_resources", +@@ -269,6 +270,10 @@ template("chrome_extra_paks") { + "//chrome/browser/resources/welcome:resources", ] } + if (enable_cef) { @@ -125,7 +125,7 @@ index a64a23560460..b08eee1f789a 100644 source_patterns += [ "${root_gen_dir}/extensions/strings/extensions_strings_" ] diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index 5f5cb1c752f2..ef0a01caf9cd 100644 +index ae43217ef207..2f0b95687263 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn @@ -6,6 +6,7 @@ import("//build/config/compiler/compiler.gni") diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 48814dce4..bd80a6115 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 1343d7c03b07..79843c9d7ae7 100644 +index c9e9d621c730..edeaa3662ede 100644 --- tools/gritsettings/resource_ids.spec +++ tools/gritsettings/resource_ids.spec -@@ -703,4 +703,13 @@ +@@ -739,4 +739,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/libphonenumber.patch b/patch/patches/libphonenumber.patch new file mode 100644 index 000000000..231919c62 --- /dev/null +++ b/patch/patches/libphonenumber.patch @@ -0,0 +1,160 @@ +diff --git cpp/src/phonenumbers/encoding_utils.h cpp/src/phonenumbers/encoding_utils.h +index d4271832..0c65d2bf 100644 +--- cpp/src/phonenumbers/encoding_utils.h ++++ cpp/src/phonenumbers/encoding_utils.h +@@ -29,7 +29,7 @@ class EncodingUtils { + // the function stores 0xFFFD in the output variable and returns 1. + static inline int DecodeUTF8Char(const char* in, char32* out) { + Rune r; +- int len = chartorune(&r, in); ++ int len = _chartorune(&r, in); + *out = r; + return len; + } +diff --git cpp/src/phonenumbers/utf/rune.c cpp/src/phonenumbers/utf/rune.c +index b4aa93b5..6f7b0358 100644 +--- cpp/src/phonenumbers/utf/rune.c ++++ cpp/src/phonenumbers/utf/rune.c +@@ -64,7 +64,7 @@ enum + * reasons, we return 1 instead of 0. + */ + int +-charntorune(Rune *rune, const char *str, int length) ++_charntorune(Rune *rune, const char *str, int length) + { + int c, c1, c2, c3; + long l; +@@ -167,7 +167,7 @@ badlen: + * null-terminated strings. + */ + int +-chartorune(Rune *rune, const char *str) ++_chartorune(Rune *rune, const char *str) + { + int c, c1, c2, c3; + long l; +@@ -247,12 +247,12 @@ bad: + int + isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) + { +- *consumed = charntorune(rune, str, length); ++ *consumed = _charntorune(rune, str, length); + return *rune != Runeerror || *consumed == 3; + } + + int +-runetochar(char *str, const Rune *rune) ++_runetochar(char *str, const Rune *rune) + { + /* Runes are signed, so convert to unsigned for range check. */ + unsigned long c; +@@ -311,15 +311,15 @@ runetochar(char *str, const Rune *rune) + } + + int +-runelen(Rune rune) ++_runelen(Rune rune) + { + char str[10]; + +- return runetochar(str, &rune); ++ return _runetochar(str, &rune); + } + + int +-runenlen(const Rune *r, int nrune) ++_runenlen(const Rune *r, int nrune) + { + int nb, c; + +@@ -339,7 +339,7 @@ runenlen(const Rune *r, int nrune) + } + + int +-fullrune(const char *str, int n) ++_fullrune(const char *str, int n) + { + if (n > 0) { + int c = *(uchar*)str; +diff --git cpp/src/phonenumbers/utf/unicodetext.cc cpp/src/phonenumbers/utf/unicodetext.cc +index 11f68f76..86504a31 100644 +--- cpp/src/phonenumbers/utf/unicodetext.cc ++++ cpp/src/phonenumbers/utf/unicodetext.cc +@@ -362,7 +362,7 @@ void UnicodeText::push_back(char32 c) { + if (UniLib::IsValidCodepoint(c)) { + char buf[UTFmax]; + Rune rune = c; +- int len = runetochar(buf, &rune); ++ int len = _runetochar(buf, &rune); + if (UniLib::IsInterchangeValid(buf, len)) { + repr_.append(buf, len); + } else { +diff --git cpp/src/phonenumbers/utf/unilib.cc cpp/src/phonenumbers/utf/unilib.cc +index e890f974..ce549363 100644 +--- cpp/src/phonenumbers/utf/unilib.cc ++++ cpp/src/phonenumbers/utf/unilib.cc +@@ -50,7 +50,7 @@ int SpanInterchangeValid(const char* begin, int byte_length) { + const char* p = begin; + const char* end = begin + byte_length; + while (p < end) { +- int bytes_consumed = charntorune(&rune, p, end - p); ++ int bytes_consumed = _charntorune(&rune, p, end - p); + // We want to accept Runeerror == U+FFFD as a valid char, but it is used + // by chartorune to indicate error. Luckily, the real codepoint is size 3 + // while errors return bytes_consumed <= 1. +diff --git cpp/src/phonenumbers/utf/utf.h cpp/src/phonenumbers/utf/utf.h +index 72d01ed6..35fd0ea9 100644 +--- cpp/src/phonenumbers/utf/utf.h ++++ cpp/src/phonenumbers/utf/utf.h +@@ -46,7 +46,7 @@ extern "C" { + // runetochar copies (encodes) one rune, pointed to by r, to at most + // UTFmax bytes starting at s and returns the number of bytes generated. + +-int runetochar(char* s, const Rune* r); ++int _runetochar(char* s, const Rune* r); + + + // chartorune copies (decodes) at most UTFmax bytes starting at s to +@@ -59,7 +59,7 @@ int runetochar(char* s, const Rune* r); + // Unicode value 0 (i.e., ASCII NULL). A byte value of 0 is illegal + // anywhere else in a UTF sequence. + +-int chartorune(Rune* r, const char* s); ++int _chartorune(Rune* r, const char* s); + + + // charntorune is like chartorune, except that it will access at most +@@ -69,7 +69,7 @@ int chartorune(Rune* r, const char* s); + // + // Added 2004-09-24 by Wei-Hwa Huang + +-int charntorune(Rune* r, const char* s, int n); ++int _charntorune(Rune* r, const char* s, int n); + + // isvalidcharntorune(str, n, r, consumed) + // is a convenience function that calls "*consumed = charntorune(r, str, n)" +@@ -80,13 +80,13 @@ int isvalidcharntorune(const char* str, int n, Rune* r, int* consumed); + + // runelen returns the number of bytes required to convert r into UTF. + +-int runelen(Rune r); ++int _runelen(Rune r); + + + // runenlen returns the number of bytes required to convert the n + // runes pointed to by r into UTF. + +-int runenlen(const Rune* r, int n); ++int _runenlen(const Rune* r, int n); + + + // fullrune returns 1 if the string s of length n is long enough to be +@@ -95,7 +95,7 @@ int runenlen(const Rune* r, int n); + // by programs that obtain input one byte at a time and need to know + // when a full rune has arrived. + +-int fullrune(const char* s, int n); ++int _fullrune(const char* s, int n); + + // The following routines are analogous to the corresponding string + // routines with "utf" substituted for "str", and "rune" substituted diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index 7d35a5298..b15e0f8bc 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -25,7 +25,7 @@ index 0aaed76c1dda..517c3d8b5772 100644 if (base::PathExists(sandbox_candidate)) sandbox_binary = sandbox_candidate; diff --git ui/gl/init/gl_initializer_linux_x11.cc ui/gl/init/gl_initializer_linux_x11.cc -index fb6aab8f450c..115f88ed649e 100644 +index b1f21c4bf0e0..0eea60fa82f7 100644 --- ui/gl/init/gl_initializer_linux_x11.cc +++ ui/gl/init/gl_initializer_linux_x11.cc @@ -82,7 +82,7 @@ bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) { diff --git a/patch/patches/linux_atk_1123214.patch b/patch/patches/linux_atk_1123214.patch index dff7e4e38..96d14c3a6 100644 --- a/patch/patches/linux_atk_1123214.patch +++ b/patch/patches/linux_atk_1123214.patch @@ -1,9 +1,9 @@ diff --git build/config/linux/atk/BUILD.gn build/config/linux/atk/BUILD.gn -index aad2efa60d6c..fe9f30b82c22 100644 +index bc8e27894732..5d06ce988f25 100644 --- build/config/linux/atk/BUILD.gn +++ build/config/linux/atk/BUILD.gn -@@ -10,7 +10,7 @@ import("//build/config/ui.gni") - assert(!is_chromeos) +@@ -12,7 +12,7 @@ import("//build/config/ui.gni") + assert(!is_chromeos_ash) # These packages should _only_ be expected when building for a target. -assert(current_toolchain == default_toolchain) @@ -11,3 +11,16 @@ index aad2efa60d6c..fe9f30b82c22 100644 if (use_atk) { assert(use_glib, "use_atk=true requires that use_glib=true") +diff --git build/config/linux/atspi2/BUILD.gn build/config/linux/atspi2/BUILD.gn +index 988a99568136..1791ea607550 100644 +--- build/config/linux/atspi2/BUILD.gn ++++ build/config/linux/atspi2/BUILD.gn +@@ -6,7 +6,7 @@ import("//build/config/linux/pkg_config.gni") + import("//build/config/ui.gni") + + # These packages should _only_ be expected when building for a target. +-assert(current_toolchain == default_toolchain) ++# assert(current_toolchain == default_toolchain) + + if (use_atk) { + pkg_config("atspi2") { diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index 0cbeeccec..7524b67c2 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 ef08004ce68e..8176517e8318 100644 +index 9f6dfb1d1c00..b48c1d45aa11 100644 --- base/message_loop/message_pump_win.cc +++ base/message_loop/message_pump_win.cc @@ -2,6 +2,7 @@ @@ -30,7 +30,7 @@ index ef08004ce68e..8176517e8318 100644 } if (has_msg) diff --git base/task/current_thread.cc base/task/current_thread.cc -index 068c4f837dab..50d1e4a0b770 100644 +index bc572011b138..ccb208620402 100644 --- base/task/current_thread.cc +++ base/task/current_thread.cc @@ -47,6 +47,8 @@ void CurrentThread::AddDestructionObserver( @@ -43,10 +43,10 @@ index 068c4f837dab..50d1e4a0b770 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/task/current_thread.h base/task/current_thread.h -index 52c2dbec3cac..9c8d475f50ad 100644 +index 3f64b403c7eb..1130936a5f1f 100644 --- base/task/current_thread.h +++ base/task/current_thread.h -@@ -122,6 +122,12 @@ class BASE_EXPORT CurrentThread { +@@ -127,6 +127,12 @@ class BASE_EXPORT CurrentThread { // posted tasks. void SetAddQueueTimeToTasks(bool enable); @@ -59,7 +59,7 @@ index 52c2dbec3cac..9c8d475f50ad 100644 // Enables nested task processing in scope of an upcoming native message loop. // Some unwanted message loops may occur when using common controls or printer // functions. Hence, nested task processing is disabled by default to avoid -@@ -187,6 +193,13 @@ class BASE_EXPORT CurrentThread { +@@ -192,6 +198,13 @@ class BASE_EXPORT CurrentThread { friend class web::WebTaskEnvironment; sequence_manager::internal::SequenceManagerImpl* current_; diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 08234b42c..7709bf216 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -12,7 +12,7 @@ index 954e32c842a5..7563507d52d0 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 998d6d0c481f..e0f95ee4f7a0 100644 +index 8f4c53f3f3ca..ecc27f3f224c 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents( @@ -31,10 +31,10 @@ index 998d6d0c481f..e0f95ee4f7a0 100644 + if (delegate_) + delegate_->OnGuestAttached(); + + DCHECK(stream_->handler_url().SchemeIs(extensions::kExtensionScheme)); web_contents()->GetController().LoadURL( stream_->handler_url(), content::Referrer(), - ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); -@@ -246,6 +251,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { +@@ -247,6 +252,11 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const { return true; } @@ -47,7 +47,7 @@ index 998d6d0c481f..e0f95ee4f7a0 100644 WebContents* source, const content::OpenURLParams& params) { diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index a7f0b19a8ab9..dca296badbf6 100644 +index d9e22ce31927..e02b791a19f1 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h @@ -129,6 +129,7 @@ class MimeHandlerViewGuest diff --git a/patch/patches/net_cookie_flags.patch b/patch/patches/net_cookie_flags.patch index 20cd0b1e6..d297b66f9 100644 --- a/patch/patches/net_cookie_flags.patch +++ b/patch/patches/net_cookie_flags.patch @@ -10,7 +10,7 @@ index 96d1a51ec107..e8120a818b1f 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 9d993cce5e0e..bc12684c73c6 100644 +index 15cacc16cfa7..d7aa30baf147 100644 --- net/url_request/url_request_http_job.cc +++ net/url_request/url_request_http_job.cc @@ -539,7 +539,8 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() { @@ -24,10 +24,10 @@ index 9d993cce5e0e..bc12684c73c6 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 355ca24e301c..3bdbde36de39 100644 +index 61a6f05d5d70..396b495e1598 100644 --- services/network/public/cpp/resource_request.cc +++ services/network/public/cpp/resource_request.cc -@@ -176,7 +176,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -206,7 +206,8 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { } bool ResourceRequest::SendsCookies() const { diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 071cd8bed..06a5e7f75 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -41,10 +41,10 @@ index cc4b13a7b9c6..84f3b9ed7cf4 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index e23394ae63cd..3d8e02a0b189 100644 +index b8e3f8e88495..9dcc23f28781 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -2915,6 +2915,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { +@@ -2892,6 +2892,11 @@ void RenderWidgetHostImpl::OnInvalidInputEventSource() { GetProcess(), bad_message::INPUT_ROUTER_INVALID_EVENT_SOURCE); } @@ -57,10 +57,10 @@ index e23394ae63cd..3d8e02a0b189 100644 const WebInputEvent& event) { if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index 3dd95dcf37cb..024cc350fe96 100644 +index dcc44adc51d8..ab20b3f355e7 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -743,6 +743,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -737,6 +737,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 80171a473..0a0055026 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -34,7 +34,7 @@ index 4e04a86c2d06..6d82d55acd15 100644 } diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc -index 97cae92b96fa..6acf5188e1d6 100644 +index fa088bfa0019..7f00e2a2154f 100644 --- chrome/browser/printing/print_preview_dialog_controller.cc +++ chrome/browser/printing/print_preview_dialog_controller.cc @@ -17,6 +17,7 @@ @@ -45,7 +45,7 @@ index 97cae92b96fa..6acf5188e1d6 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -452,8 +453,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( +@@ -410,8 +411,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( content::HostZoomMap::Get(preview_dialog->GetSiteInstance()) ->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0); PrintViewManager::CreateForWebContents(preview_dialog); @@ -58,10 +58,10 @@ index 97cae92b96fa..6acf5188e1d6 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 ae1ab34986d1..b742e9fffaf3 100644 +index 81df8a2cb0c3..ae4dcf5beb16 100644 --- chrome/browser/printing/print_view_manager_base.cc +++ chrome/browser/printing/print_view_manager_base.cc -@@ -22,6 +22,7 @@ +@@ -21,6 +21,7 @@ #include "base/timer/timer.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -69,7 +69,7 @@ index ae1ab34986d1..b742e9fffaf3 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/printing/print_job.h" -@@ -61,6 +62,10 @@ +@@ -58,6 +59,10 @@ #include "printing/printing_features.h" #endif @@ -80,7 +80,7 @@ index ae1ab34986d1..b742e9fffaf3 100644 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) #include "chrome/browser/printing/print_error_dialog.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -201,8 +206,11 @@ PrintViewManager* GetPrintViewManager(int render_process_id, +@@ -198,8 +203,13 @@ PrintViewManager* GetPrintViewManager(int render_process_id, DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = GetWebContentsForRenderFrame(render_process_id, render_frame_id); @@ -88,8 +88,10 @@ index ae1ab34986d1..b742e9fffaf3 100644 - : nullptr; + if (!web_contents) + return nullptr; ++#if BUILDFLAG(ENABLE_CEF) + if (cef::IsAlloyRuntimeEnabled()) + return CefPrintViewManager::FromWebContents(web_contents); ++#endif + return PrintViewManager::FromWebContents(web_contents); } @@ -164,10 +166,10 @@ index 3d415a60d436..807ab41ee6ef 100644 ConstrainedWebDialogUI::~ConstrainedWebDialogUI() { diff --git chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc chrome/browser/ui/webui/print_preview/pdf_printer_handler.cc -index 181a4132f1be..4344ceaf83e5 100644 +index e64ac255c18f..ef40c08e3373 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 @@ +@@ -22,6 +22,7 @@ #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -175,7 +177,7 @@ index 181a4132f1be..4344ceaf83e5 100644 #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_prefs.h" -@@ -54,6 +55,10 @@ +@@ -55,6 +56,10 @@ #include "chrome/browser/chromeos/drive/drive_integration_service.h" #endif @@ -186,7 +188,7 @@ index 181a4132f1be..4344ceaf83e5 100644 namespace printing { namespace { -@@ -377,10 +382,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -378,10 +383,27 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, // If the directory is empty there is no reason to create it or use the // default location. if (path.empty()) { @@ -214,7 +216,7 @@ index 181a4132f1be..4344ceaf83e5 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_); -@@ -388,8 +410,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, +@@ -389,8 +411,7 @@ void PdfPrinterHandler::SelectFile(const base::FilePath& default_filename, base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT}, base::BindOnce(&SelectSaveDirectory, path, default_path), @@ -224,7 +226,7 @@ index 181a4132f1be..4344ceaf83e5 100644 } void PdfPrinterHandler::PostPrintToPdfTask() { -@@ -430,6 +451,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, +@@ -431,6 +452,40 @@ void PdfPrinterHandler::OnDirectorySelected(const base::FilePath& filename, platform_util::GetTopLevel(preview_web_contents_->GetNativeView()), NULL); } @@ -294,7 +296,7 @@ index d796486f6b74..1a7b0d23128d 100644 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 67aa6bc0d76e..0fecbd87423b 100644 +index 5beb6ac1f575..56e0fca6f317 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 @@ @@ -302,10 +304,10 @@ index 67aa6bc0d76e..0fecbd87423b 100644 #include "build/build_config.h" #include "build/chromeos_buildflags.h" +#include "cef/libcef/features/features.h" + #include "chrome/browser/account_manager_facade_factory.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/bad_message.h" - #include "chrome/browser/browser_process.h" -@@ -1080,7 +1081,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1081,7 +1082,7 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return extension_printer_handler_.get(); } @@ -314,7 +316,7 @@ index 67aa6bc0d76e..0fecbd87423b 100644 if (printer_type == PrinterType::kPrivet && GetPrefs()->GetBoolean(prefs::kForceEnablePrivetPrinting)) { if (!privet_printer_handler_) { -@@ -1089,6 +1090,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( +@@ -1090,6 +1091,9 @@ PrinterHandler* PrintPreviewHandler::GetPrinterHandler( } return privet_printer_handler_.get(); } @@ -324,7 +326,7 @@ index 67aa6bc0d76e..0fecbd87423b 100644 #endif if (printer_type == PrinterType::kPdf) { if (!pdf_printer_handler_) { -@@ -1151,6 +1155,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, +@@ -1152,6 +1156,7 @@ void PrintPreviewHandler::OnPrintResult(const std::string& callback_id, } void PrintPreviewHandler::RegisterForGaiaCookieChanges() { @@ -332,7 +334,7 @@ index 67aa6bc0d76e..0fecbd87423b 100644 DCHECK(!identity_manager_); cloud_print_enabled_ = !base::Contains(printer_type_deny_list_, PrinterType::kCloud) && -@@ -1167,6 +1172,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { +@@ -1168,6 +1173,7 @@ void PrintPreviewHandler::RegisterForGaiaCookieChanges() { identity_manager_ = IdentityManagerFactory::GetForProfile(profile); identity_manager_->AddObserver(this); @@ -341,10 +343,10 @@ index 67aa6bc0d76e..0fecbd87423b 100644 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { diff --git chrome/browser/ui/webui/print_preview/print_preview_ui.cc chrome/browser/ui/webui/print_preview/print_preview_ui.cc -index fb3328d0d75b..4dd94d59e195 100644 +index 60b1fe2311c0..74ee97dbbf6d 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 @@ +@@ -30,6 +30,7 @@ #include "base/values.h" #include "build/build_config.h" #include "build/chromeos_buildflags.h" @@ -352,7 +354,7 @@ index fb3328d0d75b..4dd94d59e195 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/pdf/pdf_extension_util.h" #include "chrome/browser/printing/background_printing_manager.h" -@@ -85,12 +86,16 @@ namespace printing { +@@ -91,12 +92,16 @@ namespace printing { namespace { @@ -367,5 +369,5 @@ index fb3328d0d75b..4dd94d59e195 100644 #endif +#endif // !BUILDFLAG(ENABLE_CEF) - PrintPreviewUI::TestDelegate* g_test_delegate = nullptr; - + constexpr char kInvalidArgsForDidStartPreview[] = + "Invalid arguments for DidStartPreview"; diff --git a/patch/patches/renderer_host_1070713.patch b/patch/patches/renderer_host_1070713.patch index 2ce620058..da9bff317 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 255c259a9b35..c40021deb1fc 100644 +index 517ee0e43e83..6c3bab2f5780 100644 --- content/browser/renderer_host/render_view_host_impl.cc +++ content/browser/renderer_host/render_view_host_impl.cc -@@ -590,6 +590,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { +@@ -598,6 +598,8 @@ bool RenderViewHostImpl::IsRenderViewLive() { } void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { diff --git a/patch/patches/renderer_preferences_util_545103.patch b/patch/patches/renderer_preferences_util_545103.patch index 4943fb3ed..2670330b8 100644 --- a/patch/patches/renderer_preferences_util_545103.patch +++ b/patch/patches/renderer_preferences_util_545103.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc -index a0006aa682e7..b83d42c637a6 100644 +index 794160f870d4..9caa8b6df341 100644 --- chrome/browser/renderer_preferences_util.cc +++ chrome/browser/renderer_preferences_util.cc -@@ -35,7 +35,8 @@ +@@ -38,7 +38,8 @@ #include "ui/base/cocoa/defaults_utils.h" #endif @@ -12,7 +12,7 @@ index a0006aa682e7..b83d42c637a6 100644 #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "ui/views/linux_ui/linux_ui.h" -@@ -154,7 +155,8 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs, +@@ -167,7 +168,8 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs, prefs->caret_blink_interval = interval; #endif diff --git a/patch/patches/resource_bundle_2512.patch b/patch/patches/resource_bundle_2512.patch index 9a0f3e70b..984a06e38 100644 --- a/patch/patches/resource_bundle_2512.patch +++ b/patch/patches/resource_bundle_2512.patch @@ -1,8 +1,8 @@ diff --git ui/base/resource/resource_bundle.cc ui/base/resource/resource_bundle.cc -index 9f745407ec48..6d4ae4266371 100644 +index 910662d25a4f..4323dada7c98 100644 --- ui/base/resource/resource_bundle.cc +++ ui/base/resource/resource_bundle.cc -@@ -845,6 +845,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) +@@ -832,6 +832,12 @@ ResourceBundle::ResourceBundle(Delegate* delegate) : delegate_(delegate), locale_resources_data_lock_(new base::Lock), max_scale_factor_(SCALE_FACTOR_100P) { @@ -15,7 +15,7 @@ index 9f745407ec48..6d4ae4266371 100644 mangle_localized_strings_ = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kMangleLocalizedStrings); } -@@ -854,6 +860,11 @@ ResourceBundle::~ResourceBundle() { +@@ -841,6 +847,11 @@ ResourceBundle::~ResourceBundle() { UnloadLocaleResources(); } @@ -28,7 +28,7 @@ index 9f745407ec48..6d4ae4266371 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 0432b8f0965f..264759c7393d 100644 +index 48c329f00c3f..a1a0cbc98771 100644 --- ui/base/resource/resource_bundle.h +++ ui/base/resource/resource_bundle.h @@ -192,6 +192,11 @@ class COMPONENT_EXPORT(UI_BASE) ResourceBundle { diff --git a/patch/patches/runhooks.patch b/patch/patches/runhooks.patch index b5718ac18..f3fa07697 100644 --- a/patch/patches/runhooks.patch +++ b/patch/patches/runhooks.patch @@ -1,8 +1,8 @@ diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index 47309866ca79..d27ec9b50b2b 100644 +index f66de0aa63c9..98a510a6a244 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -155,13 +155,17 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): +@@ -154,13 +154,17 @@ def _LoadToolchainEnv(cpu, toolchain_root, sdk_dir, target_store): del os.environ['INCLUDE'] del os.environ['LIB'] del os.environ['LIBPATH'] @@ -26,10 +26,10 @@ index 47309866ca79..d27ec9b50b2b 100644 if (cpu != 'x64'): # x64 is default target CPU thus any other CPU requires a target set diff --git build/vs_toolchain.py build/vs_toolchain.py -index 6bc24a921272..24ee9a0a04a9 100755 +index c3b1182b75b4..04a472b149d4 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py -@@ -89,9 +89,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): +@@ -102,9 +102,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs) os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH'] elif sys.platform == 'win32' and not depot_tools_win_toolchain: @@ -46,7 +46,7 @@ index 6bc24a921272..24ee9a0a04a9 100755 # When using an installed toolchain these files aren't needed in the output # directory in order to run binaries locally, but they are needed in order # to create isolates or the mini_installer. Copying them to the output -@@ -140,6 +147,10 @@ def _RegistryGetValue(key, value): +@@ -153,6 +160,10 @@ def _RegistryGetValue(key, value): def GetVisualStudioVersion(): """Return best available version of Visual Studio. """ diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index f42c603cf..98a870f4d 100644 --- a/patch/patches/rwh_background_color_1984.patch +++ b/patch/patches/rwh_background_color_1984.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc -index dd16ddb90fa9..1d70818d0eff 100644 +index 8e71577881b0..70b4f77fe954 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -657,10 +657,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { +@@ -645,10 +645,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() { void RenderWidgetHostViewAura::UpdateBackgroundColor() { DCHECK(GetBackgroundColor()); @@ -19,7 +19,7 @@ index dd16ddb90fa9..1d70818d0eff 100644 } base::Optional RenderWidgetHostViewAura::GetDisplayFeature() { -@@ -2020,6 +2022,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -2015,6 +2017,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 771e1a70f..b10507f49 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 0ccb74571b85..b4785ae3e875 100644 +index 33681db05353..646e875a6235 100644 --- chrome/browser/net/profile_network_context_service.cc +++ chrome/browser/net/profile_network_context_service.cc @@ -20,6 +20,7 @@ @@ -10,7 +10,7 @@ index 0ccb74571b85..b4785ae3e875 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" -@@ -682,7 +683,19 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -683,7 +684,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 0ccb74571b85..b4785ae3e875 100644 PrefService* local_state = g_browser_process->local_state(); // Configure the HTTP cache path and size. base::FilePath base_cache_path; -@@ -695,7 +708,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( +@@ -696,7 +709,9 @@ void ProfileNetworkContextService::ConfigureNetworkContextParamsInternal( base_cache_path.Append(chrome::kCacheDirname); network_context_params->http_cache_max_size = local_state->GetInteger(prefs::kDiskCacheSize); @@ -42,10 +42,10 @@ index 0ccb74571b85..b4785ae3e875 100644 // change. network_context_params->http_server_properties_path = diff --git net/cookies/cookie_monster.cc net/cookies/cookie_monster.cc -index 9d5391e0c853..ebc6a10466fb 100644 +index e8e5c326c794..9ed417d9d20d 100644 --- net/cookies/cookie_monster.cc +++ net/cookies/cookie_monster.cc -@@ -471,6 +471,25 @@ void CookieMonster::SetCookieableSchemes( +@@ -475,6 +475,25 @@ void CookieMonster::SetCookieableSchemes( MaybeRunCookieCallback(std::move(callback), true); } @@ -72,7 +72,7 @@ index 9d5391e0c853..ebc6a10466fb 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 990869da1c30..22c047b1ea25 100644 +index 426507596516..2ae97326e653 100644 --- net/cookies/cookie_monster.h +++ net/cookies/cookie_monster.h @@ -184,6 +184,8 @@ class NET_EXPORT CookieMonster : public CookieStore { @@ -123,10 +123,10 @@ index f91ffe61dba5..f3482e68cd11 100644 void CookieManager::SetForceKeepSessionState() { diff --git services/network/network_context.cc services/network/network_context.cc -index a75980730046..a0c104d88545 100644 +index cbef8450741b..c0177e62cdc4 100644 --- services/network/network_context.cc +++ services/network/network_context.cc -@@ -2014,16 +2014,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -1987,16 +1987,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( network_service_->network_quality_estimator()); } @@ -157,10 +157,10 @@ index a75980730046..a0c104d88545 100644 trust_token_store_ = std::make_unique(); diff --git services/network/public/mojom/network_context.mojom services/network/public/mojom/network_context.mojom -index 294b04445bd3..f1f81e44986f 100644 +index 5aca8515f5ce..bbbb982ae52e 100644 --- services/network/public/mojom/network_context.mojom +++ services/network/public/mojom/network_context.mojom -@@ -288,6 +288,9 @@ struct NetworkContextParams { +@@ -251,6 +251,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 c1f2df49c..a02f30e2b 100644 --- a/patch/patches/services_network_2718.patch +++ b/patch/patches/services_network_2718.patch @@ -1,5 +1,5 @@ diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc -index 46fd3da02453..879e7a0b2275 100644 +index a948dde94213..4f4b09647fdb 100644 --- content/browser/storage_partition_impl.cc +++ content/browser/storage_partition_impl.cc @@ -495,10 +495,6 @@ class LoginHandlerDelegate { @@ -26,7 +26,7 @@ index 46fd3da02453..879e7a0b2275 100644 new LoginHandlerDelegate(std::move(auth_challenge_responder), std::move(web_contents_getter), auth_info, is_request_for_main_frame, process_id, routing_id, -@@ -2449,8 +2439,12 @@ void StoragePartitionImpl::GetQuotaSettings( +@@ -2479,8 +2469,12 @@ void StoragePartitionImpl::GetQuotaSettings( return; } @@ -40,7 +40,7 @@ index 46fd3da02453..879e7a0b2275 100644 storage::GetDefaultDeviceInfoHelper(), std::move(callback)); } -@@ -2462,6 +2456,11 @@ void StoragePartitionImpl::InitNetworkContext() { +@@ -2493,6 +2487,11 @@ void StoragePartitionImpl::InitNetworkContext() { GetContentClient()->browser()->ConfigureNetworkContextParams( browser_context_, is_in_memory_, relative_partition_path_, context_params.get(), cert_verifier_creation_params.get()); diff --git a/patch/patches/set_resize_background_color.patch b/patch/patches/set_resize_background_color.patch index 919d10a57..b1574521d 100644 --- a/patch/patches/set_resize_background_color.patch +++ b/patch/patches/set_resize_background_color.patch @@ -39,11 +39,11 @@ index ab2371857a00..8dccc190fa89 100644 }; diff --git ui/views/controls/webview/webview.cc ui/views/controls/webview/webview.cc -index 44a8fc6ef9d0..4718e6bb94ff 100644 +index 2ade47b0077d..7d64510adebb 100644 --- ui/views/controls/webview/webview.cc +++ ui/views/controls/webview/webview.cc -@@ -127,6 +127,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, - MaybeEnableAutoResize(); +@@ -129,6 +129,10 @@ void WebView::EnableSizingFromWebContents(const gfx::Size& min_size, + MaybeEnableAutoResize(web_contents()->GetMainFrame()); } +void WebView::SetResizeBackgroundColor(SkColor resize_background_color) { @@ -54,7 +54,7 @@ index 44a8fc6ef9d0..4718e6bb94ff 100644 if (crashed_overlay_view_ == crashed_overlay_view) return; diff --git ui/views/controls/webview/webview.h ui/views/controls/webview/webview.h -index 9604515c2d5c..e51421694752 100644 +index 94e25679eab8..3943f8c4866f 100644 --- ui/views/controls/webview/webview.h +++ ui/views/controls/webview/webview.h @@ -78,6 +78,10 @@ class WEBVIEW_EXPORT WebView : public View, diff --git a/patch/patches/storage_incognito_2289.patch b/patch/patches/storage_incognito_2289.patch index 469452dd6..ed7b86c21 100644 --- a/patch/patches/storage_incognito_2289.patch +++ b/patch/patches/storage_incognito_2289.patch @@ -13,10 +13,10 @@ index 676c2cc22bac..e6f9642e1cba 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 de8ee48c4c74..62105a814870 100644 +index 8b053971dea9..170f5c1b3863 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -246,7 +246,7 @@ StoragePartition* BrowserContext::GetStoragePartition( +@@ -235,7 +235,7 @@ StoragePartition* BrowserContext::GetStoragePartition( GetStoragePartitionMap(browser_context); auto config_to_use = storage_partition_config; @@ -25,7 +25,7 @@ index de8ee48c4c74..62105a814870 100644 config_to_use = storage_partition_config.CopyWithInMemorySet(); return partition_map->Get(config_to_use, can_create); -@@ -556,7 +556,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { +@@ -540,7 +540,7 @@ media::VideoDecodePerfHistory* BrowserContext::GetVideoDecodePerfHistory() { kUseInMemoryDBDefault); std::unique_ptr stats_db; @@ -35,15 +35,15 @@ index de8ee48c4c74..62105a814870 100644 std::make_unique(nullptr); } else { diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc -index fdf4b2466077..938df52d348e 100644 +index cb40db947624..807a7c24bc6d 100644 --- storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc -@@ -508,7 +508,7 @@ bool DatabaseTracker::LazyInit() { +@@ -495,7 +495,7 @@ bool DatabaseTracker::LazyInit() { + databases_table_.reset(new DatabasesTable(db_.get())); meta_table_.reset(new sql::MetaTable()); - is_initialized_ = -- base::CreateDirectory(db_dir_) && -+ (is_off_the_record_ ? true : base::CreateDirectory(db_dir_)) && - (db_->is_open() || - (is_off_the_record_ ? db_->OpenInMemory() - : db_->Open(kTrackerDatabaseFullPath))) && +- is_initialized_ = base::CreateDirectory(db_dir_) && ++ is_initialized_ = (is_incognito_ ? true : base::CreateDirectory(db_dir_)) && + (db_->is_open() || + (is_incognito_ ? db_->OpenInMemory() + : db_->Open(kTrackerDatabaseFullPath))) && diff --git a/patch/patches/trace_event.patch b/patch/patches/trace_event.patch index af0396755..1ca98ff9f 100644 --- a/patch/patches/trace_event.patch +++ b/patch/patches/trace_event.patch @@ -1,8 +1,8 @@ diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h -index ad3e86fb45ed..61c3db8b59d1 100644 +index 1a3fe9a570a1..dd7c52961464 100644 --- base/trace_event/builtin_categories.h +++ base/trace_event/builtin_categories.h -@@ -58,6 +58,8 @@ +@@ -59,6 +59,8 @@ X("cc") \ X("cc.debug") \ X("cdp.perf") \ diff --git a/patch/patches/ui_dragdrop_355390.patch b/patch/patches/ui_dragdrop_355390.patch index 51291b4b7..fa6715601 100644 --- a/patch/patches/ui_dragdrop_355390.patch +++ b/patch/patches/ui_dragdrop_355390.patch @@ -1,5 +1,5 @@ diff --git ui/base/x/x11_os_exchange_data_provider.cc ui/base/x/x11_os_exchange_data_provider.cc -index 824b980f5b31..54ae5151b4fc 100644 +index 78d2b362c2d6..93cff0224ce1 100644 --- ui/base/x/x11_os_exchange_data_provider.cc +++ ui/base/x/x11_os_exchange_data_provider.cc @@ -122,7 +122,8 @@ void XOSExchangeDataProvider::SetURL(const GURL& url, diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 174a12ad5..516840403 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 c746b37d6278..b6cebc24b73e 100644 +index bf7988cab13a..1c58c54bc7b6 100644 --- ui/base/models/menu_model.h +++ ui/base/models/menu_model.h @@ -12,8 +12,11 @@ @@ -14,7 +14,7 @@ index c746b37d6278..b6cebc24b73e 100644 } namespace ui { -@@ -133,6 +136,27 @@ class COMPONENT_EXPORT(UI_BASE) MenuModel +@@ -137,6 +140,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 c746b37d6278..b6cebc24b73e 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index 35ef45586f93..d094f34569c9 100644 +index 8b6064d15996..5004292484ef 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc @@ -617,6 +617,14 @@ void RenderText::SetWhitespaceElision(base::Optional whitespace_elision) { @@ -61,7 +61,7 @@ index 35ef45586f93..d094f34569c9 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -1993,6 +2001,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -2003,6 +2011,19 @@ void RenderText::OnTextAttributeChanged() { layout_text_up_to_date_ = false; @@ -82,7 +82,7 @@ index 35ef45586f93..d094f34569c9 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 29c589ee9fe6..aa0029552322 100644 +index bb7ce1ca82b4..a1c0d16b6fea 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h @@ -346,6 +346,10 @@ class GFX_EXPORT RenderText { @@ -96,7 +96,7 @@ index 29c589ee9fe6..aa0029552322 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -1053,6 +1057,8 @@ class GFX_EXPORT RenderText { +@@ -1054,6 +1058,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; @@ -119,10 +119,10 @@ index 8c8f77fc26db..0a9f50df07c1 100644 // Size used for the default SquareInkDropRipple. static constexpr gfx::Size kDefaultInkDropSize = gfx::Size(24, 24); diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc -index 66447b25c544..ea28dc3169fa 100644 +index e8b6cd6b290d..3293e3f081b9 100644 --- ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc -@@ -503,6 +503,12 @@ void LabelButton::OnThemeChanged() { +@@ -506,6 +506,12 @@ void LabelButton::OnThemeChanged() { SchedulePaint(); } @@ -150,7 +150,7 @@ index 39887eb2625c..727c1ff325f7 100644 ImageView* image() const { return image_; } Label* label() const { return label_; } diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 0381eb3769d4..7a06147d991c 100644 +index d7f4226a37fe..d8fd16500b3c 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc @@ -49,12 +49,27 @@ enum LabelPropertyKey { @@ -181,7 +181,7 @@ index 0381eb3769d4..7a06147d991c 100644 } // namespace namespace views { -@@ -412,6 +427,15 @@ base::string16 Label::GetTooltipText() const { +@@ -413,6 +428,15 @@ base::string16 Label::GetTooltipText() const { return tooltip_text_; } @@ -197,7 +197,7 @@ index 0381eb3769d4..7a06147d991c 100644 void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); if (tooltip_text_ == tooltip_text) -@@ -695,6 +719,16 @@ std::unique_ptr Label::CreateRenderText() const { +@@ -706,6 +730,16 @@ std::unique_ptr Label::CreateRenderText() const { render_text->SelectRange(stored_selection_range_); } @@ -215,10 +215,10 @@ index 0381eb3769d4..7a06147d991c 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index 2426029d6733..d12bc4568203 100644 +index 793189681a67..92397be97b0e 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h -@@ -221,6 +221,10 @@ class VIEWS_EXPORT Label : public View, +@@ -225,6 +225,10 @@ class VIEWS_EXPORT Label : public View, gfx::ElideBehavior GetElideBehavior() const; void SetElideBehavior(gfx::ElideBehavior elide_behavior); @@ -229,19 +229,19 @@ index 2426029d6733..d12bc4568203 100644 // Gets/Sets the tooltip text. Default behavior for a label (single-line) is // to show the full text if it is wider than its bounds. Calling this // overrides the default behavior and lets you set a custom tooltip. To -@@ -461,6 +465,7 @@ class VIEWS_EXPORT Label : public View, - bool collapse_when_hidden_ = false; - int fixed_width_ = 0; +@@ -471,6 +475,7 @@ class VIEWS_EXPORT Label : public View, int max_width_ = 0; + // This is used in single-line mode. + int max_width_single_line_ = 0; + int draw_strings_flags_ = 0; std::unique_ptr selection_controller_; diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 15d30255e990..745b483213cf 100644 +index 3beb5516e121..36d9f5e42460 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2744,8 +2744,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2738,8 +2738,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -256,7 +256,7 @@ index 15d30255e990..745b483213cf 100644 MenuItemView* to_select = nullptr; if (!item->GetSubmenu()->GetMenuItems().empty()) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2764,8 +2769,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2758,8 +2763,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -269,10 +269,10 @@ index 15d30255e990..745b483213cf 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 158724b4752c..c82192848584 100644 +index d863d6f874aa..f0310ca3b776 100644 --- ui/views/controls/menu/menu_delegate.h +++ ui/views/controls/menu/menu_delegate.h -@@ -80,6 +80,22 @@ class VIEWS_EXPORT MenuDelegate { +@@ -81,6 +81,22 @@ class VIEWS_EXPORT MenuDelegate { // parts of |style| or leave it unmodified. virtual void GetLabelStyle(int id, LabelStyle* style) const; @@ -295,7 +295,7 @@ index 158724b4752c..c82192848584 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 base::string16 GetTooltipText(int id, -@@ -206,6 +222,11 @@ class VIEWS_EXPORT MenuDelegate { +@@ -209,6 +225,11 @@ class VIEWS_EXPORT MenuDelegate { bool* has_mnemonics, MenuButton** button); @@ -308,10 +308,10 @@ index 158724b4752c..c82192848584 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index 3c532ce679c7..b0ff9231929b 100644 +index 89f6c657d0a6..6d1a0673f94f 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -1051,6 +1051,15 @@ void MenuItemView::PaintBackground(gfx::Canvas* canvas, +@@ -1097,6 +1097,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 3c532ce679c7..b0ff9231929b 100644 } else if (render_selection) { gfx::Rect item_bounds = GetLocalBounds(); if (type_ == Type::kActionableSubMenu) { -@@ -1118,6 +1127,13 @@ void MenuItemView::PaintMinorIconAndText( +@@ -1164,6 +1173,13 @@ void MenuItemView::PaintMinorIconAndText( } SkColor MenuItemView::GetTextColor(bool minor, bool render_selection) const { @@ -342,10 +342,10 @@ index 3c532ce679c7..b0ff9231929b 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 b0b1cf9a7a79..17b37e84e933 100644 +index 5dd4a9bbb8cf..33894ceb408f 100644 --- ui/views/controls/menu/menu_model_adapter.cc +++ ui/views/controls/menu/menu_model_adapter.cc -@@ -240,6 +240,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { +@@ -242,6 +242,77 @@ bool MenuModelAdapter::IsItemChecked(int id) const { return false; } @@ -449,10 +449,10 @@ index 78f832fd3acf..cb030c991614 100644 void WillHideMenu(MenuItemView* menu) override; void OnMenuClosed(MenuItemView* menu) override; diff --git ui/views/controls/menu/menu_scroll_view_container.cc ui/views/controls/menu/menu_scroll_view_container.cc -index 5881b07244d7..a2f671b73162 100644 +index 8e21f427f6af..2dd8451c0fdc 100644 --- ui/views/controls/menu/menu_scroll_view_container.cc +++ ui/views/controls/menu/menu_scroll_view_container.cc -@@ -201,6 +201,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) +@@ -211,6 +211,11 @@ MenuScrollViewContainer::MenuScrollViewContainer(SubmenuView* content_view) scroll_down_button_ = AddChildView(std::make_unique(content_view, false)); @@ -480,7 +480,7 @@ index 64e09ff4359a..714e8e9ff661 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 74e3010c8162..dcca72e52aa8 100644 +index 0ae7efa30827..51f3ff3ebeae 100644 --- ui/views/view.h +++ ui/views/view.h @@ -25,6 +25,7 @@ diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index b072694db..3450834b5 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 7a90002e09be..6ea815bd3256 100644 +index e2085913e2f4..6c6bd46cb125 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -525,6 +525,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { +@@ -527,6 +527,14 @@ float RenderWidgetHostViewBase::GetDeviceScaleFactor() { return screen_info.device_scale_factor; } @@ -18,10 +18,10 @@ index 7a90002e09be..6ea815bd3256 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 63c4db6df041..4d253685cb78 100644 +index cf71a09595af..49d41b5d7c52 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -64,6 +64,7 @@ class CursorManager; +@@ -65,6 +65,7 @@ class CursorManager; class MouseWheelPhaseHandler; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,17 +29,7 @@ index 63c4db6df041..4d253685cb78 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -80,6 +81,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { - float current_device_scale_factor() const { - return current_device_scale_factor_; - } -+ void set_current_device_scale_factor(float scale_factor) { -+ current_device_scale_factor_ = scale_factor; -+ } - - // Returns the focused RenderWidgetHost inside this |view|'s RWH. - RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -113,6 +117,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -114,6 +115,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { const gfx::Size& max_size) override; void DisableAutoResize(const gfx::Size& new_size) override; float GetDeviceScaleFactor() final; @@ -48,7 +38,7 @@ index 63c4db6df041..4d253685cb78 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; void SetRecordContentToVisibleTimeRequest( -@@ -405,6 +411,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -404,6 +407,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void InitAsPopup(RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds) = 0; @@ -61,7 +51,7 @@ index 63c4db6df041..4d253685cb78 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -580,6 +592,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -579,6 +588,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { bool is_currently_scrolling_viewport_ = false; @@ -73,7 +63,7 @@ index 63c4db6df041..4d253685cb78 100644 FRIEND_TEST_ALL_PREFIXES( BrowserSideFlingBrowserTest, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc -index 69d909a11756..7a555229d3e5 100644 +index ffa7faf1cbd0..4aefbdc37ecb 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -37,6 +37,10 @@ @@ -87,7 +77,7 @@ index 69d909a11756..7a555229d3e5 100644 #if defined(OS_WIN) #include "content/browser/renderer_host/render_frame_host_impl.h" #include "ui/aura/window_tree_host.h" -@@ -936,6 +940,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( +@@ -944,6 +948,14 @@ void RenderWidgetHostViewEventHandler::MoveCursorToCenter( } return; } @@ -102,7 +92,7 @@ index 69d909a11756..7a555229d3e5 100644 #endif synthetic_move_position_ = center_in_screen; } -@@ -965,6 +977,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( +@@ -973,6 +985,17 @@ bool RenderWidgetHostViewEventHandler::MatchesSynthesizedMovePosition( } void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { @@ -140,7 +130,7 @@ index beba7a3a40b8..941acdfbff8b 100644 // Set the view's active state (i.e., tint state of controls). virtual void SetActive(bool active) = 0; diff --git ui/base/x/x11_window.cc ui/base/x/x11_window.cc -index 7fbc130d78df..6092964d846c 100644 +index 585a09a2b6d8..d38924a42ea6 100644 --- ui/base/x/x11_window.cc +++ ui/base/x/x11_window.cc @@ -264,7 +264,8 @@ void XWindow::Init(const Configuration& config) { @@ -154,7 +144,7 @@ index 7fbc130d78df..6092964d846c 100644 req.y = bounds_in_pixels_.y(); req.width = bounds_in_pixels_.width(); diff --git ui/base/x/x11_window.h ui/base/x/x11_window.h -index efed967b24dd..ec4b19e53e6f 100644 +index 0a870d41a042..74401dd1635f 100644 --- ui/base/x/x11_window.h +++ ui/base/x/x11_window.h @@ -21,6 +21,7 @@ @@ -174,7 +164,7 @@ index efed967b24dd..ec4b19e53e6f 100644 XWindow(); diff --git ui/platform_window/x11/x11_window.cc ui/platform_window/x11/x11_window.cc -index 0cfcb1cb66e3..43adab9fec65 100644 +index 967dd5f1c099..7d135d890202 100644 --- ui/platform_window/x11/x11_window.cc +++ ui/platform_window/x11/x11_window.cc @@ -93,6 +93,7 @@ ui::XWindow::Configuration ConvertInitPropertiesToXWindowConfig( @@ -263,7 +253,7 @@ index e0339379e1a8..b31f4ac179f6 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 a40975533035..9a3f60066b5c 100644 +index 7476de34aa6e..1dc6eb8f12f3 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -140,8 +140,12 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -280,7 +270,7 @@ index a40975533035..9a3f60066b5c 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -915,11 +919,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -925,11 +929,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -299,10 +289,10 @@ index a40975533035..9a3f60066b5c 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 0229c1c41502..992f89126f7f 100644 +index ed3b2fe48665..20f40ec2440c 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -293,6 +293,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -292,6 +292,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -314,10 +304,10 @@ index 0229c1c41502..992f89126f7f 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index 52c1d1eb59c4..ebcbd0286a7b 100644 +index 494b38c5b486..8897d78097fc 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc -@@ -311,7 +311,8 @@ void Widget::Init(InitParams params) { +@@ -313,7 +313,8 @@ void Widget::Init(InitParams params) { parent_ = params.parent ? GetWidgetForNativeView(params.parent) : nullptr; params.child |= (params.type == InitParams::TYPE_CONTROL); @@ -327,7 +317,7 @@ index 52c1d1eb59c4..ebcbd0286a7b 100644 if (params.opacity == views::Widget::InitParams::WindowOpacity::kInferred && params.type != views::Widget::InitParams::TYPE_WINDOW) { -@@ -393,7 +394,12 @@ void Widget::Init(InitParams params) { +@@ -395,7 +396,12 @@ void Widget::Init(InitParams params) { } } else if (delegate) { SetContentsView(delegate->TransferOwnershipOfContentsView()); @@ -340,8 +330,8 @@ index 52c1d1eb59c4..ebcbd0286a7b 100644 + } } - observer_manager_.Add(GetNativeTheme()); -@@ -1176,10 +1182,16 @@ void Widget::OnNativeWidgetDestroyed() { + observation_.Observe(GetNativeTheme()); +@@ -1191,10 +1197,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -359,10 +349,10 @@ index 52c1d1eb59c4..ebcbd0286a7b 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 819ea9ae89cc..1cae5eda3d5f 100644 +index cd0c29c10bfe..5f8f286fe17a 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h -@@ -318,6 +318,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, +@@ -321,6 +321,8 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, // the concept with bubble anchoring a la BubbleDialogDelegateView. gfx::NativeView parent = nullptr; @@ -372,10 +362,10 @@ index 819ea9ae89cc..1cae5eda3d5f 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 0fab70037a44..7409dd2c8acc 100644 +index 623bbcf37780..10efeaac5686 100644 --- ui/views/widget/widget_delegate.h +++ ui/views/widget/widget_delegate.h -@@ -381,6 +381,10 @@ class VIEWS_EXPORT WidgetDelegate { +@@ -385,6 +385,10 @@ class VIEWS_EXPORT WidgetDelegate { // Returns true if the title text should be centered. bool ShouldCenterWindowTitleText() const; @@ -400,10 +390,10 @@ index 89f5b62f95df..8f6971929a12 100644 if (native_widget_delegate->IsDialogBox()) { *style |= DS_MODALFRAME; diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc -index 4c9654191ddc..1b4cf20d8df5 100644 +index 0a3940b75170..ad31ce630abb 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -3103,10 +3103,13 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3105,10 +3105,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 e93598dd3..07a4225ef 100644 --- a/patch/patches/viz_osr_2575.patch +++ b/patch/patches/viz_osr_2575.patch @@ -80,12 +80,12 @@ index 1026b739d283..fe562ab60ce9 100644 private: const HWND hwnd_; diff --git components/viz/service/BUILD.gn components/viz/service/BUILD.gn -index c66d791c7c9a..5c98ae02d8b7 100644 +index 898571527429..5e31b5ceafc3 100644 --- components/viz/service/BUILD.gn +++ components/viz/service/BUILD.gn -@@ -180,6 +180,8 @@ viz_component("service") { - "surfaces/surface_reference.cc", - "surfaces/surface_reference.h", +@@ -198,6 +198,8 @@ viz_component("service") { + "transitions/transferable_resource_tracker.cc", + "transitions/transferable_resource_tracker.h", "viz_service_export.h", + "//cef/libcef/browser/osr/software_output_device_proxy.cc", + "//cef/libcef/browser/osr/software_output_device_proxy.h", @@ -214,10 +214,10 @@ index 6b7fbb6cf13d..e2af75168cb9 100644 + Draw(gfx.mojom.Rect damage_rect) => (); }; diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index e1db8f745c07..6d94047788bf 100644 +index e4ff4cb0a2ec..5023c6139f4e 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h -@@ -27,7 +27,9 @@ +@@ -28,7 +28,9 @@ #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/common/surfaces/subtree_capture_id.h" @@ -227,7 +227,7 @@ index e1db8f745c07..6d94047788bf 100644 #include "mojo/public/cpp/bindings/pending_remote.h" #include "services/viz/privileged/mojom/compositing/vsync_parameter_observer.mojom-forward.h" #include "third_party/skia/include/core/SkColor.h" -@@ -133,6 +135,14 @@ class COMPOSITOR_EXPORT ContextFactory { +@@ -134,6 +136,14 @@ class COMPOSITOR_EXPORT ContextFactory { virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0; }; @@ -242,7 +242,7 @@ index e1db8f745c07..6d94047788bf 100644 // Compositor object to take care of GPU painting. // A Browser compositor object is responsible for generating the final // displayable form of pixels comprising a single widget's contents. It draws an -@@ -167,6 +177,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -169,6 +179,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, // Schedules a redraw of the layer tree associated with this compositor. void ScheduleDraw(); @@ -252,7 +252,7 @@ index e1db8f745c07..6d94047788bf 100644 // Sets the root of the layer tree drawn by this Compositor. The root layer // must have no parent. The compositor's root layer is reset if the root layer // is destroyed. NULL can be passed to reset the root layer, in which case the -@@ -435,6 +448,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -440,6 +453,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, std::unique_ptr pending_begin_frame_args_; diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index fe1b44ead..0aa07377b 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,22 +1,21 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index 496c36479799..ecbf2d55fe89 100644 +index 588ad8311491..7aa76b084da5 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -2724,7 +2724,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { - // main frame - let's do the same thing here. - std::string unique_name; - frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); -+ +@@ -2749,6 +2749,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { + frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, + params.main_frame_name, params.is_prerendering); + + if (params.view && params.delegate_view) { + view_.reset(params.view); + render_view_host_delegate_view_ = params.delegate_view; + } - ++ + if (!view_) { WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2735,6 +2741,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2759,6 +2765,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -24,7 +23,7 @@ index 496c36479799..ecbf2d55fe89 100644 CHECK(render_view_host_delegate_view_); CHECK(view_.get()); -@@ -3550,6 +3557,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( +@@ -3615,6 +3622,15 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow( // objects. create_params.renderer_initiated_creation = !is_new_browsing_instance; @@ -40,14 +39,13 @@ index 496c36479799..ecbf2d55fe89 100644 std::unique_ptr new_contents; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -7451,6 +7467,10 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, +@@ -7277,6 +7293,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node, // This is an outermost WebContents. SetAsFocusedWebContentsIfNecessary(); } + -+ observers_.ForEachObserver([&](WebContentsObserver* observer) { -+ observer->OnFrameFocused(node->current_frame_host()); -+ }); ++ observers_.NotifyObservers(&WebContentsObserver::OnFrameFocused, ++ node->current_frame_host()); } void WebContentsImpl::DidCallFocus() { @@ -64,7 +62,7 @@ index f1dcf53ea481..192f7c0ddd04 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index 05efddc8d80f..29e01d78cf3c 100644 +index f1bdd0c7bad8..46a33d9094e1 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h @@ -87,8 +87,10 @@ class BrowserContext; @@ -76,9 +74,9 @@ index 05efddc8d80f..29e01d78cf3c 100644 class WebContentsDelegate; +class WebContentsView; class WebUI; - struct CustomContextMenuContext; struct DropData; -@@ -222,6 +224,10 @@ class WebContents : public PageNavigator, + struct MHTMLGenerationParams; +@@ -228,6 +230,10 @@ class WebContents : public PageNavigator, // Sandboxing flags set on the new WebContents. network::mojom::WebSandboxFlags starting_sandbox_flags; @@ -90,7 +88,7 @@ index 05efddc8d80f..29e01d78cf3c 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 21d30d1b60ba..4b8eadb8fbb7 100644 +index 9075cda6487f..c7deaa1c9752 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h @@ -60,10 +60,12 @@ class EyeDropperListener; @@ -122,10 +120,10 @@ index 21d30d1b60ba..4b8eadb8fbb7 100644 // typically happens when popups are created. virtual void WebContentsCreated(WebContents* source_contents, diff --git content/public/browser/web_contents_observer.h content/public/browser/web_contents_observer.h -index 9ab0a264e9ec..ac9b1ea02aa5 100644 +index adbfea805ecc..18f3f3240a08 100644 --- content/public/browser/web_contents_observer.h +++ content/public/browser/web_contents_observer.h -@@ -609,6 +609,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { +@@ -610,6 +610,10 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener { // WebContents has gained/lost focus. virtual void OnFocusChangedInPage(FocusedNodeDetails* details) {} diff --git a/patch/patches/web_url_loader_cancel_1617042.patch b/patch/patches/web_url_loader_cancel_1617042.patch index 30dcea4ea..14c1dac6a 100644 --- a/patch/patches/web_url_loader_cancel_1617042.patch +++ b/patch/patches/web_url_loader_cancel_1617042.patch @@ -1,16 +1,16 @@ -diff --git content/renderer/loader/web_url_loader_impl.h content/renderer/loader/web_url_loader_impl.h -index 883a088152d5..578f64c3bdc5 100644 ---- content/renderer/loader/web_url_loader_impl.h -+++ content/renderer/loader/web_url_loader_impl.h -@@ -102,6 +102,7 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { - std::unique_ptr - resource_load_info_notifier_wrapper, - blink::WebURLLoaderClient* client) override; -+ void Cancel() override; - void SetDefersLoading(DeferType value) override; - void DidChangePriority(blink::WebURLRequest::Priority new_priority, - int intra_priority_value) override; -@@ -112,8 +113,6 @@ class CONTENT_EXPORT WebURLLoaderImpl : public blink::WebURLLoader { +diff --git third_party/blink/public/platform/web_url_loader.h third_party/blink/public/platform/web_url_loader.h +index 48b95a412fe0..569e8c750e0a 100644 +--- third_party/blink/public/platform/web_url_loader.h ++++ third_party/blink/public/platform/web_url_loader.h +@@ -161,12 +161,14 @@ class BLINK_PLATFORM_EXPORT WebURLLoader { + void SetResourceRequestSenderForTesting( + std::unique_ptr resource_request_sender); + ++ // Cancels an asynchronous load. This will appear as a load error to ++ // the client. ++ void Cancel(); ++ + private: class Context; class RequestPeerImpl; @@ -18,19 +18,4 @@ index 883a088152d5..578f64c3bdc5 100644 - scoped_refptr context_; - DISALLOW_COPY_AND_ASSIGN(WebURLLoaderImpl); -diff --git third_party/blink/public/platform/web_url_loader.h third_party/blink/public/platform/web_url_loader.h -index 2db7b64b7948..fc77260fc9c0 100644 ---- third_party/blink/public/platform/web_url_loader.h -+++ third_party/blink/public/platform/web_url_loader.h -@@ -94,6 +94,10 @@ class WebURLLoader { - std::unique_ptr, - WebURLLoaderClient*) = 0; - -+ // Cancels an asynchronous load. This will appear as a load error to -+ // the client. -+ virtual void Cancel() {} -+ - // |kDeferred| is when an asynchronous load is suspended. - // |kDeferredWithBackForwardCache| is when an asynchronous load is suspended - // with BackForwardCache, and BackForwardCache entry can be evicted when + DISALLOW_COPY_AND_ASSIGN(WebURLLoader); diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 9951dc101..f2106e3b1 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -10,10 +10,10 @@ index ff7a8ed89e94..77f44956ff22 100644 + GetPlugins(bool refresh, bool is_main_frame, url.mojom.Origin main_frame_origin) => (array plugins); }; diff --git third_party/blink/public/platform/platform.h third_party/blink/public/platform/platform.h -index e43136e0621f..59a8d59fcc64 100644 +index 4b29748968bc..6d781517518c 100644 --- third_party/blink/public/platform/platform.h +++ third_party/blink/public/platform/platform.h -@@ -773,6 +773,11 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -771,6 +771,11 @@ class BLINK_PLATFORM_EXPORT Platform { // unset pass an empty WebURL and WebString. virtual void SetActiveURL(const WebURL& url, const WebString& top_url) {} @@ -26,10 +26,10 @@ index e43136e0621f..59a8d59fcc64 100644 static void InitializeMainThreadCommon(Platform* platform, std::unique_ptr main_thread); diff --git third_party/blink/renderer/core/dom/document_init.cc third_party/blink/renderer/core/dom/document_init.cc -index 570678bc648c..42d979f2a496 100644 +index a43dcce78e48..46bbd086516f 100644 --- third_party/blink/renderer/core/dom/document_init.cc +++ third_party/blink/renderer/core/dom/document_init.cc -@@ -180,11 +180,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { +@@ -185,11 +185,11 @@ PluginData* DocumentInit::GetPluginData(LocalFrame* frame, const KURL& url) { // frame()->tree().top()->securityContext() returns nullptr. // For that reason, the origin must be retrieved directly from |url|. if (frame->IsMainFrame()) @@ -44,10 +44,10 @@ index 570678bc648c..42d979f2a496 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 aa8952f06c9d..1fed8c0efe80 100644 +index 74d1e79e332c..6b96bf4a2543 100644 --- third_party/blink/renderer/core/frame/local_frame.cc +++ third_party/blink/renderer/core/frame/local_frame.cc -@@ -1811,7 +1811,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { +@@ -1850,7 +1850,7 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins()) return nullptr; @@ -57,7 +57,7 @@ index aa8952f06c9d..1fed8c0efe80 100644 } diff --git third_party/blink/renderer/core/inspector/devtools_session.cc third_party/blink/renderer/core/inspector/devtools_session.cc -index 0608c4defc6d..54eaa2197957 100644 +index 242653b4e723..385e4b4d3f07 100644 --- third_party/blink/renderer/core/inspector/devtools_session.cc +++ third_party/blink/renderer/core/inspector/devtools_session.cc @@ -8,6 +8,7 @@ @@ -85,10 +85,10 @@ index 0608c4defc6d..54eaa2197957 100644 void DevToolsSession::DispatchProtocolCommand( diff --git third_party/blink/renderer/core/page/page.cc third_party/blink/renderer/core/page/page.cc -index 022b95ec4ecc..ba58b796e35e 100644 +index 415b29342170..5aebc6d6379a 100644 --- third_party/blink/renderer/core/page/page.cc +++ third_party/blink/renderer/core/page/page.cc -@@ -212,7 +212,8 @@ Page::Page(PageClients& page_clients) +@@ -210,7 +210,8 @@ Page::Page(PageClients& page_clients, MakeGarbageCollected(GetVisualViewport(), GetChromeClient())), link_highlight_(MakeGarbageCollected(*this)), @@ -98,7 +98,7 @@ index 022b95ec4ecc..ba58b796e35e 100644 // TODO(pdr): Initialize |validation_message_client_| lazily. validation_message_client_( MakeGarbageCollected(*this)), -@@ -395,21 +396,41 @@ void Page::InitialStyleChanged() { +@@ -402,21 +403,41 @@ void Page::InitialStyleChanged() { } } @@ -149,7 +149,7 @@ index 022b95ec4ecc..ba58b796e35e 100644 page->NotifyPluginsChanged(); } } -@@ -921,7 +942,8 @@ void Page::Trace(Visitor* visitor) const { +@@ -928,7 +949,8 @@ void Page::Trace(Visitor* visitor) const { visitor->Trace(link_highlight_); visitor->Trace(spatial_navigation_controller_); visitor->Trace(main_frame_); @@ -160,10 +160,10 @@ index 022b95ec4ecc..ba58b796e35e 100644 visitor->Trace(plugins_changed_observers_); visitor->Trace(next_related_page_); diff --git third_party/blink/renderer/core/page/page.h third_party/blink/renderer/core/page/page.h -index e15111958f06..bfa43194b03b 100644 +index d2efc89d1305..4934e23c3b08 100644 --- third_party/blink/renderer/core/page/page.h +++ third_party/blink/renderer/core/page/page.h -@@ -152,7 +152,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -156,7 +156,8 @@ class CORE_EXPORT Page final : public GarbageCollected, ViewportDescription GetViewportDescription() const; // Returns the plugin data associated with |main_frame_origin|. @@ -173,7 +173,7 @@ index e15111958f06..bfa43194b03b 100644 // Resets the plugin data for all pages in the renderer process and notifies // PluginsChangedObservers. -@@ -434,7 +435,8 @@ class CORE_EXPORT Page final : public GarbageCollected, +@@ -435,7 +436,8 @@ class CORE_EXPORT Page final : public GarbageCollected, const Member link_highlight_; Member spatial_navigation_controller_; diff --git a/patch/patches/webkit_popups_and_background.patch b/patch/patches/webkit_popups_and_background.patch index 788caca43..4a3506fd6 100644 --- a/patch/patches/webkit_popups_and_background.patch +++ b/patch/patches/webkit_popups_and_background.patch @@ -11,10 +11,10 @@ index 758b0b1616ec..b35748d8180c 100644 text_track_margin_percentage(0.0f), immersive_mode_enabled(false), diff --git third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -index ac2cb47de75e..1e38517a1544 100644 +index ba1ba323ec45..10829ad5220c 100644 --- third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc +++ third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc -@@ -155,6 +155,7 @@ bool StructTraitsuser_gesture_required_for_presentation = data.user_gesture_required_for_presentation(); @@ -23,10 +23,10 @@ index ac2cb47de75e..1e38517a1544 100644 out->text_track_margin_percentage = data.text_track_margin_percentage(); out->immersive_mode_enabled = data.immersive_mode_enabled(); diff --git third_party/blink/public/common/web_preferences/web_preferences.h third_party/blink/public/common/web_preferences/web_preferences.h -index 64444803e75f..740d03e7eb7b 100644 +index ab727750abcb..07a2418b92e1 100644 --- third_party/blink/public/common/web_preferences/web_preferences.h +++ third_party/blink/public/common/web_preferences/web_preferences.h -@@ -175,6 +175,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { +@@ -177,6 +177,8 @@ struct BLINK_COMMON_EXPORT WebPreferences { bool user_gesture_required_for_presentation; @@ -36,10 +36,10 @@ index 64444803e75f..740d03e7eb7b 100644 // These fields specify the foreground and background color for WebVTT text diff --git third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -index c071879cdc2e..9c11650a6045 100644 +index 68d33ca3be29..4a0403dc0707 100644 --- third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h +++ third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h -@@ -455,6 +455,11 @@ struct BLINK_COMMON_EXPORT StructTraits(this)), minimum_zoom_level_(PageZoomFactorToZoomLevel(kMinimumPageZoomFactor)), maximum_zoom_level_(PageZoomFactorToZoomLevel(kMaximumPageZoomFactor)), @@ -104,7 +104,7 @@ index 68688f094a68..9eaabb3431e2 100644 does_composite_(does_composite), fullscreen_controller_(std::make_unique(this)), receiver_(this, -@@ -1752,6 +1758,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1763,6 +1769,8 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, RuntimeEnabledFeatures::SetTranslateServiceEnabled( prefs.translate_service_available); @@ -114,10 +114,10 @@ index 68688f094a68..9eaabb3431e2 100644 void WebViewImpl::ThemeChanged() { diff --git third_party/blink/renderer/core/exported/web_view_impl.h third_party/blink/renderer/core/exported/web_view_impl.h -index 83a2e96325de..48af36ac385a 100644 +index 297d3e515abe..c61105a13fc0 100644 --- third_party/blink/renderer/core/exported/web_view_impl.h +++ third_party/blink/renderer/core/exported/web_view_impl.h -@@ -126,7 +126,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -127,7 +127,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, static HashSet& AllInstances(); // Returns true if popup menus should be rendered by the browser, false if // they should be rendered by WebKit (which is the default). @@ -127,7 +127,7 @@ index 83a2e96325de..48af36ac385a 100644 // Returns whether frames under this WebView are backed by a compositor. bool does_composite() const { return does_composite_; } -@@ -721,6 +722,8 @@ class CORE_EXPORT WebViewImpl final : public WebView, +@@ -726,6 +727,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; @@ -137,10 +137,10 @@ index 83a2e96325de..48af36ac385a 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 d31dd9eb8419..3014c9223aef 100644 +index ae4d460aaeea..4b325fb82793 100644 --- third_party/blink/renderer/core/page/chrome_client_impl.cc +++ third_party/blink/renderer/core/page/chrome_client_impl.cc -@@ -802,7 +802,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { +@@ -808,7 +808,7 @@ bool ChromeClientImpl::HasOpenedPopup() const { PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, HTMLSelectElement& select) { NotifyPopupOpeningObservers(); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index f351d45b1..88930ebb1 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc -index b001aa3db63f..dd2743ca0afc 100644 +index 44e96c687520..cb81d3f0bb92 100644 --- chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc +++ chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc @@ -10,6 +10,7 @@ @@ -26,7 +26,7 @@ index b001aa3db63f..dd2743ca0afc 100644 #include "components/prefs/pref_service.h" #include "components/sync/driver/sync_internals_util.h" #include "components/sync/driver/sync_service.h" -@@ -342,7 +345,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { +@@ -335,7 +338,11 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { response->emplace(kOsVersionTag, os_version); #endif @@ -39,7 +39,7 @@ index b001aa3db63f..dd2743ca0afc 100644 PopulateExtensionInfoLogs(response.get()); PopulatePowerApiLogs(response.get()); PopulateDataReductionProxyLogs(response.get()); -@@ -417,6 +424,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( +@@ -410,6 +417,12 @@ void ChromeInternalLogSource::PopulateExtensionInfoLogs( if (!profile) return; @@ -52,7 +52,7 @@ index b001aa3db63f..dd2743ca0afc 100644 extensions::ExtensionRegistry* extension_registry = extensions::ExtensionRegistry::Get(profile); std::string extensions_list; -@@ -524,6 +537,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( +@@ -517,6 +530,8 @@ void ChromeInternalLogSource::PopulateOnboardingTime( #if defined(OS_WIN) void ChromeInternalLogSource::PopulateUsbKeyboardDetected( SystemLogsResponse* response) { diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index 4999e8648..995f90342 100644 --- a/patch/patches/webview_plugin_2020.patch +++ b/patch/patches/webview_plugin_2020.patch @@ -1,8 +1,8 @@ diff --git chrome/app/generated_resources.grd chrome/app/generated_resources.grd -index 3a1f50cb713c..e915ab4ee03a 100644 +index dabe252bb0f9..17f696e06a1c 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -5083,7 +5083,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -5119,7 +5119,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/patch/patches/win_rt_2274.patch b/patch/patches/win_rt_2274.patch deleted file mode 100644 index 1cb57f87b..000000000 --- a/patch/patches/win_rt_2274.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git sandbox/policy/win/sandbox_win.cc sandbox/policy/win/sandbox_win.cc -index 8ae341c38aac..c67b5acc89e7 100644 ---- sandbox/policy/win/sandbox_win.cc -+++ sandbox/policy/win/sandbox_win.cc -@@ -1004,8 +1004,11 @@ ResultCode SandboxWin::StartSandboxedProcess( - } - // TODO(wfh): Relax strict handle checks for network process until root cause - // for this crash can be resolved. See https://crbug.com/939590. -- if (sandbox_type != SandboxType::kNetwork) -+ if (!launcher_process_command_line.HasSwitch("win-rt-app") && -+ sandbox_type != SandboxType::kNetwork) { -+ // Don't enable this mitigation in WinRT apps. See issue #2274. - mitigations |= MITIGATION_STRICT_HANDLE_CHECKS; -+ } - - result = policy->SetDelayedProcessMitigations(mitigations); - if (result != SBOX_ALL_OK) diff --git a/tests/ceftests/cors_unittest.cc b/tests/ceftests/cors_unittest.cc index a0b334e2c..e6d8e45fe 100644 --- a/tests/ceftests/cors_unittest.cc +++ b/tests/ceftests/cors_unittest.cc @@ -41,7 +41,9 @@ std::string GetOrigin(HandlerType handler) { case HandlerType::SERVER: return test_server::kServerOrigin; case HandlerType::HTTP_SCHEME: - return "http://corstest.com"; + // Use HTTPS because requests from HTTP to the loopback address will be + // blocked by https://chromestatus.com/feature/5436853517811712. + return "https://corstest.com"; case HandlerType::CUSTOM_STANDARD_SCHEME: // Standard scheme that is CORS and fetch enabled. // Registered in scheme_handler_unittest.cc. @@ -1122,6 +1124,19 @@ void SetupExecRequest(ExecMode mode, std::string()); preflight_resource->InitPreflight(main_handler); setup->AddResource(preflight_resource); + + if (main_handler == HandlerType::CUSTOM_NONSTANDARD_SCHEME && + add_header) { + setup->AddConsoleMessage( + "The website requested a subresource from a network that it could " + "only access because of its users' privileged network position. " + "These requests expose non-public devices and servers to the " + "internet, increasing the risk of a cross-site request forgery " + "(CSRF) attack, and/or information leakage. To mitigate these " + "risks, Chrome deprecates requests to non-public subresources when " + "initiated from non-secure contexts, and will start blocking them " + "in Chrome 92 (July 2021)"); + } } else { // The server will not handle the preflight request. Expect the // cross-origin XHR to be blocked. diff --git a/tests/ceftests/plugin_unittest.cc b/tests/ceftests/plugin_unittest.cc index a030c5243..9bdc894d5 100644 --- a/tests/ceftests/plugin_unittest.cc +++ b/tests/ceftests/plugin_unittest.cc @@ -220,16 +220,20 @@ class PluginTestHandler : public RoutingTestHandler, return "document.getElementsByTagName('embed')[0]"; } - void WaitForNavigatorPlugins(CefRefPtr frame) const { - // Test if the `navigator.plugins` list includes the PDF extension. - const std::string& code = - " if (navigator.plugins['Chrome PDF Viewer'].filename == " - " 'mhjfbmdgcfjbbpaeojofohoefgiehjai') {" - " window.testQuery({request:'pdf_plugin_found'});" - "} else {" - " window.testQuery({request:'pdf_plugin_missing'});" - "}"; - frame->ExecuteJavaScript(code, frame->GetURL(), 0); + void WaitForNavigatorPlugins(CefRefPtr frame) { + // We can no longer test for navigator.plugins because it returns empty + // as of https://www.chromestatus.com/feature/5741884322349056. + if (HasNoList()) { + // The plugin will not load. End the test. + EndTest(); + } else if (HasBlock() || HasDisable()) { + // Wait for the plugin placeholder for the first PDF file to load. The + // test will continue from OnQuery. + WaitForPlaceholderLoad(frame); + } else { + // Wait for the first PDF file to load. + WaitForPluginLoad(frame); + } } void WaitForPlaceholderLoad(CefRefPtr frame) { @@ -383,24 +387,7 @@ class PluginTestHandler : public RoutingTestHandler, const CefString& request, bool persistent, CefRefPtr callback) override { - if (request == "pdf_plugin_found" || request == "pdf_plugin_missing") { - if (request == "pdf_plugin_found") - got_pdf_plugin_found_.yes(); - else - got_pdf_plugin_missing_.yes(); - - if (HasNoList()) { - // The plugin will not load. End the test. - EndTest(); - } else if (HasBlock() || HasDisable()) { - // Wait for the plugin placeholder for the first PDF file to load. The - // test will continue from OnQuery. - WaitForPlaceholderLoad(frame); - } else { - // Wait for the first PDF file to load. - WaitForPluginLoad(frame); - } - } else if (request == "placeholder_loaded") { + if (request == "placeholder_loaded") { EXPECT_FALSE(got_placeholder_loaded_); EXPECT_FALSE(got_placeholder_hidden_); got_placeholder_loaded_.yes(); @@ -429,9 +416,15 @@ class PluginTestHandler : public RoutingTestHandler, void TriggerContextMenu(CefRefPtr browser) { CefMouseEvent mouse_event; - // Somewhere in the first plugin. - mouse_event.x = 100; - mouse_event.y = 100; + if (HasDirectPluginLoad()) { + // Somewhere in the main PDF viewing area (avoid left preview bar). + mouse_event.x = 400; + mouse_event.y = 200; + } else { + // Somewhere in the first plugin. + mouse_event.x = 100; + mouse_event.y = 100; + } // Send right-click mouse down and mouse up to tigger context menu. browser->GetHost()->SendMouseClickEvent(mouse_event, MBT_RIGHT, false, 1); @@ -514,14 +507,10 @@ class PluginTestHandler : public RoutingTestHandler, if (HasNoList()) { EXPECT_TRUE(got_on_before_plugin_empty_origin2_); - EXPECT_FALSE(got_pdf_plugin_found_); - EXPECT_TRUE(got_pdf_plugin_missing_); EXPECT_FALSE(got_run_context_menu_); EXPECT_FALSE(got_context_menu_dismissed_); } else { EXPECT_FALSE(got_on_before_plugin_empty_origin2_); - EXPECT_TRUE(got_pdf_plugin_found_); - EXPECT_FALSE(got_pdf_plugin_missing_); EXPECT_TRUE(got_run_context_menu_); EXPECT_TRUE(got_context_menu_dismissed_); } @@ -569,8 +558,6 @@ class PluginTestHandler : public RoutingTestHandler, TrackCallback got_on_load_end_html_; TrackCallback got_on_load_end_pdf1_; TrackCallback got_on_load_end_pdf2_; - TrackCallback got_pdf_plugin_found_; - TrackCallback got_pdf_plugin_missing_; TrackCallback got_placeholder_loaded_; TrackCallback got_placeholder_hidden_; TrackCallback got_run_context_menu_; diff --git a/tests/ceftests/scheme_handler_unittest.cc b/tests/ceftests/scheme_handler_unittest.cc index 5ce64304d..1407f2772 100644 --- a/tests/ceftests/scheme_handler_unittest.cc +++ b/tests/ceftests/scheme_handler_unittest.cc @@ -2581,15 +2581,20 @@ TEST(SchemeHandlerTest, AcceptLanguage) { void RegisterSchemeHandlerCustomSchemes( CefRawPtr registrar, std::vector& cookiable_schemes) { + // Registering the custom standard schemes as secure because requests from + // non-secure origins to the loopback address will be blocked by + // https://chromestatus.com/feature/5436853517811712. + // Add a custom standard scheme. - registrar->AddCustomScheme( - "customstd", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_CORS_ENABLED); + registrar->AddCustomScheme("customstd", CEF_SCHEME_OPTION_STANDARD | + CEF_SCHEME_OPTION_SECURE | + CEF_SCHEME_OPTION_CORS_ENABLED); cookiable_schemes.push_back("customstd"); // Also used in cors_unittest.cc. - registrar->AddCustomScheme("customstdfetch", - CEF_SCHEME_OPTION_STANDARD | - CEF_SCHEME_OPTION_CORS_ENABLED | - CEF_SCHEME_OPTION_FETCH_ENABLED); + registrar->AddCustomScheme( + "customstdfetch", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_SECURE | + CEF_SCHEME_OPTION_CORS_ENABLED | + CEF_SCHEME_OPTION_FETCH_ENABLED); cookiable_schemes.push_back("customstdfetch"); // Add a custom non-standard scheme. registrar->AddCustomScheme("customnonstd", CEF_SCHEME_OPTION_NONE); diff --git a/tests/ceftests/tracing_unittest.cc b/tests/ceftests/tracing_unittest.cc index d02d763f9..38c1b1b40 100644 --- a/tests/ceftests/tracing_unittest.cc +++ b/tests/ceftests/tracing_unittest.cc @@ -294,27 +294,42 @@ class TracingTestHandler : public CefEndTracingCallback, 1000, "arg1", 1); break; case TT_TRACE_EVENT_ASYNC_END0: + TRACE_EVENT_ASYNC_BEGIN0(kTraceTestCategory, + "TT_TRACE_EVENT_ASYNC_END0", 100); TRACE_EVENT_ASYNC_END0(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END0", 100); break; case TT_TRACE_EVENT_ASYNC_END1: + TRACE_EVENT_ASYNC_BEGIN1(kTraceTestCategory, + "TT_TRACE_EVENT_ASYNC_END1", 100, "arg1", 1); TRACE_EVENT_ASYNC_END1(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END1", 100, "arg1", 1); break; case TT_TRACE_EVENT_ASYNC_END2: + TRACE_EVENT_ASYNC_BEGIN2(kTraceTestCategory, + "TT_TRACE_EVENT_ASYNC_END2", 100, "arg1", 1, + "arg2", 2); TRACE_EVENT_ASYNC_END2(kTraceTestCategory, "TT_TRACE_EVENT_ASYNC_END2", 100, "arg1", 1, "arg2", 2); break; case TT_TRACE_EVENT_COPY_ASYNC_END0: + TRACE_EVENT_COPY_ASYNC_BEGIN0(kTraceTestCategory, + "TT_TRACE_EVENT_COPY_ASYNC_END0", 100); TRACE_EVENT_COPY_ASYNC_END0(kTraceTestCategory, "TT_TRACE_EVENT_COPY_ASYNC_END0", 100); break; case TT_TRACE_EVENT_COPY_ASYNC_END1: + TRACE_EVENT_COPY_ASYNC_BEGIN1(kTraceTestCategory, + "TT_TRACE_EVENT_COPY_ASYNC_END1", 100, + "arg1", 1); TRACE_EVENT_COPY_ASYNC_END1(kTraceTestCategory, "TT_TRACE_EVENT_COPY_ASYNC_END1", 100, "arg1", 1); break; case TT_TRACE_EVENT_COPY_ASYNC_END2: + TRACE_EVENT_COPY_ASYNC_BEGIN2(kTraceTestCategory, + "TT_TRACE_EVENT_COPY_ASYNC_END2", 100, + "arg1", 1, "arg2", 2); TRACE_EVENT_COPY_ASYNC_END2(kTraceTestCategory, "TT_TRACE_EVENT_COPY_ASYNC_END2", 100, "arg1", 1, "arg2", 2); @@ -411,6 +426,8 @@ TRACING_TEST(TraceEventAsyncEnd0, TT_TRACE_EVENT_ASYNC_END0) TRACING_TEST(TraceEventAsyncEnd1, TT_TRACE_EVENT_ASYNC_END1) TRACING_TEST(TraceEventAsyncEnd2, TT_TRACE_EVENT_ASYNC_END2) TRACING_TEST(TraceEventCopyAsyncEnd0, TT_TRACE_EVENT_COPY_ASYNC_END0) +TRACING_TEST(TraceEventCopyAsyncEnd1, TT_TRACE_EVENT_COPY_ASYNC_END1) +TRACING_TEST(TraceEventCopyAsyncEnd2, TT_TRACE_EVENT_COPY_ASYNC_END2) TEST(TracingTest, NowFromSystemTraceTime) { int64 val = CefNowFromSystemTraceTime(); diff --git a/tests/ceftests/urlrequest_unittest.cc b/tests/ceftests/urlrequest_unittest.cc index d4c0bed0a..6c8ff8a9c 100644 --- a/tests/ceftests/urlrequest_unittest.cc +++ b/tests/ceftests/urlrequest_unittest.cc @@ -3182,24 +3182,12 @@ class RequestTestHandler : public TestHandler { got_on_test_complete_.yes(); if (!context_tmpdir_.IsEmpty()) { - // Wait a bit for cache file handles to close after browser or request - // context destruction. - CefPostDelayedTask( - TID_FILE_USER_VISIBLE, - base::Bind(&RequestTestHandler::PostTestCompleteFileTasks, this), - 200); - } else { - TestComplete(); + // Delete the temp directory on application shutdown. + CefTestSuite::GetInstance()->RegisterTempDirectory( + context_tmpdir_.Take()); } - } - void PostTestCompleteFileTasks() { - EXPECT_TRUE(CefCurrentlyOn(TID_FILE_USER_VISIBLE)); - - EXPECT_TRUE(context_tmpdir_.Delete()); - EXPECT_TRUE(context_tmpdir_.IsEmpty()); - - CefPostTask(TID_UI, base::Bind(&RequestTestHandler::TestComplete, this)); + TestComplete(); } private: diff --git a/tests/ceftests/v8_unittest.cc b/tests/ceftests/v8_unittest.cc index 03dd08c33..f6aca3dc2 100644 --- a/tests/ceftests/v8_unittest.cc +++ b/tests/ceftests/v8_unittest.cc @@ -2932,7 +2932,8 @@ class V8TestHandler : public TestHandler { } // Time out the test after a reasonable period of time. - SetTestTimeout(); + SetTestTimeout(test_mode_ == V8TEST_ON_UNCAUGHT_EXCEPTION_DEV_TOOLS ? 10000 + : 5000); } void OnBeforeClose(CefRefPtr browser) override { diff --git a/tools/gn_args.py b/tools/gn_args.py index 62a233d0b..7d07f4569 100644 --- a/tools/gn_args.py +++ b/tools/gn_args.py @@ -492,6 +492,9 @@ def GetConfigArgsSandbox(platform, args, is_debug, cpu): # build with MSVC libc++. add_args['enable_base_tracing'] = False + # Don't enable -Wmax-tokens in combination with MSVC libc++. + add_args['enable_wmax_tokens'] = False + result = MergeDicts(args, add_args, { 'is_debug': is_debug, 'target_cpu': cpu,