diff --git a/BUILD.gn b/BUILD.gn index ee55846fe..48eefe8ee 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -713,6 +713,7 @@ static_library("libcef_static") { "//chrome/child", "//chrome/common", "//chrome/renderer", + "//chrome/utility", "//components/cdm/renderer", "//components/content_settings/core/browser", "//components/content_settings/core/common", @@ -1547,7 +1548,7 @@ if (is_mac) { ] outputs = [ - "{{bundle_root_dir}}/Frameworks/{{source_file_part}}", + "{{bundle_contents_dir}}/Frameworks/{{source_file_part}}", ] } diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index f90cd9ca4..ba3a03e49 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'fa6a5d87adff761bc16afc5498c3f5944c1daa68', + 'chromium_checkout': 'adb61db19020ed8ecee5e91b1a0ea4c924ae2988', } diff --git a/libcef/browser/browser_context_impl.cc b/libcef/browser/browser_context_impl.cc index 0e8d5881e..825eb371e 100644 --- a/libcef/browser/browser_context_impl.cc +++ b/libcef/browser/browser_context_impl.cc @@ -424,6 +424,11 @@ content::PermissionManager* CefBrowserContextImpl::GetPermissionManager() { return permission_manager_.get(); } +content::BackgroundFetchDelegate* +CefBrowserContextImpl::GetBackgroundFetchDelegate() { + return nullptr; +} + content::BackgroundSyncController* CefBrowserContextImpl::GetBackgroundSyncController() { return nullptr; diff --git a/libcef/browser/browser_context_impl.h b/libcef/browser/browser_context_impl.h index f50be0d80..c0e5b77fd 100644 --- a/libcef/browser/browser_context_impl.h +++ b/libcef/browser/browser_context_impl.h @@ -68,6 +68,7 @@ class CefBrowserContextImpl : public CefBrowserContext, content::PushMessagingService* GetPushMessagingService() override; content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; content::PermissionManager* GetPermissionManager() override; + content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override; content::BackgroundSyncController* GetBackgroundSyncController() override; content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate() override; diff --git a/libcef/browser/browser_context_proxy.cc b/libcef/browser/browser_context_proxy.cc index a17f047d3..0117ea6f0 100644 --- a/libcef/browser/browser_context_proxy.cc +++ b/libcef/browser/browser_context_proxy.cc @@ -156,6 +156,11 @@ content::PermissionManager* CefBrowserContextProxy::GetPermissionManager() { return parent_->GetPermissionManager(); } +content::BackgroundFetchDelegate* +CefBrowserContextProxy::GetBackgroundFetchDelegate() { + return parent_->GetBackgroundFetchDelegate(); +} + content::BackgroundSyncController* CefBrowserContextProxy::GetBackgroundSyncController() { return parent_->GetBackgroundSyncController(); diff --git a/libcef/browser/browser_context_proxy.h b/libcef/browser/browser_context_proxy.h index 95b9e5c08..814bb1b11 100644 --- a/libcef/browser/browser_context_proxy.h +++ b/libcef/browser/browser_context_proxy.h @@ -43,6 +43,7 @@ class CefBrowserContextProxy : public CefBrowserContext { content::PushMessagingService* GetPushMessagingService() override; content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; content::PermissionManager* GetPermissionManager() override; + content::BackgroundFetchDelegate* GetBackgroundFetchDelegate() override; content::BackgroundSyncController* GetBackgroundSyncController() override; content::BrowsingDataRemoverDelegate* GetBrowsingDataRemoverDelegate() override; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 093d665cc..42ae7b202 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -49,7 +49,6 @@ #include "chrome/browser/ui/prefs/prefs_tab_helper.h" #include "components/zoom/zoom_controller.h" #include "content/browser/gpu/compositor_util.h" -#include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/common/view_messages.h" #include "content/public/browser/desktop_media_id.h" @@ -1793,7 +1792,7 @@ void CefBrowserHostImpl::ExecuteJavaScriptWithUserGestureForTests( rfh = web_contents()->GetMainFrame(); } else { rfh = content::RenderFrameHost::FromID( - web_contents()->GetRenderProcessHost()->GetID(), frame_id); + web_contents()->GetRenderViewHost()->GetProcess()->GetID(), frame_id); } if (rfh) @@ -2616,12 +2615,8 @@ void CefBrowserHostImpl::RenderFrameDeleted( void CefBrowserHostImpl::RenderViewCreated( content::RenderViewHost* render_view_host) { - // The swapped out state of a RVH is determined by its main frame since - // subframes should have their own widgets. We should never recieve creation - // notifications for a RVH where the main frame is swapped out. - content::RenderViewHostImpl* render_view_host_impl = - static_cast(render_view_host); - DCHECK(!render_view_host_impl->is_swapped_out()); + // As of https://crrev.com/27caae83 this notification will be sent for RVHs + // created for provisional main frame navigations. const int render_process_id = render_view_host->GetProcess()->GetID(); const int render_routing_id = render_view_host->GetRoutingID(); @@ -2641,15 +2636,6 @@ void CefBrowserHostImpl::RenderViewCreated( void CefBrowserHostImpl::RenderViewDeleted( content::RenderViewHost* render_view_host) { - // The swapped out state of a RVH is determined by its main frame since - // subframes should have their own widgets. Ignore deletion notification for - // a RVH where the main frame host is swapped out. We probably shouldn't be - // getting these notifications to begin with. - content::RenderViewHostImpl* render_view_host_impl = - static_cast(render_view_host); - if (render_view_host_impl->is_swapped_out()) - return; - const int render_process_id = render_view_host->GetProcess()->GetID(); const int render_routing_id = render_view_host->GetRoutingID(); browser_info_->render_id_manager()->remove_render_view_id(render_process_id, @@ -2788,8 +2774,7 @@ void CefBrowserHostImpl::FrameDeleted( focused_frame_id_ = CefFrameHostImpl::kInvalidFrameId; } -void CefBrowserHostImpl::TitleWasSet(content::NavigationEntry* entry, - bool explicit_set) { +void CefBrowserHostImpl::TitleWasSet(content::NavigationEntry* entry) { // |entry| may be NULL if a popup is created via window.open and never // navigated. if (entry) @@ -2892,8 +2877,11 @@ bool CefBrowserHostImpl::Send(IPC::Message* message) { if (queue_messages_) { queued_messages_.push(message); return true; + } else if (web_contents() && web_contents()->GetRenderViewHost()) { + return web_contents()->GetRenderViewHost()->Send(message); } else { - return content::WebContentsObserver::Send(message); + delete message; + return false; } } else { CEF_POST_TASK( @@ -2903,6 +2891,14 @@ bool CefBrowserHostImpl::Send(IPC::Message* message) { } } +int CefBrowserHostImpl::routing_id() const { + CEF_REQUIRE_UIT(); + if (!web_contents()) + return MSG_ROUTING_NONE; + + return web_contents()->GetRenderViewHost()->GetRoutingID(); +} + void CefBrowserHostImpl::AddObserver(Observer* observer) { CEF_REQUIRE_UIT(); observers_.AddObserver(observer); diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 404d175a8..b024dc701 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -498,7 +498,7 @@ class CefBrowserHostImpl : public CefBrowserHost, int error_code, const base::string16& error_description) override; void FrameDeleted(content::RenderFrameHost* render_frame_host) override; - void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override; + void TitleWasSet(content::NavigationEntry* entry) override; void PluginCrashed(const base::FilePath& plugin_path, base::ProcessId plugin_pid) override; void DidUpdateFaviconURL( @@ -515,8 +515,12 @@ class CefBrowserHostImpl : public CefBrowserHost, void OnWebContentsFocused( content::RenderWidgetHost* render_widget_host) override; - // Override to provide a thread safe implementation. - bool Send(IPC::Message* message) override; + + // Send a message to the RenderViewHost associated with this browser. + // TODO(cef): With the introduction of OOPIFs, WebContents can span multiple + // processes. Messages should be sent to specific RenderFrameHosts instead. + bool Send(IPC::Message* message); + int routing_id() const; // Manage observer objects. The observer must either outlive this object or // remove itself before destruction. These methods can only be called on the diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index 7758657bd..b1b90a408 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -60,50 +60,6 @@ #include "libcef/browser/printing/print_dialog_linux.h" #endif -namespace { - -// In-memory store for access tokens used by geolocation. -class CefAccessTokenStore : public device::AccessTokenStore { - public: - // |system_context| is used by NetworkLocationProvider to communicate with a - // remote geolocation service. - explicit CefAccessTokenStore(net::URLRequestContextGetter* system_context) - : system_context_(system_context) {} - - void LoadAccessTokens(const LoadAccessTokensCallback& callback) override { - callback.Run(access_token_map_, system_context_); - } - - void SaveAccessToken(const GURL& server_url, - const base::string16& access_token) override { - access_token_map_[server_url] = access_token; - } - - private: - net::URLRequestContextGetter* system_context_; - AccessTokenMap access_token_map_; - - DISALLOW_COPY_AND_ASSIGN(CefAccessTokenStore); -}; - -// A provider of services for geolocation. -class CefGeolocationDelegate : public device::GeolocationDelegate { - public: - explicit CefGeolocationDelegate(net::URLRequestContextGetter* system_context) - : system_context_(system_context) {} - - scoped_refptr CreateAccessTokenStore() override { - return new CefAccessTokenStore(system_context_); - } - - private: - net::URLRequestContextGetter* system_context_; - - DISALLOW_COPY_AND_ASSIGN(CefGeolocationDelegate); -}; - -} // namespace - CefBrowserMainParts::CefBrowserMainParts( const content::MainFunctionParams& parameters) : BrowserMainParts(), devtools_delegate_(NULL) {} @@ -199,10 +155,6 @@ void CefBrowserMainParts::PreMainMessageLoopRun() { // Triggers initialization of the singleton instance on UI thread. PluginFinder::GetInstance()->Init(); - device::GeolocationProvider::SetGeolocationDelegate( - new CefGeolocationDelegate( - browser_context->request_context_getter().get())); - scheme::RegisterWebUIControllerFactory(); } diff --git a/libcef/browser/chrome_browser_process_stub.cc b/libcef/browser/chrome_browser_process_stub.cc index 904902f4c..ef2486158 100644 --- a/libcef/browser/chrome_browser_process_stub.cc +++ b/libcef/browser/chrome_browser_process_stub.cc @@ -31,20 +31,11 @@ ChromeBrowserProcessStub::~ChromeBrowserProcessStub() { chrome::SetBrowserContextIncognitoHelper(nullptr); } -void ChromeBrowserProcessStub::Initialize( - const base::CommandLine& command_line) { +void ChromeBrowserProcessStub::Initialize() { DCHECK(!initialized_); DCHECK(!context_initialized_); DCHECK(!shutdown_); - net_log_ = base::MakeUnique(); - if (command_line.HasSwitch(switches::kLogNetLog)) { - net_log_->StartWritingToFile( - command_line.GetSwitchValuePath(switches::kLogNetLog), - GetNetCaptureModeFromCommandLine(command_line), - command_line.GetCommandLineString(), std::string()); - } - initialized_ = true; } @@ -300,6 +291,17 @@ void ChromeBrowserProcessStub::StartAutoupdateTimer() {} net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() { DCHECK(initialized_); + if (!net_log_) { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + net_log_ = base::MakeUnique(); + if (command_line.HasSwitch(switches::kLogNetLog)) { + net_log_->StartWritingToFile( + command_line.GetSwitchValuePath(switches::kLogNetLog), + GetNetCaptureModeFromCommandLine(command_line), + command_line.GetCommandLineString(), std::string()); + } + } return net_log_.get(); } @@ -314,12 +316,6 @@ CRLSetFetcher* ChromeBrowserProcessStub::crl_set_fetcher() { return NULL; } -component_updater::PnaclComponentInstaller* -ChromeBrowserProcessStub::pnacl_component_installer() { - NOTREACHED(); - return NULL; -} - component_updater::SupervisedUserWhitelistInstaller* ChromeBrowserProcessStub::supervised_user_whitelist_installer() { NOTREACHED(); diff --git a/libcef/browser/chrome_browser_process_stub.h b/libcef/browser/chrome_browser_process_stub.h index f67a4637e..06bb88d04 100644 --- a/libcef/browser/chrome_browser_process_stub.h +++ b/libcef/browser/chrome_browser_process_stub.h @@ -35,7 +35,7 @@ class ChromeBrowserProcessStub : public BrowserProcess, ChromeBrowserProcessStub(); ~ChromeBrowserProcessStub() override; - void Initialize(const base::CommandLine& command_line); + void Initialize(); void OnContextInitialized(); void Shutdown(); @@ -95,8 +95,6 @@ class ChromeBrowserProcessStub : public BrowserProcess, net_log::ChromeNetLog* net_log() override; component_updater::ComponentUpdateService* component_updater() override; CRLSetFetcher* crl_set_fetcher() override; - component_updater::PnaclComponentInstaller* pnacl_component_installer() - override; component_updater::SupervisedUserWhitelistInstaller* supervised_user_whitelist_installer() override; MediaFileSystemRegistry* media_file_system_registry() override; diff --git a/libcef/browser/chrome_profile_stub.cc b/libcef/browser/chrome_profile_stub.cc index 6afa417a1..bf651d56c 100644 --- a/libcef/browser/chrome_profile_stub.cc +++ b/libcef/browser/chrome_profile_stub.cc @@ -107,12 +107,6 @@ chrome_browser_net::Predictor* ChromeProfileStub::GetNetworkPredictor() { return NULL; } -DevToolsNetworkControllerHandle* -ChromeProfileStub::GetDevToolsNetworkControllerHandle() { - NOTREACHED(); - return NULL; -} - void ChromeProfileStub::ClearNetworkingHistorySince( base::Time time, const base::Closure& completion) { diff --git a/libcef/browser/chrome_profile_stub.h b/libcef/browser/chrome_profile_stub.h index e4b08bed9..fafde9101 100644 --- a/libcef/browser/chrome_profile_stub.h +++ b/libcef/browser/chrome_profile_stub.h @@ -40,8 +40,6 @@ class ChromeProfileStub : public Profile { void set_last_selected_directory(const base::FilePath& path) override; PrefProxyConfigTracker* GetProxyConfigTracker() override; chrome_browser_net::Predictor* GetNetworkPredictor() override; - DevToolsNetworkControllerHandle* GetDevToolsNetworkControllerHandle() - override; void ClearNetworkingHistorySince(base::Time time, const base::Closure& completion) override; GURL GetHomePage() override; diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 280cf3fa5..0537caa16 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -599,9 +599,8 @@ void CefContentBrowserClient::SiteInstanceDeleting( void CefContentBrowserClient::RegisterOutOfProcessServices( OutOfProcessServiceMap* services) { - (*services)[printing::mojom::kServiceName] = { - base::ASCIIToUTF16("PDF Compositor Service"), - content::SANDBOX_TYPE_UTILITY}; + (*services)[printing::mojom::kServiceName] = + base::ASCIIToUTF16("PDF Compositor Service"); } std::unique_ptr CefContentBrowserClient::GetServiceManifestOverlay( @@ -767,7 +766,6 @@ void CefContentBrowserClient::AllowCertificateError( const net::SSLInfo& ssl_info, const GURL& request_url, content::ResourceType resource_type, - bool overridable, bool strict_enforcement, bool expired_previous_decision, const base::Callback& diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index ee525356b..48b2a7536 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -71,7 +71,6 @@ class CefContentBrowserClient : public content::ContentBrowserClient { const net::SSLInfo& ssl_info, const GURL& request_url, content::ResourceType resource_type, - bool overridable, bool strict_enforcement, bool expired_previous_decision, const base::Callback& diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc index 52285bc68..2deb32f62 100644 --- a/libcef/browser/context.cc +++ b/libcef/browser/context.cc @@ -391,8 +391,7 @@ bool CefContext::Initialize(const CefMainArgs& args, if (exit_code >= 0) return false; - static_cast(g_browser_process) - ->Initialize(*base::CommandLine::ForCurrentProcess()); + static_cast(g_browser_process)->Initialize(); // Run the process. Results in a call to CefMainDelegate::RunProcess() which // will create the browser runner and message loop without blocking. diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index 8e65279a0..f3325965f 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -590,7 +590,7 @@ void CefExtensionSystem::NotifyExtensionLoaded(const Extension* extension) { extension, base::Bind(&CefExtensionSystem::OnExtensionRegisteredWithRequestContexts, weak_ptr_factory_.GetWeakPtr(), - make_scoped_refptr(extension))); + base::WrapRefCounted(extension))); // Tell renderers about the loaded extension. renderer_helper_->OnExtensionLoaded(*extension); diff --git a/libcef/browser/extensions/pdf_extension_util.cc b/libcef/browser/extensions/pdf_extension_util.cc index 9e72c5066..4fb7066a3 100644 --- a/libcef/browser/extensions/pdf_extension_util.cc +++ b/libcef/browser/extensions/pdf_extension_util.cc @@ -32,7 +32,7 @@ const char kPdfResourceIdentifier[] = "chromium-pdf"; const char kPdfPluginName[] = "Chrome PDF Viewer"; std::string GetManifest() { - std::string manifest_contents = ResourceBundle::GetSharedInstance() + std::string manifest_contents = ui::ResourceBundle::GetSharedInstance() .GetRawDataResource(IDR_PDF_MANIFEST) .as_string(); DCHECK(manifest_contents.find(kNameTag) != std::string::npos); diff --git a/libcef/browser/image_impl.cc b/libcef/browser/image_impl.cc index efd019c96..391a2fdfb 100644 --- a/libcef/browser/image_impl.cc +++ b/libcef/browser/image_impl.cc @@ -128,7 +128,7 @@ bool CefImageImpl::AddBitmap(float scale_factor, return false; } - DCHECK_EQ(pixel_data_size, bitmap.getSize()); + DCHECK_EQ(pixel_data_size, bitmap.computeByteSize()); memcpy(bitmap.getPixels(), pixel_data, pixel_data_size); return AddBitmap(scale_factor, bitmap); @@ -226,14 +226,15 @@ CefRefPtr CefImageImpl::GetAsBitmap(float scale_factor, if (bitmap->colorType() == desired_ct && bitmap->alphaType() == desired_at) { // No conversion necessary. - return CefBinaryValue::Create(bitmap->getPixels(), bitmap->getSize()); + return CefBinaryValue::Create(bitmap->getPixels(), + bitmap->computeByteSize()); } else { SkBitmap desired_bitmap; if (!ConvertBitmap(*bitmap, &desired_bitmap, desired_ct, desired_at)) return nullptr; DCHECK(desired_bitmap.readyToDraw()); return CefBinaryValue::Create(desired_bitmap.getPixels(), - desired_bitmap.getSize()); + desired_bitmap.computeByteSize()); } } diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index 813683144..41d1449e6 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -20,16 +20,16 @@ namespace { class CefJSDialogCallbackImpl : public CefJSDialogCallback { public: CefJSDialogCallbackImpl( - const content::JavaScriptDialogManager::DialogClosedCallback& callback) - : callback_(callback) {} + content::JavaScriptDialogManager::DialogClosedCallback callback) + : callback_(std::move(callback)) {} ~CefJSDialogCallbackImpl() override { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. if (CEF_CURRENTLY_ON_UIT()) { - CancelNow(callback_); + CancelNow(std::move(callback_)); } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::CancelNow, - callback_)); + base::Passed(std::move(callback_)))); } } } @@ -37,8 +37,7 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { void Continue(bool success, const CefString& user_input) override { if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { - callback_.Run(success, user_input); - callback_.Reset(); + std::move(callback_).Run(success, user_input); } } else { CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::Continue, @@ -50,9 +49,9 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { private: static void CancelNow( - const content::JavaScriptDialogManager::DialogClosedCallback& callback) { + content::JavaScriptDialogManager::DialogClosedCallback callback) { CEF_REQUIRE_UIT(); - callback.Run(false, base::string16()); + std::move(callback).Run(false, base::string16()); } content::JavaScriptDialogManager::DialogClosedCallback callback_; @@ -85,7 +84,7 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( content::JavaScriptDialogType message_type, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback, + DialogClosedCallback callback, bool* did_suppress_message) { CefRefPtr client = browser_->GetClient(); if (client.get()) { @@ -94,7 +93,7 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( *did_suppress_message = false; CefRefPtr callbackPtr( - new CefJSDialogCallbackImpl(callback)); + new CefJSDialogCallbackImpl(std::move(callback))); // Execute the user callback. bool handled = handler->OnJSDialog( @@ -132,18 +131,19 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( runner_->Run(browser_, message_type, display_url, message_text, default_prompt_text, base::Bind(&CefJavaScriptDialogManager::DialogClosed, - weak_ptr_factory_.GetWeakPtr(), callback)); + weak_ptr_factory_.GetWeakPtr(), + base::Passed(std::move(callback)))); } void CefJavaScriptDialogManager::RunBeforeUnloadDialog( content::WebContents* web_contents, bool is_reload, - const DialogClosedCallback& callback) { + DialogClosedCallback callback) { if (browser_->destruction_state() >= CefBrowserHostImpl::DESTRUCTION_STATE_ACCEPTED) { // Currently destroying the browser. Accept the unload without showing // the prompt. - callback.Run(true, base::string16()); + std::move(callback).Run(true, base::string16()); return; } @@ -155,7 +155,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( CefRefPtr handler = client->GetJSDialogHandler(); if (handler.get()) { CefRefPtr callbackPtr( - new CefJSDialogCallbackImpl(callback)); + new CefJSDialogCallbackImpl(std::move(callback))); // Execute the user callback. bool handled = handler->OnBeforeUnloadDialog( @@ -172,7 +172,7 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( LOG(WARNING) << "No javascript dialog runner available for this platform"; // Suppress the dialog if there is no platform runner or if the dialog is // currently running. - callback.Run(true, base::string16()); + std::move(callback).Run(true, base::string16()); return; } @@ -183,7 +183,8 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( message_text, base::string16(), // default_prompt_text base::Bind(&CefJavaScriptDialogManager::DialogClosed, - weak_ptr_factory_.GetWeakPtr(), callback)); + weak_ptr_factory_.GetWeakPtr(), + base::Passed(std::move(callback)))); } void CefJavaScriptDialogManager::CancelDialogs( @@ -205,7 +206,7 @@ void CefJavaScriptDialogManager::CancelDialogs( } void CefJavaScriptDialogManager::DialogClosed( - const DialogClosedCallback& callback, + DialogClosedCallback callback, bool success, const base::string16& user_input) { CefRefPtr client = browser_->GetClient(); @@ -220,5 +221,5 @@ void CefJavaScriptDialogManager::DialogClosed( dialog_running_ = false; - callback.Run(success, user_input); + std::move(callback).Run(success, user_input); } diff --git a/libcef/browser/javascript_dialog_manager.h b/libcef/browser/javascript_dialog_manager.h index 7178c09d8..5307ed1cd 100644 --- a/libcef/browser/javascript_dialog_manager.h +++ b/libcef/browser/javascript_dialog_manager.h @@ -33,17 +33,17 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager { content::JavaScriptDialogType message_type, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback, + DialogClosedCallback callback, bool* did_suppress_message) override; void RunBeforeUnloadDialog(content::WebContents* web_contents, bool is_reload, - const DialogClosedCallback& callback) override; + DialogClosedCallback callback) override; void CancelDialogs(content::WebContents* web_contents, bool reset_state) override; private: // Method executed by the callback passed to CefJavaScriptDialogRunner::Run. - void DialogClosed(const DialogClosedCallback& callback, + void DialogClosed(DialogClosedCallback callback, bool success, const base::string16& user_input); diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 64af2ba31..46c361551 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -4,10 +4,6 @@ #include "libcef/browser/native/browser_platform_delegate_native_linux.h" -// Include this first to avoid type conflict errors. -#include "base/tracked_objects.h" -#undef Status - #include #include "libcef/browser/browser_host_impl.h" diff --git a/libcef/browser/net/scheme_handler.cc b/libcef/browser/net/scheme_handler.cc index ffa282ee0..eb7dc5861 100644 --- a/libcef/browser/net/scheme_handler.cc +++ b/libcef/browser/net/scheme_handler.cc @@ -11,7 +11,7 @@ #include "libcef/common/net/scheme_registration.h" #include "base/memory/ptr_util.h" -#include "base/threading/sequenced_worker_pool.h" +#include "base/task_scheduler/post_task.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/url_constants.h" #include "net/net_features.h" @@ -34,10 +34,9 @@ void InstallInternalProtectedHandlers( protocol_handlers->insert(std::make_pair( url::kFileScheme, linked_ptr( - new net::FileProtocolHandler( - content::BrowserThread::GetBlockingPool() - ->GetTaskRunnerWithShutdownBehavior( - base::SequencedWorkerPool::SKIP_ON_SHUTDOWN))))); + new net::FileProtocolHandler(base::CreateTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}))))); #if !BUILDFLAG(DISABLE_FTP_SUPPORT) protocol_handlers->insert(std::make_pair( url::kFtpScheme, diff --git a/libcef/browser/net/url_request_context_getter_impl.cc b/libcef/browser/net/url_request_context_getter_impl.cc index 8741a9059..aa3471d65 100644 --- a/libcef/browser/net/url_request_context_getter_impl.cc +++ b/libcef/browser/net/url_request_context_getter_impl.cc @@ -23,7 +23,6 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/threading/thread_restrictions.h" -#include "base/threading/worker_pool.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h" @@ -33,6 +32,7 @@ #include "components/network_session_configurator/browser/network_session_configurator.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" +#include "content/network/proxy_service_mojo.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" @@ -55,7 +55,6 @@ #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" #include "net/proxy/proxy_script_fetcher_impl.h" #include "net/proxy/proxy_service.h" -#include "net/proxy/proxy_service_mojo.h" #include "net/ssl/ssl_config_service_defaults.h" #include "net/url_request/http_user_agent_settings.h" #include "net/url_request/url_request.h" @@ -136,7 +135,7 @@ std::unique_ptr CreateProxyService( net::DhcpProxyScriptFetcherFactory dhcp_factory; dhcp_proxy_script_fetcher = dhcp_factory.Create(context); - proxy_service = net::CreateProxyServiceUsingMojoFactory( + proxy_service = content::CreateProxyServiceUsingMojoFactory( ChromeMojoProxyResolverFactory::GetInstance(), std::move(proxy_config_service), new net::ProxyScriptFetcherImpl(context), diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index aebe69a2e..808880b16 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -18,9 +18,9 @@ #include "base/command_line.h" #include "base/memory/ptr_util.h" #include "cc/base/switches.h" +#include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/delay_based_time_source.h" #include "components/viz/common/gl_helper.h" -#include "components/viz/common/quads/copy_output_request.h" #include "content/browser/bad_message.h" #include "content/browser/compositor/image_transport_factory.h" #include "content/browser/frame_host/render_widget_host_view_guest.h" @@ -131,9 +131,11 @@ class CefCopyFrameGenerator { // DelegatedFrameHost::CopyFromCompositingSurface but we reuse the same // SkBitmap in the GPU codepath and avoid scaling where possible. std::unique_ptr request = - viz::CopyOutputRequest::CreateRequest(base::Bind( - &CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult, - weak_ptr_factory_.GetWeakPtr(), damage_rect)); + std::make_unique( + viz::CopyOutputRequest::ResultFormat::RGBA_BITMAP, + base::Bind( + &CefCopyFrameGenerator::CopyFromCompositingSurfaceHasResult, + weak_ptr_factory_.GetWeakPtr(), damage_rect)); request->set_area(gfx::Rect(view_->GetPhysicalBackingSize())); view_->GetRootLayer()->RequestCopyOfOutput(std::move(request)); @@ -148,19 +150,19 @@ class CefCopyFrameGenerator { return; } - if (result->HasTexture()) { + if (result->format() == viz::CopyOutputResult::Format::RGBA_TEXTURE) { PrepareTextureCopyOutputResult(damage_rect, std::move(result)); return; } - DCHECK(result->HasBitmap()); + DCHECK_EQ(viz::CopyOutputResult::Format::RGBA_BITMAP, result->format()); PrepareBitmapCopyOutputResult(damage_rect, std::move(result)); } void PrepareTextureCopyOutputResult( const gfx::Rect& damage_rect, std::unique_ptr result) { - DCHECK(result->HasTexture()); + DCHECK_EQ(result->format(), viz::CopyOutputResult::Format::RGBA_TEXTURE); base::ScopedClosureRunner scoped_callback_runner( base::Bind(&CefCopyFrameGenerator::OnCopyFrameCaptureFailure, weak_ptr_factory_.GetWeakPtr(), damage_rect)); @@ -189,8 +191,10 @@ class CefCopyFrameGenerator { viz::TextureMailbox texture_mailbox; std::unique_ptr release_callback; - result->TakeTexture(&texture_mailbox, &release_callback); - DCHECK(texture_mailbox.IsTexture()); + if (auto* mailbox = result->GetTextureMailbox()) { + texture_mailbox = *mailbox; + release_callback = result->TakeTextureOwnership(); + } if (!texture_mailbox.IsTexture()) return; @@ -198,7 +202,7 @@ class CefCopyFrameGenerator { gl_helper->CropScaleReadbackAndCleanMailbox( texture_mailbox.mailbox(), texture_mailbox.sync_token(), result_size, - gfx::Rect(result_size), result_size, pixels, kN32_SkColorType, + result_size, pixels, kN32_SkColorType, base::Bind( &CefCopyFrameGenerator::CopyFromCompositingSurfaceFinishedProxy, weak_ptr_factory_.GetWeakPtr(), base::Passed(&release_callback), @@ -248,10 +252,14 @@ class CefCopyFrameGenerator { void PrepareBitmapCopyOutputResult( const gfx::Rect& damage_rect, std::unique_ptr result) { - DCHECK(result->HasBitmap()); - std::unique_ptr source = result->TakeBitmap(); + DCHECK(!result->IsEmpty()); + DCHECK_EQ(result->format(), viz::CopyOutputResult::Format::RGBA_BITMAP); + std::unique_ptr source = + std::make_unique(result->AsSkBitmap()); DCHECK(source); + if (source) { + DCHECK(source->readyToDraw()); OnCopyFrameCaptureSuccess(damage_rect, *source); } else { OnCopyFrameCaptureFailure(damage_rect); @@ -376,9 +384,12 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( content::RenderViewHost::From(render_widget_host_)); } + local_surface_id_ = local_surface_id_allocator_.GenerateId(); + #if !defined(OS_MACOSX) delegated_frame_host_ = base::MakeUnique( - AllocateFrameSinkId(is_guest_view_hack), this); + AllocateFrameSinkId(is_guest_view_hack), this, + false /* enable_surface_synchronization */); root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); #endif @@ -583,7 +594,7 @@ void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink( void CefRenderWidgetHostViewOSR::SubmitCompositorFrame( const viz::LocalSurfaceId& local_surface_id, - cc::CompositorFrame frame) { + viz::CompositorFrame frame) { TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::OnSwapCompositorFrame"); if (frame.metadata.root_scroll_offset != last_scroll_offset_) { @@ -622,7 +633,7 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame( // Determine the damage rectangle for the current frame. This is the same // calculation that SwapDelegatedFrame uses. - cc::RenderPass* root_pass = frame.render_pass_list.back().get(); + viz::RenderPass* root_pass = frame.render_pass_list.back().get(); gfx::Size frame_size = root_pass->output_rect.size(); gfx::Rect damage_rect = gfx::ToEnclosingRect(gfx::RectF(root_pass->damage_rect)); @@ -1000,7 +1011,7 @@ bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView( point, target_view, transformed_point); } -std::unique_ptr +std::unique_ptr CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice( ui::Compositor* compositor) { DCHECK_EQ(GetCompositor(), compositor); @@ -1052,6 +1063,10 @@ CefRenderWidgetHostViewOSR::DelegatedFrameHostCreateResizeLock() { return base::MakeUnique(this, desired_size); } +viz::LocalSurfaceId CefRenderWidgetHostViewOSR::GetLocalSurfaceId() const { + return local_surface_id_; +} + void CefRenderWidgetHostViewOSR::OnBeginFrame() { // TODO(cef): Maybe we can use this method in combination with // OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer. @@ -1076,11 +1091,11 @@ void CefRenderWidgetHostViewOSR::CompositorResizeLockEnded() { bool CefRenderWidgetHostViewOSR::InstallTransparency() { if (background_color() == SK_ColorTRANSPARENT) { - SetBackgroundColor(SkColor()); + SetBackgroundColor(background_color()); #if defined(OS_MACOSX) - browser_compositor_->SetHasTransparentBackground(true); + browser_compositor_->SetBackgroundColor(background_color()); #else - compositor_->SetHostHasTransparentBackground(true); + compositor_->SetBackgroundColor(background_color()); #endif return true; } @@ -1465,6 +1480,8 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() { const gfx::Size& size_in_pixels = gfx::ConvertSizeToPixel(current_device_scale_factor_, size); + local_surface_id_ = local_surface_id_allocator_.GenerateId(); + GetRootLayer()->SetBounds(gfx::Rect(size)); GetCompositor()->SetScaleAndSize(current_device_scale_factor_, size_in_pixels); diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index 1df88906d..c3738f0c1 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -16,6 +16,7 @@ #include "base/memory/weak_ptr.h" #include "build/build_config.h" #include "components/viz/common/frame_sinks/begin_frame_source.h" +#include "components/viz/common/surfaces/local_surface_id_allocator.h" #include "content/browser/renderer_host/compositor_resize_lock.h" #include "content/browser/renderer_host/delegated_frame_host.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" @@ -132,7 +133,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) override; void SubmitCompositorFrame(const viz::LocalSurfaceId& local_surface_id, - cc::CompositorFrame frame) override; + viz::CompositorFrame frame) override; void ClearCompositorFrame() override; void InitAsPopup(content::RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) override; @@ -196,7 +197,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, gfx::Point* transformed_point) override; // ui::CompositorDelegate implementation. - std::unique_ptr CreateSoftwareOutputDevice( + std::unique_ptr CreateSoftwareOutputDevice( ui::Compositor* compositor) override; #if !defined(OS_MACOSX) @@ -208,6 +209,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, bool DelegatedFrameCanCreateResizeLock() const override; std::unique_ptr DelegatedFrameHostCreateResizeLock() override; + viz::LocalSurfaceId GetLocalSurfaceId() const override; void OnBeginFrame() override; bool IsAutoResizeEnabled() const override; @@ -267,6 +269,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, } ui::Layer* GetRootLayer() const; + viz::LocalSurfaceId local_surface_id() const { return local_surface_id_; } + private: content::DelegatedFrameHost* GetDelegatedFrameHost() const; @@ -326,6 +330,9 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, std::unique_ptr root_layer_; #endif + viz::LocalSurfaceId local_surface_id_; + viz::LocalSurfaceIdAllocator local_surface_id_allocator_; + #if defined(OS_WIN) std::unique_ptr window_; #elif defined(OS_MACOSX) diff --git a/libcef/browser/osr/render_widget_host_view_osr_mac.mm b/libcef/browser/osr/render_widget_host_view_osr_mac.mm index 9e77a4442..c0389f6c9 100644 --- a/libcef/browser/osr/render_widget_host_view_osr_mac.mm +++ b/libcef/browser/osr/render_widget_host_view_osr_mac.mm @@ -46,6 +46,10 @@ class MacHelper : public content::BrowserCompositorMacClient, void BrowserCompositorMacOnBeginFrame() override {} + viz::LocalSurfaceId GetLocalSurfaceId() const override { + return view_->local_surface_id(); + } + // AcceleratedWidgetMacNSView methods: NSView* AcceleratedWidgetGetNSView() const override { diff --git a/libcef/browser/osr/software_output_device_osr.cc b/libcef/browser/osr/software_output_device_osr.cc index 328e9061b..67d5eef30 100644 --- a/libcef/browser/osr/software_output_device_osr.cc +++ b/libcef/browser/osr/software_output_device_osr.cc @@ -69,7 +69,7 @@ void CefSoftwareOutputDeviceOSR::EndPaint() { if (!bitmap_.get()) return; - cc::SoftwareOutputDevice::EndPaint(); + viz::SoftwareOutputDevice::EndPaint(); if (active_) OnPaint(damage_rect_); diff --git a/libcef/browser/osr/software_output_device_osr.h b/libcef/browser/osr/software_output_device_osr.h index ab3ab9a49..cfcc6c58d 100644 --- a/libcef/browser/osr/software_output_device_osr.h +++ b/libcef/browser/osr/software_output_device_osr.h @@ -7,7 +7,7 @@ #define CEF_LIBCEF_BROWSER_OSR_SOFTWARE_OUTPUT_DEVICE_OSR_H_ #include "base/callback.h" -#include "cc/output/software_output_device.h" +#include "components/viz/service/display/software_output_device.h" namespace ui { class Compositor; @@ -15,7 +15,7 @@ class Compositor; // Device implementation for direct software rendering via DelegatedFrameHost. // All Rect/Size values are in pixels. -class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice { +class CefSoftwareOutputDeviceOSR : public viz::SoftwareOutputDevice { public: typedef base::Callback OnPaintCallback; @@ -25,7 +25,7 @@ class CefSoftwareOutputDeviceOSR : public cc::SoftwareOutputDevice { const OnPaintCallback& callback); ~CefSoftwareOutputDeviceOSR() override; - // cc::SoftwareOutputDevice implementation. + // viz::SoftwareOutputDevice implementation. void Resize(const gfx::Size& viewport_pixel_size, float scale_factor) override; SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override; diff --git a/libcef/browser/plugins/plugin_info_message_filter.cc b/libcef/browser/plugins/plugin_info_message_filter.cc index be654a50e..2a10c3897 100644 --- a/libcef/browser/plugins/plugin_info_message_filter.cc +++ b/libcef/browser/plugins/plugin_info_message_filter.cc @@ -24,6 +24,7 @@ #include "chrome/common/pref_names.h" #include "components/content_settings/core/common/content_settings_utils.h" #include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h" +#include "components/nacl/common/features.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/plugin_service.h" @@ -40,7 +41,7 @@ #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. -#if !defined(DISABLE_NACL) +#if BUILDFLAG(ENABLE_NACL) #include "components/nacl/common/nacl_constants.h" #endif @@ -88,7 +89,7 @@ bool ShouldUseJavaScriptSettingForPlugin(const WebPluginInfo& plugin) { return false; } -#if !defined(DISABLE_NACL) +#if BUILDFLAG(ENABLE_NACL) // Treat Native Client invocations like JavaScript. if (plugin.name == base::ASCIIToUTF16(nacl::kNaClPluginName)) return true; diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index a197c18b6..e5d42dbcf 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -13,6 +13,7 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/strings/string_number_conversions.h" +#include "base/task_scheduler/post_task.h" #include "base/values.h" #include "chrome/browser/net/prediction_options.h" #include "chrome/browser/prefs/chrome_command_line_pref_store.h" @@ -118,11 +119,11 @@ std::unique_ptr CreatePrefService(Profile* profile, scoped_refptr sequenced_task_runner; if (store_on_disk) { - // Get sequenced task runner for making sure that file operations of - // this profile (defined by |cache_path|) are executed in expected order - // (what was previously assured by the FILE thread). - sequenced_task_runner = JsonPrefStore::GetTaskRunnerForFile( - cache_path, content::BrowserThread::GetBlockingPool()); + // Get sequenced task runner for making sure that file operations are + // executed in expected order (what was previously assured by the FILE + // thread). + sequenced_task_runner = base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}); } // Used to store user preferences. @@ -154,7 +155,7 @@ std::unique_ptr CreatePrefService(Profile* profile, } scoped_refptr supervised_user_prefs = - make_scoped_refptr(new SupervisedUserPrefStore(supervised_user_settings)); + base::MakeRefCounted(supervised_user_settings); DCHECK(supervised_user_prefs->IsInitializationComplete()); factory.set_supervised_user_prefs(supervised_user_prefs); #endif // BUILDFLAG(ENABLE_SUPERVISED_USERS) diff --git a/libcef/browser/prefs/renderer_prefs.cc b/libcef/browser/prefs/renderer_prefs.cc index 0d354341c..d780d7ca7 100644 --- a/libcef/browser/prefs/renderer_prefs.cc +++ b/libcef/browser/prefs/renderer_prefs.cc @@ -108,8 +108,10 @@ void SetChromePrefs(CefBrowserContext* profile, content::WebPreferences& web) { web.loads_images_automatically = prefs->GetBoolean(prefs::kWebKitLoadsImagesAutomatically); - if (prefs->GetBoolean(prefs::kDisable3DAPIs)) - web.experimental_webgl_enabled = false; + if (prefs->GetBoolean(prefs::kDisable3DAPIs)) { + web.webgl1_enabled = false; + web.webgl2_enabled = false; + } web.allow_running_insecure_content = prefs->GetBoolean(prefs::kWebKitAllowRunningInsecureContent); @@ -251,8 +253,10 @@ void SetCefPrefs(const CefBrowserSettings& cef, content::WebPreferences& web) { // Never explicitly enable GPU-related functions in this method because the // GPU blacklist is not being checked here. - if (cef.webgl == STATE_DISABLED) - web.experimental_webgl_enabled = false; + if (cef.webgl == STATE_DISABLED) { + web.webgl1_enabled = false; + web.webgl2_enabled = false; + } } void SetString(CommandLinePrefStore* prefs, diff --git a/libcef/browser/printing/print_view_manager_base.cc b/libcef/browser/printing/print_view_manager_base.cc index 78e715761..0da409927 100644 --- a/libcef/browser/printing/print_view_manager_base.cc +++ b/libcef/browser/printing/print_view_manager_base.cc @@ -383,7 +383,7 @@ bool CefPrintViewManagerBase::CreateNewPrintJob(PrintJobWorkerOwner* job) { return false; print_job_ = new PrintJob(); - print_job_->Initialize(job, this, number_pages_); + print_job_->Initialize(job, RenderSourceName(), number_pages_); registrar_.Add(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(print_job_.get())); printing_succeeded_ = false; @@ -445,7 +445,6 @@ void CefPrintViewManagerBase::ReleasePrintJob() { registrar_.Remove(this, chrome::NOTIFICATION_PRINT_JOB_EVENT, content::Source(print_job_.get())); - print_job_->DisconnectSource(); // Don't close the worker thread. print_job_ = nullptr; } diff --git a/libcef/browser/printing/print_view_manager_base.h b/libcef/browser/printing/print_view_manager_base.h index e14da839f..60e6009a8 100644 --- a/libcef/browser/printing/print_view_manager_base.h +++ b/libcef/browser/printing/print_view_manager_base.h @@ -16,7 +16,6 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "printing/features/features.h" -#include "printing/printed_pages_source.h" struct PrintHostMsg_DidPrintPage_Params; @@ -34,7 +33,6 @@ class PrintQueriesQueue; // Base class for managing the print commands for a WebContents. class CefPrintViewManagerBase : public content::NotificationObserver, - public PrintedPagesSource, public PrintManager { public: ~CefPrintViewManagerBase() override; @@ -49,8 +47,7 @@ class CefPrintViewManagerBase : public content::NotificationObserver, // Whether printing is enabled or not. void UpdatePrintingEnabled(); - // PrintedPagesSource implementation. - base::string16 RenderSourceName() override; + base::string16 RenderSourceName(); protected: explicit CefPrintViewManagerBase(content::WebContents* web_contents); diff --git a/libcef/browser/printing/printing_message_filter.cc b/libcef/browser/printing/printing_message_filter.cc index 16fe8c0dd..d5266feca 100644 --- a/libcef/browser/printing/printing_message_filter.cc +++ b/libcef/browser/printing/printing_message_filter.cc @@ -9,6 +9,7 @@ #include #include "base/bind.h" +#include "base/lazy_instance.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/printing/print_job_manager.h" diff --git a/libcef/browser/request_context_impl.cc b/libcef/browser/request_context_impl.cc index 6a9d142cc..0533d4a57 100644 --- a/libcef/browser/request_context_impl.cc +++ b/libcef/browser/request_context_impl.cc @@ -718,8 +718,8 @@ void CefRequestContextImpl::GetRequestContextImplOnIOThread( } else { // Execute the callback on the target thread. task_runner->PostTask( - FROM_HERE, - base::Bind(callback, make_scoped_refptr(request_context_getter_impl_))); + FROM_HERE, base::Bind(callback, base::WrapRefCounted( + request_context_getter_impl_))); } } diff --git a/libcef/browser/speech_recognition_manager_delegate.cc b/libcef/browser/speech_recognition_manager_delegate.cc index 8ebeba2a4..856a0cac2 100644 --- a/libcef/browser/speech_recognition_manager_delegate.cc +++ b/libcef/browser/speech_recognition_manager_delegate.cc @@ -86,7 +86,8 @@ class CefSpeechRecognitionManagerDelegate::WebContentsWatcher DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type); WebContents* web_contents = content::Source(source).ptr(); - int render_process_id = web_contents->GetRenderProcessHost()->GetID(); + int render_process_id = + web_contents->GetRenderViewHost()->GetProcess()->GetID(); int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID(); registrar_->Remove(this, content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, diff --git a/libcef/browser/storage_partition_proxy.cc b/libcef/browser/storage_partition_proxy.cc index c738abdb4..c52a3c34d 100644 --- a/libcef/browser/storage_partition_proxy.cc +++ b/libcef/browser/storage_partition_proxy.cc @@ -30,6 +30,11 @@ content::mojom::NetworkContext* CefStoragePartitionProxy::GetNetworkContext() { return parent_->GetNetworkContext(); } +content::mojom::URLLoaderFactory* +CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcess() { + return parent_->GetURLLoaderFactoryForBrowserProcess(); +} + storage::QuotaManager* CefStoragePartitionProxy::GetQuotaManager() { return parent_->GetQuotaManager(); } @@ -175,8 +180,8 @@ content::BrowserContext* CefStoragePartitionProxy::browser_context() const { return parent_->browser_context(); } -void CefStoragePartitionProxy::Bind( +mojo::BindingId CefStoragePartitionProxy::Bind( int process_id, mojo::InterfaceRequest request) { - parent_->Bind(process_id, std::move(request)); + return parent_->Bind(process_id, std::move(request)); } diff --git a/libcef/browser/storage_partition_proxy.h b/libcef/browser/storage_partition_proxy.h index 8c7dfd1f8..acbb7de65 100644 --- a/libcef/browser/storage_partition_proxy.h +++ b/libcef/browser/storage_partition_proxy.h @@ -25,6 +25,8 @@ class CefStoragePartitionProxy : public content::StoragePartition { net::URLRequestContextGetter* GetURLRequestContext() override; net::URLRequestContextGetter* GetMediaURLRequestContext() override; content::mojom::NetworkContext* GetNetworkContext() override; + content::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcess() + override; storage::QuotaManager* GetQuotaManager() override; content::AppCacheService* GetAppCacheService() override; storage::FileSystemContext* GetFileSystemContext() override; @@ -73,9 +75,10 @@ class CefStoragePartitionProxy : public content::StoragePartition { void ClearBluetoothAllowedDevicesMapForTesting() override; content::URLLoaderFactoryGetter* url_loader_factory_getter() override; content::BrowserContext* browser_context() const override; - void Bind(int process_id, - mojo::InterfaceRequest - request) override; + mojo::BindingId Bind( + int process_id, + mojo::InterfaceRequest request) + override; content::StoragePartition* parent() const { return parent_; } diff --git a/libcef/browser/trace_subscriber.cc b/libcef/browser/trace_subscriber.cc index 637740a9c..b14ab21ca 100644 --- a/libcef/browser/trace_subscriber.cc +++ b/libcef/browser/trace_subscriber.cc @@ -114,7 +114,7 @@ bool CefTraceSubscriber::EndTracing(const base::FilePath& tracing_file, weak_factory_.GetWeakPtr(), callback, tracing_file); TracingController::GetInstance()->StopTracing( - TracingController::CreateFileSink(tracing_file, result_callback)); + TracingController::CreateFileEndpoint(tracing_file, result_callback)); return true; } diff --git a/libcef/common/cef_switches.cc b/libcef/common/cef_switches.cc index 431f0f9da..dee4e9288 100644 --- a/libcef/common/cef_switches.cc +++ b/libcef/common/cef_switches.cc @@ -6,9 +6,6 @@ namespace switches { -// Log file path. -const char kLogFile[] = "log-file"; - // Severity of messages to log. const char kLogSeverity[] = "log-severity"; const char kLogSeverity_Verbose[] = "verbose"; diff --git a/libcef/common/cef_switches.h b/libcef/common/cef_switches.h index 02318166c..7dd77334a 100644 --- a/libcef/common/cef_switches.h +++ b/libcef/common/cef_switches.h @@ -12,7 +12,6 @@ namespace switches { -extern const char kLogFile[]; extern const char kLogSeverity[]; extern const char kLogSeverity_Verbose[]; extern const char kLogSeverity_Info[]; diff --git a/libcef/common/content_client.cc b/libcef/common/content_client.cc index 405a7b7bd..807194243 100644 --- a/libcef/common/content_client.cc +++ b/libcef/common/content_client.cc @@ -251,7 +251,7 @@ std::string CefContentClient::GetUserAgent() const { base::string16 CefContentClient::GetLocalizedString(int message_id) const { base::string16 value = - ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); + ui::ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); if (value.empty()) LOG(ERROR) << "No localized string available for id " << message_id; @@ -262,7 +262,7 @@ base::StringPiece CefContentClient::GetDataResource( int resource_id, ui::ScaleFactor scale_factor) const { base::StringPiece value = - ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( + ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( resource_id, scale_factor); if (value.empty()) LOG(ERROR) << "No data resource available for id " << resource_id; @@ -273,7 +273,8 @@ base::StringPiece CefContentClient::GetDataResource( base::RefCountedMemory* CefContentClient::GetDataResourceBytes( int resource_id) const { base::RefCountedMemory* value = - ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); + ui::ResourceBundle::GetSharedInstance().LoadDataResourceBytes( + resource_id); if (!value) LOG(ERROR) << "No data resource bytes available for id " << resource_id; @@ -282,7 +283,7 @@ base::RefCountedMemory* CefContentClient::GetDataResourceBytes( gfx::Image& CefContentClient::GetNativeImageNamed(int resource_id) const { gfx::Image& value = - ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); + ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); if (value.IsEmpty()) LOG(ERROR) << "No native image available for id " << resource_id; diff --git a/libcef/common/crash_reporting.cc b/libcef/common/crash_reporting.cc index d1c16582f..f9dc56d93 100644 --- a/libcef/common/crash_reporting.cc +++ b/libcef/common/crash_reporting.cc @@ -28,6 +28,7 @@ #if defined(OS_POSIX) && !defined(OS_MACOSX) #include "components/crash/content/app/breakpad_linux.h" +#include "v8/include/v8.h" #endif #if defined(OS_WIN) @@ -136,6 +137,8 @@ void BasicStartupComplete(base::CommandLine* command_line) { #if !defined(OS_MACOSX) // Breakpad requires this switch. command_line->AppendSwitch(switches::kEnableCrashReporter); + + breakpad::SetFirstChanceExceptionHandler(v8::V8::TryHandleSignal); #endif } } diff --git a/libcef/common/crash_reporting_win.cc b/libcef/common/crash_reporting_win.cc index f5b89ea0b..c976c194f 100644 --- a/libcef/common/crash_reporting_win.cc +++ b/libcef/common/crash_reporting_win.cc @@ -15,6 +15,9 @@ namespace crash_reporting_win { namespace { +const base::FilePath::CharType kChromeElfDllName[] = + FILE_PATH_LITERAL("chrome_elf.dll"); + // exported in crash_reporter_client.cc: // size_t __declspec(dllexport) __cdecl GetCrashKeyCountImpl. typedef size_t(__cdecl* GetCrashKeyCount)(); @@ -25,7 +28,7 @@ typedef bool(__cdecl* GetCrashKey)(size_t, const char**, size_t*); size_t GetCrashKeyCountTrampoline() { static GetCrashKeyCount get_crash_key_count = []() { - HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName); + HMODULE elf_module = GetModuleHandle(kChromeElfDllName); return reinterpret_cast( elf_module ? GetProcAddress(elf_module, "GetCrashKeyCountImpl") : nullptr); @@ -40,7 +43,7 @@ bool GetCrashKeyTrampoline(size_t index, const char** key_name, size_t* max_length) { static GetCrashKey get_crash_key = []() { - HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName); + HMODULE elf_module = GetModuleHandle(kChromeElfDllName); return reinterpret_cast( elf_module ? GetProcAddress(elf_module, "GetCrashKeyImpl") : nullptr); }(); @@ -63,7 +66,7 @@ typedef void(__cdecl* ClearCrashKeyValue)(const wchar_t*); void SetCrashKeyValueTrampoline(const base::StringPiece& key, const base::StringPiece& value) { static SetCrashKeyValue set_crash_key = []() { - HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName); + HMODULE elf_module = GetModuleHandle(kChromeElfDllName); return reinterpret_cast( elf_module ? GetProcAddress(elf_module, "SetCrashKeyValueImpl") : nullptr); @@ -76,7 +79,7 @@ void SetCrashKeyValueTrampoline(const base::StringPiece& key, void ClearCrashKeyValueTrampoline(const base::StringPiece& key) { static ClearCrashKeyValue clear_crash_key = []() { - HMODULE elf_module = GetModuleHandle(chrome::kChromeElfDllName); + HMODULE elf_module = GetModuleHandle(kChromeElfDllName); return reinterpret_cast( elf_module ? GetProcAddress(elf_module, "ClearCrashKeyValueImpl") : nullptr); diff --git a/libcef/common/extensions/extensions_client.cc b/libcef/common/extensions/extensions_client.cc index 78a53a782..d9d955712 100644 --- a/libcef/common/extensions/extensions_client.cc +++ b/libcef/common/extensions/extensions_client.cc @@ -63,6 +63,9 @@ void CefExtensionsClient::Initialize() { GetExtensionsPermissionAliases()); } +void CefExtensionsClient::InitializeWebStoreUrls( + base::CommandLine* command_line) {} + const PermissionMessageProvider& CefExtensionsClient::GetPermissionMessageProvider() const { return permission_message_provider_; diff --git a/libcef/common/extensions/extensions_client.h b/libcef/common/extensions/extensions_client.h index da40f43e0..fd3a68780 100644 --- a/libcef/common/extensions/extensions_client.h +++ b/libcef/common/extensions/extensions_client.h @@ -24,6 +24,7 @@ class CefExtensionsClient : public ExtensionsClient { // ExtensionsClient overrides: void Initialize() override; + void InitializeWebStoreUrls(base::CommandLine* command_line) override; const PermissionMessageProvider& GetPermissionMessageProvider() const override; const std::string GetProductName() override; diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 264b1decc..22c0ee527 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -228,7 +228,7 @@ base::FilePath GetUserDataPath() { } // Returns true if |scale_factor| is supported by this platform. -// Same as ResourceBundle::IsScaleFactorSupported. +// Same as ui::ResourceBundle::IsScaleFactorSupported. bool IsScaleFactorSupported(ui::ScaleFactor scale_factor) { const std::vector& supported_scale_factors = ui::GetSupportedScaleFactors(); @@ -579,7 +579,7 @@ int CefMainDelegate::RunProcess( } void CefMainDelegate::ProcessExiting(const std::string& process_type) { - ResourceBundle::CleanupSharedInstance(); + ui::ResourceBundle::CleanupSharedInstance(); } #if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX) @@ -660,7 +660,7 @@ void CefMainDelegate::InitializeResourceBundle() { std::string locale = command_line->GetSwitchValueASCII(switches::kLang); DCHECK(!locale.empty()); - // Avoid DCHECK() in ResourceBundle::LoadChromeResources(). + // Avoid DCHECK() in ui::ResourceBundle::LoadChromeResources(). ui::MaterialDesignController::Initialize(); const std::string loaded_locale = @@ -669,7 +669,7 @@ void CefMainDelegate::InitializeResourceBundle() { if (!loaded_locale.empty() && g_browser_process) g_browser_process->SetApplicationLocale(loaded_locale); - ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance(); + ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); if (!content_client_.pack_loading_disabled()) { if (loaded_locale.empty()) diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 325e9d96c..a0a71218f 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -217,7 +217,8 @@ CefRefPtr CefRequest::Create() { CefRequestImpl::CefRequestImpl() : read_only_(false), track_changes_(false) { // Verify that our enum matches Chromium's values. static_assert( - REFERRER_POLICY_LAST_VALUE == net::URLRequest::MAX_REFERRER_POLICY, + static_cast(REFERRER_POLICY_LAST_VALUE) == + static_cast(net::URLRequest::MAX_REFERRER_POLICY), "enum mismatch"); base::AutoLock lock_scope(lock_); diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index b5bffc9b5..021c4dac7 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -279,7 +279,8 @@ void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path, cdm_codecs, std::string(1, kCdmSupportedCodecsValueDelimiter), base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); content::CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo( - kWidevineCdmType, base::Version(cdm_version), cdm_path, codecs)); + kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version), + cdm_path, kWidevineCdmFileSystemId, codecs, kWidevineKeySystem, false)); DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(), callback); diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index b34f104b0..81abc15cb 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -330,11 +330,6 @@ void CefContentRendererClient::WebKitInitialized() { } } -void CefContentRendererClient::OnRenderProcessShutdown() { - // Destroy global objects associated with the default Isolate. - CefV8IsolateDestroyed(); -} - void CefContentRendererClient::DevToolsAgentAttached() { CEF_REQUIRE_RT(); ++devtools_agent_count_; diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index 213810bcf..fa09efe99 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -75,7 +75,6 @@ class CefContentRendererClient : public content::ContentRendererClient, } void WebKitInitialized(); - void OnRenderProcessShutdown(); void DevToolsAgentAttached(); void DevToolsAgentDetached(); diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index f8c378729..1654751bb 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -18,9 +18,9 @@ #include "content/public/renderer/render_thread.h" #include "extensions/common/constants.h" #include "extensions/common/switches.h" +#include "extensions/renderer/api/automation/automation_api_helper.h" #include "extensions/renderer/dispatcher.h" #include "extensions/renderer/extension_frame_helper.h" -#include "extensions/renderer/extension_helper.h" #include "extensions/renderer/extensions_render_frame_observer.h" #include "extensions/renderer/guest_view/extensions_guest_view_container.h" #include "extensions/renderer/guest_view/extensions_guest_view_container_dispatcher.h" @@ -130,10 +130,8 @@ void CefExtensionsRendererClient::OnExtensionUnloaded( void CefExtensionsRendererClient::RenderThreadStarted() { content::RenderThread* thread = content::RenderThread::Get(); - extension_dispatcher_delegate_.reset( - new extensions::CefExtensionsDispatcherDelegate()); - extension_dispatcher_.reset( - new extensions::Dispatcher(extension_dispatcher_delegate_.get())); + extension_dispatcher_.reset(new extensions::Dispatcher( + std::make_unique())); resource_request_policy_.reset( new extensions::ResourceRequestPolicy(extension_dispatcher_.get())); guest_view_container_dispatcher_.reset( @@ -154,7 +152,8 @@ void CefExtensionsRendererClient::RenderFrameCreated( void CefExtensionsRendererClient::RenderViewCreated( content::RenderView* render_view) { - new extensions::ExtensionHelper(render_view, extension_dispatcher_.get()); + // Manages its own lifetime. + new extensions::AutomationApiHelper(render_view); } bool CefExtensionsRendererClient::OverrideCreatePlugin( diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index b3c2dc105..8d2f112d6 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -75,8 +75,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { const GURL& original_url); private: - std::unique_ptr - extension_dispatcher_delegate_; std::unique_ptr extension_dispatcher_; std::unique_ptr guest_view_container_dispatcher_; diff --git a/libcef/renderer/plugins/cef_plugin_placeholder.cc b/libcef/renderer/plugins/cef_plugin_placeholder.cc index 2022e9246..1a33fcc1b 100644 --- a/libcef/renderer/plugins/cef_plugin_placeholder.cc +++ b/libcef/renderer/plugins/cef_plugin_placeholder.cc @@ -69,7 +69,7 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateLoadableMissingPlugin( content::RenderFrame* render_frame, const blink::WebPluginParams& params) { const base::StringPiece template_html( - ResourceBundle::GetSharedInstance().GetRawDataResource( + ui::ResourceBundle::GetSharedInstance().GetRawDataResource( IDR_BLOCKED_PLUGIN_HTML)); base::DictionaryValue values; @@ -121,7 +121,7 @@ CefPluginPlaceholder* CefPluginPlaceholder::CreateBlockedPlugin( } const base::StringPiece template_html( - ResourceBundle::GetSharedInstance().GetRawDataResource(template_id)); + ui::ResourceBundle::GetSharedInstance().GetRawDataResource(template_id)); DCHECK(!template_html.empty()) << "unable to load template. ID: " << template_id; diff --git a/libcef/renderer/render_thread_observer.cc b/libcef/renderer/render_thread_observer.cc index 315e17d36..df20c04dc 100644 --- a/libcef/renderer/render_thread_observer.cc +++ b/libcef/renderer/render_thread_observer.cc @@ -54,11 +54,6 @@ bool CefRenderThreadObserver::OnControlMessageReceived( return handled; } -void CefRenderThreadObserver::OnRenderProcessShutdown() { - CefContentRendererClient::Get()->OnRenderProcessShutdown(); - visited_link_slave_.reset(); -} - void CefRenderThreadObserver::OnSetIsIncognitoProcess( bool is_incognito_process) { is_incognito_process_ = is_incognito_process; diff --git a/libcef/renderer/render_thread_observer.h b/libcef/renderer/render_thread_observer.h index a4a30c778..a4f5960b9 100644 --- a/libcef/renderer/render_thread_observer.h +++ b/libcef/renderer/render_thread_observer.h @@ -27,7 +27,6 @@ class CefRenderThreadObserver : public content::RenderThreadObserver { // RenderThreadObserver implementation. bool OnControlMessageReceived(const IPC::Message& message) override; - void OnRenderProcessShutdown() override; visitedlink::VisitedLinkSlave* visited_link_slave() { return visited_link_slave_.get(); diff --git a/libcef/renderer/webkit_glue.cc b/libcef/renderer/webkit_glue.cc index 7cbd50d9a..d91cd27c7 100644 --- a/libcef/renderer/webkit_glue.cc +++ b/libcef/renderer/webkit_glue.cc @@ -163,7 +163,7 @@ v8::MaybeLocal ExecuteV8ScriptAndReturnValue( : blink::KURL(blink::kParsedURLString, source_url); const blink::ScriptSourceCode ssc = blink::ScriptSourceCode( - source, kurl, + source, kurl, blink::WebString() /* nonce */, blink::kNotParserInserted, WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), WTF::OrdinalNumber::FromZeroBasedInt(0))); diff --git a/libcef/utility/content_utility_client.cc b/libcef/utility/content_utility_client.cc index 2dff3701f..a2f646fce 100644 --- a/libcef/utility/content_utility_client.cc +++ b/libcef/utility/content_utility_client.cc @@ -14,24 +14,16 @@ #include "content/public/child/child_thread.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/simple_connection_filter.h" +#include "content/public/network/url_request_context_builder_mojo.h" #include "mojo/public/cpp/bindings/strong_binding.h" -#include "net/proxy/mojo_proxy_resolver_factory_impl.h" +#include "services/proxy_resolver/proxy_resolver_service.h" // nogncheck +#include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h" // nogncheck #include "services/service_manager/public/cpp/binder_registry.h" #if defined(OS_WIN) #include "chrome/utility/printing_handler.h" #endif -namespace { - -void CreateProxyResolverFactory( - net::interfaces::ProxyResolverFactoryRequest request) { - mojo::MakeStrongBinding(base::MakeUnique(), - std::move(request)); -} - -} // namespace - CefContentUtilityClient::CefContentUtilityClient() { #if defined(OS_WIN) handlers_.push_back(base::MakeUnique()); @@ -51,10 +43,6 @@ void CefContentUtilityClient::UtilityThreadStarted() { auto registry = base::MakeUnique(); - registry->AddInterface( - base::Bind(CreateProxyResolverFactory), - base::ThreadTaskRunnerHandle::Get()); - connection->AddConnectionFilter( base::MakeUnique(std::move(registry))); } @@ -75,4 +63,12 @@ void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) { pdf_compositor_info.factory = base::Bind(&printing::CreatePdfCompositorService, std::string()); services->emplace(printing::mojom::kServiceName, pdf_compositor_info); + + service_manager::EmbeddedServiceInfo proxy_resolver_info; + proxy_resolver_info.task_runner = + content::ChildThread::Get()->GetIOTaskRunner(); + proxy_resolver_info.factory = + base::Bind(&proxy_resolver::ProxyResolverService::CreateService); + services->emplace(proxy_resolver::mojom::kProxyResolverServiceName, + proxy_resolver_info); } diff --git a/patch/patch.cfg b/patch/patch.cfg index b8d7a06ec..b3ee60d8b 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -239,14 +239,6 @@ patches = [ # (b) Adding BrowserContext::GetStoragePartitionProxy(); # (c) Removing static_cast<> of StoragePartition to StoragePartitionImpl. # https://bitbucket.org/chromiumembedded/cef/issues/1973 - # - # Clear RenderProcessHostImpl's |browser_context_| member when the - # BrowserContext is deleted. - # https://bitbucket.org/chromiumembedded/cef/issues/2032 - # - # Check RenderProcessHostImpl's |browser_context_| member before re- - # initializing the channel from RPHI::ProcessDied. - # https://bitbucket.org/chromiumembedded/cef/issues/2096 'name': 'storage_partition_1973', }, { @@ -323,19 +315,11 @@ patches = [ 'name': 'printing_context_2196', }, { - # Linux: Fix build errors related to dependency versions. - # # Linux: Fix 32-bit build fails with ld.gold: internal error in # get_section_contents, at icf.cc:467 # https://bitbucket.org/chromiumembedded/cef/issues/2256 'name': 'linux_build', }, - { - # Linux: Fix duplicate definition of MurmerHash3 functions. - # https://bugs.chromium.org/p/chromium/issues/detail?id=697758#c24 - 'name': 'angle_697758', - 'path': 'third_party/angle/', - }, { # Changes necessary to support for chrome extensions: # (a) Add a new ExtensionHost constructor that allows CEF to create the diff --git a/patch/patches/angle_697758.patch b/patch/patches/angle_697758.patch deleted file mode 100644 index 3dbdb7dd4..000000000 --- a/patch/patches/angle_697758.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git src/libGLESv2.gypi src/libGLESv2.gypi -index 8f12a4a9b..2d7175eb7 100644 ---- src/libGLESv2.gypi -+++ src/libGLESv2.gypi -@@ -36,8 +36,6 @@ - 'common/third_party/base/anglebase/sha1.cc', - 'common/third_party/base/anglebase/sha1.h', - 'common/third_party/base/anglebase/sys_byteorder.h', -- 'common/third_party/murmurhash/MurmurHash3.cpp', -- 'common/third_party/murmurhash/MurmurHash3.h', - 'common/tls.cpp', - 'common/tls.h', - 'common/utilities.cpp', -@@ -123,6 +121,8 @@ - [ - 'common/event_tracer.cpp', - 'common/event_tracer.h', -+ 'common/third_party/murmurhash/MurmurHash3.cpp', -+ 'common/third_party/murmurhash/MurmurHash3.h', - 'libANGLE/AttributeMap.cpp', - 'libANGLE/AttributeMap.h', - 'libANGLE/BinaryStream.h', diff --git a/patch/patches/browser_compositor_mac.patch b/patch/patches/browser_compositor_mac.patch index 1d8114bad..e7be3cb18 100644 --- a/patch/patches/browser_compositor_mac.patch +++ b/patch/patches/browser_compositor_mac.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h -index 4355a8cdacb4..57961ef39f8d 100644 +index 8bc4ebd0d771..42949486cf98 100644 --- content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h -@@ -50,6 +50,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { +@@ -52,6 +52,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { // These will not return nullptr until Destroy is called. DelegatedFrameHost* GetDelegatedFrameHost(); @@ -10,7 +10,7 @@ index 4355a8cdacb4..57961ef39f8d 100644 // Ensure that the currect compositor frame be cleared (even if it is // potentially visible). -@@ -57,6 +58,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { +@@ -59,6 +60,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { // This may return nullptr, if this has detached itself from its // ui::Compositor. @@ -19,10 +19,10 @@ index 4355a8cdacb4..57961ef39f8d 100644 void DidCreateNewRendererCompositorFrameSink( diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm -index 428bef1ff74e..e841db553ed8 100644 +index 04ca86589a13..796a874d0e13 100644 --- content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm -@@ -205,6 +205,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { +@@ -209,6 +209,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { g_spare_recyclable_compositors.Get().clear(); } @@ -35,7 +35,7 @@ index 428bef1ff74e..e841db553ed8 100644 ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() { if (recyclable_compositor_) return recyclable_compositor_->accelerated_widget_mac(); -@@ -437,8 +443,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor( +@@ -439,8 +445,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor( } gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const { diff --git a/patch/patches/browser_frame_host_guest_1687.patch b/patch/patches/browser_frame_host_guest_1687.patch index 2b36e5127..c4f573522 100644 --- a/patch/patches/browser_frame_host_guest_1687.patch +++ b/patch/patches/browser_frame_host_guest_1687.patch @@ -1,5 +1,5 @@ diff --git content/browser/frame_host/render_widget_host_view_guest.cc content/browser/frame_host/render_widget_host_view_guest.cc -index a1abce179e5e..fed7d874781b 100644 +index e885721017fd..7a20a016b389 100644 --- content/browser/frame_host/render_widget_host_view_guest.cc +++ content/browser/frame_host/render_widget_host_view_guest.cc @@ -251,13 +251,14 @@ void RenderWidgetHostViewGuest::Destroy() { diff --git a/patch/patches/browser_plugin_guest_1565.patch b/patch/patches/browser_plugin_guest_1565.patch index 71b097048..df6a92f5c 100644 --- a/patch/patches/browser_plugin_guest_1565.patch +++ b/patch/patches/browser_plugin_guest_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc -index 13e452c2b72b..2c4c55d90a50 100644 +index e6e79a68e263..c8007ccea445 100644 --- content/browser/browser_plugin/browser_plugin_guest.cc +++ content/browser/browser_plugin/browser_plugin_guest.cc -@@ -345,8 +345,11 @@ void BrowserPluginGuest::InitInternal( +@@ -337,8 +337,11 @@ void BrowserPluginGuest::InitInternal( static_cast(GetWebContents()->GetView()); } @@ -15,7 +15,7 @@ index 13e452c2b72b..2c4c55d90a50 100644 // Once a BrowserPluginGuest has an embedder WebContents, it's considered to // be attached. -@@ -843,10 +846,19 @@ void BrowserPluginGuest::OnWillAttachComplete( +@@ -832,10 +835,19 @@ void BrowserPluginGuest::OnWillAttachComplete( static_cast(GetWebContents()->GetView()); if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { web_contents_view->CreateViewForWidget( @@ -37,10 +37,10 @@ index 13e452c2b72b..2c4c55d90a50 100644 attached_ = true; diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc -index 28a7ddfc40ac..33c0c4399584 100644 +index 5db34c6d5f92..cdd9d1245571 100644 --- content/browser/frame_host/interstitial_page_impl.cc +++ content/browser/frame_host/interstitial_page_impl.cc -@@ -609,7 +609,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { +@@ -613,7 +613,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { WebContentsView* wcv = static_cast(web_contents())->GetView(); RenderWidgetHostViewBase* view = @@ -79,10 +79,10 @@ index e4401f85bf3f..20b85609a23f 100644 // Creates a new View that holds a popup and receives messages for it. virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc -index f407726a437e..0efc406c949f 100644 +index 3395028a568b..5364563c606b 100644 --- content/browser/web_contents/web_contents_view_aura.cc +++ content/browser/web_contents/web_contents_view_aura.cc -@@ -833,7 +833,8 @@ void WebContentsViewAura::CreateView( +@@ -840,7 +840,8 @@ void WebContentsViewAura::CreateView( } RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( @@ -92,7 +92,7 @@ index f407726a437e..0efc406c949f 100644 if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the // test view, so we don't want to clobber it with a real one. To verify that -@@ -845,6 +846,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( +@@ -852,6 +853,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( render_widget_host->GetView()); } @@ -101,7 +101,7 @@ index f407726a437e..0efc406c949f 100644 g_create_render_widget_host_view ? g_create_render_widget_host_view(render_widget_host, diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h -index 7979b48375e1..add76f7404de 100644 +index 359032e66343..b45b8c426421 100644 --- content/browser/web_contents/web_contents_view_aura.h +++ content/browser/web_contents/web_contents_view_aura.h @@ -116,7 +116,7 @@ class CONTENT_EXPORT WebContentsViewAura @@ -221,10 +221,10 @@ index 12675d077c8a..46db5596618e 100644 RenderWidgetHost* render_widget_host) override; void SetPageTitle(const base::string16& title) override; diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm -index a9111f9d9cef..33d5eea2cbb9 100644 +index abcbb302f417..63e73721f155 100644 --- content/browser/web_contents/web_contents_view_mac.mm +++ content/browser/web_contents/web_contents_view_mac.mm -@@ -352,7 +352,8 @@ void WebContentsViewMac::CreateView( +@@ -353,7 +353,8 @@ void WebContentsViewMac::CreateView( } RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( @@ -234,7 +234,7 @@ index a9111f9d9cef..33d5eea2cbb9 100644 if (render_widget_host->GetView()) { // During testing, the view will already be set up in most cases to the // test view, so we don't want to clobber it with a real one. To verify that -@@ -364,6 +365,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( +@@ -365,6 +366,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget( render_widget_host->GetView()); } diff --git a/patch/patches/chrome_profile.patch b/patch/patches/chrome_profile.patch index 5a9e7b528..cf894f3aa 100644 --- a/patch/patches/chrome_profile.patch +++ b/patch/patches/chrome_profile.patch @@ -63,10 +63,10 @@ index 4b430133e16f..169ca4765907 100644 content::BrowserContext* GetBrowserContextRedirectedInIncognito( content::BrowserContext* context); diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 460098e8f17d..9bf838204f62 100644 +index a711472a63a9..47212b151d41 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -377,7 +377,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -375,7 +375,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 11fb3df23..1b88e6e8d 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,13 +1,14 @@ diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc -index 17d9819ad2b0..05a72199a247 100644 +index 84016e8ad769..684b9d1f6089 100644 --- chrome/common/chrome_content_client.cc +++ chrome/common/chrome_content_client.cc -@@ -82,7 +82,7 @@ - #endif +@@ -90,7 +90,8 @@ - #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS) && \ -- !defined(WIDEVINE_CDM_IS_COMPONENT) -+ !defined(WIDEVINE_CDM_IS_COMPONENT) && defined(WIDEVINE_CDM_VERSION_STRING) + #if BUILDFLAG(ENABLE_LIBRARY_CDMS) + #include "media/cdm/cdm_paths.h" // nogncheck +-#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) ++#if defined(WIDEVINE_CDM_AVAILABLE) && !defined(WIDEVINE_CDM_IS_COMPONENT) && \ ++ defined(WIDEVINE_CDM_VERSION_STRING) #define WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT #include "chrome/common/widevine_cdm_constants.h" #endif diff --git a/patch/patches/component_build_1617.patch b/patch/patches/component_build_1617.patch index 056bd3f70..4c8cb6674 100644 --- a/patch/patches/component_build_1617.patch +++ b/patch/patches/component_build_1617.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index 97c769cdf483..78d9db9d084e 100644 +index 82f43b9591ae..1ef9adad166f 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn -@@ -489,6 +489,7 @@ split_static_library("ui") { +@@ -369,6 +369,7 @@ split_static_library("ui") { "//chrome/browser/ui/webui/usb_internals:mojo_bindings", "//chrome/common", "//chrome/common:search_mojom", @@ -25,10 +25,10 @@ index 7563ce48bf5e..6c594749d57b 100644 explicit ContentServiceManagerMainDelegate(const ContentMainParams& params); ~ContentServiceManagerMainDelegate() override; diff --git third_party/WebKit/Source/controller/BUILD.gn third_party/WebKit/Source/controller/BUILD.gn -index dbcd69337de8..fc0b6aca080f 100644 +index 1d29633ba10d..1a42fe1d37fa 100644 --- third_party/WebKit/Source/controller/BUILD.gn +++ third_party/WebKit/Source/controller/BUILD.gn -@@ -15,6 +15,7 @@ component("controller") { +@@ -16,6 +16,7 @@ component("controller") { output_name = "blink_controller" deps = [ diff --git a/patch/patches/compositor_1368.patch b/patch/patches/compositor_1368.patch index 2046f541a..0d1dbe3ec 100644 --- a/patch/patches/compositor_1368.patch +++ b/patch/patches/compositor_1368.patch @@ -1,13 +1,13 @@ diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc -index 8313f13f3355..9ee1056eb825 100644 +index 45bf6b1b4618..f41d40a6887b 100644 --- content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc @@ -274,6 +274,13 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() { - std::unique_ptr + std::unique_ptr GpuProcessTransportFactory::CreateSoftwareOutputDevice( ui::Compositor* compositor) { + if (compositor->delegate()) { -+ std::unique_ptr output_device = ++ std::unique_ptr output_device = + compositor->delegate()->CreateSoftwareOutputDevice(compositor); + if (output_device) + return output_device; @@ -15,26 +15,26 @@ index 8313f13f3355..9ee1056eb825 100644 + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kHeadless)) - return base::WrapUnique(new cc::SoftwareOutputDevice); + return base::WrapUnique(new viz::SoftwareOutputDevice); diff --git ui/compositor/compositor.h ui/compositor/compositor.h -index a3bc8cafc574..745f1dacb26e 100644 +index d842aa55175b..5683e6fb68f8 100644 --- ui/compositor/compositor.h +++ ui/compositor/compositor.h -@@ -17,6 +17,7 @@ - #include "base/single_thread_task_runner.h" - #include "base/time/time.h" - #include "build/build_config.h" -+#include "cc/output/software_output_device.h" - #include "cc/trees/layer_tree_host_client.h" - #include "cc/trees/layer_tree_host_single_thread_client.h" - #include "components/viz/common/frame_sinks/begin_frame_args.h" +@@ -23,6 +23,7 @@ + #include "components/viz/common/surfaces/local_surface_id.h" + #include "components/viz/common/surfaces/surface_sequence.h" + #include "components/viz/host/host_frame_sink_client.h" ++#include "components/viz/service/display/software_output_device.h" + #include "third_party/skia/include/core/SkColor.h" + #include "ui/compositor/compositor_animation_observer.h" + #include "ui/compositor/compositor_export.h" @@ -179,6 +180,17 @@ class COMPOSITOR_EXPORT ContextFactory { virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; }; +class COMPOSITOR_EXPORT CompositorDelegate { + public: -+ virtual std::unique_ptr CreateSoftwareOutputDevice( ++ virtual std::unique_ptr CreateSoftwareOutputDevice( + ui::Compositor* compositor) { + return nullptr; + } @@ -56,7 +56,7 @@ index a3bc8cafc574..745f1dacb26e 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 -@@ -431,6 +446,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, +@@ -426,6 +441,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, ui::ContextFactory* context_factory_; ui::ContextFactoryPrivate* context_factory_private_; diff --git a/patch/patches/content_1129_2015.patch b/patch/patches/content_1129_2015.patch index ef34d8fba..6a798ecd4 100644 --- a/patch/patches/content_1129_2015.patch +++ b/patch/patches/content_1129_2015.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index faca8fe60751..cd96d66a5d8b 100644 +index 4f4dadd98fd9..840c1df997dd 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -484,8 +484,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context, +@@ -539,8 +539,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context, content::PluginService* plugin_service = content::PluginService::GetInstance(); bool plugin_found = plugin_service->GetPluginInfo( @@ -38,10 +38,10 @@ index f8b651f1ddc4..ec39f8d7dc85 100644 content::WebPluginInfo* plugin) override; diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc -index 83445e1428a9..385e223b9069 100644 +index 8027836d925e..71f8d5a3f9dc 100644 --- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc +++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc -@@ -52,7 +52,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor( +@@ -53,7 +53,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor( content::ResourceContext* resource_context = handle->GetWebContents()->GetBrowserContext()->GetResourceContext(); if (filter->IsPluginAvailable(process_id, routing_id, resource_context, @@ -51,10 +51,10 @@ index 83445e1428a9..385e223b9069 100644 return nullptr; } diff --git chrome/browser/plugins/plugin_info_message_filter.cc chrome/browser/plugins/plugin_info_message_filter.cc -index 8d0adcac00c1..2751e745107f 100644 +index 5a807cdf51a2..7cec2bdb773b 100644 --- chrome/browser/plugins/plugin_info_message_filter.cc +++ chrome/browser/plugins/plugin_info_message_filter.cc -@@ -451,8 +451,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin( +@@ -468,8 +468,8 @@ bool PluginInfoMessageFilter::Context::FindEnabledPlugin( for (; i < matching_plugins.size(); ++i) { if (!filter || filter->IsPluginAvailable(render_process_id_, render_frame_id, @@ -79,10 +79,10 @@ index 6a2122ee1ed7..68831894695a 100644 } diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -index ef7ae9c7de76..29a4e7cb9578 100644 +index ba2dacd6f420..803b5bc929bd 100644 --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc -@@ -594,6 +594,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted( +@@ -597,6 +597,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted( content::PluginService::GetInstance()->GetPluginInfo( -1, // process ID MSG_ROUTING_NONE, // routing ID @@ -91,7 +91,7 @@ index ef7ae9c7de76..29a4e7cb9578 100644 mime_type, false, NULL, &plugin, NULL)); } diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc -index 2e4d0d9ac4cb..9bd0bf12ca88 100644 +index 28048bdb2046..b295b7a33601 100644 --- content/browser/frame_host/navigation_handle_impl.cc +++ content/browser/frame_host/navigation_handle_impl.cc @@ -312,12 +312,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() { @@ -108,10 +108,10 @@ index 2e4d0d9ac4cb..9bd0bf12ca88 100644 } diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc -index 7e577c8395d7..96421d4f2d88 100644 +index 2b2e16f95e48..17731d783a63 100644 --- content/browser/frame_host/render_frame_host_impl.cc +++ content/browser/frame_host/render_frame_host_impl.cc -@@ -370,9 +370,9 @@ void ForwardRequest(const char* service_name, +@@ -359,9 +359,9 @@ void ForwardRequest(const char* service_name, void CreatePaymentManager(RenderFrameHostImpl* rfh, payments::mojom::PaymentManagerRequest request) { @@ -124,18 +124,7 @@ index 7e577c8395d7..96421d4f2d88 100644 storage_partition->GetPaymentAppContext()->CreatePaymentManager( std::move(request)); } -@@ -937,10 +937,8 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { - IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) - IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) - #endif --#if defined(OS_ANDROID) - IPC_MESSAGE_HANDLER(FrameHostMsg_NavigationHandledByEmbedder, - OnNavigationHandledByEmbedder) --#endif - IPC_MESSAGE_HANDLER(FrameHostMsg_RequestOverlayRoutingToken, - OnRequestOverlayRoutingToken) - IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow) -@@ -1436,6 +1434,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( +@@ -1452,6 +1452,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( if (navigation_handle_) { navigation_handle_->set_net_error_code( static_cast(params.error_code)); @@ -143,40 +132,11 @@ index 7e577c8395d7..96421d4f2d88 100644 } frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); -@@ -2705,14 +2704,12 @@ void RenderFrameHostImpl::OnHidePopup() { - } - #endif - --#if defined(OS_ANDROID) - void RenderFrameHostImpl::OnNavigationHandledByEmbedder() { - if (navigation_handle_) - navigation_handle_->set_net_error_code(net::ERR_ABORTED); - - OnDidStopLoading(); - } --#endif - - void RenderFrameHostImpl::OnRequestOverlayRoutingToken() { - // Make sure that we have a token. -diff --git content/browser/frame_host/render_frame_host_impl.h content/browser/frame_host/render_frame_host_impl.h -index 9a4fa29dd7c6..bfd658b91c06 100644 ---- content/browser/frame_host/render_frame_host_impl.h -+++ content/browser/frame_host/render_frame_host_impl.h -@@ -821,8 +821,8 @@ class CONTENT_EXPORT RenderFrameHostImpl - void OnShowPopup(const FrameHostMsg_ShowPopup_Params& params); - void OnHidePopup(); - #endif --#if defined(OS_ANDROID) - void OnNavigationHandledByEmbedder(); -+#if defined(OS_ANDROID) - void ForwardGetInterfaceToRenderFrame(const std::string& interface_name, - mojo::ScopedMessagePipeHandle pipe); - #endif diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index c440d8061dac..1ee6a7ca1cf1 100644 +index a842664b32a8..93b489020e2a 100644 --- content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc -@@ -509,6 +509,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, +@@ -516,6 +516,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, void RenderFrameMessageFilter::OnGetPlugins( bool refresh, @@ -184,7 +144,7 @@ index c440d8061dac..1ee6a7ca1cf1 100644 const url::Origin& main_frame_origin, IPC::Message* reply_msg) { // Don't refresh if the specified threshold has not been passed. Note that -@@ -530,18 +531,19 @@ void RenderFrameMessageFilter::OnGetPlugins( +@@ -537,18 +538,19 @@ void RenderFrameMessageFilter::OnGetPlugins( PluginServiceImpl::GetInstance()->GetPlugins( base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this, @@ -206,7 +166,7 @@ index c440d8061dac..1ee6a7ca1cf1 100644 int routing_id = MSG_ROUTING_NONE; // In this loop, copy the WebPluginInfo (and do not use a reference) because // the filter might mutate it. -@@ -550,7 +552,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( +@@ -557,7 +559,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( if (!filter || filter->IsPluginAvailable(child_process_id, routing_id, resource_context_, main_frame_origin.GetURL(), @@ -215,7 +175,7 @@ index c440d8061dac..1ee6a7ca1cf1 100644 plugins.push_back(plugin); } } -@@ -562,6 +564,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( +@@ -569,6 +571,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( void RenderFrameMessageFilter::OnGetPluginInfo( int render_frame_id, const GURL& url, @@ -223,7 +183,7 @@ index c440d8061dac..1ee6a7ca1cf1 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool* found, -@@ -570,8 +573,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( +@@ -577,8 +580,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( bool allow_wildcard = true; *found = plugin_service_->GetPluginInfo( render_process_id_, render_frame_id, resource_context_, url, @@ -235,10 +195,10 @@ index c440d8061dac..1ee6a7ca1cf1 100644 void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h -index 6875eb6496c4..a9248109c2b3 100644 +index 1826101c76d0..eafe5930cfc1 100644 --- content/browser/frame_host/render_frame_message_filter.h +++ content/browser/frame_host/render_frame_message_filter.h -@@ -127,13 +127,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter +@@ -130,13 +130,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter #if BUILDFLAG(ENABLE_PLUGINS) void OnGetPlugins(bool refresh, @@ -305,10 +265,10 @@ index b654bf3c98b4..1b09cd3d0a23 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/common/frame_messages.h content/common/frame_messages.h -index 7fcc51298b12..6cde762011c9 100644 +index 18c4b420d781..c9cd1cac49fc 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -1324,8 +1324,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -1327,8 +1327,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // Used to get the list of plugins. |main_frame_origin| is used to handle // exceptions for plugin content settings. @@ -319,7 +279,7 @@ index 7fcc51298b12..6cde762011c9 100644 url::Origin /* main_frame_origin */, std::vector /* plugins */) -@@ -1333,9 +1334,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins, +@@ -1336,9 +1337,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -331,22 +291,11 @@ index 7fcc51298b12..6cde762011c9 100644 url::Origin /* main_frame_origin */, std::string /* mime_type */, bool /* found */, -@@ -1722,9 +1724,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply, - IPC_MESSAGE_ROUTED2(FrameHostMsg_GetNearestFindResult_Reply, - int /* nfr_request_id */, - float /* distance */) -+#endif - - IPC_MESSAGE_ROUTED0(FrameHostMsg_NavigationHandledByEmbedder) --#endif - - // Adding a new message? Stick to the sort order above: first platform - // independent FrameMsg, then ifdefs for platform specific FrameMsg, then diff --git content/ppapi_plugin/ppapi_blink_platform_impl.cc content/ppapi_plugin/ppapi_blink_platform_impl.cc -index bf393b7025c9..ae2f1840d193 100644 +index e26ffe9ab2d0..3bbe19ae4146 100644 --- content/ppapi_plugin/ppapi_blink_platform_impl.cc +++ content/ppapi_plugin/ppapi_blink_platform_impl.cc -@@ -215,6 +215,7 @@ std::unique_ptr PpapiBlinkPlatformImpl::CreateURLLoader( +@@ -207,6 +207,7 @@ std::unique_ptr PpapiBlinkPlatformImpl::CreateURLLoader( void PpapiBlinkPlatformImpl::GetPluginList( bool refresh, @@ -355,12 +304,12 @@ index bf393b7025c9..ae2f1840d193 100644 blink::WebPluginListBuilder* builder) { NOTREACHED(); diff --git content/ppapi_plugin/ppapi_blink_platform_impl.h content/ppapi_plugin/ppapi_blink_platform_impl.h -index f7684513c3bd..ff6d12f17fe7 100644 +index dfc2f2b1f4c6..d931301523ec 100644 --- content/ppapi_plugin/ppapi_blink_platform_impl.h +++ content/ppapi_plugin/ppapi_blink_platform_impl.h -@@ -46,6 +46,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -43,6 +43,7 @@ class PpapiBlinkPlatformImpl : public BlinkPlatformImpl { const blink::WebURLRequest& request, - base::SingleThreadTaskRunner* task_runner) override; + scoped_refptr task_runner) override; void GetPluginList(bool refresh, + bool isMainFrame, const blink::WebSecurityOrigin& mainFrameOrigin, @@ -391,10 +340,10 @@ index 3b610b1f554e..7c439e060779 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.cc content/public/renderer/content_renderer_client.cc -index 303653a66248..a53478408226 100644 +index d8a56e64875d..4b66b2fc0efc 100644 --- content/public/renderer/content_renderer_client.cc +++ content/public/renderer/content_renderer_client.cc -@@ -109,7 +109,6 @@ bool ContentRendererClient::AllowPopup() { +@@ -103,7 +103,6 @@ bool ContentRendererClient::AllowPopup() { return false; } @@ -402,7 +351,7 @@ index 303653a66248..a53478408226 100644 bool ContentRendererClient::HandleNavigation( RenderFrame* render_frame, bool is_content_initiated, -@@ -122,6 +121,7 @@ bool ContentRendererClient::HandleNavigation( +@@ -116,6 +115,7 @@ bool ContentRendererClient::HandleNavigation( return false; } @@ -411,10 +360,10 @@ index 303653a66248..a53478408226 100644 return false; } diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 16f55a95fdea..7f40cd466b09 100644 +index a05d000287b6..682a3e61d980 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h -@@ -77,6 +77,9 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -75,6 +75,9 @@ class CONTENT_EXPORT ContentRendererClient { // Notifies us that the RenderThread has been created. virtual void RenderThreadStarted() {} @@ -424,7 +373,7 @@ index 16f55a95fdea..7f40cd466b09 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -201,7 +204,6 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -193,7 +196,6 @@ class CONTENT_EXPORT ContentRendererClient { // Returns true if a popup window should be allowed. virtual bool AllowPopup(); @@ -432,7 +381,7 @@ index 16f55a95fdea..7f40cd466b09 100644 // TODO(sgurun) This callback is deprecated and will be removed as soon // as android webview completes implementation of a resource throttle based // shouldoverrideurl implementation. See crbug.com/325351 -@@ -217,6 +219,7 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -209,6 +211,7 @@ class CONTENT_EXPORT ContentRendererClient { blink::WebNavigationPolicy default_policy, bool is_redirect); @@ -455,10 +404,10 @@ index 4f8478bfa87a..52471407518e 100644 virtual void FocusedNodeChanged(const blink::WebNode& node) {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 7fc594620793..9082ae71219f 100644 +index 285d1d6fb031..8024d725d86c 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -2952,7 +2952,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -2975,7 +2975,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -468,7 +417,7 @@ index 7fc594620793..9082ae71219f 100644 params.mime_type.Utf8(), &found, &info, &mime_type)); if (!found) return nullptr; -@@ -3258,6 +3259,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { +@@ -3283,6 +3284,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { void RenderFrameImpl::FrameFocused() { Send(new FrameHostMsg_FrameFocused(routing_id_)); @@ -477,7 +426,7 @@ index 7fc594620793..9082ae71219f 100644 } void RenderFrameImpl::WillCommitProvisionalLoad() { -@@ -5397,9 +5400,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( +@@ -5459,9 +5462,8 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( (!IsBrowserSideNavigationEnabled() || url != pending_navigation_params_->request_params.redirects[0])); @@ -488,9 +437,9 @@ index 7fc594620793..9082ae71219f 100644 + bool render_view_was_created_by_renderer = false; // The handlenavigation API is deprecated and will be removed once // crbug.com/325351 is resolved. - if (GetContentClient()->renderer()->HandleNavigation( -@@ -5412,7 +5414,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( - } + if ((!IsBrowserSideNavigationEnabled() || !IsURLHandledByNetworkStack(url)) && +@@ -5471,7 +5473,6 @@ WebNavigationPolicy RenderFrameImpl::DecidePolicyForNavigation( + is_redirect)) { return blink::kWebNavigationPolicyIgnore; } -#endif @@ -498,10 +447,10 @@ index 7fc594620793..9082ae71219f 100644 // If the browser is interested, then give it a chance to look at the request. if (is_content_initiated && IsTopLevelNavigation(frame_) && diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index dbf1a1967f90..064f48a2e071 100644 +index dc0111728c3e..b8ab8834fc97 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -774,6 +774,8 @@ void RenderThreadImpl::Init( +@@ -779,6 +779,8 @@ void RenderThreadImpl::Init( StartServiceManagerConnection(); @@ -511,10 +460,10 @@ index dbf1a1967f90..064f48a2e071 100644 base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 2246aa95c564..02d25c60a090 100644 +index 1a9d6c2e7ef2..25166d5d9730 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -783,6 +783,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor( +@@ -794,6 +794,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor( void RendererBlinkPlatformImpl::GetPluginList( bool refresh, @@ -522,7 +471,7 @@ index 2246aa95c564..02d25c60a090 100644 const blink::WebSecurityOrigin& mainFrameOrigin, blink::WebPluginListBuilder* builder) { #if BUILDFLAG(ENABLE_PLUGINS) -@@ -790,7 +791,8 @@ void RendererBlinkPlatformImpl::GetPluginList( +@@ -801,7 +802,8 @@ void RendererBlinkPlatformImpl::GetPluginList( if (!plugin_refresh_allowed_) refresh = false; RenderThread::Get()->Send( @@ -533,10 +482,10 @@ index 2246aa95c564..02d25c60a090 100644 builder->AddPlugin(WebString::FromUTF16(plugin.name), WebString::FromUTF16(plugin.desc), diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index 18ab5e68d8a6..bd40d2914f7a 100644 +index 8d68defb758a..6891eb484eec 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h -@@ -125,6 +125,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -126,6 +126,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { viz::FrameSinkId GenerateFrameSinkId() override; void GetPluginList(bool refresh, @@ -593,7 +542,7 @@ index db23a83ed079..57a4c536118c 100644 const std::string& mime_type, bool allow_wildcard, diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc -index c19d608cc3e1..3dce54daf1cb 100644 +index 9f4c763b336b..2cd2087d11e3 100644 --- content/test/test_blink_web_unit_test_support.cc +++ content/test/test_blink_web_unit_test_support.cc @@ -290,6 +290,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { @@ -605,7 +554,7 @@ index c19d608cc3e1..3dce54daf1cb 100644 blink::WebPluginListBuilder* builder) { builder->AddPlugin("pdf", "pdf", "pdf-files"); diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h -index 556242d76fa9..61853c2df547 100644 +index 93df7c8c312a..7829493c88a3 100644 --- content/test/test_blink_web_unit_test_support.h +++ content/test/test_blink_web_unit_test_support.h @@ -70,6 +70,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index 2d9f8cedd..9b2c691dd 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -31,7 +31,7 @@ index 4d385dd5512b..1b51f2d17491 100644 cflags = [ "/wd4201" ] } diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc -index 1b3349852829..c1425f39e28d 100644 +index ff516e246948..47e474c1840d 100644 --- chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc @@ -4,6 +4,8 @@ @@ -52,7 +52,7 @@ index 1b3349852829..c1425f39e28d 100644 // The following keys may be chunked by the underlying crash logging system, // but ultimately constitute a single key-value pair. // -@@ -212,10 +214,16 @@ size_t RegisterChromeCrashKeys() { +@@ -223,10 +225,16 @@ size_t RegisterChromeCrashKeys() { // This dynamic set of keys is used for sets of key value pairs when gathering // a collection of data, like command line switches or extension IDs. @@ -71,7 +71,7 @@ index 1b3349852829..c1425f39e28d 100644 // Register the extension IDs. { -@@ -249,7 +257,7 @@ size_t RegisterChromeCrashKeys() { +@@ -260,7 +268,7 @@ size_t RegisterChromeCrashKeys() { return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength); } @@ -80,7 +80,7 @@ index 1b3349852829..c1425f39e28d 100644 static const char* const kIgnoreSwitches[] = { switches::kEnableLogging, switches::kFlagSwitchesBegin, -@@ -305,7 +313,7 @@ static bool IsBoringSwitch(const std::string& flag) { +@@ -316,7 +324,7 @@ static bool IsBoringSwitch(const std::string& flag) { } void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) { @@ -113,7 +113,7 @@ index 687146e9e92c..b1b73d6e36b2 100644 // on the given |command_line|. void SetCrashKeysFromCommandLine(const base::CommandLine& command_line); diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn -index f8ac4823fa05..83386f77dd69 100644 +index 1276a06ac02a..f5198bc4be48 100644 --- chrome_elf/BUILD.gn +++ chrome_elf/BUILD.gn @@ -7,6 +7,7 @@ @@ -124,7 +124,7 @@ index f8ac4823fa05..83386f77dd69 100644 import("//chrome/process_version_rc_template.gni") import("//testing/test.gni") -@@ -158,9 +159,6 @@ static_library("blacklist") { +@@ -166,9 +167,6 @@ static_library("blacklist") { static_library("crash") { sources = [ @@ -134,7 +134,7 @@ index f8ac4823fa05..83386f77dd69 100644 "crash/crash_helper.cc", "crash/crash_helper.h", ] -@@ -168,6 +166,7 @@ static_library("crash") { +@@ -176,6 +174,7 @@ static_library("crash") { ":hook_util", "//base", # This needs to go. DEP of app, crash_keys, client. "//base:base_static", # pe_image @@ -142,7 +142,7 @@ index f8ac4823fa05..83386f77dd69 100644 "//chrome/install_static:install_static_util", "//components/crash/content/app", "//components/crash/core/common", # crash_keys -@@ -176,6 +175,17 @@ static_library("crash") { +@@ -184,6 +183,17 @@ static_library("crash") { "//gpu/config:crash_keys", "//third_party/crashpad/crashpad/client", # DumpWithoutCrash ] @@ -161,7 +161,7 @@ index f8ac4823fa05..83386f77dd69 100644 static_library("hook_util") { diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc -index e1bede4790c0..e21761ecaf52 100644 +index e8e27dc4ebd7..7cb2149ec41d 100644 --- chrome_elf/crash/crash_helper.cc +++ chrome_elf/crash/crash_helper.cc @@ -11,12 +11,17 @@ @@ -195,7 +195,7 @@ index e1bede4790c0..e21761ecaf52 100644 g_crash_helper_enabled = true; return true; diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc -index 2199920ee793..e6e8f58a0be0 100644 +index 526c410915f3..347385906357 100644 --- components/crash/content/app/breakpad_linux.cc +++ components/crash/content/app/breakpad_linux.cc @@ -29,6 +29,7 @@ @@ -254,7 +254,7 @@ index 2199920ee793..e6e8f58a0be0 100644 if (info.pid > 0) { char pid_value_buf[kUint64StringSize]; uint64_t pid_value_len = my_uint64_len(info.pid); -@@ -2011,6 +2022,17 @@ void InitCrashReporter(const std::string& process_type) { +@@ -2013,6 +2024,17 @@ void InitCrashReporter(const std::string& process_type) { PostEnableBreakpadInitialization(); } @@ -356,7 +356,7 @@ index 2e9ee28e1b00..de53f5927143 100644 - } // namespace crash_reporter diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h -index 9f69c193dda2..2abaee004c47 100644 +index 46ba162cd35a..19afc3c6215f 100644 --- components/crash/content/app/crash_reporter_client.h +++ components/crash/content/app/crash_reporter_client.h @@ -8,6 +8,7 @@ @@ -415,7 +415,7 @@ index 9f69c193dda2..2abaee004c47 100644 } // namespace crash_reporter diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc -index aface8de549a..df37644bd872 100644 +index af31c1a40d4f..0452cfb5dc39 100644 --- components/crash/content/app/crashpad.cc +++ components/crash/content/app/crashpad.cc @@ -135,7 +135,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -530,7 +530,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644 handler_path, database_path, metrics_path, url, process_annotations, arguments, true, false); diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc -index bb5c09732c20..da3628cf8eb1 100644 +index 3a33c9bb8e92..961d600f7452 100644 --- components/crash/content/app/crashpad_win.cc +++ components/crash/content/app/crashpad_win.cc @@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations( diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index c0643f965..88b6e7227 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -1,5 +1,5 @@ diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc -index 799d2925b21a..43f9173e5db2 100644 +index 7e444585731f..2355ab4fec2b 100644 --- content/browser/frame_host/render_frame_host_manager.cc +++ content/browser/frame_host/render_frame_host_manager.cc @@ -1072,10 +1072,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( @@ -18,7 +18,7 @@ index 799d2925b21a..43f9173e5db2 100644 return true; } -@@ -1197,7 +1198,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation( +@@ -1214,7 +1215,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation( // Double-check that the new SiteInstance is associated with the right // BrowserContext. @@ -29,10 +29,10 @@ index 799d2925b21a..43f9173e5db2 100644 // If |new_instance| is a new SiteInstance for a subframe with an isolated // origin, set its process reuse policy so that such subframes are diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index 507f728ffe5b..20c49cc25387 100644 +index 842557d5fcb7..fc254e2b7bb8 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -316,6 +316,13 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -325,6 +325,13 @@ class CONTENT_EXPORT ContentBrowserClient { const GURL& current_url, const GURL& new_url); @@ -47,7 +47,7 @@ index 507f728ffe5b..20c49cc25387 100644 // current SiteInstance, if it does not yet have a site. virtual bool ShouldAssignSiteForURL(const GURL& url); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 4ec655aa834c..b937c201ecf9 100644 +index e85940e1123a..7d4e3c13204b 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -69,11 +69,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -197,7 +197,7 @@ index 0c70794823d3..4922df0d5398 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 073efff20e05..7a7656206cef 100644 +index 383b13c51e08..b3cde7df636a 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc @@ -349,9 +349,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, diff --git a/patch/patches/font_family_cache_1501.patch b/patch/patches/font_family_cache_1501.patch index 689dfe66b..c23529870 100644 --- a/patch/patches/font_family_cache_1501.patch +++ b/patch/patches/font_family_cache_1501.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/font_family_cache.h chrome/browser/font_family_cache.h -index 9366134bfe8e..c85039bad70b 100644 +index 36577f32fba3..a45e9230e6e5 100644 --- chrome/browser/font_family_cache.h +++ chrome/browser/font_family_cache.h @@ -21,6 +21,8 @@ class Profile; diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index fcad3259b..d1a4710a0 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 29d65d771249..eb61510004a7 100644 +index 7a7160de63c1..2b715af702dc 100644 --- .gn +++ .gn -@@ -255,6 +255,8 @@ exec_script_whitelist = +@@ -221,6 +221,8 @@ exec_script_whitelist = # in the Chromium repo outside of //build. "//build_overrides/build.gni", @@ -12,10 +12,10 @@ index 29d65d771249..eb61510004a7 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index 5fdb6c5f516c..654c28e9f3a0 100644 +index df54a97736bd..6a2938a28f8c 100644 --- BUILD.gn +++ BUILD.gn -@@ -172,6 +172,7 @@ group("gn_all") { +@@ -179,6 +179,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ "//cc:cc_unittests", @@ -56,30 +56,35 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index 8150d3a4e4ac..39441ef7ae89 100644 +index bb599d62968f..410c888cbe54 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py -@@ -132,17 +132,21 @@ def _LoadToolchainEnv(cpu, sdk_dir): +@@ -132,19 +132,22 @@ def _LoadToolchainEnv(cpu, sdk_dir): # variable. if 'VSINSTALLDIR' in os.environ: del os.environ['VSINSTALLDIR'] - other_path = os.path.normpath(os.path.join( -+ script_path = os.path.normpath(os.path.join( - os.environ['GYP_MSVS_OVERRIDE_PATH'], - 'VC/Auxiliary/Build/vcvarsall.bat')) +- os.environ['GYP_MSVS_OVERRIDE_PATH'], +- 'VC/Auxiliary/Build/vcvarsall.bat')) - if not os.path.exists(other_path): - raise Exception('%s is missing - make sure VC++ tools are installed.' % - script_path) - script_path = other_path -- # Chromium requires the 10.0.14393.0 SDK or higher - previous versions don't -- # have all of the required declarations. -- args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64'] +- # Chromium requires the 10.0.15063.468 SDK - previous versions don't have +- # all of the required declarations and 10.0.16299.0 has some +- # incompatibilities (crbug.com/773476). +- args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', +- '10.0.15063.0'] - variables = _LoadEnvFromBat(args) ++ script_path = os.path.normpath(os.path.join( ++ os.environ['GYP_MSVS_OVERRIDE_PATH'], ++ 'VC/Auxiliary/Build/vcvarsall.bat')) + if os.path.exists(script_path): -+ # Chromium requires the 10.0.14393.0 SDK. Previous versions don't have all -+ # of the required declarations, and 10.0.15063.0 is buggy. ++ # Chromium requires the 10.0.15063.468 SDK - previous versions don't have ++ # all of the required declarations and 10.0.16299.0 has some ++ # incompatibilities (crbug.com/773476). + args = [script_path, 'amd64_x86' if cpu == 'x86' else 'amd64', -+ '10.0.14393.0'] ++ '10.0.15063.0'] + variables = _LoadEnvFromBat(args) + else: + variables = [] @@ -91,10 +96,10 @@ index 8150d3a4e4ac..39441ef7ae89 100644 diff --git build/vs_toolchain.py build/vs_toolchain.py -index 93a04ceb27d0..05342d2707e9 100755 +index 7626880b142a..009eab551c90 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py -@@ -79,11 +79,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): +@@ -81,11 +81,18 @@ 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: @@ -114,10 +119,10 @@ index 93a04ceb27d0..05342d2707e9 100755 # directory in order to run binaries locally, but they are needed in order # to create isolates or the mini_installer. Copying them to the output diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index c9a9a3d95f29..41f3bd29d7dc 100644 +index 91dc01d5ca6e..129f0a4db7f0 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni -@@ -248,7 +248,7 @@ template("chrome_paks") { +@@ -250,7 +250,7 @@ template("chrome_paks") { } input_locales = locales @@ -127,15 +132,15 @@ index c9a9a3d95f29..41f3bd29d7dc 100644 if (is_mac) { output_locales = locales_as_mac_outputs diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn -index 14a729a33cd4..3651ff58915c 100644 +index cc3782f4a91d..7f0e8aa3f82e 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn -@@ -130,7 +130,7 @@ template("generate_mini_installer") { +@@ -131,7 +131,7 @@ template("generate_mini_installer") { inputs = [ "$chrome_dll_file", "$root_out_dir/chrome.exe", - "$root_out_dir/locales/en-US.pak", + "$root_out_dir/chrome/locales/en-US.pak", "$root_out_dir/setup.exe", + "$root_out_dir/v8_context_snapshot.bin", release_file, - ] diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 6873d2f09..e86bb4f0d 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,8 +1,8 @@ diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids -index ee0116d1852b..be1ec3e1c230 100644 +index b0c2f87c10e6..521022553ec9 100644 --- tools/gritsettings/resource_ids +++ tools/gritsettings/resource_ids -@@ -380,4 +380,11 @@ +@@ -386,4 +386,11 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. diff --git a/patch/patches/linux_build.patch b/patch/patches/linux_build.patch index 0ae7af2ae..001500554 100644 --- a/patch/patches/linux_build.patch +++ b/patch/patches/linux_build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index 0acb460fe62d..5b0183fb7540 100644 +index 7888e2f8589d..2b3e8dff4637 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -415,7 +415,7 @@ config("compiler") { +@@ -398,7 +398,7 @@ config("compiler") { # chromeos binutils has been patched with the fix, so always use icf there. # The bug only affects x86 and x64, so we can still use ICF when targeting # other architectures. @@ -11,23 +11,3 @@ index 0acb460fe62d..5b0183fb7540 100644 !(current_cpu == "x86" || current_cpu == "x64")) { ldflags += [ "-Wl,--icf=all" ] } -diff --git chrome/browser/ui/libgtkui/gtk_ui.cc chrome/browser/ui/libgtkui/gtk_ui.cc -index f45f2b10a842..dbabf1bb7f3b 100644 ---- chrome/browser/ui/libgtkui/gtk_ui.cc -+++ chrome/browser/ui/libgtkui/gtk_ui.cc -@@ -92,6 +92,7 @@ namespace libgtkui { - - namespace { - -+#if GTK_MAJOR_VERSION == 3 - // We would like this to be a feature flag, but GtkUi gets initialized - // earlier than the feature flag registry, so just use a simple bool. - // The reason for wanting a flag is so that we can release the GTK3 -@@ -100,6 +101,7 @@ namespace { - // Since this was never really intended to be toggled by users, this - // is fine for now. - const bool kUseGtkNavButtonLayoutManager = true; -+#endif - - const double kDefaultDPI = 96; - diff --git a/patch/patches/message_loop_443_1992243003.patch b/patch/patches/message_loop_443_1992243003.patch index eba446511..55b62ae59 100644 --- a/patch/patches/message_loop_443_1992243003.patch +++ b/patch/patches/message_loop_443_1992243003.patch @@ -1,8 +1,8 @@ diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h -index a118917ea1cc..5c89a01e1019 100644 +index 0c82e51dfcd4..e5cb6fdb4c80 100644 --- base/message_loop/message_loop.h +++ base/message_loop/message_loop.h -@@ -278,6 +278,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, +@@ -277,6 +277,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, void AddTaskObserver(TaskObserver* task_observer); void RemoveTaskObserver(TaskObserver* task_observer); @@ -19,7 +19,7 @@ index a118917ea1cc..5c89a01e1019 100644 // Returns true if the message loop is "idle". Provided for testing. bool IsIdleForTesting(); -@@ -413,6 +423,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, +@@ -376,6 +386,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, // need to be checked in conditionals). bool nestable_tasks_allowed_; diff --git a/patch/patches/net_filter_515.patch b/patch/patches/net_filter_515.patch index c0f06f202..d9a53aa71 100644 --- a/patch/patches/net_filter_515.patch +++ b/patch/patches/net_filter_515.patch @@ -22,10 +22,10 @@ index 22d22d03554a..c9a1c6df8f1b 100644 THREAD_CHECKER(thread_checker_); diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc -index 9112c4467cb2..4298ab28eab1 100644 +index d9719f0bb720..2a798690a932 100644 --- net/url_request/url_request_job.cc +++ net/url_request/url_request_job.cc -@@ -531,6 +531,12 @@ void URLRequestJob::NotifyHeadersComplete() { +@@ -442,6 +442,12 @@ void URLRequestJob::NotifyHeadersComplete() { DCHECK(!source_stream_); source_stream_ = SetUpSourceStream(); diff --git a/patch/patches/net_security_expiration_1994.patch b/patch/patches/net_security_expiration_1994.patch index 0448501c7..5fea43450 100644 --- a/patch/patches/net_security_expiration_1994.patch +++ b/patch/patches/net_security_expiration_1994.patch @@ -1,5 +1,5 @@ diff --git net/cert/ct_policy_enforcer.cc net/cert/ct_policy_enforcer.cc -index 0dd6a0d6bc0c..8bc6502d1e6f 100644 +index 61d169cb5bfa..6e16906c7cc2 100644 --- net/cert/ct_policy_enforcer.cc +++ net/cert/ct_policy_enforcer.cc @@ -35,15 +35,6 @@ namespace net { @@ -18,7 +18,7 @@ index 0dd6a0d6bc0c..8bc6502d1e6f 100644 // Returns a rounded-down months difference of |start| and |end|, // together with an indication of whether the last month was // a full month, because the range starts specified in the policy -@@ -296,4 +287,13 @@ ct::CertPolicyCompliance CTPolicyEnforcer::DoesConformToCertPolicy( +@@ -301,4 +292,13 @@ ct::CertPolicyCompliance CTPolicyEnforcer::DoesConformToCertPolicy( return compliance; } @@ -55,10 +55,10 @@ index b594cba1a6fc..285eae814c50 100644 } // namespace net diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc -index 718c70b8f865..0973f4ac142c 100644 +index 5af15d92ef49..f459c4355860 100644 --- net/http/transport_security_state.cc +++ net/http/transport_security_state.cc -@@ -1550,8 +1550,10 @@ void TransportSecurityState::ClearReportCachesForTesting() { +@@ -1541,8 +1541,10 @@ void TransportSecurityState::ClearReportCachesForTesting() { sent_expect_ct_reports_cache_.Clear(); } diff --git a/patch/patches/net_urlrequest_1327.patch b/patch/patches/net_urlrequest_1327.patch index 660708e37..219cf4023 100644 --- a/patch/patches/net_urlrequest_1327.patch +++ b/patch/patches/net_urlrequest_1327.patch @@ -1,5 +1,5 @@ diff --git net/url_request/url_request.h net/url_request/url_request.h -index ae6bba1cdfa7..6fe1172b01b8 100644 +index 378fe780f11d..2a9b37b3ad8d 100644 --- net/url_request/url_request.h +++ net/url_request/url_request.h @@ -681,10 +681,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData { diff --git a/patch/patches/pdfium_print_549365.patch b/patch/patches/pdfium_print_549365.patch index 27dfc8f44..e2fe55ee6 100644 --- a/patch/patches/pdfium_print_549365.patch +++ b/patch/patches/pdfium_print_549365.patch @@ -1,5 +1,5 @@ diff --git BUILD.gn BUILD.gn -index f268a0c3f..8767aed1d 100644 +index 3e3f22fdd..b5c2e5265 100644 --- BUILD.gn +++ BUILD.gn @@ -227,6 +227,10 @@ static_library("pdfium") { @@ -14,10 +14,10 @@ index f268a0c3f..8767aed1d 100644 static_library("test_support") { diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp -index e93e8bcd5..c003f9f9b 100644 +index af1d0db1a..9b0397391 100644 --- fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp -@@ -38,6 +38,7 @@ +@@ -37,6 +37,7 @@ #include "fpdfsdk/fsdk_define.h" #include "fpdfsdk/fsdk_pauseadapter.h" #include "fpdfsdk/javascript/ijs_runtime.h" @@ -25,7 +25,7 @@ index e93e8bcd5..c003f9f9b 100644 #include "public/fpdf_edit.h" #include "public/fpdf_ext.h" #include "public/fpdf_progressive.h" -@@ -480,6 +481,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { +@@ -486,6 +487,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { CPDF_ModuleMgr::Destroy(); CFX_GEModule::Destroy(); diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index b5328ffb1..884b1ff55 100644 --- a/patch/patches/prefs_content_1161.patch +++ b/patch/patches/prefs_content_1161.patch @@ -1,8 +1,8 @@ diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h -index 24302aa9a63b..ba5c08bf5892 100644 +index 90951a5d5e56..940fe86b6587 100644 --- content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h -@@ -205,6 +205,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -208,6 +208,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) @@ -11,34 +11,34 @@ index 24302aa9a63b..ba5c08bf5892 100644 IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc -index a9c7b7d8c3ae..7c9d26fb223f 100644 +index 722afb30f662..42274dd9cc8c 100644 --- content/public/common/web_preferences.cc +++ content/public/common/web_preferences.cc -@@ -170,6 +170,7 @@ WebPreferences::WebPreferences() +@@ -179,6 +179,7 @@ WebPreferences::WebPreferences() spatial_navigation_enabled(false), use_solid_color_scrollbars(false), navigate_on_drag_drop(true), + base_background_color(0xFFFFFFFF), // Color::white v8_cache_options(V8_CACHE_OPTIONS_DEFAULT), record_whole_document(false), - cookie_enabled(true), + save_previous_document_resources(SavePreviousDocumentResources::NEVER), diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h -index 1e24ea16ae51..2c4062d42992 100644 +index c81979993ad5..f0a4474c4023 100644 --- content/public/common/web_preferences.h +++ content/public/common/web_preferences.h -@@ -191,6 +191,7 @@ struct CONTENT_EXPORT WebPreferences { +@@ -198,6 +198,7 @@ struct CONTENT_EXPORT WebPreferences { bool spatial_navigation_enabled; bool use_solid_color_scrollbars; bool navigate_on_drag_drop; + uint32_t base_background_color; V8CacheOptions v8_cache_options; bool record_whole_document; - + SavePreviousDocumentResources save_previous_document_resources; diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index 344e89232ca7..c74e5c5432ed 100644 +index 22bd13a28fb7..027eaf5b65da 100644 --- content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc -@@ -1309,6 +1309,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( +@@ -1308,6 +1308,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( blink::WebView* web_view, CompositorDependencies* compositor_deps) { ApplyWebPreferences(prefs, web_view); diff --git a/patch/patches/print_header_footer_1478_1565.patch b/patch/patches/print_header_footer_1478_1565.patch index 721aff0ec..9f929997d 100644 --- a/patch/patches/print_header_footer_1478_1565.patch +++ b/patch/patches/print_header_footer_1478_1565.patch @@ -41,7 +41,7 @@ index 0cd84f38c229..2f872dd3dfe2 100644 - (void)handlesSaveScriptCommand:(NSScriptCommand*)command { diff --git chrome/common/chrome_utility_printing_messages.h chrome/common/chrome_utility_printing_messages.h -index f5712a7a5bb8..11c03661412b 100644 +index fa7702857f75..874a37146fb5 100644 --- chrome/common/chrome_utility_printing_messages.h +++ chrome/common/chrome_utility_printing_messages.h @@ -26,7 +26,6 @@ @@ -61,10 +61,10 @@ index f5712a7a5bb8..11c03661412b 100644 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc -index 4a7c94d1cdd0..7bf3e6ae072c 100644 +index 6767c4af66ab..c860394ba411 100644 --- components/printing/common/print_messages.cc +++ components/printing/common/print_messages.cc -@@ -107,7 +107,6 @@ void PrintMsg_PrintPages_Params::Reset() { +@@ -101,7 +101,6 @@ void PrintMsg_PrintPages_Params::Reset() { pages = std::vector(); } @@ -72,13 +72,13 @@ index 4a7c94d1cdd0..7bf3e6ae072c 100644 PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params() : is_modifiable(false), -@@ -129,4 +128,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: +@@ -123,4 +122,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params:: ~PrintHostMsg_SetOptionsFromDocument_Params() { } -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h -index f9b1daf905f2..971b92bccfdc 100644 +index ed443d2a8117..a0180ec440f0 100644 --- components/printing/common/print_messages.h +++ components/printing/common/print_messages.h @@ -76,7 +76,6 @@ struct PrintMsg_PrintPages_Params { @@ -154,7 +154,7 @@ index f9b1daf905f2..971b92bccfdc 100644 #if BUILDFLAG(ENABLE_BASIC_PRINTING) // Tells the RenderFrame to switch the CSS to print media type, renders every -@@ -348,13 +340,11 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, +@@ -348,13 +340,13 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, // Tells the RenderFrame whether printing is enabled or not. IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */) @@ -164,11 +164,12 @@ index f9b1daf905f2..971b92bccfdc 100644 // called multiple times as the user updates settings. IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, base::DictionaryValue /* settings */) --#endif - // Messages sent from the renderer to the browser. - -@@ -411,7 +401,6 @@ IPC_MESSAGE_CONTROL3(PrintHostMsg_TempFileForPrintingWritten, ++#if BUILDFLAG(ENABLE_PRINT_PREVIEW) + // Tells the RenderFrame that print preview dialog was closed. + IPC_MESSAGE_ROUTED0(PrintMsg_ClosePrintPreviewDialog) + #endif +@@ -414,7 +406,6 @@ IPC_MESSAGE_CONTROL3(PrintHostMsg_TempFileForPrintingWritten, int /* page count */) #endif // defined(OS_ANDROID) @@ -176,7 +177,7 @@ index f9b1daf905f2..971b92bccfdc 100644 // Asks the browser to do print preview. IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, PrintHostMsg_RequestPrintPreview_Params /* params */) -@@ -445,7 +434,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, +@@ -448,7 +439,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, // The memory handle in this message is already valid in the browser process. IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, PrintHostMsg_DidPreviewDocument_Params /* params */) @@ -184,7 +185,7 @@ index f9b1daf905f2..971b92bccfdc 100644 // This is sent when there are invalid printer settings. IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) -@@ -454,7 +442,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) +@@ -457,7 +447,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, int /* document cookie */) @@ -192,16 +193,16 @@ index f9b1daf905f2..971b92bccfdc 100644 // Tell the browser print preview failed. IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, int /* document cookie */) -@@ -481,4 +468,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, +@@ -484,4 +473,3 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, // Notify the browser to set print presets based on source PDF document. IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, PrintHostMsg_SetOptionsFromDocument_Params /* params */) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) diff --git components/printing/renderer/print_render_frame_helper.cc components/printing/renderer/print_render_frame_helper.cc -index 18469953e9f0..bb94f44e58b0 100644 +index c6b03ed6ad9a..5f6545a3dee7 100644 --- components/printing/renderer/print_render_frame_helper.cc +++ components/printing/renderer/print_render_frame_helper.cc -@@ -320,7 +320,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, +@@ -319,7 +319,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, return plugin && plugin->SupportsPaginatedPrint(); } @@ -209,7 +210,7 @@ index 18469953e9f0..bb94f44e58b0 100644 // Returns true if the current destination printer is PRINT_TO_PDF. bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool print_to_pdf = false; -@@ -342,7 +341,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame, +@@ -341,7 +340,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame, } return frame_has_custom_page_size_style; } @@ -217,7 +218,7 @@ index 18469953e9f0..bb94f44e58b0 100644 #if BUILDFLAG(ENABLE_PRINTING) // Disable scaling when either: -@@ -399,7 +397,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, +@@ -398,7 +396,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, } #endif @@ -225,7 +226,7 @@ index 18469953e9f0..bb94f44e58b0 100644 bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool fit_to_paper_size = false; if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { -@@ -441,7 +438,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( +@@ -440,7 +437,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( } return blink::kWebPrintScalingOptionFitToPrintableArea; } @@ -233,7 +234,7 @@ index 18469953e9f0..bb94f44e58b0 100644 // Helper function to scale and round an integer value with a double valued // scaling. -@@ -977,6 +973,7 @@ PrintRenderFrameHelper::PrintRenderFrameHelper( +@@ -959,6 +955,7 @@ PrintRenderFrameHelper::PrintRenderFrameHelper( print_for_preview_(false), delegate_(std::move(delegate)), print_node_in_progress_(false), @@ -241,7 +242,7 @@ index 18469953e9f0..bb94f44e58b0 100644 is_loading_(false), is_scripted_preview_delayed_(false), ipc_nesting_level_(0), -@@ -1038,10 +1035,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1020,10 +1017,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { return; if (g_is_preview_enabled) { @@ -251,8 +252,8 @@ index 18469953e9f0..bb94f44e58b0 100644 -#endif } else { #if BUILDFLAG(ENABLE_BASIC_PRINTING) - Print(web_frame, blink::WebNode(), true /* is_scripted? */); -@@ -1067,14 +1062,10 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) { + auto weak_this = weak_ptr_factory_.GetWeakPtr(); +@@ -1055,13 +1050,11 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) @@ -263,11 +264,11 @@ index 18469953e9f0..bb94f44e58b0 100644 IPC_MESSAGE_HANDLER(PrintMsg_InitiatePrintPreview, OnInitiatePrintPreview) IPC_MESSAGE_HANDLER(PrintMsg_PrintPreview, OnPrintPreview) IPC_MESSAGE_HANDLER(PrintMsg_PrintingDone, OnPrintingDone) --#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) - IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() -@@ -1122,7 +1113,6 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { ++#if BUILDFLAG(ENABLE_PRINT_PREVIEW) + IPC_MESSAGE_HANDLER(PrintMsg_ClosePrintPreviewDialog, + OnClosePrintPreviewDialog) + #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) +@@ -1121,7 +1114,6 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { } #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) @@ -275,7 +276,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::OnPrintForPrintPreview( const base::DictionaryValue& job_settings) { CHECK_LE(ipc_nesting_level_, 1); -@@ -1182,7 +1172,6 @@ void PrintRenderFrameHelper::OnPrintForPrintPreview( +@@ -1181,7 +1173,6 @@ void PrintRenderFrameHelper::OnPrintForPrintPreview( DidFinishPrinting(FAIL_PRINT); } } @@ -283,7 +284,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::GetPageSizeAndContentAreaFromPageLayout( const PageSizeMargins& page_layout_in_points, -@@ -1207,7 +1196,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo( +@@ -1206,7 +1197,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo( ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); } @@ -291,7 +292,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::OnPrintPreview( const base::DictionaryValue& settings) { if (ipc_nesting_level_ > 1) -@@ -1399,7 +1387,7 @@ bool PrintRenderFrameHelper::CreatePreviewDocument() { +@@ -1398,7 +1388,7 @@ bool PrintRenderFrameHelper::CreatePreviewDocument() { return true; } @@ -300,7 +301,7 @@ index 18469953e9f0..bb94f44e58b0 100644 bool PrintRenderFrameHelper::RenderPreviewPage( int page_number, const PrintMsg_Print_Params& print_params) { -@@ -1429,7 +1417,7 @@ bool PrintRenderFrameHelper::RenderPreviewPage( +@@ -1428,7 +1418,7 @@ bool PrintRenderFrameHelper::RenderPreviewPage( } return PreviewPageRendered(page_number, draft_metafile.get()); } @@ -309,7 +310,7 @@ index 18469953e9f0..bb94f44e58b0 100644 bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { DCHECK(!is_print_ready_metafile_sent_); -@@ -1458,7 +1446,6 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { +@@ -1457,7 +1447,6 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); return true; } @@ -317,7 +318,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::OnPrintingDone(bool success) { if (ipc_nesting_level_ > 1) -@@ -1473,7 +1460,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) { +@@ -1472,7 +1461,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) { is_printing_enabled_ = enabled; } @@ -325,7 +326,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { if (ipc_nesting_level_ > 1) return; -@@ -1484,7 +1470,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { +@@ -1483,7 +1471,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { // that instead. auto plugin = delegate_->GetPdfElement(frame); if (!plugin.IsNull()) { @@ -335,15 +336,20 @@ index 18469953e9f0..bb94f44e58b0 100644 return; } print_preview_context_.InitWithFrame(frame); -@@ -1492,7 +1480,6 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { - ? PRINT_PREVIEW_USER_INITIATED_SELECTION +@@ -1492,10 +1482,11 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); } + ++#if BUILDFLAG(ENABLE_PRINT_PREVIEW) + void PrintRenderFrameHelper::OnClosePrintPreviewDialog() { + print_preview_context_.source_frame()->DispatchAfterPrintEvent(); + } -#endif ++#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) bool PrintRenderFrameHelper::IsPrintingEnabled() const { return is_printing_enabled_; -@@ -1514,11 +1501,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -1517,11 +1508,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { print_node_in_progress_ = true; @@ -356,7 +362,7 @@ index 18469953e9f0..bb94f44e58b0 100644 } else { #if BUILDFLAG(ENABLE_BASIC_PRINTING) // Make a copy of the node, in case RenderView::OnContextMenuClosed() resets -@@ -1608,7 +1593,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { +@@ -1611,7 +1600,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { } break; @@ -364,7 +370,7 @@ index 18469953e9f0..bb94f44e58b0 100644 case FAIL_PREVIEW: if (!is_print_ready_metafile_sent_) { if (notify_browser_of_print_failure_) { -@@ -1625,7 +1609,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { +@@ -1628,7 +1616,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { cookie)); print_preview_context_.Failed(false); break; @@ -372,7 +378,7 @@ index 18469953e9f0..bb94f44e58b0 100644 } prep_frame_view_.reset(); print_pages_params_.reset(); -@@ -1757,7 +1740,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, +@@ -1757,7 +1744,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, return true; } @@ -380,7 +386,7 @@ index 18469953e9f0..bb94f44e58b0 100644 bool PrintRenderFrameHelper::SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options) { blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); -@@ -1864,7 +1846,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings( +@@ -1864,7 +1850,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings( print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS); return false; } @@ -388,7 +394,7 @@ index 18469953e9f0..bb94f44e58b0 100644 #if BUILDFLAG(ENABLE_BASIC_PRINTING) void PrintRenderFrameHelper::GetPrintSettingsFromUser( -@@ -2023,7 +2004,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToSharedMem( +@@ -2023,7 +2008,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToSharedMem( return true; } @@ -396,7 +402,7 @@ index 18469953e9f0..bb94f44e58b0 100644 void PrintRenderFrameHelper::ShowScriptedPrintPreview() { if (is_scripted_preview_delayed_) { is_scripted_preview_delayed_ = false; -@@ -2154,7 +2134,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(int page_number, +@@ -2158,7 +2142,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(int page_number, Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); return true; } @@ -405,7 +411,7 @@ index 18469953e9f0..bb94f44e58b0 100644 PrintRenderFrameHelper::PrintPreviewContext::PrintPreviewContext() : total_page_count_(0), diff --git components/printing/renderer/print_render_frame_helper.h components/printing/renderer/print_render_frame_helper.h -index 6a52cd8bb78e..d5ca1ceb264d 100644 +index a9fe8cb7dcaf..ea35ea3cc920 100644 --- components/printing/renderer/print_render_frame_helper.h +++ components/printing/renderer/print_render_frame_helper.h @@ -156,10 +156,8 @@ class PrintRenderFrameHelper @@ -419,18 +425,18 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 }; enum PrintPreviewErrorBuckets { -@@ -196,10 +194,8 @@ class PrintRenderFrameHelper +@@ -196,9 +194,9 @@ class PrintRenderFrameHelper void OnPrintForSystemDialog(); void OnPrintForPrintPreview(const base::DictionaryValue& job_settings); #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW) void OnInitiatePrintPreview(bool has_selection); void OnPrintPreview(const base::DictionaryValue& settings); --#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) ++#if BUILDFLAG(ENABLE_PRINT_PREVIEW) + void OnClosePrintPreviewDialog(); + #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) void OnPrintingDone(bool success); - - // Get |page_size| and |content_area| information from -@@ -212,7 +208,6 @@ class PrintRenderFrameHelper +@@ -213,7 +211,6 @@ class PrintRenderFrameHelper // Update |ignore_css_margins_| based on settings. void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); @@ -438,7 +444,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 // Prepare frame for creating preview document. void PrepareFrameForPreviewDocument(); -@@ -229,7 +224,6 @@ class PrintRenderFrameHelper +@@ -230,7 +227,6 @@ class PrintRenderFrameHelper // Finalize the print ready preview document. bool FinalizePrintReadyDocument(); @@ -446,7 +452,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 // Enable/Disable printing. void OnSetPrintingEnabled(bool enabled); -@@ -259,7 +253,6 @@ class PrintRenderFrameHelper +@@ -260,7 +256,6 @@ class PrintRenderFrameHelper const blink::WebNode& node, int* number_of_pages); @@ -454,7 +460,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 // Set options for print preset from source PDF document. bool SetOptionsFromPdfDocument( PrintHostMsg_SetOptionsFromDocument_Params* options); -@@ -270,7 +263,6 @@ class PrintRenderFrameHelper +@@ -271,7 +266,6 @@ class PrintRenderFrameHelper bool UpdatePrintSettings(blink::WebLocalFrame* frame, const blink::WebNode& node, const base::DictionaryValue& passed_job_settings); @@ -462,7 +468,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 #if BUILDFLAG(ENABLE_BASIC_PRINTING) // Get final print settings from the user. -@@ -374,7 +366,6 @@ class PrintRenderFrameHelper +@@ -375,7 +369,6 @@ class PrintRenderFrameHelper bool IsScriptInitiatedPrintAllowed(blink::WebLocalFrame* frame, bool user_initiated); @@ -470,7 +476,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 // Shows scripted print preview when options from plugin are available. void ShowScriptedPrintPreview(); -@@ -392,7 +383,6 @@ class PrintRenderFrameHelper +@@ -393,7 +386,6 @@ class PrintRenderFrameHelper // |metafile| is the rendered page. Otherwise |metafile| is NULL. // Returns true if print preview should continue, false on failure. bool PreviewPageRendered(int page_number, PdfMetafileSkia* metafile); @@ -478,7 +484,7 @@ index 6a52cd8bb78e..d5ca1ceb264d 100644 void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); -@@ -553,6 +543,7 @@ class PrintRenderFrameHelper +@@ -554,6 +546,7 @@ class PrintRenderFrameHelper ScriptingThrottler scripting_throttler_; bool print_node_in_progress_; diff --git a/patch/patches/printing_context_2196.patch b/patch/patches/printing_context_2196.patch index e9ded1026..6c17ca9a6 100644 --- a/patch/patches/printing_context_2196.patch +++ b/patch/patches/printing_context_2196.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc -index a884d985f16f..2d4df5e9b13a 100644 +index 13434ba2f6cd..9e6734501057 100644 --- chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc @@ -125,6 +125,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, @@ -11,7 +11,7 @@ index a884d985f16f..2d4df5e9b13a 100644 PrintJobWorker::~PrintJobWorker() { diff --git printing/printing_context.h printing/printing_context.h -index 7054654260a7..ed5b664f86a7 100644 +index 03f940ca4684..d23a4a354d57 100644 --- printing/printing_context.h +++ printing/printing_context.h @@ -127,6 +127,13 @@ class PRINTING_EXPORT PrintingContext { diff --git a/patch/patches/render_view_host_impl_1392.patch b/patch/patches/render_view_host_impl_1392.patch index ca10fff74..1673e67f3 100644 --- a/patch/patches/render_view_host_impl_1392.patch +++ b/patch/patches/render_view_host_impl_1392.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_view_host_impl.h content/browser/renderer_host/render_view_host_impl.h -index d9667c321aab..1cee78df71d3 100644 +index 071ed012bada..0957d5dda328 100644 --- content/browser/renderer_host/render_view_host_impl.h +++ content/browser/renderer_host/render_view_host_impl.h -@@ -155,6 +155,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, +@@ -158,6 +158,7 @@ class CONTENT_EXPORT RenderViewHostImpl : public RenderViewHost, void set_is_swapped_out(bool is_swapped_out) { is_swapped_out_ = is_swapped_out; } diff --git a/patch/patches/rwh_background_color_1984.patch b/patch/patches/rwh_background_color_1984.patch index f6558ff3a..71803975a 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 dda1da688eb7..936fc509685c 100644 +index 7f727c290067..9d8a4683411f 100644 --- content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -422,13 +422,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(RenderWidgetHost* host, +@@ -426,13 +426,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura( selection_controller_client_.reset( new TouchSelectionControllerClientAura(this)); CreateSelectionController(); @@ -16,7 +16,7 @@ index dda1da688eb7..936fc509685c 100644 } //////////////////////////////////////////////////////////////////////////////// -@@ -746,8 +739,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( +@@ -750,8 +743,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( background_color_ = color; bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; @@ -29,7 +29,7 @@ index dda1da688eb7..936fc509685c 100644 } bool RenderWidgetHostViewAura::IsMouseLocked() { -@@ -1933,6 +1928,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { +@@ -1913,6 +1908,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { window_->Init(ui::LAYER_SOLID_COLOR); window_->layer()->SetColor(background_color_); diff --git a/patch/patches/service_factory_1680.patch b/patch/patches/service_factory_1680.patch index b12af9e22..5e04984d0 100644 --- a/patch/patches/service_factory_1680.patch +++ b/patch/patches/service_factory_1680.patch @@ -97,7 +97,7 @@ index 2907619549ba..f941fba363b5 100644 SupervisedUserSettingsServiceFactory(); diff --git chrome/browser/ui/prefs/prefs_tab_helper.cc chrome/browser/ui/prefs/prefs_tab_helper.cc -index 4d4fd0e7a4bb..e5bb39adc24e 100644 +index 149dbc568f54..ec01bd851d9c 100644 --- chrome/browser/ui/prefs/prefs_tab_helper.cc +++ chrome/browser/ui/prefs/prefs_tab_helper.cc @@ -11,8 +11,8 @@ @@ -110,7 +110,7 @@ index 4d4fd0e7a4bb..e5bb39adc24e 100644 #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" -@@ -432,12 +432,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { +@@ -392,12 +392,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { GetInstance()->GetServiceForBrowserContext(profile, true)); } @@ -125,7 +125,7 @@ index 4d4fd0e7a4bb..e5bb39adc24e 100644 PrefWatcherFactory() : BrowserContextKeyedServiceFactory( "PrefWatcher", -@@ -458,6 +456,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { +@@ -418,6 +416,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory { } }; diff --git a/patch/patches/storage_partition_1973.patch b/patch/patches/storage_partition_1973.patch index 62619d9bd..69a12c657 100644 --- a/patch/patches/storage_partition_1973.patch +++ b/patch/patches/storage_partition_1973.patch @@ -1,5 +1,5 @@ diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc -index f7c812a2c9b1..d0f5c191a4f5 100644 +index 71bf90c54ae5..d3308da307d7 100644 --- content/browser/appcache/appcache_internals_ui.cc +++ content/browser/appcache/appcache_internals_ui.cc @@ -372,8 +372,8 @@ void AppCacheInternalsUI::CreateProxyForPartition( @@ -59,16 +59,18 @@ index 13d802fa72cd..a2d34d1d72eb 100644 partition->GetBluetoothAllowedDevicesMap(); return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin()); diff --git content/browser/browser_context.cc content/browser/browser_context.cc -index 42b002908c3b..f7d9c3933090 100644 +index 1e3eb64f87ba..e895554337c6 100644 --- content/browser/browser_context.cc +++ content/browser/browser_context.cc -@@ -125,7 +125,14 @@ StoragePartition* GetStoragePartitionFromConfig( +@@ -126,8 +126,15 @@ StoragePartition* GetStoragePartitionFromConfig( if (browser_context->IsOffTheRecord()) in_memory = true; -- return partition_map->Get(partition_domain, partition_name, in_memory); +- return partition_map->Get(partition_domain, partition_name, in_memory, +- can_create); + StoragePartitionImpl* partition_impl = -+ partition_map->Get(partition_domain, partition_name, in_memory); ++ partition_map->Get(partition_domain, partition_name, in_memory, ++ can_create); + if (partition_impl->browser_context() == browser_context) + return partition_impl; + @@ -78,7 +80,7 @@ index 42b002908c3b..f7d9c3933090 100644 } void SaveSessionStateOnIOThread( -@@ -544,6 +551,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor( +@@ -548,6 +555,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor( BrowserContext::BrowserContext() : media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {} @@ -91,45 +93,72 @@ index 42b002908c3b..f7d9c3933090 100644 CHECK(GetUserData(kMojoWasInitialized)) << "Attempting to destroy a BrowserContext that never called " diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc -index c2fbb6a68dd3..8e5747a50908 100644 +index a65884075126..241653eb4fd6 100644 --- content/browser/devtools/protocol/service_worker_handler.cc +++ content/browser/devtools/protocol/service_worker_handler.cc -@@ -321,10 +321,9 @@ Response ServiceWorkerHandler::DispatchSyncEvent( +@@ -334,8 +334,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent( if (!base::StringToInt64(registration_id, &id)) return CreateInvalidVersionIdErrorResponse(); - StoragePartitionImpl* partition = -- static_cast(BrowserContext::GetStoragePartition( -+ StoragePartition* partition = BrowserContext::GetStoragePartition( - render_frame_host_->GetProcess()->GetBrowserContext(), -- render_frame_host_->GetSiteInstance())); -+ render_frame_host_->GetSiteInstance()); +- static_cast(process_->GetStoragePartition()); ++ StoragePartition* partition = process_->GetStoragePartition(); BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext(); BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc -index 4722f367c327..bd7720092bf2 100644 +index 68293acdadc6..ca613c9218c8 100644 --- content/browser/download/download_manager_impl.cc +++ content/browser/download/download_manager_impl.cc -@@ -81,8 +81,8 @@ scoped_refptr GetURLLoaderFactoryGetter( +@@ -69,9 +69,9 @@ + namespace content { + namespace { + +-StoragePartitionImpl* GetStoragePartition(BrowserContext* context, +- int render_process_id, +- int render_frame_id) { ++StoragePartition* GetStoragePartition(BrowserContext* context, ++ int render_process_id, ++ int render_frame_id) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + SiteInstance* site_instance = nullptr; +@@ -81,8 +81,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context, if (render_frame_host_) site_instance = render_frame_host_->GetSiteInstance(); } -- StoragePartitionImpl* partition = static_cast( +- return static_cast( - BrowserContext::GetStoragePartition(context, site_instance)); -+ StoragePartition* partition = -+ BrowserContext::GetStoragePartition(context, site_instance); - return partition->url_loader_factory_getter(); ++ return BrowserContext::GetStoragePartition(context, site_instance); } + bool CanRequestURLFromRenderer(int render_process_id, GURL url) { +@@ -737,14 +736,15 @@ void DownloadManagerImpl::DownloadUrl( + if (base::FeatureList::IsEnabled(features::kNetworkService)) { + std::unique_ptr request = CreateResourceRequest( + params.get()); +- StoragePartitionImpl* storage_partition = ++ StoragePartition* storage_partition = + GetStoragePartition(browser_context_, params->render_process_host_id(), + params->render_frame_host_routing_id()); + BrowserThread::PostTaskAndReplyWithResult( + BrowserThread::IO, FROM_HERE, + base::BindOnce( + &BeginResourceDownload, std::move(params), std::move(request), +- storage_partition->url_loader_factory_getter(), ++ base::WrapRefCounted( ++ storage_partition->url_loader_factory_getter()), + base::WrapRefCounted(storage_partition->GetFileSystemContext()), + content::DownloadItem::kInvalidId, weak_factory_.GetWeakPtr()), + base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler, diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc -index 8a9139cc0c53..1feb90ab9d5e 100644 +index dadbbdcc8fc8..1fd206309eb8 100644 --- content/browser/loader/navigation_url_loader_network_service.cc +++ content/browser/loader/navigation_url_loader_network_service.cc -@@ -469,8 +469,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( +@@ -579,8 +579,8 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( DCHECK(!request_controller_); request_controller_ = base::MakeUnique( - std::move(new_request), resource_context, + std::move(initial_handlers), std::move(new_request), resource_context, - static_cast(storage_partition) - ->url_loader_factory_getter(), + scoped_refptr( @@ -138,7 +167,7 @@ index 8a9139cc0c53..1feb90ab9d5e 100644 BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc -index 7b72610e288a..6c95278110d6 100644 +index 337411c80e5a..7acc48a745a2 100644 --- content/browser/payments/payment_app_provider_impl.cc +++ content/browser/payments/payment_app_provider_impl.cc @@ -328,10 +328,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context, @@ -168,10 +197,10 @@ index 7b72610e288a..6c95278110d6 100644 partition->GetPaymentAppContext(); diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc -index 678135b37ee9..cdbdf8248453 100644 +index 44207cf02ab6..a59cd89a31f8 100644 --- content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc -@@ -489,9 +489,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver { +@@ -493,9 +493,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver { SpareRenderProcessHostManager() {} void WarmupSpareRenderProcessHost(BrowserContext* browser_context) { @@ -183,7 +212,7 @@ index 678135b37ee9..cdbdf8248453 100644 if (spare_render_process_host_ && matching_browser_context_ == browser_context && -@@ -630,11 +629,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data, +@@ -634,11 +633,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data, // Gets the correct render process to use for this SiteInstance. RenderProcessHost* GetProcessHost(SiteInstance* site_instance, bool is_for_guests_only) { @@ -199,7 +228,7 @@ index 678135b37ee9..cdbdf8248453 100644 // Is this the default storage partition? If it isn't, then just give it its // own non-shared process. -@@ -1199,7 +1197,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { +@@ -1206,7 +1204,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { // static RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( BrowserContext* browser_context, @@ -208,7 +237,7 @@ index 678135b37ee9..cdbdf8248453 100644 SiteInstance* site_instance, bool is_for_guests_only) { if (g_render_process_host_factory_) { -@@ -1208,8 +1206,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( +@@ -1215,8 +1213,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( } if (!storage_partition_impl) { @@ -219,7 +248,7 @@ index 678135b37ee9..cdbdf8248453 100644 } return new RenderProcessHostImpl(browser_context, storage_partition_impl, -@@ -1219,7 +1217,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( +@@ -1226,7 +1224,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( // static RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( BrowserContext* browser_context, @@ -228,7 +257,7 @@ index 678135b37ee9..cdbdf8248453 100644 SiteInstance* site_instance, bool is_for_guests_only) { RenderProcessHost* render_process_host = -@@ -1239,7 +1237,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( +@@ -1246,7 +1244,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( RenderProcessHostImpl::RenderProcessHostImpl( BrowserContext* browser_context, @@ -237,7 +266,7 @@ index 678135b37ee9..cdbdf8248453 100644 bool is_for_guests_only) : fast_shutdown_started_(false), deleting_soon_(false), -@@ -1275,7 +1273,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( +@@ -1282,7 +1280,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( indexed_db_factory_(new IndexedDBDispatcherHost( id_, storage_partition_impl_->GetURLRequestContext(), @@ -247,7 +276,7 @@ index 678135b37ee9..cdbdf8248453 100644 ChromeBlobStorageContext::GetFor(browser_context_))), channel_connected_(false), sent_render_process_ready_(false), -@@ -1309,7 +1308,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( +@@ -1316,7 +1315,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( } push_messaging_manager_.reset(new PushMessagingManager( @@ -256,17 +285,8 @@ index 678135b37ee9..cdbdf8248453 100644 + storage_partition_impl_->GetServiceWorkerContext()))); AddObserver(indexed_db_factory_.get()); - #if defined(OS_MACOSX) -@@ -1520,7 +1520,7 @@ bool RenderProcessHostImpl::Init() { - } - void RenderProcessHostImpl::EnableSendQueue() { -- if (!channel_) -+ if (!channel_ && browser_context_) - InitializeChannelProxy(); - } - -@@ -1617,6 +1617,22 @@ void RenderProcessHostImpl::ResetChannelProxy() { +@@ -1620,6 +1620,20 @@ void RenderProcessHostImpl::ResetChannelProxy() { void RenderProcessHostImpl::CreateMessageFilters() { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -276,8 +296,6 @@ index 678135b37ee9..cdbdf8248453 100644 + storage_partition_impl_->GetAppCacheService()); + auto dom_storage_context = static_cast( + storage_partition_impl_->GetDOMStorageContext()); -+ auto indexed_db_context = static_cast( -+ storage_partition_impl_->GetIndexedDBContext()); + auto cache_storage_context = static_cast( + storage_partition_impl_->GetCacheStorageContext()); + auto service_worker_context = static_cast( @@ -289,7 +307,7 @@ index 678135b37ee9..cdbdf8248453 100644 AddFilter(new ResourceSchedulerFilter(GetID())); MediaInternals* media_internals = MediaInternals::GetInstance(); // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages -@@ -1631,8 +1647,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1634,8 +1648,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { new RenderMessageFilter( GetID(), GetBrowserContext(), request_context.get(), widget_helper_.get(), media_internals, @@ -300,7 +318,7 @@ index 678135b37ee9..cdbdf8248453 100644 AddFilter(render_message_filter.get()); render_frame_message_filter_ = new RenderFrameMessageFilter( -@@ -1661,10 +1677,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1664,10 +1678,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { ChromeBlobStorageContext::GetFor(browser_context); resource_message_filter_ = new ResourceMessageFilter( @@ -313,7 +331,7 @@ index 678135b37ee9..cdbdf8248453 100644 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); AddFilter(resource_message_filter_.get()); -@@ -1691,10 +1707,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1694,10 +1708,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { AddFilter( new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service())); AddFilter(new AppCacheDispatcherHost( @@ -326,7 +344,7 @@ index 678135b37ee9..cdbdf8248453 100644 #if BUILDFLAG(ENABLE_WEBRTC) peer_connection_tracker_host_ = new PeerConnectionTrackerHost( -@@ -1731,13 +1747,12 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1731,13 +1745,12 @@ void RenderProcessHostImpl::CreateMessageFilters() { scoped_refptr cache_storage_filter = new CacheStorageDispatcherHost(); @@ -341,24 +359,8 @@ index 678135b37ee9..cdbdf8248453 100644 + service_worker_filter->Init(service_worker_context); AddFilter(service_worker_filter.get()); - AddFilter(new SharedWorkerMessageFilter( -@@ -1745,12 +1760,12 @@ void RenderProcessHostImpl::CreateMessageFilters() { - WorkerStoragePartition( - storage_partition_impl_->GetURLRequestContext(), - storage_partition_impl_->GetMediaURLRequestContext(), -- storage_partition_impl_->GetAppCacheService(), -+ app_cache_service, - storage_partition_impl_->GetQuotaManager(), - storage_partition_impl_->GetFileSystemContext(), - storage_partition_impl_->GetDatabaseTracker(), -- storage_partition_impl_->GetIndexedDBContext(), -- storage_partition_impl_->GetServiceWorkerContext()), -+ indexed_db_context, -+ service_worker_context), - base::Bind(&RenderWidgetHelper::GetNextRoutingID, - base::Unretained(widget_helper_.get())))); - -@@ -1766,11 +1781,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { + #if BUILDFLAG(ENABLE_WEBRTC) +@@ -1752,11 +1765,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { GetID(), storage_partition_impl_->GetQuotaManager(), GetContentClient()->browser()->CreateQuotaPermissionContext())); @@ -371,7 +373,7 @@ index 678135b37ee9..cdbdf8248453 100644 resource_context, service_worker_context, browser_context); AddFilter(notification_message_filter_.get()); -@@ -1786,6 +1798,11 @@ void RenderProcessHostImpl::CreateMessageFilters() { +@@ -1771,6 +1781,11 @@ void RenderProcessHostImpl::CreateMessageFilters() { void RenderProcessHostImpl::RegisterMojoInterfaces() { auto registry = base::MakeUnique(); @@ -383,7 +385,7 @@ index 678135b37ee9..cdbdf8248453 100644 channel_->AddAssociatedInterfaceForIOThread( base::Bind(&IndexedDBDispatcherHost::AddBinding, base::Unretained(indexed_db_factory_.get()))); -@@ -1836,8 +1853,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { +@@ -1825,8 +1840,7 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() { AddUIThreadInterface( registry.get(), base::Bind(&PlatformNotificationContextImpl::CreateService, @@ -393,14 +395,6 @@ index 678135b37ee9..cdbdf8248453 100644 GetID())); AddUIThreadInterface( registry.get(), -@@ -2088,6 +2104,7 @@ void RenderProcessHostImpl::DisableKeepAliveRefCount() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(!is_keep_alive_ref_count_disabled_); - is_keep_alive_ref_count_disabled_ = true; -+ browser_context_ = nullptr; - if (!keep_alive_ref_count_) - return; - keep_alive_ref_count_ = 0; diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h index dd7df59cb5c4..3c802e969d80 100644 --- content/browser/renderer_host/render_process_host_impl.h @@ -454,10 +448,10 @@ index dd7df59cb5c4..3c802e969d80 100644 // The observers watching our lifetime. base::ObserverList observers_; diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h -index b5902ac7f70f..8592375cc0d6 100644 +index 6e62286f3f09..11a3cd5f07cb 100644 --- content/browser/storage_partition_impl.h +++ content/browser/storage_partition_impl.h -@@ -114,30 +114,30 @@ class CONTENT_EXPORT StoragePartitionImpl +@@ -117,32 +117,31 @@ class CONTENT_EXPORT StoragePartitionImpl const base::Closure& callback) override; void Flush() override; void ClearBluetoothAllowedDevicesMapForTesting() override; @@ -492,14 +486,15 @@ index b5902ac7f70f..8592375cc0d6 100644 - BrowserContext* browser_context() const; + BrowserContext* browser_context() const override; - // Called by each renderer process once. - void Bind(int process_id, -- mojo::InterfaceRequest request); -+ mojo::InterfaceRequest request) -+ override; + // Called by each renderer process once. Returns the id of the created + // binding. + mojo::BindingId Bind( + int process_id, +- mojo::InterfaceRequest request); ++ mojo::InterfaceRequest request) override; + + auto& bindings_for_testing() { return bindings_; } - struct DataDeletionHelper; - struct QuotaManagedDataDeletionHelper; diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc index b23d083c7342..49d52038a049 100644 --- content/browser/streams/stream_context.cc @@ -529,7 +524,7 @@ index 075ae3e7431e..57fb5fd2c4a8 100644 void InitializeOnIOThread(); diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc -index 3c49b85b0474..d15896854e9e 100644 +index 579df51d8083..09298a8d042a 100644 --- content/browser/webui/web_ui_url_loader_factory.cc +++ content/browser/webui/web_ui_url_loader_factory.cc @@ -19,13 +19,13 @@ @@ -547,7 +542,7 @@ index 3c49b85b0474..d15896854e9e 100644 #include "content/public/browser/web_contents.h" #include "content/public/common/network_service.mojom.h" #include "content/public/common/url_constants.h" -@@ -208,8 +208,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory, +@@ -209,8 +209,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory, public: WebUIURLLoaderFactory(FrameTreeNode* ftn) : frame_tree_node_id_(ftn->frame_tree_node_id()), @@ -558,7 +553,7 @@ index 3c49b85b0474..d15896854e9e 100644 ftn->AddObserver(this); } -@@ -277,7 +277,7 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory, +@@ -278,7 +278,7 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory, private: int frame_tree_node_id_; @@ -568,10 +563,10 @@ index 3c49b85b0474..d15896854e9e 100644 DISALLOW_COPY_AND_ASSIGN(WebUIURLLoaderFactory); diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h -index 486eee89ef60..ee0aa05c2215 100644 +index eff149812e0e..d0484fa48674 100644 --- content/public/browser/browser_context.h +++ content/public/browser/browser_context.h -@@ -188,6 +188,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { +@@ -194,6 +194,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { BrowserContext(); @@ -580,7 +575,7 @@ index 486eee89ef60..ee0aa05c2215 100644 ~BrowserContext() override; // Shuts down the storage partitions associated to this browser context. -@@ -272,6 +274,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { +@@ -282,6 +284,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData { const base::FilePath& partition_path, bool in_memory) = 0; @@ -596,7 +591,7 @@ index 486eee89ef60..ee0aa05c2215 100644 std::map; diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h -index cf270b894186..1f95c9c3b023 100644 +index c3c1aa9d5351..08555f42ac39 100644 --- content/public/browser/storage_partition.h +++ content/public/browser/storage_partition.h @@ -13,6 +13,7 @@ @@ -628,8 +623,8 @@ index cf270b894186..1f95c9c3b023 100644 #if !defined(OS_ANDROID) class HostZoomLevelContext; -@@ -58,6 +67,11 @@ namespace mojom { - class NetworkContext; +@@ -59,6 +68,11 @@ class NetworkContext; + class URLLoaderFactory; } +namespace mojom { @@ -640,7 +635,7 @@ index cf270b894186..1f95c9c3b023 100644 // Defines what persistent state a child process can access. // // The StoragePartition defines the view each child process has of the -@@ -86,6 +100,13 @@ class CONTENT_EXPORT StoragePartition { +@@ -91,6 +105,13 @@ class CONTENT_EXPORT StoragePartition { virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0; #endif // !defined(OS_ANDROID) virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0; @@ -654,7 +649,7 @@ index cf270b894186..1f95c9c3b023 100644 enum : uint32_t { REMOVE_DATA_MASK_APPCACHE = 1 << 0, -@@ -191,6 +212,14 @@ class CONTENT_EXPORT StoragePartition { +@@ -196,6 +217,14 @@ class CONTENT_EXPORT StoragePartition { // Clear the bluetooth allowed devices map. For test use only. virtual void ClearBluetoothAllowedDevicesMapForTesting() = 0; @@ -662,7 +657,7 @@ index cf270b894186..1f95c9c3b023 100644 + virtual BrowserContext* browser_context() const = 0; + + // Called by each renderer process once. -+ virtual void Bind( ++ virtual mojo::BindingId Bind( + int process_id, + mojo::InterfaceRequest request) = 0; + diff --git a/patch/patches/views_1749_2102.patch b/patch/patches/views_1749_2102.patch index 49c451e1a..fde2a1c03 100644 --- a/patch/patches/views_1749_2102.patch +++ b/patch/patches/views_1749_2102.patch @@ -39,7 +39,7 @@ index 0755f2752f1d..0322b8c638e7 100644 virtual void MenuWillShow() {} diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc -index f8999eb9f61c..dff78c1ca921 100644 +index 43603c028e5e..a06aaf037153 100644 --- ui/gfx/render_text.cc +++ ui/gfx/render_text.cc @@ -495,6 +495,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) { @@ -57,7 +57,7 @@ index f8999eb9f61c..dff78c1ca921 100644 void RenderText::SetDisplayRect(const Rect& r) { if (r != display_rect_) { display_rect_ = r; -@@ -1395,6 +1403,19 @@ void RenderText::OnTextAttributeChanged() { +@@ -1433,6 +1441,19 @@ void RenderText::OnTextAttributeChanged() { if (!multiline_ && replace_newline_chars_with_symbols_) base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_); @@ -78,10 +78,10 @@ index f8999eb9f61c..dff78c1ca921 100644 } diff --git ui/gfx/render_text.h ui/gfx/render_text.h -index 024c73ed1ac3..29ad09f7c2f0 100644 +index fb9ab0f6cc85..17f182198b06 100644 --- ui/gfx/render_text.h +++ ui/gfx/render_text.h -@@ -276,6 +276,10 @@ class GFX_EXPORT RenderText { +@@ -280,6 +280,10 @@ class GFX_EXPORT RenderText { void SetElideBehavior(ElideBehavior elide_behavior); ElideBehavior elide_behavior() const { return elide_behavior_; } @@ -92,7 +92,7 @@ index 024c73ed1ac3..29ad09f7c2f0 100644 const Rect& display_rect() const { return display_rect_; } void SetDisplayRect(const Rect& r); -@@ -828,6 +832,8 @@ class GFX_EXPORT RenderText { +@@ -833,6 +837,8 @@ class GFX_EXPORT RenderText { // The ratio of strike-through line thickness to text height. SkScalar strike_thickness_factor_; @@ -211,10 +211,10 @@ index e38200b8a43a..f40b079f82ec 100644 // The time is used for simulating menu behavior for the menu button; that // is, if the menu is shown and the button is pressed, we need to close the diff --git ui/views/controls/label.cc ui/views/controls/label.cc -index 16aec515d729..a75ddb9802bb 100644 +index def97220e051..cbe1568cbda3 100644 --- ui/views/controls/label.cc +++ ui/views/controls/label.cc -@@ -26,6 +26,7 @@ +@@ -25,6 +25,7 @@ #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/insets.h" #include "ui/gfx/text_elider.h" @@ -222,7 +222,7 @@ index 16aec515d729..a75ddb9802bb 100644 #include "ui/native_theme/native_theme.h" #include "ui/strings/grit/ui_strings.h" #include "ui/views/background.h" -@@ -42,6 +43,20 @@ namespace { +@@ -41,6 +42,20 @@ namespace { gfx::Insets NonBorderInsets(const Label& label) { return label.GetInsets() - label.View::GetInsets(); } @@ -243,7 +243,7 @@ index 16aec515d729..a75ddb9802bb 100644 } // namespace const char Label::kViewClassName[] = "Label"; -@@ -227,6 +242,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { +@@ -226,6 +241,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { ResetLayout(); } @@ -259,7 +259,7 @@ index 16aec515d729..a75ddb9802bb 100644 void Label::SetTooltipText(const base::string16& tooltip_text) { DCHECK(handles_tooltips_); tooltip_text_ = tooltip_text; -@@ -454,7 +478,19 @@ std::unique_ptr Label::CreateRenderText( +@@ -453,7 +477,19 @@ std::unique_ptr Label::CreateRenderText( render_text->SetFontList(font_list()); render_text->set_shadows(shadows()); render_text->SetCursorEnabled(false); @@ -281,7 +281,7 @@ index 16aec515d729..a75ddb9802bb 100644 } diff --git ui/views/controls/label.h ui/views/controls/label.h -index 7cae587453c0..33d15cd4bc59 100644 +index ab6487ee6a60..0b105a658e8f 100644 --- ui/views/controls/label.h +++ ui/views/controls/label.h @@ -151,6 +151,10 @@ class VIEWS_EXPORT Label : public View, @@ -295,7 +295,7 @@ index 7cae587453c0..33d15cd4bc59 100644 // Sets the tooltip text. Default behavior for a label (single-line) is to // show the full text if it is wider than its bounds. Calling this overrides // the default behavior and lets you set a custom tooltip. To revert to -@@ -371,6 +375,7 @@ class VIEWS_EXPORT Label : public View, +@@ -372,6 +376,7 @@ class VIEWS_EXPORT Label : public View, bool collapse_when_hidden_; int fixed_width_; int max_width_; @@ -304,10 +304,10 @@ index 7cae587453c0..33d15cd4bc59 100644 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is // closed. diff --git ui/views/controls/menu/menu_controller.cc ui/views/controls/menu/menu_controller.cc -index 9c0a30130cdc..36f1e4db0ad0 100644 +index 2f78dfd30849..313a26e85e3b 100644 --- ui/views/controls/menu/menu_controller.cc +++ ui/views/controls/menu/menu_controller.cc -@@ -2267,8 +2267,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( +@@ -2262,8 +2262,13 @@ MenuItemView* MenuController::FindNextSelectableMenuItem( void MenuController::OpenSubmenuChangeSelectionIfCan() { MenuItemView* item = pending_state_.item; @@ -322,7 +322,7 @@ index 9c0a30130cdc..36f1e4db0ad0 100644 MenuItemView* to_select = NULL; if (item->GetSubmenu()->GetMenuItemCount() > 0) to_select = FindInitialSelectableMenuItem(item, INCREMENT_SELECTION_DOWN); -@@ -2283,8 +2288,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { +@@ -2278,8 +2283,10 @@ void MenuController::OpenSubmenuChangeSelectionIfCan() { void MenuController::CloseSubmenu() { MenuItemView* item = state_.item; DCHECK(item); @@ -382,10 +382,10 @@ index 4dea63f9f286..ef50b710c5af 100644 virtual int GetMaxWidthForMenu(MenuItemView* menu); diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc -index fcf1e9aa0b74..dd4f65849feb 100644 +index d90a8ec45fcf..0a7b0a9d2ea5 100644 --- ui/views/controls/menu/menu_item_view.cc +++ ui/views/controls/menu/menu_item_view.cc -@@ -810,7 +810,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { +@@ -811,7 +811,12 @@ void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) { // only need the background when we want it to look different, as when we're // selected. ui::NativeTheme* native_theme = GetNativeTheme(); @@ -399,7 +399,7 @@ index fcf1e9aa0b74..dd4f65849feb 100644 gfx::Rect item_bounds(0, 0, width(), height()); AdjustBoundsForRTLUI(&item_bounds); -@@ -899,6 +904,13 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas, SkColor color) { +@@ -900,6 +905,13 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas, SkColor color) { SkColor MenuItemView::GetTextColor(bool minor, bool render_selection, bool emphasized) const { @@ -552,7 +552,7 @@ index 534e0c4cb41d..974d82da99cb 100644 // Move the cursor because EnterNotify/LeaveNotify are generated with the // current mouse position as a result of XGrabPointer() diff --git ui/views/view.h ui/views/view.h -index 33f393275cbc..67cc5d64c58d 100644 +index bfacdb72edaa..b7684349c0cc 100644 --- ui/views/view.h +++ ui/views/view.h @@ -18,6 +18,7 @@ diff --git a/patch/patches/views_widget_180_1481_1565_1677_1749.patch b/patch/patches/views_widget_180_1481_1565_1677_1749.patch index 4fdfc191c..26bb44e2e 100644 --- a/patch/patches/views_widget_180_1481_1565_1677_1749.patch +++ b/patch/patches/views_widget_180_1481_1565_1677_1749.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc -index 69c338c37b5a..6301d3737b12 100644 +index 964578b4d170..6a3f3c347031 100644 --- content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc -@@ -298,6 +298,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched( +@@ -301,6 +301,14 @@ void RenderWidgetHostViewBase::FocusedNodeTouched( DVLOG(1) << "FocusedNodeTouched: " << editable; } @@ -18,10 +18,10 @@ index 69c338c37b5a..6301d3737b12 100644 return renderer_frame_number_; } diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h -index faec1e5bb3bc..4331d143c5c4 100644 +index 1764ea8c31cd..c772ae729d08 100644 --- content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h -@@ -74,6 +74,7 @@ class BrowserAccessibilityManager; +@@ -82,6 +82,7 @@ class BrowserAccessibilityManager; class CursorManager; class RenderWidgetHostImpl; class RenderWidgetHostViewBaseObserver; @@ -29,7 +29,7 @@ index faec1e5bb3bc..4331d143c5c4 100644 class SyntheticGestureTarget; class TextInputManager; class TouchSelectionControllerClientManager; -@@ -91,6 +92,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -99,6 +100,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, float current_device_scale_factor() const { return current_device_scale_factor_; } @@ -39,7 +39,7 @@ index faec1e5bb3bc..4331d143c5c4 100644 // Returns the focused RenderWidgetHost inside this |view|'s RWH. RenderWidgetHostImpl* GetFocusedWidget() const; -@@ -120,6 +124,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -128,6 +132,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, void EndFrameSubscription() override; void FocusedNodeTouched(const gfx::Point& location_dips_screen, bool editable) override; @@ -48,7 +48,7 @@ index faec1e5bb3bc..4331d143c5c4 100644 TouchSelectionControllerClientManager* GetTouchSelectionControllerClientManager() override; -@@ -366,6 +372,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -376,6 +382,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, // helps to position the full screen widget on the correct monitor. virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; @@ -61,7 +61,7 @@ index faec1e5bb3bc..4331d143c5c4 100644 // Sets the cursor for this view to the one associated with the specified // cursor_type. virtual void UpdateCursor(const WebCursor& cursor) = 0; -@@ -493,6 +505,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, +@@ -519,6 +531,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, WebContentsAccessibility* web_contents_accessibility_; @@ -70,8 +70,8 @@ index faec1e5bb3bc..4331d143c5c4 100644 + bool has_external_parent_; + private: - gfx::Rect current_display_area_; - + #if defined(USE_AURA) + void OnDidScheduleEmbed(int routing_id, diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc index 02614b2e7eff..38c207888aba 100644 --- content/browser/renderer_host/render_widget_host_view_event_handler.cc @@ -135,7 +135,7 @@ index f772f64d656e..7d13f9f81b6c 100644 return host ? host->GetAcceleratedWidget() : NULL; } diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index c332dc7e0a58..6be166492241 100644 +index 8e0c55fbba08..49e519244c97 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -84,6 +84,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -160,7 +160,7 @@ index c332dc7e0a58..6be166492241 100644 remove_standard_frame_ = params.remove_standard_frame; has_non_client_view_ = Widget::RequiresNonClientView(params.type); -@@ -825,11 +830,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { +@@ -829,11 +834,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { } void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { @@ -179,10 +179,10 @@ index c332dc7e0a58..6be166492241 100644 bool DesktopWindowTreeHostWin::HandleMouseEvent(const 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 4ee4bb30a122..5441d5e8a2a5 100644 +index db66147f0e9c..2b9bdfa2ec53 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.h -@@ -265,6 +265,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin +@@ -271,6 +271,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin // True if the window should have the frame removed. bool remove_standard_frame_; @@ -194,7 +194,7 @@ index 4ee4bb30a122..5441d5e8a2a5 100644 // a reference. corewm::TooltipWin* tooltip_; diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc -index fa2878ae0d1d..fde5a8e549be 100644 +index ebb251545434..14f1320470cd 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc @@ -152,6 +152,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -275,7 +275,7 @@ index fa2878ae0d1d..fde5a8e549be 100644 bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.height(), 0, // border width -@@ -2011,6 +2025,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( +@@ -2012,6 +2026,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( } break; } @@ -287,7 +287,7 @@ index fa2878ae0d1d..fde5a8e549be 100644 case FocusOut: OnFocusEvent(xev->type == FocusIn, event->xfocus.mode, diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h -index b72ec26d3ed6..263c233bf0f6 100644 +index a47b80fe8a82..624ac7764c83 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h @@ -86,6 +86,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -335,7 +335,7 @@ index b72ec26d3ed6..263c233bf0f6 100644 base::WeakPtrFactory weak_factory_; diff --git ui/views/widget/widget.cc ui/views/widget/widget.cc -index d37585c6fa39..d036db18c12d 100644 +index 8911591f9afa..a0103f5aeb99 100644 --- ui/views/widget/widget.cc +++ ui/views/widget/widget.cc @@ -130,6 +130,7 @@ Widget::InitParams::InitParams(Type type) @@ -369,7 +369,7 @@ index d37585c6fa39..d036db18c12d 100644 } // This must come after SetContentsView() or it might not be able to find // the correct NativeTheme (on Linux). See http://crbug.com/384492 -@@ -1094,10 +1100,16 @@ void Widget::OnNativeWidgetDestroyed() { +@@ -1096,10 +1102,16 @@ void Widget::OnNativeWidgetDestroyed() { } gfx::Size Widget::GetMinimumSize() const { @@ -387,7 +387,7 @@ index d37585c6fa39..d036db18c12d 100644 } diff --git ui/views/widget/widget.h ui/views/widget/widget.h -index 6590ea90b805..814bd617df3b 100644 +index 242c9496b29a..05a21aeb9035 100644 --- ui/views/widget/widget.h +++ ui/views/widget/widget.h @@ -254,6 +254,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, @@ -427,10 +427,10 @@ index 163e4b54b033..58f594db5019 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 4af7811d64d9..7f8f08900ac1 100644 +index 9776325defc8..f86f1409bdd2 100644 --- ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc -@@ -2659,8 +2659,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -2664,8 +2664,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, active_mouse_tracking_flags_ = 0; } else if (event.type() == ui::ET_MOUSEWHEEL) { // Reroute the mouse wheel to the window under the pointer if applicable. diff --git a/patch/patches/web_contents_1257_1565.patch b/patch/patches/web_contents_1257_1565.patch index dcbc1f33a..e2c731d44 100644 --- a/patch/patches/web_contents_1257_1565.patch +++ b/patch/patches/web_contents_1257_1565.patch @@ -1,8 +1,8 @@ diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc -index 5b54c7614dcb..89addf197fae 100644 +index 7297db47cf2d..d47c44680415 100644 --- content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc -@@ -1772,6 +1772,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1762,6 +1762,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { std::string unique_name; frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); @@ -15,7 +15,7 @@ index 5b54c7614dcb..89addf197fae 100644 WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -1782,6 +1788,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -1772,6 +1778,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -23,7 +23,7 @@ index 5b54c7614dcb..89addf197fae 100644 if (browser_plugin_guest_ && !GuestMode::IsCrossProcessFrameGuest(this)) { view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), -@@ -2343,6 +2350,15 @@ void WebContentsImpl::CreateNewWindow( +@@ -2340,6 +2347,15 @@ void WebContentsImpl::CreateNewWindow( create_params.renderer_initiated_creation = main_frame_route_id != MSG_ROUTING_NONE; @@ -39,7 +39,7 @@ index 5b54c7614dcb..89addf197fae 100644 WebContentsImpl* new_contents = NULL; if (!is_guest) { create_params.context = view_->GetNativeView(); -@@ -2372,7 +2388,7 @@ void WebContentsImpl::CreateNewWindow( +@@ -2369,7 +2385,7 @@ void WebContentsImpl::CreateNewWindow( // TODO(brettw): It seems bogus that we have to call this function on the // newly created object and give it one of its own member variables. new_view->CreateViewForWidget( @@ -48,7 +48,7 @@ index 5b54c7614dcb..89addf197fae 100644 } // Save the created window associated with the route so we can show it // later. -@@ -5534,7 +5550,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { +@@ -5507,7 +5523,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager( RenderViewHost* render_view_host) { RenderWidgetHostViewBase* rwh_view = @@ -73,12 +73,12 @@ index fa0afb545df9..d677b310e5ec 100644 WebContents::CreateParams::CreateParams(const CreateParams& other) = default; diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h -index ddaf664254ab..ffec3b79332e 100644 +index 453942537f6c..be871fbb677b 100644 --- content/public/browser/web_contents.h +++ content/public/browser/web_contents.h -@@ -68,9 +68,11 @@ class PageState; +@@ -68,9 +68,11 @@ class InterstitialPage; + class PageState; class RenderFrameHost; - class RenderProcessHost; class RenderViewHost; +class RenderViewHostDelegateView; class RenderWidgetHost; @@ -88,7 +88,7 @@ index ddaf664254ab..ffec3b79332e 100644 struct CustomContextMenuContext; struct DropData; struct Manifest; -@@ -171,6 +173,10 @@ class WebContents : public PageNavigator, +@@ -170,6 +172,10 @@ class WebContents : public PageNavigator, // Note that the pre-created renderer process may not be used if the first // navigation requires a dedicated or privileged process, such as a WebUI. bool initialize_renderer; @@ -100,10 +100,10 @@ index ddaf664254ab..ffec3b79332e 100644 // Creates a new WebContents. diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h -index 8b548ba29917..dd9bff8f3939 100644 +index 3f31a372ecbb..0958fe90bb31 100644 --- content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h -@@ -43,11 +43,13 @@ class ColorChooser; +@@ -44,11 +44,13 @@ class ColorChooser; class JavaScriptDialogManager; class PageState; class RenderFrameHost; @@ -117,7 +117,7 @@ index 8b548ba29917..dd9bff8f3939 100644 struct ColorSuggestion; struct ContextMenuParams; struct DropData; -@@ -320,6 +322,14 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -318,6 +320,14 @@ class CONTENT_EXPORT WebContentsDelegate { const std::string& partition_id, SessionStorageNamespace* session_storage_namespace); diff --git a/patch/patches/webkit_plugin_info_2015.patch b/patch/patches/webkit_plugin_info_2015.patch index 1a1f7b28b..4f05469a1 100644 --- a/patch/patches/webkit_plugin_info_2015.patch +++ b/patch/patches/webkit_plugin_info_2015.patch @@ -1,14 +1,14 @@ diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp -index 9a7f30516021..22f1214abbe2 100644 +index b26a7d6b8413..476b5c138555 100644 --- third_party/WebKit/Source/core/dom/DOMImplementation.cpp +++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp @@ -242,10 +242,11 @@ Document* DOMImplementation::createDocument(const String& type, // For that reason, the origin must be retrieved directly from init.url(). if (init.GetFrame()->IsMainFrame()) { RefPtr origin = SecurityOrigin::Create(init.Url()); -- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.Get()); +- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.get()); + plugin_data = init.GetFrame()->GetPage()->GetPluginData(true, -+ origin.Get()); ++ origin.get()); } else { plugin_data = - init.GetFrame()->GetPage()->GetPluginData(init.GetFrame() @@ -17,10 +17,10 @@ index 9a7f30516021..22f1214abbe2 100644 .Top() .GetSecurityContext() diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp -index a06acdcd51ff..90ba2c860542 100644 +index bf29beabedf7..e45901940d91 100644 --- third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ third_party/WebKit/Source/core/frame/LocalFrame.cpp -@@ -1016,7 +1016,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() { +@@ -1026,7 +1026,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() { PluginData* LocalFrame::GetPluginData() const { if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) return nullptr; @@ -30,7 +30,7 @@ index a06acdcd51ff..90ba2c860542 100644 } diff --git third_party/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp -index bdc85924f2b3..8105be8f4e5d 100644 +index 769fb58698a4..5372984b342a 100644 --- third_party/WebKit/Source/core/page/Page.cpp +++ third_party/WebKit/Source/core/page/Page.cpp @@ -126,7 +126,8 @@ Page::Page(PageClients& page_clients) @@ -152,23 +152,23 @@ index 5eb6af5fbdd5..eac85461c7de 100644 for (PluginInfo* plugin_info : plugins_) { for (MimeClassInfo* mime_class_info : plugin_info->mimes_) diff --git third_party/WebKit/Source/platform/plugins/PluginData.h third_party/WebKit/Source/platform/plugins/PluginData.h -index 6cb520cd5810..fdcaf938b28a 100644 +index 14a944467373..f4333c6a5f09 100644 --- third_party/WebKit/Source/platform/plugins/PluginData.h +++ third_party/WebKit/Source/platform/plugins/PluginData.h -@@ -93,7 +93,7 @@ class PLATFORM_EXPORT PluginData final +@@ -94,7 +94,7 @@ class PLATFORM_EXPORT PluginData final const HeapVector>& Plugins() const { return plugins_; } const HeapVector>& Mimes() const { return mimes_; } - const SecurityOrigin* Origin() const { return main_frame_origin_.Get(); } + const SecurityOrigin* Origin() const { return main_frame_origin_.get(); } - void UpdatePluginList(SecurityOrigin* main_frame_origin); + void UpdatePluginList(bool is_main_frame, SecurityOrigin* main_frame_origin); void ResetPluginData(); bool SupportsMimeType(const String& mime_type) const; diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h -index de906059109c..baaeb09ec8f5 100644 +index 379b033facc4..fcea4c7171b7 100644 --- third_party/WebKit/public/platform/Platform.h +++ third_party/WebKit/public/platform/Platform.h -@@ -384,6 +384,7 @@ class BLINK_PLATFORM_EXPORT Platform { +@@ -369,6 +369,7 @@ class BLINK_PLATFORM_EXPORT Platform { // satisfy this call. mainFrameOrigin is used by the browser process to // filter plugins from the plugin list based on content settings. virtual void GetPluginList(bool refresh, diff --git a/patch/patches/webkit_popups.patch b/patch/patches/webkit_popups.patch index 0eb34bd87..5c32e5b47 100644 --- a/patch/patches/webkit_popups.patch +++ b/patch/patches/webkit_popups.patch @@ -1,8 +1,8 @@ diff --git third_party/WebKit/Source/core/exported/WebViewImpl.cpp third_party/WebKit/Source/core/exported/WebViewImpl.cpp -index 827581a9cb57..318e5181545a 100644 +index 1cc7c6eb7182..67129b9719b5 100644 --- third_party/WebKit/Source/core/exported/WebViewImpl.cpp +++ third_party/WebKit/Source/core/exported/WebViewImpl.cpp -@@ -247,8 +247,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { +@@ -249,8 +249,13 @@ void WebView::SetUseExternalPopupMenus(bool use_external_popup_menus) { g_should_use_external_popup_menus = use_external_popup_menus; } @@ -18,7 +18,7 @@ index 827581a9cb57..318e5181545a 100644 } namespace { -@@ -342,6 +347,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, +@@ -346,6 +351,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, enable_fake_page_scale_animation_for_testing_(false), fake_page_scale_animation_page_scale_factor_(0), fake_page_scale_animation_use_anchor_(false), @@ -27,7 +27,7 @@ index 827581a9cb57..318e5181545a 100644 suppress_next_keypress_event_(false), ime_accept_events_(true), diff --git third_party/WebKit/Source/core/exported/WebViewImpl.h third_party/WebKit/Source/core/exported/WebViewImpl.h -index 7ea90b01b4c6..30e54df93efc 100644 +index 820c1d2a8500..653c868a8444 100644 --- third_party/WebKit/Source/core/exported/WebViewImpl.h +++ third_party/WebKit/Source/core/exported/WebViewImpl.h @@ -108,7 +108,8 @@ class CORE_EXPORT WebViewImpl final @@ -40,7 +40,7 @@ index 7ea90b01b4c6..30e54df93efc 100644 // WebWidget methods: void Close() override; -@@ -615,6 +616,8 @@ class CORE_EXPORT WebViewImpl final +@@ -613,6 +614,8 @@ class CORE_EXPORT WebViewImpl final float fake_page_scale_animation_page_scale_factor_; bool fake_page_scale_animation_use_anchor_; @@ -50,10 +50,10 @@ index 7ea90b01b4c6..30e54df93efc 100644 TransformationMatrix device_emulation_transform_; diff --git third_party/WebKit/Source/core/page/ChromeClientImpl.cpp third_party/WebKit/Source/core/page/ChromeClientImpl.cpp -index 581b6b5b9538..14aec97bd676 100644 +index a68ce2c67710..c85fd4cdfa43 100644 --- third_party/WebKit/Source/core/page/ChromeClientImpl.cpp +++ third_party/WebKit/Source/core/page/ChromeClientImpl.cpp -@@ -776,7 +776,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, +@@ -774,7 +774,7 @@ PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame, return nullptr; NotifyPopupOpeningObservers(); @@ -63,10 +63,10 @@ index 581b6b5b9538..14aec97bd676 100644 DCHECK(RuntimeEnabledFeatures::PagePopupEnabled()); diff --git third_party/WebKit/public/web/WebView.h third_party/WebKit/public/web/WebView.h -index 729c1ceabb91..a11ad9e6c86e 100644 +index 03bfa9b85e7e..6f970fe0802e 100644 --- third_party/WebKit/public/web/WebView.h +++ third_party/WebKit/public/web/WebView.h -@@ -374,6 +374,7 @@ class WebView : protected WebWidget { +@@ -367,6 +367,7 @@ class WebView : protected WebWidget { // Sets whether select popup menus should be rendered by the browser. BLINK_EXPORT static void SetUseExternalPopupMenus(bool); diff --git a/patch/patches/webui_2037.patch b/patch/patches/webui_2037.patch index 5430343f5..a6dbd71f8 100644 --- a/patch/patches/webui_2037.patch +++ b/patch/patches/webui_2037.patch @@ -1,8 +1,8 @@ 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 0442d4d191a5..9b2d2e572f1f 100644 +index 6b81e1e0f6c5..7509c2b18b47 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 -@@ -163,6 +163,10 @@ void ChromeInternalLogSource::Fetch(const SysLogsSourceCallback& callback) { +@@ -164,6 +164,10 @@ void ChromeInternalLogSource::Fetch(const SysLogsSourceCallback& callback) { } void ChromeInternalLogSource::PopulateSyncLogs(SystemLogsResponse* response) { @@ -14,7 +14,7 @@ index 0442d4d191a5..9b2d2e572f1f 100644 Profile* profile = ProfileManager::GetPrimaryUserProfile(); if (!profile || diff --git chrome/browser/ui/webui/net_internals/net_internals_ui.cc chrome/browser/ui/webui/net_internals/net_internals_ui.cc -index 1c3b918736f5..a408d04f550a 100644 +index 442ee5b2a91f..23c3feb4dea3 100644 --- chrome/browser/ui/webui/net_internals/net_internals_ui.cc +++ chrome/browser/ui/webui/net_internals/net_internals_ui.cc @@ -515,41 +515,31 @@ void NetInternalsMessageHandler::OnClearBrowserCache( @@ -124,10 +124,10 @@ index 903cc543a242..5bd30ae82974 100644 CONTENT_EXPORT void InitializeResourceContext(BrowserContext* browser_context); diff --git content/browser/webui/url_data_manager.cc content/browser/webui/url_data_manager.cc -index 5681ff549fd4..7d96c24fab2f 100644 +index f45d227fe94a..32e37bd0a79e 100644 --- content/browser/webui/url_data_manager.cc +++ content/browser/webui/url_data_manager.cc -@@ -152,6 +152,11 @@ void URLDataManager::UpdateWebUIDataSource( +@@ -150,6 +150,11 @@ void URLDataManager::UpdateWebUIDataSource( ->UpdateWebUIDataSource(source_name, std::move(update)); } diff --git a/patch/patches/webview_plugin_2020.patch b/patch/patches/webview_plugin_2020.patch index 5426e16bb..4dcb839e8 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 97b732500593..899c6a710344 100644 +index acf5d47d03b2..1d126bb79633 100644 --- chrome/app/generated_resources.grd +++ chrome/app/generated_resources.grd -@@ -5060,7 +5060,7 @@ Keep your key file in a safe place. You will need it to create new versions of y +@@ -4807,7 +4807,7 @@ Keep your key file in a safe place. You will need it to create new versions of y diff --git a/patch/patches/win_rt_2274.patch b/patch/patches/win_rt_2274.patch index 0bcb71c31..4a504d914 100644 --- a/patch/patches/win_rt_2274.patch +++ b/patch/patches/win_rt_2274.patch @@ -1,8 +1,8 @@ diff --git content/common/sandbox_win.cc content/common/sandbox_win.cc -index a98c8bd7646b..7c100ff20d34 100644 +index 3c8150376bbe..5d505838ec1d 100644 --- content/common/sandbox_win.cc +++ content/common/sandbox_win.cc -@@ -782,8 +782,11 @@ sandbox::ResultCode StartSandboxedProcess( +@@ -783,8 +783,11 @@ sandbox::ResultCode StartSandboxedProcess( #endif // Post-startup mitigations.