diff --git a/BUILD.gn b/BUILD.gn index 49083cd6e..30d84d053 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -772,9 +772,9 @@ static_library("libcef_static") { "//components/printing/common", "//components/printing/renderer", "//components/proxy_config", - "//components/safe_browsing/db:test_database_manager", - "//components/services/pdf_compositor/public/cpp", - "//components/services/pdf_compositor/public/mojom", + "//components/safe_browsing/core/db:test_database_manager", + "//components/services/print_compositor/public/cpp", + "//components/services/print_compositor/public/mojom", "//components/tracing", "//components/update_client", "//components/url_formatter", @@ -1377,13 +1377,16 @@ repack("pak") { # Add associated .h files in the make_pack_header("resources") target. sources = [ "$root_gen_dir/chrome/browser_resources.pak", + "$root_gen_dir/chrome/dev_ui_browser_resources.pak", "$root_gen_dir/chrome/net_internals_resources.pak", "$root_gen_dir/chrome/print_preview_resources.pak", "$root_gen_dir/chrome/common_resources.pak", "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/dev_ui_components_resources.pak", "$root_gen_dir/cef/cef_resources.pak", "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", "$root_gen_dir/net/net_resources.pak", "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak", ] @@ -1392,14 +1395,17 @@ repack("pak") { # the libcef_static target. Grit deps that generate .cc files must be # listed both here and in the libcef_static target. public_deps = [ + "//chrome/browser:dev_ui_browser_resources", "//chrome/browser:resources", "//chrome/browser/resources/net_internals:net_internals_resources", "//chrome/browser/resources:print_preview_resources", "//chrome/common:resources", "//components/resources:components_resources", + "//components/resources:dev_ui_components_resources", ":cef_resources", "//content/browser/tracing:resources", - "//content:resources", + "//content:content_resources", + "//content:dev_ui_content_resources", "//net:net_resources", "//third_party/blink/public:resources", ] @@ -1442,12 +1448,15 @@ make_pack_header("resources") { "$root_gen_dir/chrome/grit/browser_resources.h", "$root_gen_dir/chrome/grit/common_resources.h", "$root_gen_dir/chrome/grit/component_extension_resources.h", + "$root_gen_dir/chrome/grit/dev_ui_browser_resources.h", "$root_gen_dir/chrome/grit/net_internals_resources.h", "$root_gen_dir/chrome/grit/renderer_resources.h", "$root_gen_dir/components/grit/components_resources.h", + "$root_gen_dir/components/grit/dev_ui_components_resources.h", "$root_gen_dir/content/browser/devtools/grit/devtools_resources.h", "$root_gen_dir/content/browser/tracing/grit/tracing_resources.h", "$root_gen_dir/content/grit/content_resources.h", + "$root_gen_dir/content/grit/dev_ui_content_resources.h", "$root_gen_dir/extensions/grit/extensions_browser_resources.h", "$root_gen_dir/extensions/grit/extensions_renderer_resources.h", "$root_gen_dir/extensions/grit/extensions_resources.h", diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 77fef47fa..804dbfbe7 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -7,5 +7,5 @@ # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding { - 'chromium_checkout': 'refs/tags/80.0.3987.0' + 'chromium_checkout': 'refs/tags/81.0.4044.0' } diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h index 5115cffce..48377384a 100644 --- a/include/internal/cef_types.h +++ b/include/internal/cef_types.h @@ -2926,6 +2926,16 @@ typedef enum { CEF_CDM_REGISTRATION_ERROR_NOT_SUPPORTED, } cef_cdm_registration_error_t; +/// +// Composition underline style. +/// +typedef enum { + CEF_CUS_SOLID, + CEF_CUS_DOT, + CEF_CUS_DASH, + CEF_CUS_NONE, +} cef_composition_underline_style_t; + /// // Structure representing IME composition underline information. This is a thin // wrapper around Blink's WebCompositionUnderline class and should be kept in @@ -2951,6 +2961,11 @@ typedef struct _cef_composition_underline_t { // Set to true (1) for thick underline. /// int thick; + + /// + // Style. + /// + cef_composition_underline_style_t style; } cef_composition_underline_t; #ifdef __cplusplus diff --git a/include/internal/cef_types_wrappers.h b/include/internal/cef_types_wrappers.h index e616b52c2..41e79488b 100644 --- a/include/internal/cef_types_wrappers.h +++ b/include/internal/cef_types_wrappers.h @@ -866,10 +866,7 @@ struct CefCursorInfoTraits { static inline void set(const struct_type* src, struct_type* target, bool copy) { - target->hotspot = src->hotspot; - target->image_scale_factor = src->image_scale_factor; - target->buffer = src->buffer; - target->size = src->size; + *target = *src; } }; @@ -942,23 +939,14 @@ typedef CefStructBase CefBoxLayoutSettings; struct CefCompositionUnderlineTraits { typedef cef_composition_underline_t struct_type; - static inline void init(struct_type* s) { - s->range.from = 0; - s->range.to = 0; - s->color = 0; - s->background_color = 0; - s->thick = 0; - } + static inline void init(struct_type* s) {} static inline void clear(struct_type* s) {} static inline void set(const struct_type* src, struct_type* target, bool copy) { - target->range = src->range; - target->color = src->color; - target->background_color = src->background_color; - target->thick = src->thick; + *target = *src; } }; diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 28f5a1bb6..b028e5d10 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -1708,9 +1708,9 @@ void CefBrowserHostImpl::OnSetFocus(cef_focus_source_t source) { void CefBrowserHostImpl::RunFileChooser( const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback) { + CefFileDialogRunner::RunFileChooserCallback callback) { EnsureFileDialogManager(); - file_dialog_manager_->RunFileChooser(params, callback); + file_dialog_manager_->RunFileChooser(params, std::move(callback)); } bool CefBrowserHostImpl::EmbedsFullscreenWidget() { @@ -2467,9 +2467,9 @@ bool CefBrowserHostImpl::CheckMediaAccessPermission( return command_line->HasSwitch(switches::kEnableMediaStream); } -bool CefBrowserHostImpl::IsNeverVisible(content::WebContents* web_contents) { +bool CefBrowserHostImpl::IsNeverComposited(content::WebContents* web_contents) { if (extension_host_) - return extension_host_->IsNeverVisible(web_contents); + return extension_host_->IsNeverComposited(web_contents); return false; } @@ -2651,8 +2651,7 @@ void CefBrowserHostImpl::DocumentAvailableInMainFrame() { void CefBrowserHostImpl::DidFailLoad( content::RenderFrameHost* render_frame_host, const GURL& validated_url, - int error_code, - const base::string16& error_description) { + int error_code) { // The navigation failed after commit. OnLoadStart was called so we also call // OnLoadEnd. auto frame = browser_info_->GetFrameForHost(render_frame_host); diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index 5b30b9e96..dbc4cfc18 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -351,9 +351,8 @@ class CefBrowserHostImpl : public CefBrowserHost, // Run the file chooser dialog specified by |params|. Only a single dialog may // be pending at any given time. |callback| will be executed asynchronously // after the dialog is dismissed or if another dialog is already pending. - void RunFileChooser( - const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback); + void RunFileChooser(const CefFileDialogRunner::FileChooserParams& params, + CefFileDialogRunner::RunFileChooserCallback callback); bool HandleContextMenu(content::WebContents* web_contents, const content::ContextMenuParams& params); @@ -458,7 +457,7 @@ class CefBrowserHostImpl : public CefBrowserHost, bool CheckMediaAccessPermission(content::RenderFrameHost* render_frame_host, const GURL& security_origin, blink::mojom::MediaStreamType type) override; - bool IsNeverVisible(content::WebContents* web_contents) override; + bool IsNeverComposited(content::WebContents* web_contents) override; content::PictureInPictureResult EnterPictureInPicture( content::WebContents* web_contents, const viz::SurfaceId& surface_id, @@ -481,8 +480,7 @@ class CefBrowserHostImpl : public CefBrowserHost, void DocumentAvailableInMainFrame() override; void DidFailLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url, - int error_code, - const base::string16& error_description) override; + int error_code) override; void TitleWasSet(content::NavigationEntry* entry) override; void PluginCrashed(const base::FilePath& plugin_path, base::ProcessId plugin_pid) override; diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index 1a5b31ed9..59ff5fed2 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -50,6 +50,7 @@ #include "ui/wm/core/wm_state.h" #if defined(OS_WIN) +#include "components/os_crypt/os_crypt.h" #include "ui/base/cursor/cursor_loader_win.h" #endif #endif // defined(USE_AURA) @@ -71,11 +72,6 @@ #include "libcef/browser/printing/print_dialog_linux.h" #endif -#if defined(OS_MACOSX) || defined(OS_WIN) -#include "chrome/browser/browser_process.h" -#include "components/os_crypt/os_crypt.h" -#endif - CefBrowserMainParts::CefBrowserMainParts( const content::MainFunctionParams& parameters) : BrowserMainParts(), devtools_delegate_(nullptr) {} @@ -122,11 +118,12 @@ void CefBrowserMainParts::PreMainMessageLoopStart() { ui::TouchFactory::SetTouchDeviceListFromCommandLine(); #endif -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_WIN) // Initialize the OSCrypt. PrefService* local_state = g_browser_process->local_state(); DCHECK(local_state); - OSCrypt::Init(local_state); + bool os_crypt_init = OSCrypt::Init(local_state); + DCHECK(os_crypt_init); #endif } diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 27c92e6e7..9b5ec3e2d 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -136,7 +136,6 @@ #if defined(OS_MACOSX) #include "net/ssl/client_cert_store_mac.h" -#include "services/audio/public/mojom/constants.mojom.h" #include "services/video_capture/public/mojom/constants.mojom.h" #endif @@ -157,18 +156,19 @@ namespace { class CefQuotaCallbackImpl : public CefRequestCallback { public: - explicit CefQuotaCallbackImpl( - const content::QuotaPermissionContext::PermissionCallback& callback) - : callback_(callback) {} + using CallbackType = content::QuotaPermissionContext::PermissionCallback; + + explicit CefQuotaCallbackImpl(CallbackType callback) + : callback_(std::move(callback)) {} ~CefQuotaCallbackImpl() { if (!callback_.is_null()) { // The callback is still pending. Cancel it now. if (CEF_CURRENTLY_ON_IOT()) { - RunNow(callback_, false); + RunNow(std::move(callback_), false); } else { - CEF_POST_TASK(CEF_IOT, base::Bind(&CefQuotaCallbackImpl::RunNow, - callback_, false)); + CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::RunNow, + std::move(callback_), false)); } } } @@ -176,31 +176,28 @@ class CefQuotaCallbackImpl : public CefRequestCallback { void Continue(bool allow) override { if (CEF_CURRENTLY_ON_IOT()) { if (!callback_.is_null()) { - RunNow(callback_, allow); - callback_.Reset(); + RunNow(std::move(callback_), allow); } } else { - CEF_POST_TASK(CEF_IOT, - base::Bind(&CefQuotaCallbackImpl::Continue, this, allow)); + CEF_POST_TASK(CEF_IOT, base::BindOnce(&CefQuotaCallbackImpl::Continue, + this, allow)); } } void Cancel() override { Continue(false); } - void Disconnect() { callback_.Reset(); } + CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); } private: - static void RunNow( - const content::QuotaPermissionContext::PermissionCallback& callback, - bool allow) { + static void RunNow(CallbackType callback, bool allow) { CEF_REQUIRE_IOT(); - callback.Run( + std::move(callback).Run( allow ? content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW : content::QuotaPermissionContext:: QUOTA_PERMISSION_RESPONSE_DISALLOW); } - content::QuotaPermissionContext::PermissionCallback callback_; + CallbackType callback_; IMPLEMENT_REFCOUNTING(CefQuotaCallbackImpl); DISALLOW_COPY_AND_ASSIGN(CefQuotaCallbackImpl); @@ -282,9 +279,10 @@ class CefSelectClientCertificateCallbackImpl if (CEF_CURRENTLY_ON_UIT()) { RunNow(std::move(delegate_), cert); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&CefSelectClientCertificateCallbackImpl::RunNow, - base::Passed(std::move(delegate_)), cert)); + CEF_POST_TASK( + CEF_UIT, + base::BindOnce(&CefSelectClientCertificateCallbackImpl::RunNow, + std::move(delegate_), cert)); } } @@ -296,9 +294,9 @@ class CefSelectClientCertificateCallbackImpl if (cert) { CefX509CertificateImpl* certImpl = static_cast(cert.get()); - certImpl->AcquirePrivateKey( - base::Bind(&CefSelectClientCertificateCallbackImpl::RunWithPrivateKey, - base::Passed(std::move(delegate)), cert)); + certImpl->AcquirePrivateKey(base::BindOnce( + &CefSelectClientCertificateCallbackImpl::RunWithPrivateKey, + std::move(delegate), cert)); return; } @@ -334,11 +332,11 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext { // The callback will be dispatched on the IO thread. void RequestQuotaPermission(const content::StorageQuotaParams& params, int render_process_id, - const PermissionCallback& callback) override { + PermissionCallback callback) override { if (params.storage_type != blink::mojom::StorageType::kPersistent) { // To match Chrome behavior we only support requesting quota with this // interface for Persistent storage type. - callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); + std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); return; } @@ -353,19 +351,22 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext { CefRefPtr handler = client->GetRequestHandler(); if (handler.get()) { CefRefPtr callbackImpl( - new CefQuotaCallbackImpl(callback)); + new CefQuotaCallbackImpl(std::move(callback))); handled = handler->OnQuotaRequest( browser.get(), params.origin_url.spec(), params.requested_size, callbackImpl.get()); - if (!handled) - callbackImpl->Disconnect(); + if (!handled) { + // May return nullptr if the client has already executed the + // callback. + callback = callbackImpl->Disconnect(); + } } } } - if (!handled) { + if (!handled && !callback.is_null()) { // Disallow the request by default. - callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); + std::move(callback).Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); } } @@ -843,18 +844,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches( } } -void CefContentBrowserClient::AdjustUtilityServiceProcessCommandLine( - const service_manager::Identity& identity, - base::CommandLine* command_line) { -#if defined(OS_MACOSX) - // On Mac, the video-capture and audio services require a CFRunLoop, provided - // by a UI message loop, to run AVFoundation and CoreAudio code. - // See https://crbug.com/834581 - if (identity.name() == audio::mojom::kServiceName) - command_line->AppendSwitch(switches::kMessageLoopTypeUi); -#endif -} - std::string CefContentBrowserClient::GetApplicationLocale() { return g_browser_process->GetApplicationLocale(); } @@ -884,16 +873,6 @@ CefContentBrowserClient::CreateQuotaPermissionContext() { return new CefQuotaPermissionContext(); } -void CefContentBrowserClient::GetQuotaSettings( - content::BrowserContext* context, - content::StoragePartition* partition, - base::OnceCallback)> callback) { - const base::FilePath& cache_path = partition->GetPath(); - storage::GetNominalDynamicSettings( - cache_path, cache_path.empty() /* is_incognito */, - storage::GetDefaultDeviceInfoHelper(), std::move(callback)); -} - content::MediaObserver* CefContentBrowserClient::GetMediaObserver() { return CefMediaCaptureDevicesDispatcher::GetInstance(); } @@ -1274,6 +1253,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory( mojo::PendingRemote* header_client, bool* bypass_redirect_checks, + bool* disable_secure_dns, network::mojom::URLLoaderFactoryOverridePtr* factory_override) { auto request_handler = net_service::CreateInterceptedRequestHandler( browser_context, frame, render_process_id, diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 72833cb8f..7b639a00d 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -63,20 +63,12 @@ class CefContentBrowserClient : public content::ContentBrowserClient { base::StringPiece name) override; void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) override; - void AdjustUtilityServiceProcessCommandLine( - const service_manager::Identity& identity, - base::CommandLine* command_line) override; std::string GetApplicationLocale() override; scoped_refptr GetSystemSharedURLLoaderFactory() override; network::mojom::NetworkContext* GetSystemNetworkContext() override; scoped_refptr CreateQuotaPermissionContext() override; - void GetQuotaSettings( - content::BrowserContext* context, - content::StoragePartition* partition, - base::OnceCallback)> callback) - override; content::MediaObserver* GetMediaObserver() override; content::SpeechRecognitionManagerDelegate* CreateSpeechRecognitionManagerDelegate() override; @@ -172,6 +164,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient { mojo::PendingRemote* header_client, bool* bypass_redirect_checks, + bool* disable_secure_dns, network::mojom::URLLoaderFactoryOverridePtr* factory_override) override; void OnNetworkServiceCreated( network::mojom::NetworkService* network_service) override; diff --git a/libcef/browser/devtools/devtools_frontend.cc b/libcef/browser/devtools/devtools_frontend.cc index af252f13a..d05e559aa 100644 --- a/libcef/browser/devtools/devtools_frontend.cc +++ b/libcef/browser/devtools/devtools_frontend.cc @@ -45,7 +45,6 @@ #include "net/base/net_errors.h" #include "net/http/http_response_headers.h" #include "net/traffic_annotation/network_traffic_annotation.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" #include "services/network/public/mojom/url_response_head.mojom.h" @@ -59,9 +58,20 @@ static std::string GetFrontendURL() { } std::unique_ptr BuildObjectForResponse( - const net::HttpResponseHeaders* rh) { + const net::HttpResponseHeaders* rh, + bool success, + int net_error) { auto response = std::make_unique(); - response->SetInteger("statusCode", rh ? rh->response_code() : 200); + int responseCode = 200; + if (rh) { + responseCode = rh->response_code(); + } else if (!success) { + // In case of no headers, assume file:// URL and failed to load + responseCode = 404; + } + response->SetInteger("statusCode", responseCode); + response->SetInteger("netError", net_error); + response->SetString("netErrorName", net::ErrorToString(net_error)); auto headers = std::make_unique(); size_t iterator = 0; @@ -122,7 +132,8 @@ class CefDevToolsFrontend::NetworkResourceLoader } void OnComplete(bool success) override { - auto response = BuildObjectForResponse(response_headers_.get()); + auto response = BuildObjectForResponse(response_headers_.get(), success, + loader_->NetError()); bindings_->SendMessageAck(request_id_, response.get()); bindings_->loaders_.erase(bindings_->loaders_.find(this)); @@ -289,7 +300,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( std::string protocol_message; if (!agent_host_ || !params->GetString(0, &protocol_message)) return; - agent_host_->DispatchProtocolMessage(this, protocol_message); + agent_host_->DispatchProtocolMessage( + this, base::as_bytes(base::make_span(protocol_message))); } else if (method == "loadCompleted") { web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"), @@ -308,6 +320,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( if (!gurl.is_valid()) { base::DictionaryValue response; response.SetInteger("statusCode", 404); + response.SetBoolean("urlValid", false); SendMessageAck(request_id, &response); return; } @@ -344,7 +357,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( // TODO(caseq): this preserves behavior of URLFetcher-based // implementation. We really need to pass proper first party origin from // the front-end. - resource_request->site_for_cookies = gurl; + resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl); resource_request->headers.AddHeadersFromString(headers); std::unique_ptr file_url_loader_factory; @@ -435,10 +448,12 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( void CefDevToolsFrontend::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, - const std::string& message) { - if (message.length() < kMaxMessageChunkSize) { + base::span message) { + base::StringPiece str_message(reinterpret_cast(message.data()), + message.size()); + if (str_message.length() < kMaxMessageChunkSize) { std::string param; - base::EscapeJSONString(message, true, ¶m); + base::EscapeJSONString(str_message, true, ¶m); std::string code = "DevToolsAPI.dispatchMessage(" + param + ");"; base::string16 javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( @@ -446,10 +461,11 @@ void CefDevToolsFrontend::DispatchProtocolMessage( return; } - size_t total_size = message.length(); - for (size_t pos = 0; pos < message.length(); pos += kMaxMessageChunkSize) { + size_t total_size = str_message.length(); + for (size_t pos = 0; pos < str_message.length(); + pos += kMaxMessageChunkSize) { std::string param; - base::EscapeJSONString(message.substr(pos, kMaxMessageChunkSize), true, + base::EscapeJSONString(str_message.substr(pos, kMaxMessageChunkSize), true, ¶m); std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + "," + std::to_string(pos ? 0 : total_size) + ");"; diff --git a/libcef/browser/devtools/devtools_frontend.h b/libcef/browser/devtools/devtools_frontend.h index 5beacbac2..ef68c1048 100644 --- a/libcef/browser/devtools/devtools_frontend.h +++ b/libcef/browser/devtools/devtools_frontend.h @@ -66,7 +66,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver, // content::DevToolsAgentHostClient implementation. void AgentHostClosed(content::DevToolsAgentHost* agent_host) override; void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, - const std::string& message) override; + base::span message) override; void HandleMessageFromDevToolsFrontend(const std::string& message); private: diff --git a/libcef/browser/download_manager_delegate.cc b/libcef/browser/download_manager_delegate.cc index 25db0e58d..e15c9a54e 100644 --- a/libcef/browser/download_manager_delegate.cc +++ b/libcef/browser/download_manager_delegate.cc @@ -43,11 +43,11 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { CefBeforeDownloadCallbackImpl(const base::WeakPtr& manager, uint32 download_id, const base::FilePath& suggested_name, - const content::DownloadTargetCallback& callback) + content::DownloadTargetCallback callback) : manager_(manager), download_id_(download_id), suggested_name_(suggested_name), - callback_(callback) {} + callback_(std::move(callback)) {} void Continue(const CefString& download_path, bool show_dialog) override { if (CEF_CURRENTLY_ON_UIT()) { @@ -56,28 +56,27 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { if (manager_) { base::FilePath path = base::FilePath(download_path); - CEF_POST_USER_VISIBLE_TASK(base::Bind( - &CefBeforeDownloadCallbackImpl::GenerateFilename, manager_, - download_id_, suggested_name_, path, show_dialog, callback_)); + CEF_POST_USER_VISIBLE_TASK( + base::BindOnce(&CefBeforeDownloadCallbackImpl::GenerateFilename, + manager_, download_id_, suggested_name_, path, + show_dialog, std::move(callback_))); } download_id_ = 0; - callback_.Reset(); } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefBeforeDownloadCallbackImpl::Continue, this, - download_path, show_dialog)); + base::BindOnce(&CefBeforeDownloadCallbackImpl::Continue, + this, download_path, show_dialog)); } } private: - static void GenerateFilename( - base::WeakPtr manager, - uint32 download_id, - const base::FilePath& suggested_name, - const base::FilePath& download_path, - bool show_dialog, - const content::DownloadTargetCallback& callback) { + static void GenerateFilename(base::WeakPtr manager, + uint32 download_id, + const base::FilePath& suggested_name, + const base::FilePath& download_path, + bool show_dialog, + content::DownloadTargetCallback callback) { CEF_REQUIRE_BLOCKING(); base::FilePath suggested_path = download_path; @@ -103,16 +102,16 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { CEF_POST_TASK( CEF_UIT, - base::Bind(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, manager, - download_id, suggested_path, show_dialog, callback)); + base::BindOnce(&CefBeforeDownloadCallbackImpl::ChooseDownloadPath, + manager, download_id, suggested_path, show_dialog, + std::move(callback))); } - static void ChooseDownloadPath( - base::WeakPtr manager, - uint32 download_id, - const base::FilePath& suggested_path, - bool show_dialog, - const content::DownloadTargetCallback& callback) { + static void ChooseDownloadPath(base::WeakPtr manager, + uint32 download_id, + const base::FilePath& suggested_path, + bool show_dialog, + content::DownloadTargetCallback callback) { if (!manager) return; @@ -142,21 +141,23 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { browser->RunFileChooser( params, - base::Bind( + base::BindOnce( &CefBeforeDownloadCallbackImpl::ChooseDownloadPathCallback, - callback)); + std::move(callback))); } } if (!handled) { - callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path, - download::DOWNLOAD_INTERRUPT_REASON_NONE); + std::move(callback).Run( + suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, + download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, + download::DownloadItem::MixedContentStatus::UNKNOWN, suggested_path, + download::DOWNLOAD_INTERRUPT_REASON_NONE); } } static void ChooseDownloadPathCallback( - const content::DownloadTargetCallback& callback, + content::DownloadTargetCallback callback, int selected_accept_filter, const std::vector& file_paths) { DCHECK_LE(file_paths.size(), (size_t)1); @@ -166,9 +167,10 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback { path = file_paths.front(); // The download will be cancelled if |path| is empty. - callback.Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path, - download::DOWNLOAD_INTERRUPT_REASON_NONE); + std::move(callback).Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE, + download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, + download::DownloadItem::MixedContentStatus::UNKNOWN, + path, download::DOWNLOAD_INTERRUPT_REASON_NONE); } base::WeakPtr manager_; @@ -347,12 +349,13 @@ void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) { bool CefDownloadManagerDelegate::DetermineDownloadTarget( DownloadItem* item, - const content::DownloadTargetCallback& callback) { + content::DownloadTargetCallback* callback) { if (!item->GetForcedFilePath().empty()) { - callback.Run( + std::move(*callback).Run( item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE, - download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(), - download::DOWNLOAD_INTERRUPT_REASON_NONE); + download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, + download::DownloadItem::MixedContentStatus::UNKNOWN, + item->GetForcedFilePath(), download::DOWNLOAD_INTERRUPT_REASON_NONE); return true; } @@ -372,7 +375,7 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( CefRefPtr callbackObj( new CefBeforeDownloadCallbackImpl(manager_ptr_factory_.GetWeakPtr(), item->GetId(), suggested_name, - callback)); + std::move(*callback))); handler->OnBeforeDownload(browser.get(), download_item.get(), suggested_name.value(), callbackObj); @@ -384,9 +387,9 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget( } void CefDownloadManagerDelegate::GetNextId( - const content::DownloadIdCallback& callback) { + content::DownloadIdCallback callback) { static uint32 next_id = DownloadItem::kInvalidId + 1; - callback.Run(next_id++); + std::move(callback).Run(next_id++); } std::string CefDownloadManagerDelegate::ApplicationClientIdForFileScanning() { diff --git a/libcef/browser/download_manager_delegate.h b/libcef/browser/download_manager_delegate.h index 0a1368834..86a54ba5a 100644 --- a/libcef/browser/download_manager_delegate.h +++ b/libcef/browser/download_manager_delegate.h @@ -37,8 +37,8 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer, // DownloadManagerDelegate methods. bool DetermineDownloadTarget( download::DownloadItem* item, - const content::DownloadTargetCallback& callback) override; - void GetNextId(const content::DownloadIdCallback& callback) override; + content::DownloadTargetCallback* callback) override; + void GetNextId(content::DownloadIdCallback callback) override; std::string ApplicationClientIdForFileScanning() override; // CefBrowserHostImpl::Observer methods. diff --git a/libcef/browser/extensions/extension_function_details.cc b/libcef/browser/extensions/extension_function_details.cc index 096d60722..d4bcbcb54 100644 --- a/libcef/browser/extensions/extension_function_details.cc +++ b/libcef/browser/extensions/extension_function_details.cc @@ -44,10 +44,9 @@ class CefGetExtensionLoadFileCallbackImpl if (CEF_CURRENTLY_ON_UIT()) { RunNow(file_, std::move(callback_), nullptr); } else { - CEF_POST_TASK( - CEF_UIT, - base::BindOnce(&CefGetExtensionLoadFileCallbackImpl::RunNow, file_, - base::Passed(std::move(callback_)), nullptr)); + CEF_POST_TASK(CEF_UIT, base::BindOnce( + &CefGetExtensionLoadFileCallbackImpl::RunNow, + file_, std::move(callback_), nullptr)); } } } @@ -56,10 +55,9 @@ class CefGetExtensionLoadFileCallbackImpl if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { // Always continue asynchronously. - CEF_POST_TASK( - CEF_UIT, - base::BindOnce(&CefGetExtensionLoadFileCallbackImpl::RunNow, file_, - base::Passed(std::move(callback_)), stream)); + CEF_POST_TASK(CEF_UIT, base::BindOnce( + &CefGetExtensionLoadFileCallbackImpl::RunNow, + file_, std::move(callback_), stream)); } } else { CEF_POST_TASK(CEF_UIT, base::BindOnce( diff --git a/libcef/browser/extensions/extension_system.cc b/libcef/browser/extensions/extension_system.cc index a3dc98d60..341142e33 100644 --- a/libcef/browser/extensions/extension_system.cc +++ b/libcef/browser/extensions/extension_system.cc @@ -44,6 +44,7 @@ #include "extensions/browser/runtime_data.h" #include "extensions/browser/service_worker_manager.h" #include "extensions/browser/state_store.h" +#include "extensions/browser/unloaded_extension_reason.h" #include "extensions/common/constants.h" #include "extensions/common/extension_messages.h" #include "extensions/common/file_util.h" @@ -96,9 +97,8 @@ void LoadExtensionOnUIThread(base::WeakPtr context, CefRefPtr handler) { if (!CEF_CURRENTLY_ON_UIT()) { CEF_POST_TASK(CEF_UIT, base::BindOnce(LoadExtensionOnUIThread, context, - base::Passed(std::move(manifest)), - root_directory, internal, - loader_context, handler)); + std::move(manifest), root_directory, + internal, loader_context, handler)); return; } @@ -447,7 +447,7 @@ AppSorting* CefExtensionSystem::app_sorting() { // ExtensionSystemImpl::RegisterExtensionWithRequestContexts. void CefExtensionSystem::RegisterExtensionWithRequestContexts( const Extension* extension, - const base::Closure& callback) { + base::OnceClosure callback) { // TODO(extensions): The |incognito_enabled| value should be set based on // manifest settings. base::PostTaskAndReply( @@ -456,7 +456,7 @@ void CefExtensionSystem::RegisterExtensionWithRequestContexts( base::RetainedRef(extension), base::Time::Now(), true, // incognito_enabled false), // notifications_disabled - callback); + std::move(callback)); } // Implementation based on diff --git a/libcef/browser/extensions/extension_system.h b/libcef/browser/extensions/extension_system.h index 3d555e548..cdb7480b2 100644 --- a/libcef/browser/extensions/extension_system.h +++ b/libcef/browser/extensions/extension_system.h @@ -102,7 +102,7 @@ class CefExtensionSystem : public ExtensionSystem { AppSorting* app_sorting() override; void RegisterExtensionWithRequestContexts( const Extension* extension, - const base::Closure& callback) override; + base::OnceClosure callback) override; void UnregisterExtensionWithRequestContexts( const std::string& extension_id, const UnloadedExtensionReason reason) override; diff --git a/libcef/browser/extensions/extension_view_host.cc b/libcef/browser/extensions/extension_view_host.cc index 98fbe2eb5..d7af71626 100644 --- a/libcef/browser/extensions/extension_view_host.cc +++ b/libcef/browser/extensions/extension_view_host.cc @@ -12,7 +12,7 @@ #include "extensions/browser/extension_system.h" #include "extensions/browser/notification_types.h" #include "extensions/browser/runtime_data.h" -#include "third_party/blink/public/platform/web_gesture_event.h" +#include "third_party/blink/public/common/input/web_gesture_event.h" using content::NativeWebKeyboardEvent; using content::OpenURLParams; diff --git a/libcef/browser/extensions/extensions_browser_client.cc b/libcef/browser/extensions/extensions_browser_client.cc index 0aabad2d0..f58273d14 100644 --- a/libcef/browser/extensions/extensions_browser_client.cc +++ b/libcef/browser/extensions/extensions_browser_client.cc @@ -32,7 +32,6 @@ #include "extensions/browser/extension_host_delegate.h" #include "extensions/browser/extensions_browser_interface_binders.h" #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" -#include "extensions/browser/mojo/interface_registration.h" #include "extensions/browser/url_request_util.h" #include "extensions/common/api/mime_handler.mojom.h" #include "extensions/common/constants.h" @@ -307,14 +306,6 @@ void CefExtensionsBrowserClient::RegisterBrowserInterfaceBindersForFrame( base::BindRepeating(&BindBeforeUnloadControl)); } -void CefExtensionsBrowserClient::RegisterExtensionInterfaces( - service_manager::BinderRegistryWithArgs* - registry, - content::RenderFrameHost* render_frame_host, - const Extension* extension) const { - RegisterInterfacesForExtension(registry, render_frame_host, extension); -} - std::unique_ptr CefExtensionsBrowserClient::CreateRuntimeAPIDelegate( content::BrowserContext* context) const { diff --git a/libcef/browser/extensions/extensions_browser_client.h b/libcef/browser/extensions/extensions_browser_client.h index 8d926b671..73b3f9cd8 100644 --- a/libcef/browser/extensions/extensions_browser_client.h +++ b/libcef/browser/extensions/extensions_browser_client.h @@ -86,10 +86,6 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient { binder_map, content::RenderFrameHost* render_frame_host, const Extension* extension) const override; - void RegisterExtensionInterfaces(service_manager::BinderRegistryWithArgs< - content::RenderFrameHost*>* registry, - content::RenderFrameHost* render_frame_host, - const Extension* extension) const override; std::unique_ptr CreateRuntimeAPIDelegate( content::BrowserContext* context) const override; const ComponentExtensionResourceManager* diff --git a/libcef/browser/file_dialog_manager.cc b/libcef/browser/file_dialog_manager.cc index 78ac58006..eb25c9f57 100644 --- a/libcef/browser/file_dialog_manager.cc +++ b/libcef/browser/file_dialog_manager.cc @@ -20,17 +20,20 @@ namespace { class CefFileDialogCallbackImpl : public CefFileDialogCallback { public: - explicit CefFileDialogCallbackImpl( - const CefFileDialogRunner::RunFileChooserCallback& callback) - : callback_(callback) {} + using CallbackType = CefFileDialogRunner::RunFileChooserCallback; + + explicit CefFileDialogCallbackImpl(CallbackType callback) + : callback_(std::move(callback)) {} + ~CefFileDialogCallbackImpl() 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(&CefFileDialogCallbackImpl::CancelNow, - callback_)); + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&CefFileDialogCallbackImpl::CancelNow, + std::move(callback_))); } } } @@ -45,41 +48,36 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback { for (; it != file_paths.end(); ++it) vec.push_back(base::FilePath(*it)); } - callback_.Run(selected_accept_filter, vec); - callback_.Reset(); + std::move(callback_).Run(selected_accept_filter, vec); } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefFileDialogCallbackImpl::Continue, this, - selected_accept_filter, file_paths)); + base::BindOnce(&CefFileDialogCallbackImpl::Continue, this, + selected_accept_filter, file_paths)); } } void Cancel() override { if (CEF_CURRENTLY_ON_UIT()) { if (!callback_.is_null()) { - CancelNow(callback_); - callback_.Reset(); + CancelNow(std::move(callback_)); } } else { CEF_POST_TASK(CEF_UIT, - base::Bind(&CefFileDialogCallbackImpl::Cancel, this)); + base::BindOnce(&CefFileDialogCallbackImpl::Cancel, this)); } } - bool IsConnected() { return !callback_.is_null(); } - - void Disconnect() { callback_.Reset(); } + CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); } private: - static void CancelNow( - const CefFileDialogRunner::RunFileChooserCallback& callback) { + static void CancelNow(CallbackType callback) { CEF_REQUIRE_UIT(); std::vector file_paths; - callback.Run(0, file_paths); + std::move(callback).Run(0, file_paths); } - CefFileDialogRunner::RunFileChooserCallback callback_; + CallbackType callback_; IMPLEMENT_REFCOUNTING(CefFileDialogCallbackImpl); }; @@ -99,16 +97,16 @@ class UploadFolderHelper : public net::DirectoryLister::DirectoryListerDelegate { public: explicit UploadFolderHelper( - const CefFileDialogRunner::RunFileChooserCallback& callback) - : callback_(callback) {} + CefFileDialogRunner::RunFileChooserCallback callback) + : callback_(std::move(callback)) {} ~UploadFolderHelper() override { if (!callback_.is_null()) { if (CEF_CURRENTLY_ON_UIT()) { - CancelNow(callback_); + CancelNow(std::move(callback_)); } else { - CEF_POST_TASK(CEF_UIT, - base::Bind(&UploadFolderHelper::CancelNow, callback_)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&UploadFolderHelper::CancelNow, + std::move(callback_))); } } } @@ -123,17 +121,15 @@ class UploadFolderHelper void OnListDone(int error) override { CEF_REQUIRE_UIT(); if (!callback_.is_null()) { - callback_.Run(0, select_files_); - callback_.Reset(); + std::move(callback_).Run(0, select_files_); } } private: - static void CancelNow( - const CefFileDialogRunner::RunFileChooserCallback& callback) { + static void CancelNow(CefFileDialogRunner::RunFileChooserCallback callback) { CEF_REQUIRE_UIT(); std::vector file_paths; - callback.Run(0, file_paths); + std::move(callback).Run(0, file_paths); } CefFileDialogRunner::RunFileChooserCallback callback_; @@ -215,37 +211,35 @@ void CefFileDialogManager::RunFileChooser( CefFileDialogRunner::RunFileChooserCallback callback; if (params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) { - callback = base::Bind( + callback = base::BindOnce( &CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode, - base::Passed(std::move(listener))); + weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener)); } else { - callback = - base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), params.mode, - base::Passed(std::move(listener))); + callback = base::BindOnce( + &CefFileDialogManager::OnRunFileChooserDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), params.mode, std::move(listener)); } - RunFileChooserInternal(cef_params, callback); + RunFileChooserInternal(cef_params, std::move(callback)); } void CefFileDialogManager::RunFileChooser( const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback) { - const CefFileDialogRunner::RunFileChooserCallback& host_callback = - base::Bind(&CefFileDialogManager::OnRunFileChooserCallback, - weak_ptr_factory_.GetWeakPtr(), callback); - RunFileChooserInternal(params, host_callback); + CefFileDialogRunner::RunFileChooserCallback callback) { + CefFileDialogRunner::RunFileChooserCallback host_callback = + base::BindOnce(&CefFileDialogManager::OnRunFileChooserCallback, + weak_ptr_factory_.GetWeakPtr(), std::move(callback)); + RunFileChooserInternal(params, std::move(host_callback)); } void CefFileDialogManager::RunFileChooserInternal( const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback) { + CefFileDialogRunner::RunFileChooserCallback callback) { CEF_REQUIRE_UIT(); if (file_chooser_pending_) { // Dismiss the new dialog immediately. - callback.Run(0, std::vector()); + std::move(callback).Run(0, std::vector()); return; } @@ -289,35 +283,30 @@ void CefFileDialogManager::RunFileChooserInternal( accept_filters.push_back(*it); CefRefPtr callbackImpl( - new CefFileDialogCallbackImpl(callback)); + new CefFileDialogCallbackImpl(std::move(callback))); handled = handler->OnFileDialog( browser_, static_cast(mode), params.title, params.default_file_name.value(), accept_filters, params.selected_accept_filter, callbackImpl.get()); if (!handled) { - if (callbackImpl->IsConnected()) { - callbackImpl->Disconnect(); - } else { - // User executed the callback even though they returned false. - NOTREACHED(); - handled = true; - } + // May return nullptr if the client has already executed the callback. + callback = callbackImpl->Disconnect(); } } } - if (!handled) { + if (!handled && !callback.is_null()) { if (runner_.get()) { - runner_->Run(browser_, params, callback); + runner_->Run(browser_, params, std::move(callback)); } else { LOG(WARNING) << "No file dialog runner available for this platform"; - callback.Run(0, std::vector()); + std::move(callback).Run(0, std::vector()); } } } void CefFileDialogManager::OnRunFileChooserCallback( - const CefFileDialogRunner::RunFileChooserCallback& callback, + CefFileDialogRunner::RunFileChooserCallback callback, int selected_accept_filter, const std::vector& file_paths) { CEF_REQUIRE_UIT(); @@ -325,8 +314,8 @@ void CefFileDialogManager::OnRunFileChooserCallback( Cleanup(); // Execute the callback asynchronously. - CEF_POST_TASK(CEF_UIT, - base::Bind(callback, selected_accept_filter, file_paths)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(std::move(callback), + selected_accept_filter, file_paths)); } void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( @@ -344,10 +333,9 @@ void CefFileDialogManager::OnRunFileChooserUploadFolderDelegateCallback( } else { lister_.reset(new net::DirectoryLister( file_paths[0], net::DirectoryLister::NO_SORT_RECURSIVE, - new UploadFolderHelper( - base::Bind(&CefFileDialogManager::OnRunFileChooserDelegateCallback, - weak_ptr_factory_.GetWeakPtr(), mode, - base::Passed(std::move(listener)))))); + new UploadFolderHelper(base::BindOnce( + &CefFileDialogManager::OnRunFileChooserDelegateCallback, + weak_ptr_factory_.GetWeakPtr(), mode, std::move(listener))))); lister_->Start(); } } diff --git a/libcef/browser/file_dialog_manager.h b/libcef/browser/file_dialog_manager.h index 55737787f..a739c51fc 100644 --- a/libcef/browser/file_dialog_manager.h +++ b/libcef/browser/file_dialog_manager.h @@ -52,19 +52,18 @@ class CefFileDialogManager { // Run the file chooser dialog specified by |params|. Only a single dialog may // be pending at any given time. |callback| will be executed asynchronously // after the dialog is dismissed or if another dialog is already pending. - void RunFileChooser( - const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback); + void RunFileChooser(const CefFileDialogRunner::FileChooserParams& params, + CefFileDialogRunner::RunFileChooserCallback callback); private: void RunFileChooserInternal( const CefFileDialogRunner::FileChooserParams& params, - const CefFileDialogRunner::RunFileChooserCallback& callback); + CefFileDialogRunner::RunFileChooserCallback callback); // Used with the RunFileChooser variant where the caller specifies a callback // (no associated RenderFrameHost). void OnRunFileChooserCallback( - const CefFileDialogRunner::RunFileChooserCallback& callback, + CefFileDialogRunner::RunFileChooserCallback callback, int selected_accept_filter, const std::vector& file_paths); diff --git a/libcef/browser/file_dialog_runner.h b/libcef/browser/file_dialog_runner.h index 656a0fc27..1ad114303 100644 --- a/libcef/browser/file_dialog_runner.h +++ b/libcef/browser/file_dialog_runner.h @@ -30,7 +30,7 @@ class CefFileDialogRunner { }; // The argument vector will be empty if the dialog was canceled. - typedef base::Callback&)> + typedef base::OnceCallback&)> RunFileChooserCallback; // Display the file chooser dialog. Execute |callback| on completion. diff --git a/libcef/browser/javascript_dialog_manager.cc b/libcef/browser/javascript_dialog_manager.cc index eed9ab415..4e4c791f9 100644 --- a/libcef/browser/javascript_dialog_manager.cc +++ b/libcef/browser/javascript_dialog_manager.cc @@ -19,17 +19,19 @@ namespace { class CefJSDialogCallbackImpl : public CefJSDialogCallback { public: - using Callback = content::JavaScriptDialogManager::DialogClosedCallback; + using CallbackType = content::JavaScriptDialogManager::DialogClosedCallback; - CefJSDialogCallbackImpl(Callback callback) : callback_(std::move(callback)) {} + CefJSDialogCallbackImpl(CallbackType 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(std::move(callback_)); } else { - CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::CancelNow, - base::Passed(std::move(callback_)))); + CEF_POST_TASK(CEF_UIT, + base::BindOnce(&CefJSDialogCallbackImpl::CancelNow, + std::move(callback_))); } } } @@ -40,20 +42,20 @@ class CefJSDialogCallbackImpl : public CefJSDialogCallback { std::move(callback_).Run(success, user_input); } } else { - CEF_POST_TASK(CEF_UIT, base::Bind(&CefJSDialogCallbackImpl::Continue, - this, success, user_input)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefJSDialogCallbackImpl::Continue, + this, success, user_input)); } } - Callback Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); } + CallbackType Disconnect() WARN_UNUSED_RESULT { return std::move(callback_); } private: - static void CancelNow(Callback callback) { + static void CancelNow(CallbackType callback) { CEF_REQUIRE_UIT(); std::move(callback).Run(false, base::string16()); } - Callback callback_; + CallbackType callback_; IMPLEMENT_REFCOUNTING(CefJSDialogCallbackImpl); }; @@ -130,11 +132,10 @@ void CefJavaScriptDialogManager::RunJavaScriptDialog( url_formatter::FormatUrlForSecurityDisplay(origin_url); DCHECK(!callback.is_null()); - runner_->Run(browser_, message_type, display_url, message_text, - default_prompt_text, - base::Bind(&CefJavaScriptDialogManager::DialogClosed, - weak_ptr_factory_.GetWeakPtr(), - base::Passed(std::move(callback)))); + runner_->Run( + browser_, message_type, display_url, message_text, default_prompt_text, + base::BindOnce(&CefJavaScriptDialogManager::DialogClosed, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } void CefJavaScriptDialogManager::RunBeforeUnloadDialog( @@ -185,13 +186,13 @@ void CefJavaScriptDialogManager::RunBeforeUnloadDialog( dialog_running_ = true; DCHECK(!callback.is_null()); - runner_->Run(browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM, - base::string16(), // display_url - message_text, - base::string16(), // default_prompt_text - base::Bind(&CefJavaScriptDialogManager::DialogClosed, - weak_ptr_factory_.GetWeakPtr(), - base::Passed(std::move(callback)))); + runner_->Run( + browser_, content::JAVASCRIPT_DIALOG_TYPE_CONFIRM, + base::string16(), // display_url + message_text, + base::string16(), // default_prompt_text + base::BindOnce(&CefJavaScriptDialogManager::DialogClosed, + weak_ptr_factory_.GetWeakPtr(), std::move(callback))); } void CefJavaScriptDialogManager::CancelDialogs( diff --git a/libcef/browser/javascript_dialog_runner.h b/libcef/browser/javascript_dialog_runner.h index 7056b7428..8d79320fd 100644 --- a/libcef/browser/javascript_dialog_runner.h +++ b/libcef/browser/javascript_dialog_runner.h @@ -15,8 +15,8 @@ class CefBrowserHostImpl; class CefJavaScriptDialogRunner { public: - typedef base::Callback + typedef base::OnceCallback DialogClosedCallback; // Run the dialog. Execute |callback| on completion. @@ -25,7 +25,7 @@ class CefJavaScriptDialogRunner { const base::string16& display_url, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback) = 0; + DialogClosedCallback callback) = 0; // Cancel a dialog mid-flight. virtual void Cancel() = 0; diff --git a/libcef/browser/native/browser_platform_delegate_native.cc b/libcef/browser/native/browser_platform_delegate_native.cc index f7c0cb7ed..b26ee3e1f 100644 --- a/libcef/browser/native/browser_platform_delegate_native.cc +++ b/libcef/browser/native/browser_platform_delegate_native.cc @@ -8,7 +8,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" -#include "third_party/blink/public/platform/web_mouse_event.h" +#include "third_party/blink/public/common/input/web_mouse_event.h" CefBrowserPlatformDelegateNative::CefBrowserPlatformDelegateNative( const CefWindowInfo& window_info, diff --git a/libcef/browser/native/browser_platform_delegate_native_mac.mm b/libcef/browser/native/browser_platform_delegate_native_mac.mm index f14b9a281..3355a97d1 100644 --- a/libcef/browser/native/browser_platform_delegate_native_mac.mm +++ b/libcef/browser/native/browser_platform_delegate_native_mac.mm @@ -21,9 +21,9 @@ #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/web_contents.h" -#include "third_party/blink/public/platform/web_input_event.h" -#include "third_party/blink/public/platform/web_mouse_event.h" -#include "third_party/blink/public/platform/web_mouse_wheel_event.h" +#include "third_party/blink/public/common/input/web_input_event.h" +#include "third_party/blink/public/common/input/web_mouse_event.h" +#include "third_party/blink/public/common/input/web_mouse_wheel_event.h" #import "ui/base/cocoa/cocoa_base_utils.h" #import "ui/base/cocoa/underlay_opengl_hosting_window.h" #include "ui/events/base_event_utils.h" diff --git a/libcef/browser/native/browser_platform_delegate_native_win.cc b/libcef/browser/native/browser_platform_delegate_native_win.cc index 9b07e1c03..30eac2a98 100644 --- a/libcef/browser/native/browser_platform_delegate_native_win.cc +++ b/libcef/browser/native/browser_platform_delegate_native_win.cc @@ -22,8 +22,8 @@ #include "base/win/registry.h" #include "base/win/win_util.h" #include "content/public/browser/native_web_keyboard_event.h" -#include "third_party/blink/public/platform/web_mouse_event.h" -#include "third_party/blink/public/platform/web_mouse_wheel_event.h" +#include "third_party/blink/public/common/input/web_mouse_event.h" +#include "third_party/blink/public/common/input/web_mouse_wheel_event.h" #include "ui/aura/window.h" #include "ui/base/win/shell.h" #include "ui/display/display.h" diff --git a/libcef/browser/native/file_dialog_runner_mac.h b/libcef/browser/native/file_dialog_runner_mac.h index e101db5a0..4fa8fdcb6 100644 --- a/libcef/browser/native/file_dialog_runner_mac.h +++ b/libcef/browser/native/file_dialog_runner_mac.h @@ -9,6 +9,10 @@ #include "libcef/browser/file_dialog_runner.h" +#include "base/memory/weak_ptr.h" + +@class NSView; + class CefFileDialogRunnerMac : public CefFileDialogRunner { public: CefFileDialogRunnerMac(); @@ -17,6 +21,21 @@ class CefFileDialogRunnerMac : public CefFileDialogRunner { void Run(CefBrowserHostImpl* browser, const FileChooserParams& params, RunFileChooserCallback callback) override; + + private: + static void RunOpenFileDialog( + base::WeakPtr weak_this, + const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index); + static void RunSaveFileDialog( + base::WeakPtr weak_this, + const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index); + + CefFileDialogRunner::RunFileChooserCallback callback_; + base::WeakPtrFactory weak_ptr_factory_; }; #endif // CEF_LIBCEF_BROWSER_NATIVE_FILE_DIALOG_RUNNER_MAC_H_ diff --git a/libcef/browser/native/file_dialog_runner_mac.mm b/libcef/browser/native/file_dialog_runner_mac.mm index fe88d9a41..25ffa1aaa 100644 --- a/libcef/browser/native/file_dialog_runner_mac.mm +++ b/libcef/browser/native/file_dialog_runner_mac.mm @@ -229,12 +229,34 @@ void AddFilters(NSPopUpButton* button, @end -namespace { +CefFileDialogRunnerMac::CefFileDialogRunnerMac() : weak_ptr_factory_(this) {} -void RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params, - NSView* view, - int filter_index, - CefFileDialogRunner::RunFileChooserCallback callback) { +void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser, + const FileChooserParams& params, + RunFileChooserCallback callback) { + callback_ = std::move(callback); + + int filter_index = params.selected_accept_filter; + NSView* owner = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(browser->GetWindowHandle()); + auto weak_this = weak_ptr_factory_.GetWeakPtr(); + + if (params.mode == blink::mojom::FileChooserParams::Mode::kOpen || + params.mode == blink::mojom::FileChooserParams::Mode::kOpenMultiple || + params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) { + RunOpenFileDialog(weak_this, params, owner, filter_index); + } else if (params.mode == blink::mojom::FileChooserParams::Mode::kSave) { + RunSaveFileDialog(weak_this, params, owner, filter_index); + } else { + NOTIMPLEMENTED(); + } +} + +// static +void CefFileDialogRunnerMac::RunOpenFileDialog( + base::WeakPtr weak_this, + const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index) { NSOpenPanel* openPanel = [NSOpenPanel openPanel]; base::string16 title; @@ -308,18 +330,21 @@ void RunOpenFileDialog(const CefFileDialogRunner::FileChooserParams& params, if (url.isFileURL) files.push_back(base::FilePath(url.path.UTF8String)); } - callback.Run(filter_index_to_use, files); + std::move(weak_this->callback_) + .Run(filter_index_to_use, files); } else { - callback.Run(filter_index_to_use, - std::vector()); + std::move(weak_this->callback_) + .Run(filter_index_to_use, std::vector()); } }]; } -void RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params, - NSView* view, - int filter_index, - CefFileDialogRunner::RunFileChooserCallback callback) { +// static +void CefFileDialogRunnerMac::RunSaveFileDialog( + base::WeakPtr weak_this, + const CefFileDialogRunner::FileChooserParams& params, + NSView* view, + int filter_index) { NSSavePanel* savePanel = [NSSavePanel savePanel]; base::string16 title; @@ -371,31 +396,11 @@ void RunSaveFileDialog(const CefFileDialogRunner::FileChooserParams& params, NSURL* url = savePanel.URL; const char* path = url.path.UTF8String; std::vector files(1, base::FilePath(path)); - callback.Run(filter_index_to_use, files); + std::move(weak_this->callback_) + .Run(filter_index_to_use, files); } else { - callback.Run(filter_index_to_use, - std::vector()); + std::move(weak_this->callback_) + .Run(filter_index_to_use, std::vector()); } }]; } - -} // namespace - -CefFileDialogRunnerMac::CefFileDialogRunnerMac() {} - -void CefFileDialogRunnerMac::Run(CefBrowserHostImpl* browser, - const FileChooserParams& params, - RunFileChooserCallback callback) { - int filter_index = params.selected_accept_filter; - NSView* owner = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(browser->GetWindowHandle()); - - if (params.mode == blink::mojom::FileChooserParams::Mode::kOpen || - params.mode == blink::mojom::FileChooserParams::Mode::kOpenMultiple || - params.mode == blink::mojom::FileChooserParams::Mode::kUploadFolder) { - RunOpenFileDialog(params, owner, filter_index, callback); - } else if (params.mode == blink::mojom::FileChooserParams::Mode::kSave) { - RunSaveFileDialog(params, owner, filter_index, callback); - } else { - NOTIMPLEMENTED(); - } -} diff --git a/libcef/browser/native/file_dialog_runner_win.cc b/libcef/browser/native/file_dialog_runner_win.cc index 8c295a83f..83feeed0e 100644 --- a/libcef/browser/native/file_dialog_runner_win.cc +++ b/libcef/browser/native/file_dialog_runner_win.cc @@ -520,5 +520,5 @@ void CefFileDialogRunnerWin::Run(CefBrowserHostImpl* browser, NOTIMPLEMENTED(); } - callback.Run(filter_index, files); + std::move(callback).Run(filter_index, files); } diff --git a/libcef/browser/native/javascript_dialog_runner_mac.h b/libcef/browser/native/javascript_dialog_runner_mac.h index cc90a4684..0cd92ec98 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.h +++ b/libcef/browser/native/javascript_dialog_runner_mac.h @@ -29,7 +29,7 @@ class CefJavaScriptDialogRunnerMac : public CefJavaScriptDialogRunner { const base::string16& display_url, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback) override; + DialogClosedCallback callback) override; void Cancel() override; // Callback from CefJavaScriptDialogHelper when the dialog is closed. diff --git a/libcef/browser/native/javascript_dialog_runner_mac.mm b/libcef/browser/native/javascript_dialog_runner_mac.mm index 77fe7d357..289a539fa 100644 --- a/libcef/browser/native/javascript_dialog_runner_mac.mm +++ b/libcef/browser/native/javascript_dialog_runner_mac.mm @@ -38,7 +38,7 @@ - (id)initHelperWithCallback: (CefJavaScriptDialogRunner::DialogClosedCallback)callback { if (self = [super init]) - callback_ = callback; + callback_ = std::move(callback); return self; } @@ -69,7 +69,7 @@ if (textField_) input = base::SysNSStringToUTF16([textField_ stringValue]); - callback_.Run(success, input); + std::move(callback_).Run(success, input); } - (void)cancel { @@ -92,15 +92,15 @@ void CefJavaScriptDialogRunnerMac::Run( const base::string16& display_url, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback) { + DialogClosedCallback callback) { DCHECK(!helper_.get()); - callback_ = callback; + callback_ = std::move(callback); bool text_field = message_type == content::JAVASCRIPT_DIALOG_TYPE_PROMPT; bool one_button = message_type == content::JAVASCRIPT_DIALOG_TYPE_ALERT; helper_.reset([[CefJavaScriptDialogHelper alloc] - initHelperWithCallback:base::Bind( + initHelperWithCallback:base::BindOnce( &CefJavaScriptDialogRunnerMac::DialogClosed, weak_ptr_factory_.GetWeakPtr())]); @@ -167,5 +167,5 @@ void CefJavaScriptDialogRunnerMac::DialogClosed( bool success, const base::string16& user_input) { helper_.reset(nil); - callback_.Run(success, user_input); + std::move(callback_).Run(success, user_input); } diff --git a/libcef/browser/native/javascript_dialog_runner_win.cc b/libcef/browser/native/javascript_dialog_runner_win.cc index 42b993026..37b52eb2a 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.cc +++ b/libcef/browser/native/javascript_dialog_runner_win.cc @@ -96,13 +96,13 @@ void CefJavaScriptDialogRunnerWin::Run( const base::string16& display_url, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback) { + DialogClosedCallback callback) { DCHECK(!dialog_win_); message_type_ = message_type; message_text_ = message_text; default_prompt_text_ = default_prompt_text; - callback_ = callback; + callback_ = std::move(callback); InstallMessageHook(); hook_installed_ = true; @@ -177,8 +177,7 @@ void CefJavaScriptDialogRunnerWin::CloseDialog( // cleared. Otherwise, RenderWidgetHostImpl::IsIgnoringInputEvents will // return true and RenderWidgetHostViewAura::OnWindowFocused will fail to // re-assign browser focus. - callback_.Run(success, user_input); - callback_.Reset(); + std::move(callback_).Run(success, user_input); Cancel(); } diff --git a/libcef/browser/native/javascript_dialog_runner_win.h b/libcef/browser/native/javascript_dialog_runner_win.h index 2897bc3b2..f8e33d859 100644 --- a/libcef/browser/native/javascript_dialog_runner_win.h +++ b/libcef/browser/native/javascript_dialog_runner_win.h @@ -22,7 +22,7 @@ class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner { const base::string16& display_url, const base::string16& message_text, const base::string16& default_prompt_text, - const DialogClosedCallback& callback) override; + DialogClosedCallback callback) override; void Cancel() override; private: diff --git a/libcef/browser/navigate_params.h b/libcef/browser/navigate_params.h index 77b1b0d20..92b898031 100644 --- a/libcef/browser/navigate_params.h +++ b/libcef/browser/navigate_params.h @@ -37,7 +37,7 @@ struct CefNavigateParams { // lead to undesired cookie blocking. Third-party cookie blocking can be // bypassed by setting site_for_cookies = url, but this should ideally // only be done if there really is no way to determine the correct value. - GURL site_for_cookies; + net::SiteForCookies site_for_cookies; // Additional HTTP request headers. std::string headers; diff --git a/libcef/browser/net/crlset_file_util_impl.cc b/libcef/browser/net/crlset_file_util_impl.cc index 028f7710b..fecd791af 100644 --- a/libcef/browser/net/crlset_file_util_impl.cc +++ b/libcef/browser/net/crlset_file_util_impl.cc @@ -17,7 +17,7 @@ namespace { void UpdateCRLSet(const std::string& crl_set_bytes) { CEF_REQUIRE_UIT(); content::GetNetworkService()->UpdateCRLSet( - base::as_bytes(base::make_span(crl_set_bytes))); + base::as_bytes(base::make_span(crl_set_bytes)), base::DoNothing()); } void LoadFromDisk(const base::FilePath& path) { diff --git a/libcef/browser/net_service/browser_urlrequest_impl.cc b/libcef/browser/net_service/browser_urlrequest_impl.cc index 0d2cf84a5..11721c223 100644 --- a/libcef/browser/net_service/browser_urlrequest_impl.cc +++ b/libcef/browser/net_service/browser_urlrequest_impl.cc @@ -280,7 +280,7 @@ class CefBrowserURLRequest::Context // Associate the request with |request_id|. request_id_ = request_id; - loader_->SetRequestId(request_id); + loader_->SetRequestID(request_id); g_manager.Get().Add(request_id, url_request_, client_); if (request_body) { diff --git a/libcef/browser/net_service/cookie_helper.cc b/libcef/browser/net_service/cookie_helper.cc index e51d90b89..25de20df6 100644 --- a/libcef/browser/net_service/cookie_helper.cc +++ b/libcef/browser/net_service/cookie_helper.cc @@ -15,7 +15,6 @@ #include "net/cookies/cookie_util.h" #include "services/network/cookie_manager.h" #include "services/network/public/cpp/resource_request.h" -#include "services/network/public/cpp/resource_response.h" namespace net_service { @@ -169,14 +168,14 @@ void LoadCookies(content::BrowserContext* browser_context, void SaveCookies(content::BrowserContext* browser_context, const network::ResourceRequest& request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, const AllowCookieCallback& allow_cookie_callback, DoneCookieCallback done_callback) { CEF_REQUIRE_IOT(); if (request.credentials_mode == network::mojom::CredentialsMode::kOmit || - request.url.IsAboutBlank() || !head.headers || - !head.headers->HasHeader(net_service::kHTTPSetCookieHeaderName)) { + request.url.IsAboutBlank() || !headers || + !headers->HasHeader(net_service::kHTTPSetCookieHeaderName)) { // Continue immediately without saving cookies. std::move(done_callback).Run(0, {}); return; @@ -185,7 +184,7 @@ void SaveCookies(content::BrowserContext* browser_context, // Match the logic in // URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete. base::Time response_date; - if (!head.headers->GetDateValue(&response_date)) + if (!headers->GetDateValue(&response_date)) response_date = base::Time(); net::CookieOptions options; @@ -201,7 +200,7 @@ void SaveCookies(content::BrowserContext* browser_context, net::CookieList allowed_cookies; int total_count = 0; - while (head.headers->EnumerateHeader(&iter, name, &cookie_string)) { + while (headers->EnumerateHeader(&iter, name, &cookie_string)) { total_count++; net::CanonicalCookie::CookieInclusionStatus returned_status; diff --git a/libcef/browser/net_service/cookie_helper.h b/libcef/browser/net_service/cookie_helper.h index fd2bd76ac..00b2a3ec3 100644 --- a/libcef/browser/net_service/cookie_helper.h +++ b/libcef/browser/net_service/cookie_helper.h @@ -12,9 +12,12 @@ namespace content { class BrowserContext; } +namespace net { +class HttpResponseHeaders; +} + namespace network { struct ResourceRequest; -struct ResourceResponseHead; } // namespace network namespace net_service { @@ -45,7 +48,7 @@ void LoadCookies(content::BrowserContext* browser_context, // on the IO thread. void SaveCookies(content::BrowserContext* browser_context, const network::ResourceRequest& request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, const AllowCookieCallback& allow_cookie_callback, DoneCookieCallback done_callback); diff --git a/libcef/browser/net_service/proxy_url_loader_factory.cc b/libcef/browser/net_service/proxy_url_loader_factory.cc index a780c73ee..3a16e4604 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.cc +++ b/libcef/browser/net_service/proxy_url_loader_factory.cc @@ -11,7 +11,7 @@ #include "base/barrier_closure.h" #include "base/strings/string_number_conversions.h" -#include "components/safe_browsing/common/safebrowsing_constants.h" +#include "components/safe_browsing/core/common/safebrowsing_constants.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/resource_context.h" @@ -245,7 +245,8 @@ class InterceptedRequest : public network::mojom::URLLoader, bool waiting_for_upload_progress_ack_ = false; network::ResourceRequest request_; - network::ResourceResponseHead current_response_; + network::mojom::URLResponseHeadPtr current_response_; + scoped_refptr current_headers_; scoped_refptr override_headers_; GURL original_url_; GURL redirect_url_; @@ -426,16 +427,15 @@ void InterceptedRequest::OnHeadersReceived( return; } - current_response_.headers = - base::MakeRefCounted(headers); + current_headers_ = base::MakeRefCounted(headers); on_headers_received_callback_ = std::move(callback); base::Optional redirect_info; std::string location; - if (current_response_.headers->IsRedirect(&location)) { + if (current_headers_->IsRedirect(&location)) { const GURL new_url = request_.url.Resolve(location); redirect_info = - MakeRedirectInfo(request_, current_response_.headers.get(), new_url, 0); + MakeRedirectInfo(request_, current_headers_.get(), new_url, 0); } HandleResponseOrRedirectHeaders( @@ -448,16 +448,16 @@ void InterceptedRequest::OnHeadersReceived( void InterceptedRequest::OnReceiveResponse( network::mojom::URLResponseHeadPtr head) { + current_response_ = std::move(head); + if (current_request_uses_header_client_) { // Use the headers we got from OnHeadersReceived as that'll contain // Set-Cookie if it existed. - auto saved_headers = current_response_.headers; - DCHECK(saved_headers); - current_response_ = head; - current_response_.headers = saved_headers; + DCHECK(current_headers_); + current_response_->headers = current_headers_; + current_headers_ = nullptr; ContinueToResponseStarted(net::OK); } else { - current_response_ = head; HandleResponseOrRedirectHeaders( base::nullopt, base::BindOnce(&InterceptedRequest::ContinueToResponseStarted, @@ -470,16 +470,15 @@ void InterceptedRequest::OnReceiveRedirect( network::mojom::URLResponseHeadPtr head) { bool needs_callback = false; + current_response_ = std::move(head); + if (current_request_uses_header_client_) { // Use the headers we got from OnHeadersReceived as that'll contain // Set-Cookie if it existed. May be null for synthetic redirects. - auto saved_headers = current_response_.headers; - current_response_ = head; - if (saved_headers) { - current_response_.headers = saved_headers; - } + DCHECK(current_headers_); + current_response_->headers = current_headers_; + current_headers_ = nullptr; } else { - current_response_ = head; needs_callback = true; } @@ -625,33 +624,35 @@ void InterceptedRequest::InterceptResponseReceived( DCHECK(!response); // Perform the redirect. - network::ResourceResponseHead head; - head.request_start = base::TimeTicks::Now(); - head.response_start = base::TimeTicks::Now(); - head.headers = MakeResponseHeaders( + current_response_ = network::mojom::URLResponseHead::New(); + current_response_->request_start = base::TimeTicks::Now(); + current_response_->response_start = base::TimeTicks::Now(); + + auto headers = MakeResponseHeaders( net::HTTP_TEMPORARY_REDIRECT, std::string(), std::string(), std::string(), -1, {}, false /* allow_existing_header_override */); + current_response_->headers = headers; - head.encoded_data_length = head.headers->raw_headers().length(); - head.content_length = head.encoded_body_length = 0; + current_response_->encoded_data_length = headers->raw_headers().length(); + current_response_->content_length = current_response_->encoded_body_length = + 0; std::string origin; if (request_.headers.GetHeader(net::HttpRequestHeaders::kOrigin, &origin) && origin != url::Origin().Serialize()) { // Allow redirects of cross-origin resource loads. - head.headers->AddHeader(MakeHeader( + headers->AddHeader(MakeHeader( network::cors::header_names::kAccessControlAllowOrigin, origin)); } if (request_.credentials_mode == network::mojom::CredentialsMode::kInclude) { - head.headers->AddHeader(MakeHeader( + headers->AddHeader(MakeHeader( network::cors::header_names::kAccessControlAllowCredentials, "true")); } - current_response_ = head; const net::RedirectInfo& redirect_info = - MakeRedirectInfo(request_, head.headers.get(), request_.url, 0); + MakeRedirectInfo(request_, headers.get(), request_.url, 0); HandleResponseOrRedirectHeaders( redirect_info, base::BindOnce(&InterceptedRequest::ContinueToBeforeRedirect, @@ -715,17 +716,21 @@ void InterceptedRequest::HandleResponseOrRedirectHeaders( redirect_url_ = redirect_info.has_value() ? redirect_info->new_url : GURL(); original_url_ = request_.url; + // |current_response_| may be nullptr when called from OnHeadersReceived. + auto headers = + current_response_ ? current_response_->headers : current_headers_; + // Even though |head| is const we can get a non-const pointer to the headers // and modifications we make are passed to the target client. factory_->request_handler_->ProcessResponseHeaders( - id_, request_, redirect_url_, current_response_); + id_, request_, redirect_url_, headers.get()); // Pause handling of client messages before waiting on an async callback. if (proxied_client_binding_) proxied_client_binding_.PauseIncomingMethodCallProcessing(); factory_->request_handler_->OnRequestResponse( - id_, &request_, current_response_, redirect_info, + id_, &request_, headers.get(), redirect_info, base::BindOnce(&InterceptedRequest::ContinueResponseOrRedirect, weak_factory_.GetWeakPtr(), std::move(continuation))); } @@ -749,7 +754,7 @@ void InterceptedRequest::ContinueResponseOrRedirect( // Make sure to update current_response_, since when OnReceiveResponse // is called we will not use its headers as it might be missing the // Set-Cookie line (which gets stripped by the IPC layer). - current_response_.headers = override_headers_; + current_response_->headers = override_headers_; } redirect_url_ = redirect_url; @@ -780,21 +785,22 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) { net::RedirectInfo InterceptedRequest::MakeRedirectResponseAndInfo( const GURL& new_location) { // Clear the Content-Type values. - current_response_.mime_type = current_response_.charset = std::string(); - current_response_.headers->RemoveHeader( + current_response_->mime_type = current_response_->charset = std::string(); + current_response_->headers->RemoveHeader( net::HttpRequestHeaders::kContentType); // Clear the Content-Length values. - current_response_.content_length = current_response_.encoded_body_length = 0; - current_response_.headers->RemoveHeader( + current_response_->content_length = current_response_->encoded_body_length = + 0; + current_response_->headers->RemoveHeader( net::HttpRequestHeaders::kContentLength); - current_response_.encoded_data_length = - current_response_.headers->raw_headers().size(); + current_response_->encoded_data_length = + current_response_->headers->raw_headers().size(); const net::RedirectInfo& redirect_info = MakeRedirectInfo( - request_, current_response_.headers.get(), new_location, 0); - current_response_.headers->ReplaceStatusLine( + request_, current_response_->headers.get(), new_location, 0); + current_response_->headers->ReplaceStatusLine( MakeStatusLine(redirect_info.status_code, std::string(), true)); return redirect_info; @@ -824,10 +830,12 @@ void InterceptedRequest::ContinueToBeforeRedirect( if (redirect_url.is_valid()) { net::RedirectInfo new_redirect_info = redirect_info; new_redirect_info.new_url = redirect_url; - target_client_->OnReceiveRedirect(new_redirect_info, current_response_); + target_client_->OnReceiveRedirect(new_redirect_info, + std::move(current_response_)); request_.url = redirect_url; } else { - target_client_->OnReceiveRedirect(redirect_info, current_response_); + target_client_->OnReceiveRedirect(redirect_info, + std::move(current_response_)); request_.url = redirect_info.new_url; } @@ -854,8 +862,8 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) { std::string location; const bool is_redirect = redirect_url.is_valid() || - (current_response_.headers && - current_response_.headers->IsRedirect(&location)); + (current_response_->headers && + current_response_->headers->IsRedirect(&location)); if (stream_loader_ && is_redirect) { // Redirecting from OnReceiveResponse generally isn't supported by the // NetworkService, so we can only support it when using a custom loader. @@ -879,7 +887,7 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) { if (proxied_client_binding_) proxied_client_binding_.ResumeIncomingMethodCallProcessing(); - target_client_->OnReceiveResponse(current_response_); + target_client_->OnReceiveResponse(std::move(current_response_)); } if (stream_loader_) @@ -1012,7 +1020,7 @@ void InterceptedRequestHandler::ShouldInterceptRequest( void InterceptedRequestHandler::OnRequestResponse( const RequestId& id, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, base::Optional redirect_info, OnRequestResponseResultCallback callback) { std::move(callback).Run( diff --git a/libcef/browser/net_service/proxy_url_loader_factory.h b/libcef/browser/net_service/proxy_url_loader_factory.h index b955de8f5..fc1b4f2ef 100644 --- a/libcef/browser/net_service/proxy_url_loader_factory.h +++ b/libcef/browser/net_service/proxy_url_loader_factory.h @@ -18,7 +18,6 @@ #include "content/public/browser/web_contents.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "mojo/public/cpp/bindings/pending_receiver.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" @@ -76,11 +75,10 @@ class InterceptedRequestHandler { // method is called in response to a redirect. Even though |head| is const the // |head.headers| value is non-const and any changes will be passed to the // client. - virtual void ProcessResponseHeaders( - const RequestId& id, - const network::ResourceRequest& request, - const GURL& redirect_url, - const network::ResourceResponseHead& head) {} + virtual void ProcessResponseHeaders(const RequestId& id, + const network::ResourceRequest& request, + const GURL& redirect_url, + net::HttpResponseHeaders* headers) {} enum class ResponseMode { // Continue the request. @@ -101,7 +99,7 @@ class InterceptedRequestHandler { virtual void OnRequestResponse( const RequestId& id, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, base::Optional redirect_info, OnRequestResponseResultCallback callback); diff --git a/libcef/browser/net_service/resource_request_handler_wrapper.cc b/libcef/browser/net_service/resource_request_handler_wrapper.cc index c6c692c2f..0e1983bf8 100644 --- a/libcef/browser/net_service/resource_request_handler_wrapper.cc +++ b/libcef/browser/net_service/resource_request_handler_wrapper.cc @@ -592,7 +592,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { new RequestCallbackWrapper(base::BindOnce( &InterceptedRequestHandlerWrapper::ContinueShouldInterceptRequest, weak_ptr_factory_.GetWeakPtr(), id, base::Unretained(request), - base::Passed(std::move(callback)))); + std::move(callback))); cef_return_value_t retval = state->handler_->OnBeforeResourceLoad( init_state_->browser_, init_state_->frame_, @@ -687,11 +687,10 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { std::move(callback).Run(std::move(resource_response)); } - void ProcessResponseHeaders( - const RequestId& id, - const network::ResourceRequest& request, - const GURL& redirect_url, - const network::ResourceResponseHead& head) override { + void ProcessResponseHeaders(const RequestId& id, + const network::ResourceRequest& request, + const GURL& redirect_url, + net::HttpResponseHeaders* headers) override { CEF_REQUIRE_IOT(); RequestState* state = GetState(id); @@ -708,15 +707,15 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { else state->pending_response_->SetReadOnly(false); - if (head.headers) - state->pending_response_->SetResponseHeaders(*head.headers); + if (headers) + state->pending_response_->SetResponseHeaders(*headers); state->pending_response_->SetReadOnly(true); } void OnRequestResponse(const RequestId& id, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, base::Optional redirect_info, OnRequestResponseResultCallback callback) override { CEF_REQUIRE_IOT(); @@ -735,7 +734,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { if (!state->handler_) { // Cookies may come from a scheme handler. MaybeSaveCookies( - id, state, request, head, + id, state, request, headers, base::BindOnce( std::move(callback), ResponseMode::CONTINUE, nullptr, redirect_info.has_value() ? redirect_info->new_url : GURL())); @@ -746,17 +745,17 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { DCHECK(state->pending_response_); if (redirect_info.has_value()) { - HandleRedirect(id, state, request, head, *redirect_info, + HandleRedirect(id, state, request, headers, *redirect_info, std::move(callback)); } else { - HandleResponse(id, state, request, head, std::move(callback)); + HandleResponse(id, state, request, headers, std::move(callback)); } } void HandleRedirect(const RequestId& id, RequestState* state, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, const net::RedirectInfo& redirect_info, OnRequestResponseResultCallback callback) { GURL new_url = redirect_info.new_url; @@ -786,13 +785,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { auto exec_callback = base::BindOnce( std::move(callback), ResponseMode::CONTINUE, nullptr, new_url); - MaybeSaveCookies(id, state, request, head, std::move(exec_callback)); + MaybeSaveCookies(id, state, request, headers, std::move(exec_callback)); } void HandleResponse(const RequestId& id, RequestState* state, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, OnRequestResponseResultCallback callback) { // The client may modify |pending_request_| in OnResourceResponse. state->pending_request_->SetReadOnly(false); @@ -835,13 +834,13 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { return; } - MaybeSaveCookies(id, state, request, head, std::move(exec_callback)); + MaybeSaveCookies(id, state, request, headers, std::move(exec_callback)); } void MaybeSaveCookies(const RequestId& id, RequestState* state, network::ResourceRequest* request, - const network::ResourceResponseHead& head, + net::HttpResponseHeaders* headers, base::OnceClosure callback) { CEF_REQUIRE_IOT(); @@ -863,7 +862,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler { auto done_cookie_callback = base::BindOnce( &InterceptedRequestHandlerWrapper::ContinueWithSavedCookies, weak_ptr_factory_.GetWeakPtr(), id, std::move(callback)); - net_service::SaveCookies(init_state_->browser_context_, *request, head, + net_service::SaveCookies(init_state_->browser_context_, *request, headers, allow_cookie_callback, std::move(done_cookie_callback)); } diff --git a/libcef/browser/net_service/stream_reader_url_loader.cc b/libcef/browser/net_service/stream_reader_url_loader.cc index 79b699e2e..e8be7609a 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.cc +++ b/libcef/browser/net_service/stream_reader_url_loader.cc @@ -420,8 +420,8 @@ void InputStreamReader::RunSkipCallback(int64_t bytes_skipped) { DCHECK(!pending_skip_callback_.is_null()); job_thread_task_runner_->PostTask( FROM_HERE, - base::Bind(InputStreamReader::RunSkipCallbackOnJobThread, bytes_skipped, - base::Passed(std::move(pending_skip_callback_)))); + base::BindOnce(InputStreamReader::RunSkipCallbackOnJobThread, + bytes_skipped, std::move(pending_skip_callback_))); // Reset callback state. pending_callback_id_ = -1; @@ -433,9 +433,8 @@ void InputStreamReader::RunReadCallback(int bytes_read) { DCHECK(!pending_read_callback_.is_null()); job_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(InputStreamReader::RunReadCallbackOnJobThread, bytes_read, - base::Passed(std::move(pending_read_callback_)))); + FROM_HERE, base::BindOnce(InputStreamReader::RunReadCallbackOnJobThread, + bytes_read, std::move(pending_read_callback_))); // Reset callback state. pending_callback_id_ = -1; @@ -640,32 +639,38 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code, return; } - pending_response_.request_start = base::TimeTicks::Now(); - pending_response_.response_start = base::TimeTicks::Now(); - pending_response_.headers = MakeResponseHeaders( + auto pending_response = network::mojom::URLResponseHead::New(); + pending_response->request_start = base::TimeTicks::Now(); + pending_response->response_start = base::TimeTicks::Now(); + + auto headers = MakeResponseHeaders( status_code, status_text, mime_type, charset, content_length, extra_headers, false /* allow_existing_header_override */); + pending_response->headers = headers; if (content_length >= 0) - pending_response_.content_length = content_length; + pending_response->content_length = content_length; if (!mime_type.empty()) { - pending_response_.mime_type = mime_type; + pending_response->mime_type = mime_type; if (!charset.empty()) - pending_response_.charset = charset; + pending_response->charset = charset; } if (header_client_.is_bound()) { header_client_->OnHeadersReceived( - pending_response_.headers->raw_headers(), net::IPEndPoint(), + headers->raw_headers(), net::IPEndPoint(), base::BindOnce(&StreamReaderURLLoader::ContinueWithResponseHeaders, - weak_factory_.GetWeakPtr())); + weak_factory_.GetWeakPtr(), + std::move(pending_response))); } else { - ContinueWithResponseHeaders(net::OK, base::nullopt, GURL()); + ContinueWithResponseHeaders(std::move(pending_response), net::OK, + base::nullopt, base::nullopt); } } void StreamReaderURLLoader::ContinueWithResponseHeaders( + network::mojom::URLResponseHeadPtr pending_response, int32_t result, const base::Optional& headers, const base::Optional& redirect_url) { @@ -676,34 +681,35 @@ void StreamReaderURLLoader::ContinueWithResponseHeaders( if (headers) { DCHECK(header_client_.is_bound()); - pending_response_.headers = + pending_response->headers = base::MakeRefCounted(*headers); } + auto pending_headers = pending_response->headers; + // What the length would be if we sent headers over the network. Used to // calculate data length. - header_length_ = pending_response_.headers->raw_headers().length(); + header_length_ = pending_headers->raw_headers().length(); DCHECK(client_.is_bound()); std::string location; const auto has_redirect_url = redirect_url && !redirect_url->is_empty(); - if (has_redirect_url || pending_response_.headers->IsRedirect(&location)) { - pending_response_.encoded_data_length = header_length_; - pending_response_.content_length = pending_response_.encoded_body_length = + if (has_redirect_url || pending_headers->IsRedirect(&location)) { + pending_response->encoded_data_length = header_length_; + pending_response->content_length = pending_response->encoded_body_length = 0; const GURL new_location = has_redirect_url ? *redirect_url : request_.url.Resolve(location); client_->OnReceiveRedirect( - MakeRedirectInfo(request_, pending_response_.headers.get(), - new_location, - pending_response_.headers->response_code()), - pending_response_); + MakeRedirectInfo(request_, pending_headers.get(), new_location, + pending_headers->response_code()), + std::move(pending_response)); // The client will restart the request with a new loader. // |this| will be deleted. CleanUp(); } else { - client_->OnReceiveResponse(pending_response_); + client_->OnReceiveResponse(std::move(pending_response)); } } diff --git a/libcef/browser/net_service/stream_reader_url_loader.h b/libcef/browser/net_service/stream_reader_url_loader.h index 2192fc675..7ec165f4c 100644 --- a/libcef/browser/net_service/stream_reader_url_loader.h +++ b/libcef/browser/net_service/stream_reader_url_loader.h @@ -13,9 +13,9 @@ #include "mojo/public/cpp/system/simple_watcher.h" #include "net/http/http_byte_range.h" #include "services/network/public/cpp/net_adapters.h" -#include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader.mojom.h" +#include "services/network/public/mojom/url_response_head.mojom.h" namespace net_service { @@ -188,9 +188,11 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { void OnReaderSkipCompleted(int64_t bytes_skipped); void HeadersComplete(int status_code, int64_t expected_content_length); - void ContinueWithResponseHeaders(int32_t result, - const base::Optional& headers, - const base::Optional& redirect_url); + void ContinueWithResponseHeaders( + network::mojom::URLResponseHeadPtr pending_response, + int32_t result, + const base::Optional& headers, + const base::Optional& redirect_url); void SendBody(); void ReadMore(); @@ -205,8 +207,6 @@ class StreamReaderURLLoader : public network::mojom::URLLoader { const RequestId request_id_; - network::ResourceResponseHead pending_response_; - size_t header_length_ = 0; int64_t total_bytes_read_ = 0; diff --git a/libcef/browser/net_service/url_loader_factory_getter.cc b/libcef/browser/net_service/url_loader_factory_getter.cc index 122444758..64afafea5 100644 --- a/libcef/browser/net_service/url_loader_factory_getter.cc +++ b/libcef/browser/net_service/url_loader_factory_getter.cc @@ -64,7 +64,8 @@ scoped_refptr URLLoaderFactoryGetter::Create( content::ContentBrowserClient::URLLoaderFactoryType::kDocumentSubResource, url::Origin(), base::nullopt /* navigation_id */, &maybe_proxy_factory_request, nullptr /* header_client */, - nullptr /* bypass_redirect_checks */, nullptr /* factory_override */); + nullptr /* bypass_redirect_checks */, nullptr /* disable_secure_dns */, + nullptr /* factory_override */); // If anyone above indicated that they care about proxying, pass the // intermediate pipe along to the URLLoaderFactoryGetter. diff --git a/libcef/browser/osr/motion_event_osr.h b/libcef/browser/osr/motion_event_osr.h index f0db7ea6d..eefac5eeb 100644 --- a/libcef/browser/osr/motion_event_osr.h +++ b/libcef/browser/osr/motion_event_osr.h @@ -9,7 +9,7 @@ #include "include/cef_base.h" -#include "third_party/blink/public/platform/web_touch_event.h" +#include "third_party/blink/public/common/input/web_touch_event.h" #include "ui/events/gesture_detection/motion_event_generic.h" // Implementation of MotionEvent which takes a stream of CefTouchEvents. diff --git a/libcef/browser/osr/osr_accessibility_util.cc b/libcef/browser/osr/osr_accessibility_util.cc index f15b61ebb..bffb27382 100644 --- a/libcef/browser/osr/osr_accessibility_util.cc +++ b/libcef/browser/osr/osr_accessibility_util.cc @@ -103,7 +103,7 @@ struct PopulateAxNodeAttributes { case ax::mojom::IntAttribute::kActivedescendantId: case ax::mojom::IntAttribute::kInPageLinkTargetId: case ax::mojom::IntAttribute::kErrormessageId: - case ax::mojom::IntAttribute::kDetailsId: + case ax::mojom::IntAttribute::kDOMNodeId: case ax::mojom::IntAttribute::kDropeffect: case ax::mojom::IntAttribute::kMemberOfId: case ax::mojom::IntAttribute::kNextFocusId: diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 2b8d0c2bb..e8ed4a401 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -64,7 +64,7 @@ const size_t kMaxDamageRects = 10; const float kDefaultScaleFactor = 1.0; -static content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { +content::ScreenInfo ScreenInfoFrom(const CefScreenInfo& src) { content::ScreenInfo screenInfo; screenInfo.device_scale_factor = src.device_scale_factor; screenInfo.depth = src.depth; @@ -104,12 +104,6 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient { return *view_->GetBackgroundColor(); } - void OnBeginFrame(base::TimeTicks frame_time) override { - // TODO(cef): Maybe we can use this method in combination with - // OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer. - // See https://codereview.chromium.org/1841083007. - } - void OnFrameTokenChanged(uint32_t frame_token) override { view_->render_widget_host()->DidProcessFrame(frame_token); } @@ -179,6 +173,23 @@ float GetDeviceScaleFactor(CefBrowserHostImpl* browser) { return screen_info.device_scale_factor; } +ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle( + cef_composition_underline_style_t style) { + switch (style) { + case CEF_CUS_SOLID: + return ui::ImeTextSpan::UnderlineStyle::kSolid; + case CEF_CUS_DOT: + return ui::ImeTextSpan::UnderlineStyle::kDot; + case CEF_CUS_DASH: + return ui::ImeTextSpan::UnderlineStyle::kDash; + case CEF_CUS_NONE: + return ui::ImeTextSpan::UnderlineStyle::kNone; + } + + NOTREACHED(); + return ui::ImeTextSpan::UnderlineStyle::kSolid; +} + } // namespace CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR( @@ -450,11 +461,6 @@ void CefRenderWidgetHostViewOSR::TakeFallbackContentFrom( host()->GetContentRenderingTimeoutFrom(view_cef->host()); } -void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink( - viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) { - NOTREACHED(); -} - void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {} void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete( @@ -526,13 +532,6 @@ void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t sequence, damage_rects_[sequence] = rect; } -void CefRenderWidgetHostViewOSR::SubmitCompositorFrame( - const viz::LocalSurfaceId& local_surface_id, - viz::CompositorFrame frame, - base::Optional hit_test_region_list) { - NOTREACHED(); -} - void CefRenderWidgetHostViewOSR::ResetFallbackToFirstNavigationSurface() { delegated_frame_host_->ResetFallbackToFirstNavigationSurface(); } @@ -795,7 +794,8 @@ void CefRenderWidgetHostViewOSR::ImeSetComposition( ui::ImeTextSpan::Type::kComposition, line.range.from, line.range.to, line.thick ? ui::ImeTextSpan::Thickness::kThick : ui::ImeTextSpan::Thickness::kThin, - line.background_color, line.color, std::vector())); + GetImeUnderlineStyle(line.style), line.background_color, line.color, + std::vector())); } gfx::Range range(replacement_range.from, replacement_range.to); @@ -898,20 +898,6 @@ CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() { return std::make_unique(host()); } -void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) { - SetFrameRate(); - - if (host_display_client_) { - host_display_client_->SetActive(enabled); - } -} - -void CefRenderWidgetHostViewOSR::SetWantsAnimateOnlyBeginFrames() { - if (delegated_frame_host_) { - delegated_frame_host_->SetWantsAnimateOnlyBeginFrames(); - } -} - bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView( const gfx::PointF& point, RenderWidgetHostViewBase* target_view, @@ -1108,13 +1094,15 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent( if (popup_host_view_) { if (popup_host_view_->popup_position_.Contains( - event.PositionInWidget().x, event.PositionInWidget().y)) { + event.PositionInWidget().x(), event.PositionInWidget().y())) { blink::WebMouseEvent popup_event(event); popup_event.SetPositionInWidget( - event.PositionInWidget().x - popup_host_view_->popup_position_.x(), - event.PositionInWidget().y - popup_host_view_->popup_position_.y()); - popup_event.SetPositionInScreen(popup_event.PositionInWidget().x, - popup_event.PositionInWidget().y); + event.PositionInWidget().x() - + popup_host_view_->popup_position_.x(), + event.PositionInWidget().y() - + popup_host_view_->popup_position_.y()); + popup_event.SetPositionInScreen(popup_event.PositionInWidget().x(), + popup_event.PositionInWidget().y()); popup_host_view_->SendMouseEvent(popup_event); return; @@ -1127,14 +1115,14 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent( } const gfx::Rect& guest_bounds = guest_host_view->render_widget_host_->GetView()->GetViewBounds(); - if (guest_bounds.Contains(event.PositionInWidget().x, - event.PositionInWidget().y)) { + if (guest_bounds.Contains(event.PositionInWidget().x(), + event.PositionInWidget().y())) { blink::WebMouseEvent guest_event(event); guest_event.SetPositionInWidget( - event.PositionInWidget().x - guest_bounds.x(), - event.PositionInWidget().y - guest_bounds.y()); - guest_event.SetPositionInScreen(guest_event.PositionInWidget().x, - guest_event.PositionInWidget().y); + event.PositionInWidget().x() - guest_bounds.x(), + event.PositionInWidget().y() - guest_bounds.y()); + guest_event.SetPositionInScreen(guest_event.PositionInWidget().x(), + guest_event.PositionInWidget().y()); guest_host_view->SendMouseEvent(guest_event); return; @@ -1168,14 +1156,16 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( if (popup_host_view_) { if (popup_host_view_->popup_position_.Contains( - event.PositionInWidget().x, event.PositionInWidget().y)) { + event.PositionInWidget().x(), event.PositionInWidget().y())) { blink::WebMouseWheelEvent popup_mouse_wheel_event(event); popup_mouse_wheel_event.SetPositionInWidget( - event.PositionInWidget().x - popup_host_view_->popup_position_.x(), - event.PositionInWidget().y - popup_host_view_->popup_position_.y()); + event.PositionInWidget().x() - + popup_host_view_->popup_position_.x(), + event.PositionInWidget().y() - + popup_host_view_->popup_position_.y()); popup_mouse_wheel_event.SetPositionInScreen( - popup_mouse_wheel_event.PositionInWidget().x, - popup_mouse_wheel_event.PositionInWidget().y); + popup_mouse_wheel_event.PositionInWidget().x(), + popup_mouse_wheel_event.PositionInWidget().y()); popup_host_view_->SendMouseWheelEvent(popup_mouse_wheel_event); return; @@ -1196,15 +1186,15 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent( } const gfx::Rect& guest_bounds = guest_host_view->render_widget_host_->GetView()->GetViewBounds(); - if (guest_bounds.Contains(event.PositionInWidget().x, - event.PositionInWidget().y)) { + if (guest_bounds.Contains(event.PositionInWidget().x(), + event.PositionInWidget().y())) { blink::WebMouseWheelEvent guest_mouse_wheel_event(event); guest_mouse_wheel_event.SetPositionInWidget( - event.PositionInWidget().x - guest_bounds.x(), - event.PositionInWidget().y - guest_bounds.y()); + event.PositionInWidget().x() - guest_bounds.x(), + event.PositionInWidget().y() - guest_bounds.y()); guest_mouse_wheel_event.SetPositionInScreen( - guest_mouse_wheel_event.PositionInWidget().x, - guest_mouse_wheel_event.PositionInWidget().y); + guest_mouse_wheel_event.PositionInWidget().x(), + guest_mouse_wheel_event.PositionInWidget().y()); guest_host_view->SendMouseWheelEvent(guest_mouse_wheel_event); return; diff --git a/libcef/browser/osr/render_widget_host_view_osr.h b/libcef/browser/osr/render_widget_host_view_osr.h index c853bbab6..f93b653be 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.h +++ b/libcef/browser/osr/render_widget_host_view_osr.h @@ -135,13 +135,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, #endif // defined(OS_MACOSX) // RenderWidgetHostViewBase implementation. - void DidCreateNewRendererCompositorFrameSink( - viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink) - override; - void SubmitCompositorFrame( - const viz::LocalSurfaceId& local_surface_id, - viz::CompositorFrame frame, - base::Optional hit_test_region_list) override; void ResetFallbackToFirstNavigationSurface() override; void InitAsPopup(content::RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) override; @@ -176,8 +169,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, const std::vector& character_bounds) override; std::unique_ptr CreateSyntheticGestureTarget() override; - void SetNeedsBeginFrames(bool enabled) override; - void SetWantsAnimateOnlyBeginFrames() override; bool TransformPointToCoordSpaceForView( const gfx::PointF& point, RenderWidgetHostViewBase* target_view, @@ -400,9 +391,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase, content::MouseWheelPhaseHandler mouse_wheel_phase_handler_; - std::unique_ptr - renderer_compositor_frame_sink_; - // Latest capture sequence number which is incremented when the caller // requests surfaces be synchronized via // EnsureSurfaceSynchronizedForLayoutTest(). diff --git a/libcef/browser/prefs/browser_prefs.cc b/libcef/browser/prefs/browser_prefs.cc index 69ca19197..d582f1b44 100644 --- a/libcef/browser/prefs/browser_prefs.cc +++ b/libcef/browser/prefs/browser_prefs.cc @@ -56,7 +56,7 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_WIN) #include "components/os_crypt/os_crypt.h" #endif @@ -185,7 +185,7 @@ std::unique_ptr CreatePrefService(Profile* profile, if (!profile) { SystemNetworkContextManager::RegisterPrefs(registry.get()); -#if defined(OS_MACOSX) || defined(OS_WIN) +#if defined(OS_WIN) OSCrypt::RegisterLocalPrefs(registry.get()); #endif } diff --git a/libcef/browser/printing/print_view_manager.cc b/libcef/browser/printing/print_view_manager.cc index c43ec8f81..19e28f471 100644 --- a/libcef/browser/printing/print_view_manager.cc +++ b/libcef/browser/printing/print_view_manager.cc @@ -290,8 +290,11 @@ void CefPrintViewManager::OnRequestPrintPreview_PrintToPdf( DCHECK_EQ(pdf_print_state_->printing_rfh_, rfh); - rfh->Send(new PrintMsg_PrintPreview(rfh->GetRoutingID(), - pdf_print_state_->settings_)); + mojo::AssociatedRemote + print_render_frame_remote; + rfh->GetRemoteAssociatedInterfaces()->GetInterface( + &print_render_frame_remote); + print_render_frame_remote->PrintPreview(pdf_print_state_->settings_.Clone()); } void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf( diff --git a/libcef/browser/server_impl.cc b/libcef/browser/server_impl.cc index c3b08cacc..38c226c6d 100644 --- a/libcef/browser/server_impl.cc +++ b/libcef/browser/server_impl.cc @@ -381,7 +381,7 @@ void CefServerImpl::SendHttp200ResponseInternal( if (!CEF_CURRENTLY_ON_HT()) { CEF_POST_TASK_HT(base::BindOnce(&CefServerImpl::SendHttp200ResponseInternal, this, connection_id, content_type, - base::Passed(std::move(data)))); + std::move(data))); return; } @@ -407,8 +407,7 @@ void CefServerImpl::SendRawDataInternal(int connection_id, std::unique_ptr data) { if (!CEF_CURRENTLY_ON_HT()) { CEF_POST_TASK_HT(base::BindOnce(&CefServerImpl::SendRawDataInternal, this, - connection_id, - base::Passed(std::move(data)))); + connection_id, std::move(data))); return; } @@ -427,7 +426,7 @@ void CefServerImpl::SendWebSocketMessageInternal( if (!CEF_CURRENTLY_ON_HT()) { CEF_POST_TASK_HT( base::BindOnce(&CefServerImpl::SendWebSocketMessageInternal, this, - connection_id, base::Passed(std::move(data)))); + connection_id, std::move(data))); return; } diff --git a/libcef/browser/ssl_host_state_delegate.cc b/libcef/browser/ssl_host_state_delegate.cc index 8b565aded..a7f037a2a 100644 --- a/libcef/browser/ssl_host_state_delegate.cc +++ b/libcef/browser/ssl_host_state_delegate.cc @@ -57,7 +57,8 @@ bool CefSSLHostStateDelegate::DidHostRunInsecureContent( void CefSSLHostStateDelegate::AllowCert(const std::string& host, const net::X509Certificate& cert, - int error) { + int error, + content::WebContents* web_contents) { cert_policy_for_host_[host].Allow(cert, error); } @@ -82,7 +83,8 @@ void CefSSLHostStateDelegate::Clear( SSLHostStateDelegate::CertJudgment CefSSLHostStateDelegate::QueryPolicy( const std::string& host, const net::X509Certificate& cert, - int error) { + int error, + content::WebContents* web_contents) { return cert_policy_for_host_[host].Check(cert, error) ? SSLHostStateDelegate::ALLOWED : SSLHostStateDelegate::DENIED; @@ -93,7 +95,9 @@ void CefSSLHostStateDelegate::RevokeUserAllowExceptions( cert_policy_for_host_.erase(host); } -bool CefSSLHostStateDelegate::HasAllowException(const std::string& host) { +bool CefSSLHostStateDelegate::HasAllowException( + const std::string& host, + content::WebContents* web_contents) { auto policy_iterator = cert_policy_for_host_.find(host); return policy_iterator != cert_policy_for_host_.end() && policy_iterator->second.HasAllowException(); diff --git a/libcef/browser/ssl_host_state_delegate.h b/libcef/browser/ssl_host_state_delegate.h index e1aed3b61..3085c6eec 100644 --- a/libcef/browser/ssl_host_state_delegate.h +++ b/libcef/browser/ssl_host_state_delegate.h @@ -49,13 +49,15 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { // SSLHostStateDelegate methods: void AllowCert(const std::string& host, const net::X509Certificate& cert, - int error) override; + int error, + content::WebContents* web_contents) override; void Clear(const base::RepeatingCallback host_filter) override; content::SSLHostStateDelegate::CertJudgment QueryPolicy( const std::string& host, const net::X509Certificate& cert, - int error) override; + int error, + content::WebContents* web_contents) override; void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override; @@ -63,7 +65,8 @@ class CefSSLHostStateDelegate : public content::SSLHostStateDelegate { int child_id, InsecureContentType content_type) override; void RevokeUserAllowExceptions(const std::string& host) override; - bool HasAllowException(const std::string& host) override; + bool HasAllowException(const std::string& host, + content::WebContents* web_contents) override; private: // Certificate policies for each host. diff --git a/libcef/browser/x509_certificate_impl.cc b/libcef/browser/x509_certificate_impl.cc index 9f96c2751..0ae4c42ff 100644 --- a/libcef/browser/x509_certificate_impl.cc +++ b/libcef/browser/x509_certificate_impl.cc @@ -101,12 +101,12 @@ size_t CefX509CertificateImpl::GetIssuerChainSize() { } void CefX509CertificateImpl::AcquirePrivateKey( - const base::Callback)>& + base::OnceCallback)> private_key_callback) { if (identity_) - identity_->AcquirePrivateKey(private_key_callback); + identity_->AcquirePrivateKey(std::move(private_key_callback)); else - private_key_callback.Run(nullptr); + std::move(private_key_callback).Run(nullptr); } void CefX509CertificateImpl::GetEncodedIssuerChain( diff --git a/libcef/browser/x509_certificate_impl.h b/libcef/browser/x509_certificate_impl.h index d5a7ad683..5a5fc37a7 100644 --- a/libcef/browser/x509_certificate_impl.h +++ b/libcef/browser/x509_certificate_impl.h @@ -35,7 +35,7 @@ class CefX509CertificateImpl : public CefX509Certificate { scoped_refptr GetInternalCertObject() { return cert_; } void AcquirePrivateKey( - const base::Callback)>& + base::OnceCallback)> private_key_callback); private: diff --git a/libcef/common/cef_messages.h b/libcef/common/cef_messages.h index 2cfa01bf4..6662ba127 100644 --- a/libcef/common/cef_messages.h +++ b/libcef/common/cef_messages.h @@ -114,7 +114,7 @@ IPC_STRUCT_BEGIN(CefMsg_LoadRequest_Params) // lead to undesired cookie blocking. Third-party cookie blocking can be // bypassed by setting site_for_cookies = url, but this should ideally // only be done if there really is no way to determine the correct value. - IPC_STRUCT_MEMBER(GURL, site_for_cookies) + IPC_STRUCT_MEMBER(net::SiteForCookies, site_for_cookies) // Additional HTTP request headers. IPC_STRUCT_MEMBER(std::string, headers) diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 38f19c029..507a5e9c7 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -23,6 +23,7 @@ #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/path_service.h" +#include "base/run_loop.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" diff --git a/libcef/common/net_service/net_service_util.cc b/libcef/common/net_service/net_service_util.cc index 756823293..6e2e513b3 100644 --- a/libcef/common/net_service/net_service_util.cc +++ b/libcef/common/net_service/net_service_util.cc @@ -21,7 +21,6 @@ #include "net/url_request/redirect_util.h" #include "net/url_request/url_request.h" #include "services/network/public/cpp/resource_request.h" -#include "services/network/public/cpp/resource_response.h" namespace net_service { @@ -91,7 +90,7 @@ std::string MakeContentTypeValue(const std::string& mime_type, return value; } -net::HttpResponseHeaders* MakeResponseHeaders( +scoped_refptr MakeResponseHeaders( int status_code, const std::string& status_text, const std::string& mime_type, @@ -102,8 +101,8 @@ net::HttpResponseHeaders* MakeResponseHeaders( if (status_code <= 0) status_code = 200; - auto headers = new net::HttpResponseHeaders( - MakeStatusLine(status_code, status_text, false)); + auto headers = WrapRefCounted(new net::HttpResponseHeaders( + MakeStatusLine(status_code, status_text, false))); // Track the headers that have already been set. Perform all comparisons in // lowercase. @@ -171,8 +170,8 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request, : net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; return net::RedirectInfo::ComputeRedirectInfo( request.method, request.url, request.site_for_cookies, - first_party_url_policy, request.referrer_policy, - request.referrer.spec(), status_code, location, + first_party_url_policy, request.referrer_policy, request.referrer.spec(), + status_code, location, net::RedirectUtil::GetReferrerPolicyHeader(headers), insecure_scheme_was_upgraded); } diff --git a/libcef/common/net_service/net_service_util.h b/libcef/common/net_service/net_service_util.h index 32620e69b..cf748d095 100644 --- a/libcef/common/net_service/net_service_util.h +++ b/libcef/common/net_service/net_service_util.h @@ -10,6 +10,8 @@ #include "include/internal/cef_types_wrappers.h" +#include "base/memory/scoped_refptr.h" + namespace net { class CanonicalCookie; class HttpResponseHeaders; @@ -18,7 +20,6 @@ struct RedirectInfo; namespace network { struct ResourceRequest; -struct ResourceResponseHead; } // namespace network class GURL; @@ -48,7 +49,7 @@ std::string MakeContentTypeValue(const std::string& mime_type, const std::string& charset); // Make a new HttpResponseHeaders object. -net::HttpResponseHeaders* MakeResponseHeaders( +scoped_refptr MakeResponseHeaders( int status_code, const std::string& status_text, const std::string& mime_type, diff --git a/libcef/common/parser_impl.cc b/libcef/common/parser_impl.cc index 57c527b9a..b516ac771 100644 --- a/libcef/common/parser_impl.cc +++ b/libcef/common/parser_impl.cc @@ -102,8 +102,7 @@ CefString CefBase64Encode(const void* data, size_t data_size) { if (data_size == 0) return CefString(); - base::StringPiece input; - input.set(static_cast(data), data_size); + base::StringPiece input(static_cast(data), data_size); std::string output; base::Base64Encode(input, &output); return output; diff --git a/libcef/common/request_impl.cc b/libcef/common/request_impl.cc index 0196041f8..cd667d9fb 100644 --- a/libcef/common/request_impl.cc +++ b/libcef/common/request_impl.cc @@ -299,13 +299,17 @@ void CefRequestImpl::SetReferrer(const CefString& referrer_url, base::AutoLock lock_scope(lock_); CHECK_READONLY_RETURN_VOID(); - // Call GetAsReferrer here for consistency since the same logic will later be - // applied by URLRequest::SetReferrer(). - const GURL& new_referrer_url = GURL(referrer_url.ToString()).GetAsReferrer(); - if (referrer_url_ != new_referrer_url || referrer_policy_ != policy) { + const auto& sanitized_referrer = content::Referrer::SanitizeForRequest( + url_, content::Referrer(GURL(referrer_url.ToString()), + NetReferrerPolicyToBlinkReferrerPolicy(policy))); + const auto sanitized_policy = + BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy); + + if (referrer_url_ != sanitized_referrer.url || + referrer_policy_ != sanitized_policy) { Changed(kChangedReferrer); - referrer_url_ = new_referrer_url; - referrer_policy_ = policy; + referrer_url_ = sanitized_referrer.url; + referrer_policy_ = sanitized_policy; } } @@ -425,16 +429,16 @@ void CefRequestImpl::SetFlags(int flags) { CefString CefRequestImpl::GetFirstPartyForCookies() { base::AutoLock lock_scope(lock_); - return first_party_for_cookies_.spec(); + return site_for_cookies_.RepresentativeUrl().spec(); } void CefRequestImpl::SetFirstPartyForCookies(const CefString& url) { base::AutoLock lock_scope(lock_); CHECK_READONLY_RETURN_VOID(); - const GURL& new_url = GURL(url.ToString()); - if (first_party_for_cookies_ != new_url) { - Changed(kChangedFirstPartyForCookies); - first_party_for_cookies_ = new_url; + auto new_site = net::SiteForCookies::FromUrl(GURL(url.ToString())); + if (!new_site.IsEquivalent(site_for_cookies_)) { + Changed(kChangedSiteForCookies); + site_for_cookies_ = new_site; } } @@ -464,12 +468,16 @@ void CefRequestImpl::Set(const network::ResourceRequest* request, method_ = request->method; identifier_ = identifier; - // Our consumer should have made sure that this is a safe referrer. See for - // instance WebCore::FrameLoader::HideReferrer. if (request->referrer.is_valid()) { - referrer_url_ = request->referrer; + const auto& sanitized_referrer = content::Referrer::SanitizeForRequest( + request->url, + content::Referrer( + request->referrer, + NetReferrerPolicyToBlinkReferrerPolicy( + static_cast(request->referrer_policy)))); + referrer_url_ = sanitized_referrer.url; referrer_policy_ = - static_cast(request->referrer_policy); + BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy); } // Transfer request headers. @@ -481,7 +489,7 @@ void CefRequestImpl::Set(const network::ResourceRequest* request, static_cast(postdata_.get())->Set(*request->request_body); } - first_party_for_cookies_ = request->site_for_cookies; + site_for_cookies_ = request->site_for_cookies; resource_type_ = static_cast(request->resource_type); transition_type_ = @@ -519,9 +527,9 @@ void CefRequestImpl::Get(network::ResourceRequest* request, } } - if (!first_party_for_cookies_.is_empty() && - ShouldSet(kChangedFirstPartyForCookies, changed_only)) { - request->site_for_cookies = first_party_for_cookies_; + if (!site_for_cookies_.IsNull() && + ShouldSet(kChangedSiteForCookies, changed_only)) { + request->site_for_cookies = site_for_cookies_; } if (ShouldSet(kChangedFlags, changed_only)) { @@ -560,10 +568,17 @@ void CefRequestImpl::Set(const net::RedirectInfo& redirect_info) { url_ = redirect_info.new_url; method_ = redirect_info.new_method; - first_party_for_cookies_ = redirect_info.new_site_for_cookies; - referrer_url_ = GURL(redirect_info.new_referrer); + site_for_cookies_ = redirect_info.new_site_for_cookies; + + const auto& sanitized_referrer = content::Referrer::SanitizeForRequest( + redirect_info.new_url, + content::Referrer(GURL(redirect_info.new_referrer), + NetReferrerPolicyToBlinkReferrerPolicy( + static_cast( + redirect_info.new_referrer_policy)))); + referrer_url_ = sanitized_referrer.url; referrer_policy_ = - static_cast(redirect_info.new_referrer_policy); + BlinkReferrerPolicyToNetReferrerPolicy(sanitized_referrer.policy); } void CefRequestImpl::Set(const net::HttpRequestHeaders& headers) { @@ -584,7 +599,7 @@ void CefRequestImpl::Set( url_ = params.url(); method_ = params.is_post() ? "POST" : "GET"; - const content::Referrer& sanitized_referrer = + const auto& sanitized_referrer = content::Referrer::SanitizeForRequest(params.url(), params.referrer()); referrer_url_ = sanitized_referrer.url; referrer_policy_ = @@ -609,8 +624,9 @@ void CefRequestImpl::Get(blink::WebURLRequest& request, NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_), url_, blink::WebString::FromUTF8(referrer_url_.spec())); if (!referrer.IsEmpty()) { - request.SetHttpReferrer( - referrer, NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_)); + request.SetReferrerString(referrer); + request.SetReferrerPolicy( + NetReferrerPolicyToBlinkReferrerPolicy(referrer_policy_)); } } @@ -634,8 +650,8 @@ void CefRequestImpl::Get(blink::WebURLRequest& request, ::SetHeaderMap(headermap_, request); - if (!first_party_for_cookies_.is_empty()) - request.SetSiteForCookies(first_party_for_cookies_); + if (!site_for_cookies_.IsNull()) + request.SetSiteForCookies(site_for_cookies_); int flags = flags_; if (!(flags & kURCachePolicyMask)) { @@ -666,10 +682,9 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, static_cast(params.referrer_policy)), params.url, blink::WebString::FromUTF8(params.referrer.spec())); if (!referrer.IsEmpty()) { - request.SetHttpReferrer( - referrer, - NetReferrerPolicyToBlinkReferrerPolicy( - static_cast(params.referrer_policy))); + request.SetReferrerString(referrer); + request.SetReferrerPolicy(NetReferrerPolicyToBlinkReferrerPolicy( + static_cast(params.referrer_policy))); } } @@ -711,8 +726,10 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, data.Assign(element->bytes(), element->bytes_length()); body.AppendData(data); } else if (element->type() == net::UploadElement::TYPE_FILE) { - body.AppendFile( - FilePathStringToWebString(element->file_path().value())); + body.AppendFileRange( + FilePathStringToWebString(element->file_path().value()), + element->file_range_offset(), element->file_range_length(), + element->expected_file_modification_time()); } else { NOTREACHED(); } @@ -721,7 +738,7 @@ void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, request.SetHttpBody(body); } - if (params.site_for_cookies.is_valid()) + if (!params.site_for_cookies.IsNull()) request.SetSiteForCookies(params.site_for_cookies); int flags = params.load_flags; @@ -758,7 +775,7 @@ void CefRequestImpl::Get(CefNavigateParams& params) const { impl->Get(*params.upload_data.get()); } - params.site_for_cookies = first_party_for_cookies_; + params.site_for_cookies = site_for_cookies_; params.load_flags = flags_; } @@ -817,8 +834,8 @@ void CefRequestImpl::RevertChanges() { } if (backup_->backups_ & kChangedFlags) flags_ = backup_->flags_; - if (backup_->backups_ & kChangedFirstPartyForCookies) - first_party_for_cookies_ = backup_->first_party_for_cookies_; + if (backup_->backups_ & kChangedSiteForCookies) + site_for_cookies_ = backup_->site_for_cookies_; backup_.reset(); } @@ -938,10 +955,10 @@ void CefRequestImpl::Changed(uint8_t changes) { backup_->flags_ = flags_; backup_->backups_ |= kChangedFlags; } - if ((changes & kChangedFirstPartyForCookies) && - !(backup_->backups_ & kChangedFirstPartyForCookies)) { - backup_->first_party_for_cookies_ = first_party_for_cookies_; - backup_->backups_ |= kChangedFirstPartyForCookies; + if ((changes & kChangedSiteForCookies) && + !(backup_->backups_ & kChangedSiteForCookies)) { + backup_->site_for_cookies_ = site_for_cookies_; + backup_->backups_ |= kChangedSiteForCookies; } } @@ -988,7 +1005,7 @@ void CefRequestImpl::Reset() { transition_type_ = TT_EXPLICIT; identifier_ = 0U; flags_ = UR_FLAG_NONE; - first_party_for_cookies_ = GURL(); + site_for_cookies_ = net::SiteForCookies(); changes_ = kChangedNone; } @@ -1193,7 +1210,8 @@ void CefPostDataImpl::Get(blink::WebHTTPBody& data) const { if (element.type == blink::WebHTTPBody::Element::kTypeData) { data.AppendData(element.data); } else if (element.type == blink::WebHTTPBody::Element::kTypeFile) { - data.AppendFile(element.file_path); + data.AppendFileRange(element.file_path, element.file_start, + element.file_length, element.modification_time); } else { NOTREACHED(); } diff --git a/libcef/common/request_impl.h b/libcef/common/request_impl.h index 818826f56..b0e259748 100644 --- a/libcef/common/request_impl.h +++ b/libcef/common/request_impl.h @@ -13,6 +13,7 @@ #include "include/cef_request.h" #include "base/synchronization/lock.h" +#include "net/cookies/site_for_cookies.h" #include "services/network/public/mojom/referrer_policy.mojom-shared.h" #include "third_party/blink/public/platform/web_http_body.h" #include "url/gurl.h" @@ -54,7 +55,7 @@ class CefRequestImpl : public CefRequest { kChangedPostData = 1 << 3, kChangedHeaderMap = 1 << 4, kChangedFlags = 1 << 5, - kChangedFirstPartyForCookies = 1 << 6, + kChangedSiteForCookies = 1 << 6, }; CefRequestImpl(); @@ -162,7 +163,7 @@ class CefRequestImpl : public CefRequest { // The below members are used by CefURLRequest. int flags_; - GURL first_party_for_cookies_; + net::SiteForCookies site_for_cookies_; // Stores backup of values for use with track changes. struct Backup { @@ -176,7 +177,7 @@ class CefRequestImpl : public CefRequest { CefRefPtr postdata_; std::unique_ptr headermap_; int flags_; - GURL first_party_for_cookies_; + net::SiteForCookies site_for_cookies_; }; std::unique_ptr backup_; diff --git a/libcef/common/response_impl.cc b/libcef/common/response_impl.cc index 007255942..c55a17367 100644 --- a/libcef/common/response_impl.cc +++ b/libcef/common/response_impl.cc @@ -155,7 +155,7 @@ void CefResponseImpl::SetHeaderMap(const HeaderMap& headerMap) { header_map_ = headerMap; } -net::HttpResponseHeaders* CefResponseImpl::GetResponseHeaders() { +scoped_refptr CefResponseImpl::GetResponseHeaders() { base::AutoLock lock_scope(lock_); std::string mime_type = mime_type_; diff --git a/libcef/common/response_impl.h b/libcef/common/response_impl.h index da39db8f2..5dab4519b 100644 --- a/libcef/common/response_impl.h +++ b/libcef/common/response_impl.h @@ -44,7 +44,7 @@ class CefResponseImpl : public CefResponse { CefString GetURL() override; void SetURL(const CefString& url) override; - net::HttpResponseHeaders* GetResponseHeaders(); + scoped_refptr GetResponseHeaders(); void SetResponseHeaders(const net::HttpResponseHeaders& headers); void Set(const blink::WebURLResponse& response); diff --git a/libcef/common/widevine_loader.cc b/libcef/common/widevine_loader.cc index c4dd57ef1..f2d9e3068 100644 --- a/libcef/common/widevine_loader.cc +++ b/libcef/common/widevine_loader.cc @@ -417,14 +417,14 @@ void LoadWidevineCdmInfoOnBlockingThread( cef_cdm_registration_error_t result = LoadWidevineCdmInfo(base_path, args.get(), &error_message); if (result != CEF_CDM_REGISTRATION_ERROR_NONE) { - CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result, - error_message, callback)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(DeliverWidevineCdmCallback, result, + error_message, callback)); return; } // Continue execution on the UI thread. - CEF_POST_TASK(CEF_UIT, base::Bind(RegisterWidevineCdmOnUIThread, - base::Passed(std::move(args)), callback)); + CEF_POST_TASK(CEF_UIT, base::BindOnce(RegisterWidevineCdmOnUIThread, + std::move(args), callback)); } } // namespace @@ -446,7 +446,7 @@ void CefWidevineLoader::LoadWidevineCdm( } CEF_POST_USER_VISIBLE_TASK( - base::Bind(LoadWidevineCdmInfoOnBlockingThread, path, callback)); + base::BindOnce(LoadWidevineCdmInfoOnBlockingThread, path, callback)); } void CefWidevineLoader::OnContextInitialized() { diff --git a/libcef/renderer/blink_glue.cc b/libcef/renderer/blink_glue.cc index a24b4bceb..58f1c3f30 100644 --- a/libcef/renderer/blink_glue.cc +++ b/libcef/renderer/blink_glue.cc @@ -61,8 +61,10 @@ void GoBack(blink::WebView* view) { if (main_frame && main_frame->IsWebLocalFrame()) { blink::WebViewImpl* view_impl = reinterpret_cast(view); if (view_impl->Client()->HistoryBackListCount() > 0) { - main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon( - -1, true /* has_user_gesture */); + blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); + blink::To(core_frame) + ->GetLocalFrameHostRemote() + .GoToEntryAtOffset(-1, true /* has_user_gesture */); } } } @@ -75,8 +77,10 @@ void GoForward(blink::WebView* view) { if (main_frame && main_frame->IsWebLocalFrame()) { blink::WebViewImpl* view_impl = reinterpret_cast(view); if (view_impl->Client()->HistoryForwardListCount() > 0) { - main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon( - 1, true /* has_user_gesture */); + blink::Frame* core_frame = blink::WebFrame::ToCoreFrame(*main_frame); + blink::To(core_frame) + ->GetLocalFrameHostRemote() + .GoToEntryAtOffset(1, true /* has_user_gesture */); } } } diff --git a/libcef/renderer/content_renderer_client.cc b/libcef/renderer/content_renderer_client.cc index c38507b8f..d45e742cf 100644 --- a/libcef/renderer/content_renderer_client.cc +++ b/libcef/renderer/content_renderer_client.cc @@ -64,7 +64,6 @@ #include "components/printing/renderer/print_render_frame_helper.h" #include "components/spellcheck/renderer/spellcheck.h" #include "components/spellcheck/renderer/spellcheck_provider.h" -#include "components/startup_metric_utils/common/startup_metric.mojom.h" #include "components/visitedlink/renderer/visitedlink_reader.h" #include "components/web_cache/renderer/web_cache_impl.h" #include "content/common/frame_messages.h" @@ -393,13 +392,6 @@ void CefContentRendererClient::RenderThreadStarted() { ? blink::scheduler::WebRendererProcessType::kExtensionRenderer : blink::scheduler::WebRendererProcessType::kRenderer); - { - mojo::Remote - startup_metric_host; - thread->BindHostReceiver(startup_metric_host.BindNewPipeAndPassReceiver()); - startup_metric_host->RecordRendererMainEntryTime(main_entry_time_); - } - thread->AddObserver(observer_.get()); if (!command_line->HasSwitch(switches::kDisableSpellChecking)) { @@ -609,7 +601,7 @@ void CefContentRendererClient::WillSendRequest( blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - const blink::WebURL& site_for_cookies, + const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url, bool* attach_same_site_cookies) { diff --git a/libcef/renderer/content_renderer_client.h b/libcef/renderer/content_renderer_client.h index f237eeb17..19e83d614 100644 --- a/libcef/renderer/content_renderer_client.h +++ b/libcef/renderer/content_renderer_client.h @@ -118,7 +118,7 @@ class CefContentRendererClient void WillSendRequest(blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - const blink::WebURL& site_for_cookies, + const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url, bool* attach_same_site_cookies) override; diff --git a/libcef/renderer/extensions/extensions_renderer_client.cc b/libcef/renderer/extensions/extensions_renderer_client.cc index 1016c8991..a0c16f247 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.cc +++ b/libcef/renderer/extensions/extensions_renderer_client.cc @@ -122,7 +122,7 @@ void CefExtensionsRendererClient::WillSendRequest( blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - const blink::WebURL& site_for_cookies, + const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url, bool* attach_same_site_cookies) { diff --git a/libcef/renderer/extensions/extensions_renderer_client.h b/libcef/renderer/extensions/extensions_renderer_client.h index fc2bd4190..b82c3a9dc 100644 --- a/libcef/renderer/extensions/extensions_renderer_client.h +++ b/libcef/renderer/extensions/extensions_renderer_client.h @@ -22,6 +22,10 @@ struct WebPluginParams; class WebURL; } // namespace blink +namespace net { +class SiteForCookies; +} + namespace content { class BrowserPluginDelegate; class RenderFrame; @@ -64,7 +68,7 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient { void WillSendRequest(blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, - const blink::WebURL& site_for_cookies, + const net::SiteForCookies& site_for_cookies, const url::Origin* initiator_origin, GURL* new_url, bool* attach_same_site_cookies); diff --git a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc index 5e2a0e0dc..8e737399c 100644 --- a/libcef/renderer/extensions/print_render_frame_helper_delegate.cc +++ b/libcef/renderer/extensions/print_render_frame_helper_delegate.cc @@ -29,11 +29,6 @@ CefPrintRenderFrameHelperDelegate::CefPrintRenderFrameHelperDelegate( CefPrintRenderFrameHelperDelegate::~CefPrintRenderFrameHelperDelegate() {} -bool CefPrintRenderFrameHelperDelegate::CancelPrerender( - content::RenderFrame* render_frame) { - return false; -} - // Return the PDF object element if |frame| is the out of process PDF extension. blink::WebElement CefPrintRenderFrameHelperDelegate::GetPdfElement( blink::WebLocalFrame* frame) { diff --git a/libcef/renderer/extensions/print_render_frame_helper_delegate.h b/libcef/renderer/extensions/print_render_frame_helper_delegate.h index 58f9f5bf3..9ecc29dba 100644 --- a/libcef/renderer/extensions/print_render_frame_helper_delegate.h +++ b/libcef/renderer/extensions/print_render_frame_helper_delegate.h @@ -15,7 +15,6 @@ class CefPrintRenderFrameHelperDelegate explicit CefPrintRenderFrameHelperDelegate(bool is_windowless); ~CefPrintRenderFrameHelperDelegate() override; - bool CancelPrerender(content::RenderFrame* render_frame) override; blink::WebElement GetPdfElement(blink::WebLocalFrame* frame) override; bool IsPrintPreviewEnabled() override; bool OverridePrint(blink::WebLocalFrame* frame) override; diff --git a/libcef/renderer/frame_impl.cc b/libcef/renderer/frame_impl.cc index cb74a72cc..648721d0f 100644 --- a/libcef/renderer/frame_impl.cc +++ b/libcef/renderer/frame_impl.cc @@ -120,8 +120,8 @@ void CefFrameImpl::LoadRequest(CefRefPtr request) { CefMsg_LoadRequest_Params params; params.url = GURL(std::string(request->GetURL())); params.method = request->GetMethod(); - params.site_for_cookies = - GURL(std::string(request->GetFirstPartyForCookies())); + params.site_for_cookies = net::SiteForCookies::FromUrl( + GURL(request->GetFirstPartyForCookies().ToString())); CefRequest::HeaderMap headerMap; request->GetHeaderMap(headerMap); @@ -504,7 +504,6 @@ void CefFrameImpl::OnDidStopLoading() { // in this frame's in-process subtree. If there are multiple of these for the // same browser then the other occurrences will be discarded in // OnLoadingStateChange. - DCHECK(frame_->IsLocalRoot()); browser_->OnLoadingStateChange(false); } diff --git a/libcef/renderer/render_urlrequest_impl.cc b/libcef/renderer/render_urlrequest_impl.cc index 8d6777120..ac7759ce6 100644 --- a/libcef/renderer/render_urlrequest_impl.cc +++ b/libcef/renderer/render_urlrequest_impl.cc @@ -56,7 +56,7 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient { void DidStartLoadingResponseBody( mojo::ScopedDataPipeConsumerHandle response_body) override; bool WillFollowRedirect(const WebURL& new_url, - const WebURL& new_site_for_cookies, + const net::SiteForCookies& new_site_for_cookies, const WebString& new_referrer, network::mojom::ReferrerPolicy new_referrer_policy, const WebString& new_method, @@ -392,7 +392,7 @@ void CefWebURLLoaderClient::DidStartLoadingResponseBody( bool CefWebURLLoaderClient::WillFollowRedirect( const WebURL& new_url, - const WebURL& new_site_for_cookies, + const net::SiteForCookies& new_site_for_cookies, const WebString& new_referrer, network::mojom::ReferrerPolicy new_referrer_policy, const WebString& new_method, diff --git a/patch/patch.cfg b/patch/patch.cfg index 348619041..41d45b91c 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -374,12 +374,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2398 'name': 'resource_bundle_2512', }, - { - # Fix redraw of OSR PDF viewer. - # https://bitbucket.org/chromiumembedded/cef/issues/2507 - # Partially reverts changes from https://crrev.com/17771fad93 - 'name': 'browser_child_frame_2507', - }, { # macOS: Fix crash when showing a select popup with CefDoMessageLoopWork. # https://bitbucket.org/chromiumembedded/cef/issues/2495 @@ -400,14 +394,15 @@ patches = [ }, { # Enhancements to NetworkService: - # - Support customization of request_id via SimpleURLLoader. # - Remove the non-nullptr WebContents requirement from # NetworkServiceClient::OnAuthRequired. # https://bitbucket.org/chromiumembedded/cef/issues/2718 # # Fix shutdown crash in InitNetworkContext with multi-threaded message loop. # https://bitbucket.org/chromiumembedded/cef/issues/2703 - 'name': 'services_network_request_id_2718', + # + # Compute correct default quota when cache_path is unspecified. + 'name': 'services_network_2718', }, { # Windows: Remove the base::Value is_standard_layout assert which will fail @@ -482,11 +477,6 @@ patches = [ # https://bitbucket.org/chromiumembedded/cef/issues/2745 'name': 'osr_fling_2745', }, - { - # Windows: Fix ImportError: No module named win32file - # https://bugs.chromium.org/p/chromium/issues/detail?id=1033106#c7 - 'name': 'win_tool_wrapper_1033106', - }, { # Windows: Build targets as C++17 to avoid export of std::is_integral # templates in cef_sandbox that should be inlined. @@ -502,6 +492,7 @@ patches = [ # Fix Jumbo build errors. # - Allow use of jumbo-related GN args. # - Fix multiple definition errors. + # - Add `never_build_jumbo = true` for targets with complex errors. 'name': 'build_jumbo', }, { diff --git a/patch/patches/base_sandbox_2743.patch b/patch/patches/base_sandbox_2743.patch index b65005a7a..438301da8 100644 --- a/patch/patches/base_sandbox_2743.patch +++ b/patch/patches/base_sandbox_2743.patch @@ -1,5 +1,5 @@ diff --git base/BUILD.gn base/BUILD.gn -index 0e54cd8264cf..44405b8a410b 100644 +index 447280ffe5e3..ddff00ac1a69 100644 --- base/BUILD.gn +++ base/BUILD.gn @@ -32,6 +32,7 @@ import("//build/config/sysroot.gni") @@ -10,7 +10,7 @@ index 0e54cd8264cf..44405b8a410b 100644 import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") -@@ -1635,7 +1636,11 @@ jumbo_component("base") { +@@ -1644,7 +1645,11 @@ jumbo_component("base") { "hash/md5_constexpr_internal.h", "hash/sha1.h", ] diff --git a/patch/patches/browser_child_frame_2507.patch b/patch/patches/browser_child_frame_2507.patch deleted file mode 100644 index 456cb7461..000000000 --- a/patch/patches/browser_child_frame_2507.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc -index fc45d9e34fad..57d5d26613a5 100644 ---- content/browser/renderer_host/render_widget_host_view_child_frame.cc -+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc -@@ -596,6 +596,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame( - "RenderWidgetHostViewChildFrame::OnSwapCompositorFrame"); - support_->SubmitCompositorFrame(local_surface_id, std::move(frame), - std::move(hit_test_region_list)); -+ ProcessFrameSwappedCallbacks(); - } - - void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame( -@@ -604,6 +605,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame( - support_->DidNotProduceFrame(ack); - } - -+void RenderWidgetHostViewChildFrame::ProcessFrameSwappedCallbacks() { -+ std::vector process_callbacks; -+ // Swap the vectors to avoid re-entrancy issues due to calls to -+ // RegisterFrameSwappedCallback() while running the OnceClosures. -+ process_callbacks.swap(frame_swapped_callbacks_); -+ for (base::OnceClosure& callback : process_callbacks) -+ std::move(callback).Run(); -+} -+ - void RenderWidgetHostViewChildFrame::TransformPointToRootSurface( - gfx::PointF* point) { - // This function is called by RenderWidgetHostInputEventRouter only for -@@ -798,6 +808,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() { - void RenderWidgetHostViewChildFrame::SpeakSelection() {} - #endif // defined(OS_MACOSX) - -+void RenderWidgetHostViewChildFrame::RegisterFrameSwappedCallback( -+ base::OnceClosure callback) { -+ frame_swapped_callbacks_.emplace_back(std::move(callback)); -+} -+ - void RenderWidgetHostViewChildFrame::CopyFromSurface( - const gfx::Rect& src_subrect, - const gfx::Size& output_size, diff --git a/patch/patches/browser_compositor_mac.patch b/patch/patches/browser_compositor_mac.patch index d9a7d5765..85e0d566c 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 de89d291e5cb..9ce7bf4cb250 100644 +index af7b3249d421..1483a48f9074 100644 --- content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h -@@ -59,6 +59,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, +@@ -58,6 +58,8 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient, // These will not return nullptr until Destroy is called. DelegatedFrameHost* GetDelegatedFrameHost(); @@ -12,7 +12,7 @@ index de89d291e5cb..9ce7bf4cb250 100644 // Force a new surface id to be allocated. Returns true if the // RenderWidgetHostImpl sent the resulting surface id to the renderer. diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm -index 8ddd790decc4..3ffd3db8da4b 100644 +index c1593171af25..4c892782d338 100644 --- content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm @@ -85,6 +85,12 @@ DelegatedFrameHost* BrowserCompositorMac::GetDelegatedFrameHost() { diff --git a/patch/patches/browser_scheduler.patch b/patch/patches/browser_scheduler.patch index 154849741..274d54af5 100644 --- a/patch/patches/browser_scheduler.patch +++ b/patch/patches/browser_scheduler.patch @@ -1,8 +1,8 @@ diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc -index b8b4a1b8c70c..e036e15eafc7 100644 +index eb9f505243bf..191368199d44 100644 --- content/browser/scheduler/browser_task_executor.cc +++ content/browser/scheduler/browser_task_executor.cc -@@ -255,7 +255,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { +@@ -245,7 +245,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() { // static void BrowserTaskExecutor::Shutdown() { diff --git a/patch/patches/build.patch b/patch/patches/build.patch index 5b0d3fbb6..6efc58876 100644 --- a/patch/patches/build.patch +++ b/patch/patches/build.patch @@ -1,8 +1,8 @@ diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn -index fbf8335f11ba..7a80641139a4 100644 +index eef1140e8006..0e222de2a9a6 100644 --- build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn -@@ -172,7 +172,7 @@ declare_args() { +@@ -162,7 +162,7 @@ declare_args() { !use_clang_coverage && !(is_android && use_order_profiling) && (use_lld || (use_gold && @@ -11,7 +11,7 @@ index fbf8335f11ba..7a80641139a4 100644 !(current_cpu == "x86" || current_cpu == "x64")))) } -@@ -1763,8 +1763,6 @@ config("thin_archive") { +@@ -1743,8 +1743,6 @@ config("thin_archive") { # archive names to 16 characters, which is not what we want). if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { arflags = [ "-T" ] diff --git a/patch/patches/build_jumbo.patch b/patch/patches/build_jumbo.patch index a132c8232..ec4c7bc15 100644 --- a/patch/patches/build_jumbo.patch +++ b/patch/patches/build_jumbo.patch @@ -1,8 +1,8 @@ diff --git base/win/com_init_util.cc base/win/com_init_util.cc -index d81f42019bd1..fab3998df55d 100644 +index 57c3c6f8d8c5..fee206222ebf 100644 --- base/win/com_init_util.cc +++ base/win/com_init_util.cc -@@ -34,7 +34,7 @@ struct OleTlsData { +@@ -35,7 +35,7 @@ struct OleTlsData { }; OleTlsData* GetOleTlsData() { @@ -29,8 +29,21 @@ index 0c84b283bf8f..e6f033a59151 100644 # Normal builds benefit from lots of jumbification jumbo_file_merge_default = 50 +diff --git chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc +index 3a6306647661..6ea29431a353 100644 +--- chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc ++++ chrome/browser/extensions/api/identity/identity_get_auth_token_function.cc +@@ -570,7 +570,7 @@ void IdentityGetAuthTokenFunction::OnIssueAdviceSuccess( + + void IdentityGetAuthTokenFunction::OnRemoteConsentSuccess( + const RemoteConsentResolutionData& resolution_data) { +- if (!base::FeatureList::IsEnabled(switches::kOAuthRemoteConsent)) { ++ if (!base::FeatureList::IsEnabled(::switches::kOAuthRemoteConsent)) { + // Fallback to the issue advice flow. + // TODO(https://crbug.com/1026237): Remove the fallback after making sure + // that the new flow works correctly. diff --git chrome/browser/extensions/api/input_ime/input_ime_api.cc chrome/browser/extensions/api/input_ime/input_ime_api.cc -index 3f790e96da74..7deec3e4b0ce 100644 +index a7cea04fa3d0..60dc5475e747 100644 --- chrome/browser/extensions/api/input_ime/input_ime_api.cc +++ chrome/browser/extensions/api/input_ime/input_ime_api.cc @@ -19,7 +19,9 @@ namespace SendKeyEvents = extensions::api::input_ime::SendKeyEvents; @@ -47,13 +60,42 @@ index 3f790e96da74..7deec3e4b0ce 100644 std::string* error) { extensions::InputImeEventRouter* event_router = extensions::GetInputImeEventRouter(profile); -- CHECK(event_router) << kErrorRouterNotAvailable; -+ CHECK(event_router) << i::kErrorRouterNotAvailable; +- DCHECK(event_router) << kErrorRouterNotAvailable; ++ DCHECK(event_router) << i::kErrorRouterNotAvailable; InputMethodEngineBase* engine = event_router->GetEngineIfActive(extension_id, error); return engine; +diff --git chrome/browser/native_file_system/chrome_native_file_system_permission_context.cc chrome/browser/native_file_system/chrome_native_file_system_permission_context.cc +index e0da20cc3bb6..b3f6720dff90 100644 +--- chrome/browser/native_file_system/chrome_native_file_system_permission_context.cc ++++ chrome/browser/native_file_system/chrome_native_file_system_permission_context.cc +@@ -194,6 +194,7 @@ bool ShouldBlockAccessToPath(const base::FilePath& check_path) { + + // Returns a callback that calls the passed in |callback| by posting a task to + // the current sequenced task runner. ++namespace i { + template + base::OnceCallback + BindResultCallbackToCurrentSequence( +@@ -207,6 +208,7 @@ BindResultCallbackToCurrentSequence( + }, + base::SequencedTaskRunnerHandle::Get(), std::move(callback)); + } ++} // namespace i + + void DoSafeBrowsingCheckOnUIThread( + int process_id, +@@ -402,7 +404,7 @@ void ChromeNativeFileSystemPermissionContext:: + } + + auto result_callback = +- BindResultCallbackToCurrentSequence(std::move(callback)); ++ i::BindResultCallbackToCurrentSequence(std::move(callback)); + + base::PostTask( + FROM_HERE, {content::BrowserThread::UI}, diff --git chrome/browser/optimization_guide/optimization_guide_navigation_data.cc chrome/browser/optimization_guide/optimization_guide_navigation_data.cc -index acbec3d510c4..3f640008ddc0 100644 +index b532a58d5db7..e6d30ce29ea1 100644 --- chrome/browser/optimization_guide/optimization_guide_navigation_data.cc +++ chrome/browser/optimization_guide/optimization_guide_navigation_data.cc @@ -8,6 +8,7 @@ @@ -91,10 +133,10 @@ index acbec3d510c4..3f640008ddc0 100644 int64_t navigation_id) : navigation_id_(navigation_id) {} diff --git chrome/browser/optimization_guide/prediction/prediction_manager.cc chrome/browser/optimization_guide/prediction/prediction_manager.cc -index f8eb245f6b48..6b24f4d43d5f 100644 +index 7b7567f55df2..3b204a446187 100644 --- chrome/browser/optimization_guide/prediction/prediction_manager.cc +++ chrome/browser/optimization_guide/prediction/prediction_manager.cc -@@ -61,7 +61,9 @@ bool ShouldUseCurrentOptimizationTargetDecision( +@@ -62,7 +62,9 @@ bool ShouldUseCurrentOptimizationTargetDecision( // Delay between retries on failed fetch and store of prediction models and // host model features from the remote Optimization Guide Service. @@ -104,7 +146,7 @@ index f8eb245f6b48..6b24f4d43d5f 100644 // The amount of time to wait after a successful fetch of models and host model // features before requesting an update from the remote Optimization Guide -@@ -71,11 +73,13 @@ constexpr base::TimeDelta kUpdateModelsAndFeaturesDelay = +@@ -72,11 +74,13 @@ constexpr base::TimeDelta kUpdateModelsAndFeaturesDelay = // Provide a random time delta in seconds before fetching models and host model // features. @@ -116,9 +158,9 @@ index f8eb245f6b48..6b24f4d43d5f 100644 } +} - } // namespace - -@@ -694,12 +698,12 @@ void PredictionManager::ScheduleModelsAndHostModelFeaturesFetch() { + // Util class for recording the state of a prediction model. The result is + // recorded when it goes out of scope and its destructor is called. +@@ -822,12 +826,12 @@ void PredictionManager::ScheduleModelsAndHostModelFeaturesFetch() { model_and_features_store_->GetHostModelFeaturesUpdateTime() - clock_->Now(); const base::TimeDelta time_until_retry = @@ -209,8 +251,37 @@ index 43ad1e7a3a42..e158b1dff474 100644 DCHECK(data->IsEmpty()); #endif } +diff --git chrome/browser/sharing/webrtc/ice_config_fetcher.cc chrome/browser/sharing/webrtc/ice_config_fetcher.cc +index 6dee784e18f8..66bb7b805728 100644 +--- chrome/browser/sharing/webrtc/ice_config_fetcher.cc ++++ chrome/browser/sharing/webrtc/ice_config_fetcher.cc +@@ -23,6 +23,7 @@ const char kIceConfigApiUrl[] = + // configs. + constexpr int kMaxBodySize = 16 * 1024; + ++namespace i { + const net::NetworkTrafficAnnotationTag kTrafficAnnotation = + net::DefineNetworkTrafficAnnotation("ice_config_fetcher", R"( + semantics { +@@ -48,6 +49,7 @@ const net::NetworkTrafficAnnotationTag kTrafficAnnotation = + } + } + })"); ++} // namespace i + + bool IsLoaderSuccessful(const network::SimpleURLLoader* loader) { + if (!loader || loader->NetError() != net::OK) +@@ -82,7 +84,7 @@ void IceConfigFetcher::GetIceServers(IceServerCallback callback) { + "application/json"); + + url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request), +- kTrafficAnnotation); ++ i::kTrafficAnnotation); + url_loader_->DownloadToString( + url_loader_factory_.get(), + base::BindOnce(&IceConfigFetcher::OnIceServersResponse, diff --git chrome/browser/ui/views/confirm_bubble_views.cc chrome/browser/ui/views/confirm_bubble_views.cc -index 5f25a23aff9d..a2f160c2f1a5 100644 +index fb01319cb878..3a66aa3aaa72 100644 --- chrome/browser/ui/views/confirm_bubble_views.cc +++ chrome/browser/ui/views/confirm_bubble_views.cc @@ -27,6 +27,7 @@ @@ -229,15 +300,38 @@ index 5f25a23aff9d..a2f160c2f1a5 100644 } // namespace -@@ -46,7 +48,7 @@ ConfirmBubbleViews::ConfirmBubbleViews( - DialogDelegate::set_button_label( - ui::DIALOG_BUTTON_CANCEL, - model_->GetButtonLabel(ConfirmBubbleModel::BUTTON_CANCEL)); +@@ -49,7 +51,7 @@ ConfirmBubbleViews::ConfirmBubbleViews( + &ConfirmBubbleModel::Accept, base::Unretained(model_.get()))); + DialogDelegate::set_cancel_callback(base::BindOnce( + &ConfirmBubbleModel::Cancel, base::Unretained(model_.get()))); - help_button_ = DialogDelegate::SetExtraView(::CreateExtraView(this)); + help_button_ = DialogDelegate::SetExtraView(::i::CreateExtraView(this)); set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( views::TEXT, views::TEXT)); +diff --git components/metrics/metrics_state_manager.cc components/metrics/metrics_state_manager.cc +index 26b3faa7deae..75ae68d0b0b3 100644 +--- components/metrics/metrics_state_manager.cc ++++ components/metrics/metrics_state_manager.cc +@@ -41,7 +41,9 @@ namespace { + // The argument used to generate a non-identifying entropy source. We want no + // more than 13 bits of entropy, so use this max to return a number in the range + // [0, 7999] as the entropy source (12.97 bits of entropy). ++namespace i { + const int kMaxLowEntropySize = 8000; ++} + + int64_t ReadEnabledDate(PrefService* local_state) { + return local_state->GetInt64(prefs::kMetricsReportingEnabledTimestamp); +@@ -298,7 +300,7 @@ std::unique_ptr + MetricsStateManager::CreateLowEntropyProvider() { + int source = GetLowEntropySource(); + return std::make_unique( +- base::checked_cast(source), kMaxLowEntropySize); ++ base::checked_cast(source), i::kMaxLowEntropySize); + } + + // static diff --git content/browser/accessibility/accessibility_event_recorder_win.cc content/browser/accessibility/accessibility_event_recorder_win.cc index f4fcad03c04c..99b769763511 100644 --- content/browser/accessibility/accessibility_event_recorder_win.cc @@ -286,7 +380,7 @@ index f4fcad03c04c..99b769763511 100644 if (event == IA2_EVENT_TEXT_REMOVED) { IA2TextSegment old_text; diff --git content/browser/devtools/protocol/storage_handler.cc content/browser/devtools/protocol/storage_handler.cc -index 50cf4dd3edef..7ae6ed5d91f0 100644 +index 0db088ae7917..d4567efbf0b9 100644 --- content/browser/devtools/protocol/storage_handler.cc +++ content/browser/devtools/protocol/storage_handler.cc @@ -33,8 +33,10 @@ namespace content { @@ -327,8 +421,315 @@ index 50cf4dd3edef..7ae6ed5d91f0 100644 if (success) { callback->sendSuccess(); } else { +diff --git content/browser/media/capture/frame_sink_video_capture_device.cc content/browser/media/capture/frame_sink_video_capture_device.cc +index 2630aae48b16..475dc5572ef7 100644 +--- content/browser/media/capture/frame_sink_video_capture_device.cc ++++ content/browser/media/capture/frame_sink_video_capture_device.cc +@@ -53,11 +53,13 @@ class ScopedFrameDoneHelper + ~ScopedFrameDoneHelper() final = default; + }; + ++namespace i { + void BindWakeLockProvider( + mojo::PendingReceiver receiver) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + GetDeviceService().BindWakeLockProvider(std::move(receiver)); + } ++} + + } // namespace + +@@ -364,7 +366,7 @@ void FrameSinkVideoCaptureDevice::RequestWakeLock() { + mojo::Remote wake_lock_provider; + auto receiver = wake_lock_provider.BindNewPipeAndPassReceiver(); + base::PostTask(FROM_HERE, {BrowserThread::UI}, +- base::BindOnce(&BindWakeLockProvider, std::move(receiver))); ++ base::BindOnce(&i::BindWakeLockProvider, std::move(receiver))); + wake_lock_provider->GetWakeLockWithoutContext( + device::mojom::WakeLockType::kPreventDisplaySleep, + device::mojom::WakeLockReason::kOther, "screen capture", +diff --git content/browser/renderer_host/media/media_devices_manager.cc content/browser/renderer_host/media/media_devices_manager.cc +index f355780cbd83..b13c0b99a530 100644 +--- content/browser/renderer_host/media/media_devices_manager.cc ++++ content/browser/renderer_host/media/media_devices_manager.cc +@@ -60,6 +60,7 @@ struct { + // Frame rates for sources with no support for capability enumeration. + const uint16_t kFallbackVideoFrameRates[] = {30, 60}; + ++namespace i { + void SendLogMessage(const std::string& message) { + MediaStreamManager::SendMessageToNativeLog("MDM::" + message); + } +@@ -77,12 +78,13 @@ const char* DeviceTypeToString(blink::MediaDeviceType device_type) { + } + return "UNKNOWN"; + } ++} // namespace i + + std::string GetDevicesEnumeratedLogString( + blink::MediaDeviceType device_type, + const blink::WebMediaDeviceInfoArray& device_infos) { + std::string str = base::StringPrintf("DevicesEnumerated({type=%s}, ", +- DeviceTypeToString(device_type)); ++ i::DeviceTypeToString(device_type)); + base::StringAppendF(&str, "{labels=["); + for (const auto& device_info : device_infos) + base::StringAppendF(&str, "%s, ", device_info.label.c_str()); +@@ -391,7 +393,7 @@ MediaDevicesManager::MediaDevicesManager( + DCHECK(video_capture_manager_.get()); + DCHECK(!stop_removed_input_device_cb_.is_null()); + DCHECK(!ui_input_device_change_cb_.is_null()); +- SendLogMessage("MediaDevicesManager()"); ++ i::SendLogMessage("MediaDevicesManager()"); + cache_policies_.fill(CachePolicy::NO_CACHE); + has_seen_result_.fill(false); + } +@@ -433,7 +435,7 @@ void MediaDevicesManager::EnumerateDevices( + DCHECK(request_audio_input_capabilities && + requested_types[blink::MEDIA_DEVICE_TYPE_AUDIO_INPUT] || + !request_audio_input_capabilities); +- SendLogMessage(base::StringPrintf( ++ i::SendLogMessage(base::StringPrintf( + "EnumerateDevices({render_process_id=%d}, {render_frame_id=%d}, " + "{request_audio=%s}, {request_video=%s})", + render_process_id, render_frame_id, +@@ -514,7 +516,7 @@ void MediaDevicesManager::StartMonitoring() { + std::make_unique(); + } + #endif +- SendLogMessage("StartMonitoring()"); ++ i::SendLogMessage("StartMonitoring()"); + monitoring_started_ = true; + base::SystemMonitor::Get()->AddDevicesChangedObserver(this); + +@@ -547,7 +549,7 @@ void MediaDevicesManager::StopMonitoring() { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + if (!monitoring_started_) + return; +- SendLogMessage(base::StringPrintf("StopMonitoring([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("StopMonitoring([this=%p])", this)); + base::SystemMonitor::Get()->RemoveDevicesChangedObserver(this); + audio_service_device_listener_.reset(); + monitoring_started_ = false; +@@ -857,8 +859,8 @@ void MediaDevicesManager::DoEnumerateDevices(blink::MediaDeviceType type) { + CacheInfo& cache_info = cache_infos_[type]; + if (cache_info.is_update_ongoing()) + return; +- SendLogMessage(base::StringPrintf("DoEnumerateDevices({type=%s})", +- DeviceTypeToString(type))); ++ i::SendLogMessage(base::StringPrintf("DoEnumerateDevices({type=%s})", ++ i::DeviceTypeToString(type))); + + cache_info.UpdateStarted(); + switch (type) { +@@ -928,7 +930,7 @@ void MediaDevicesManager::DevicesEnumerated( + UpdateSnapshot(type, snapshot); + cache_infos_[type].UpdateCompleted(); + has_seen_result_[type] = true; +- SendLogMessage(GetDevicesEnumeratedLogString(type, snapshot)); ++ i::SendLogMessage(GetDevicesEnumeratedLogString(type, snapshot)); + + if (cache_policies_[type] == CachePolicy::NO_CACHE) { + for (auto& request : requests_) +@@ -1047,8 +1049,8 @@ void MediaDevicesManager::HandleDevicesChanged(blink::MediaDeviceType type) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(IsValidMediaDeviceType(type)); + if (!cache_infos_[type].is_update_ongoing()) { +- SendLogMessage(base::StringPrintf("HandleDevicesChanged({type=%s}", +- DeviceTypeToString(type))); ++ i::SendLogMessage(base::StringPrintf("HandleDevicesChanged({type=%s}", ++ i::DeviceTypeToString(type))); + } + cache_infos_[type].InvalidateCache(); + DoEnumerateDevices(type); +@@ -1151,9 +1153,9 @@ void MediaDevicesManager::NotifyDeviceChange( + auto it = subscriptions_.find(subscription_id); + if (it == subscriptions_.end()) + return; +- SendLogMessage( ++ i::SendLogMessage( + base::StringPrintf("NotifyDeviceChange({subscription_id=%u}, {type=%s}", +- subscription_id, DeviceTypeToString(type))); ++ subscription_id, i::DeviceTypeToString(type))); + + const SubscriptionRequest& request = it->second; + request.listener_->OnDevicesChanged( +diff --git content/browser/service_worker/service_worker_registry.cc content/browser/service_worker/service_worker_registry.cc +index 7f3723d16532..b1baf98fe511 100644 +--- content/browser/service_worker/service_worker_registry.cc ++++ content/browser/service_worker/service_worker_registry.cc +@@ -18,9 +18,11 @@ namespace content { + + namespace { + ++namespace i { + void RunSoon(const base::Location& from_here, base::OnceClosure closure) { + base::ThreadTaskRunnerHandle::Get()->PostTask(from_here, std::move(closure)); + } ++} + + void CompleteFindNow(scoped_refptr registration, + blink::ServiceWorkerStatusCode status, +@@ -39,7 +41,7 @@ void CompleteFindSoon( + scoped_refptr registration, + blink::ServiceWorkerStatusCode status, + ServiceWorkerRegistry::FindRegistrationCallback callback) { +- RunSoon(from_here, base::BindOnce(&CompleteFindNow, std::move(registration), ++ i::RunSoon(from_here, base::BindOnce(&CompleteFindNow, std::move(registration), + status, std::move(callback))); + } + +@@ -116,7 +118,7 @@ void ServiceWorkerRegistry::FindRegistrationForScope( + const GURL& scope, + FindRegistrationCallback callback) { + if (storage()->IsDisabled()) { +- RunSoon( ++ i::RunSoon( + FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorAbort, nullptr)); +@@ -232,7 +234,7 @@ void ServiceWorkerRegistry::StoreRegistration( + DCHECK(version); + + if (storage()->IsDisabled()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorAbort)); + return; +@@ -265,7 +267,7 @@ void ServiceWorkerRegistry::StoreRegistration( + version->script_cache_map()->GetResources(&resources); + + if (resources.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -289,7 +291,7 @@ void ServiceWorkerRegistry::DeleteRegistration( + const GURL& origin, + StatusCallback callback) { + if (storage()->IsDisabled()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorAbort)); + return; +@@ -353,14 +355,14 @@ void ServiceWorkerRegistry::GetUserData(int64_t registration_id, + GetUserDataCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + keys.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), std::vector(), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; + } + for (const std::string& key : keys) { + if (key.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), std::vector(), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -379,7 +381,7 @@ void ServiceWorkerRegistry::GetUserDataByKeyPrefix( + GetUserDataCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + key_prefix.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), std::vector(), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -397,7 +399,7 @@ void ServiceWorkerRegistry::GetUserKeysAndDataByKeyPrefix( + GetUserKeysAndDataCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + key_prefix.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + base::flat_map(), + blink::ServiceWorkerStatusCode::kErrorFailed)); +@@ -417,14 +419,14 @@ void ServiceWorkerRegistry::StoreUserData( + StatusCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + key_value_pairs.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; + } + for (const auto& kv : key_value_pairs) { + if (kv.first.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -442,14 +444,14 @@ void ServiceWorkerRegistry::ClearUserData(int64_t registration_id, + StatusCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + keys.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; + } + for (const std::string& key : keys) { + if (key.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -468,14 +470,14 @@ void ServiceWorkerRegistry::ClearUserDataByKeyPrefixes( + StatusCallback callback) { + if (registration_id == blink::mojom::kInvalidServiceWorkerRegistrationId || + key_prefixes.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; + } + for (const std::string& key_prefix : key_prefixes) { + if (key_prefix.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -492,7 +494,7 @@ void ServiceWorkerRegistry::ClearUserDataForAllRegistrationsByKeyPrefix( + const std::string& key_prefix, + StatusCallback callback) { + if (key_prefix.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + blink::ServiceWorkerStatusCode::kErrorFailed)); + return; +@@ -508,7 +510,7 @@ void ServiceWorkerRegistry::GetUserDataForAllRegistrations( + const std::string& key, + GetUserDataForAllRegistrationsCallback callback) { + if (key.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + std::vector>(), + blink::ServiceWorkerStatusCode::kErrorFailed)); +@@ -525,7 +527,7 @@ void ServiceWorkerRegistry::GetUserDataForAllRegistrationsByKeyPrefix( + const std::string& key_prefix, + GetUserDataForAllRegistrationsCallback callback) { + if (key_prefix.empty()) { +- RunSoon(FROM_HERE, ++ i::RunSoon(FROM_HERE, + base::BindOnce(std::move(callback), + std::vector>(), + blink::ServiceWorkerStatusCode::kErrorFailed)); diff --git content/browser/web_package/web_bundle_blob_data_source.cc content/browser/web_package/web_bundle_blob_data_source.cc -index 6b3e423e9d12..f3b63178d70e 100644 +index ee575969d8e8..1f11b02fb049 100644 --- content/browser/web_package/web_bundle_blob_data_source.cc +++ content/browser/web_package/web_bundle_blob_data_source.cc @@ -23,6 +23,7 @@ @@ -347,7 +748,7 @@ index 6b3e423e9d12..f3b63178d70e 100644 void OnReadComplete( data_decoder::mojom::BundleDataSource::ReadCallback callback, -@@ -372,7 +374,7 @@ void WebBundleBlobDataSource::BlobDataSourceCore::OnBlobReadyForReadToDataPipe( +@@ -364,7 +366,7 @@ void WebBundleBlobDataSource::BlobDataSourceCore::OnBlobReadyForReadToDataPipe( } storage::MojoBlobReader::Create( blob_.get(), net::HttpByteRange::Bounded(offset, offset + length - 1), @@ -356,6 +757,81 @@ index 6b3e423e9d12..f3b63178d70e 100644 std::move(producer_handle)); } +diff --git gpu/command_buffer/service/shared_image_backing_d3d.cc gpu/command_buffer/service/shared_image_backing_d3d.cc +index 73533fba5b15..42859c57dcd7 100644 +--- gpu/command_buffer/service/shared_image_backing_d3d.cc ++++ gpu/command_buffer/service/shared_image_backing_d3d.cc +@@ -15,6 +15,7 @@ namespace gpu { + + namespace { + ++namespace i { + class ScopedRestoreTexture2D { + public: + explicit ScopedRestoreTexture2D(gl::GLApi* api) : api_(api) { +@@ -32,6 +33,7 @@ class ScopedRestoreTexture2D { + GLuint prev_binding_ = 0; + DISALLOW_COPY_AND_ASSIGN(ScopedRestoreTexture2D); + }; ++} // namespace i + + } // anonymous namespace + +@@ -207,7 +209,7 @@ bool SharedImageBackingD3D::PresentSwapChain() { + } + + gl::GLApi* const api = gl::g_current_gl_context; +- ScopedRestoreTexture2D scoped_restore(api); ++ i::ScopedRestoreTexture2D scoped_restore(api); + + const GLenum target = GL_TEXTURE_2D; + const GLuint service_id = +diff --git media/muxers/webm_muxer.h media/muxers/webm_muxer.h +index 0d9b8c6de789..d78badac69b2 100644 +--- media/muxers/webm_muxer.h ++++ media/muxers/webm_muxer.h +@@ -13,6 +13,7 @@ + #include "base/containers/circular_deque.h" + #include "base/macros.h" + #include "base/numerics/safe_math.h" ++#include "base/optional.h" + #include "base/strings/string_piece.h" + #include "base/threading/thread_checker.h" + #include "base/time/time.h" +diff --git services/network/public/cpp/cert_verifier/nss_ocsp_session_url_loader.cc services/network/public/cpp/cert_verifier/nss_ocsp_session_url_loader.cc +index 0a95dacbfba4..a120f442770c 100644 +--- services/network/public/cpp/cert_verifier/nss_ocsp_session_url_loader.cc ++++ services/network/public/cpp/cert_verifier/nss_ocsp_session_url_loader.cc +@@ -22,9 +22,11 @@ namespace { + // URL. + const int kMaxResponseSizeInBytes = 5 * 1024 * 1024; + ++namespace i { + bool CanFetchUrl(const GURL& url) { + return url.SchemeIs("http"); + } ++} // namespace i + + } // namespace + +@@ -63,7 +65,7 @@ void OCSPRequestSessionDelegateURLLoader::StartLoad( + const net::OCSPRequestSessionParams* params) { + DCHECK(load_task_runner_->RunsTasksInCurrentSequence()); + +- if (!CanFetchUrl(params->url) || !delegate_factory_) { ++ if (!i::CanFetchUrl(params->url) || !delegate_factory_) { + CancelLoad(); + return; + } +@@ -142,7 +144,7 @@ void OCSPRequestSessionDelegateURLLoader::OnReceivedRedirect( + std::vector* removed_headers) { + DCHECK(load_task_runner_->RunsTasksInCurrentSequence()); + +- if (!CanFetchUrl(redirect_info.new_url)) { ++ if (!i::CanFetchUrl(redirect_info.new_url)) { + CancelLoad(); // May delete |this| + } + } diff --git storage/browser/quota/quota_settings.cc storage/browser/quota/quota_settings.cc index b2210b55b40f..668246e5f363 100644 --- storage/browser/quota/quota_settings.cc @@ -406,8 +882,542 @@ index b2210b55b40f..668246e5f363 100644 storage::QuotaSettings settings; +diff --git third_party/blink/renderer/core/animation/css_transform_interpolation_type.cc third_party/blink/renderer/core/animation/css_transform_interpolation_type.cc +index 25afc795a40f..202e40badb96 100644 +--- third_party/blink/renderer/core/animation/css_transform_interpolation_type.cc ++++ third_party/blink/renderer/core/animation/css_transform_interpolation_type.cc +@@ -45,6 +45,7 @@ class InheritedTransformChecker + const TransformOperations inherited_transform_; + }; + ++namespace i { + class AlwaysInvalidateChecker + : public CSSInterpolationType::CSSConversionChecker { + public: +@@ -53,6 +54,8 @@ class AlwaysInvalidateChecker + return false; + } + }; ++} // namespace i ++ + } // namespace + + InterpolationValue CSSTransformInterpolationType::MaybeConvertNeutral( +@@ -124,7 +127,7 @@ CSSTransformInterpolationType::PreInterpolationCompositeIfNeeded( + // to disable that caching in this case. + // TODO(crbug.com/1009230): Remove this once our interpolation code isn't + // caching composited values. +- conversion_checkers.push_back(std::make_unique()); ++ conversion_checkers.push_back(std::make_unique()); + + InterpolableTransformList& transform_list = + To(*value.interpolable_value); +diff --git third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc +index a8595ea2ff08..043350e75692 100644 +--- third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc ++++ third_party/blink/renderer/core/layout/ng/ng_absolute_utils.cc +@@ -57,55 +57,57 @@ bool IsTopDominant(const WritingMode container_writing_mode, + + // A direction agnostic version of |NGLogicalStaticPosition::InlineEdge|, and + // |NGLogicalStaticPosition::BlockEdge|. ++namespace i { + enum StaticPositionEdge { kStart, kCenter, kEnd }; ++} + +-inline StaticPositionEdge GetStaticPositionEdge( ++inline i::StaticPositionEdge GetStaticPositionEdge( + NGLogicalStaticPosition::InlineEdge inline_edge) { + switch (inline_edge) { + case NGLogicalStaticPosition::InlineEdge::kInlineStart: +- return kStart; ++ return i::kStart; + case NGLogicalStaticPosition::InlineEdge::kInlineCenter: +- return kCenter; ++ return i::kCenter; + case NGLogicalStaticPosition::InlineEdge::kInlineEnd: +- return kEnd; ++ return i::kEnd; + } + } + +-inline StaticPositionEdge GetStaticPositionEdge( ++inline i::StaticPositionEdge GetStaticPositionEdge( + NGLogicalStaticPosition::BlockEdge block_edge) { + switch (block_edge) { + case NGLogicalStaticPosition::BlockEdge::kBlockStart: +- return kStart; ++ return i::kStart; + case NGLogicalStaticPosition::BlockEdge::kBlockCenter: +- return kCenter; ++ return i::kCenter; + case NGLogicalStaticPosition::BlockEdge::kBlockEnd: +- return kEnd; ++ return i::kEnd; + } + } + +-inline LayoutUnit StaticPositionStartInset(StaticPositionEdge edge, ++inline LayoutUnit StaticPositionStartInset(i::StaticPositionEdge edge, + LayoutUnit static_position_offset, + LayoutUnit size) { + switch (edge) { +- case kStart: ++ case i::kStart: + return static_position_offset; +- case kCenter: ++ case i::kCenter: + return static_position_offset - (size / 2); +- case kEnd: ++ case i::kEnd: + return static_position_offset - size; + } + } + +-inline LayoutUnit StaticPositionEndInset(StaticPositionEdge edge, ++inline LayoutUnit StaticPositionEndInset(i::StaticPositionEdge edge, + LayoutUnit static_position_offset, + LayoutUnit available_size, + LayoutUnit size) { + switch (edge) { +- case kStart: ++ case i::kStart: + return available_size - static_position_offset - size; +- case kCenter: ++ case i::kCenter: + return available_size - static_position_offset - (size / 2); +- case kEnd: ++ case i::kEnd: + return available_size - static_position_offset; + } + } +@@ -136,7 +138,7 @@ void ComputeAbsoluteSize(const LayoutUnit border_padding_size, + const LayoutUnit min_size, + const LayoutUnit max_size, + const LayoutUnit static_position_offset, +- StaticPositionEdge static_position_edge, ++ i::StaticPositionEdge static_position_edge, + bool is_start_dominant, + bool is_block_direction, + base::Optional size, +@@ -178,13 +180,13 @@ void ComputeAbsoluteSize(const LayoutUnit border_padding_size, + + LayoutUnit computed_available_size; + switch (static_position_edge) { +- case kStart: ++ case i::kStart: + // The available-size for the start static-position "grows" towards the + // end edge. + // | *----------->| + computed_available_size = available_size - static_position_offset; + break; +- case kCenter: ++ case i::kCenter: + // The available-size for the center static-position "grows" towards + // both edges (equally), and stops when it hits the first one. + // |<-----*----> | +@@ -192,7 +194,7 @@ void ComputeAbsoluteSize(const LayoutUnit border_padding_size, + 2 * std::min(static_position_offset, + available_size - static_position_offset); + break; +- case kEnd: ++ case i::kEnd: + // The available-size for the end static-position "grows" towards the + // start edge. + // |<-----* | +diff --git third_party/blink/renderer/modules/mediastream/input_device_info.cc third_party/blink/renderer/modules/mediastream/input_device_info.cc +index 9ec87eb44495..74259742e417 100644 +--- third_party/blink/renderer/modules/mediastream/input_device_info.cc ++++ third_party/blink/renderer/modules/mediastream/input_device_info.cc +@@ -23,6 +23,7 @@ namespace { + + // TODO(c.padhi): Merge this method with ToWebFacingMode() in + // media_stream_constraints_util_video_device.h, see https://crbug.com/821668. ++namespace i { + WebMediaStreamTrack::FacingMode ToWebFacingMode( + media::VideoFacingMode facing_mode) { + switch (facing_mode) { +@@ -37,6 +38,7 @@ WebMediaStreamTrack::FacingMode ToWebFacingMode( + return WebMediaStreamTrack::FacingMode::kNone; + } + } ++} // namespace i + + } // namespace + +@@ -53,7 +55,7 @@ void InputDeviceInfo::SetVideoInputCapabilities( + // ComputeCapabilitiesForVideoSource() in media_stream_constraints_util.h, see + // https://crbug.com/821668. + platform_capabilities_.facing_mode = +- ToWebFacingMode(video_input_capabilities->facing_mode); ++ i::ToWebFacingMode(video_input_capabilities->facing_mode); + if (!video_input_capabilities->formats.IsEmpty()) { + int max_width = 1; + int max_height = 1; +diff --git third_party/blink/renderer/modules/mediastream/processed_local_audio_source.cc third_party/blink/renderer/modules/mediastream/processed_local_audio_source.cc +index 060674f1e823..80ef06e6fbfb 100644 +--- third_party/blink/renderer/modules/mediastream/processed_local_audio_source.cc ++++ third_party/blink/renderer/modules/mediastream/processed_local_audio_source.cc +@@ -38,9 +38,11 @@ using EchoCancellationType = + + namespace { + ++namespace k { + void SendLogMessage(const std::string& message) { + blink::WebRtcLogMessage("PLAS::" + message); + } ++} + + // Used as an identifier for ProcessedLocalAudioSource::From(). + void* const kProcessedLocalAudioSourceIdentifier = +@@ -114,7 +116,7 @@ ProcessedLocalAudioSource::ProcessedLocalAudioSource( + volume_(0), + allow_invalid_render_frame_id_for_testing_(false) { + SetDevice(device); +- SendLogMessage( ++ k::SendLogMessage( + base::StringPrintf("ProcessedLocalAudioSource({session_id=%s})", + device.session_id().ToString().c_str())); + } +@@ -135,7 +137,7 @@ ProcessedLocalAudioSource* ProcessedLocalAudioSource::From( + + void ProcessedLocalAudioSource::SendLogMessageWithSessionId( + const std::string& message) const { +- SendLogMessage(message + " [session_id=" + device().session_id().ToString() + ++ k::SendLogMessage(message + " [session_id=" + device().session_id().ToString() + + "]"); + } + +@@ -163,7 +165,7 @@ bool ProcessedLocalAudioSource::EnsureSourceIsStarted() { + return false; + } + +- SendLogMessage(GetEnsureSourceIsStartedLogString(device())); ++ k::SendLogMessage(GetEnsureSourceIsStartedLogString(device())); + SendLogMessageWithSessionId(base::StringPrintf( + "EnsureSourceIsStarted() => (audio_processing_properties=[%s])", + GetAudioProcesingPropertiesLogString(audio_processing_properties_) +@@ -240,7 +242,7 @@ bool ProcessedLocalAudioSource::EnsureSourceIsStarted() { + channel_layout != media::CHANNEL_LAYOUT_STEREO && + channel_layout != media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC && + channel_layout != media::CHANNEL_LAYOUT_DISCRETE) { +- SendLogMessage( ++ k::SendLogMessage( + base::StringPrintf("EnsureSourceIsStarted() => (ERROR: " + "input channel layout (%d) is not supported.", + static_cast(channel_layout))); +diff --git third_party/blink/renderer/modules/mediastream/user_media_processor.cc third_party/blink/renderer/modules/mediastream/user_media_processor.cc +index 19292a2b3279..d734b2df93c6 100644 +--- third_party/blink/renderer/modules/mediastream/user_media_processor.cc ++++ third_party/blink/renderer/modules/mediastream/user_media_processor.cc +@@ -122,9 +122,11 @@ const char* MediaStreamRequestResultToString(MediaStreamRequestResult value) { + return "INVALID"; + } + ++namespace l { + void SendLogMessage(const std::string& message) { + blink::WebRtcLogMessage("UMP::" + message); + } ++} + + std::string GetTrackLogString(const blink::WebMediaStreamTrack& track, + bool is_pending) { +@@ -494,10 +496,10 @@ void UserMediaProcessor::RequestInfo::StartAudioTrack( + #if DCHECK_IS_ON() + DCHECK(audio_capture_settings_.HasValue()); + #endif +- SendLogMessage(GetTrackLogString(track, is_pending)); ++ l::SendLogMessage(GetTrackLogString(track, is_pending)); + blink::MediaStreamAudioSource* native_source = + blink::MediaStreamAudioSource::From(track.Source()); +- SendLogMessage(GetTrackSourceLogString(native_source)); ++ l::SendLogMessage(GetTrackSourceLogString(native_source)); + // Add the source as pending since OnTrackStarted will expect it to be there. + sources_waiting_for_callback_.push_back(native_source); + +@@ -518,7 +520,7 @@ UserMediaProcessor::RequestInfo::CreateAndStartVideoTrack( + DCHECK(source.GetType() == blink::WebMediaStreamSource::kTypeVideo); + DCHECK(web_request().Video()); + DCHECK(video_capture_settings_.HasValue()); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "UMP::RI::CreateAndStartVideoTrack({request_id=%d})", request_id())); + + blink::MediaStreamVideoSource* native_source = +@@ -546,7 +548,7 @@ void UserMediaProcessor::RequestInfo::OnTrackStarted( + blink::WebPlatformMediaStreamSource* source, + MediaStreamRequestResult result, + const blink::WebString& result_name) { +- SendLogMessage(GetOnTrackStartedLogString(request_id(), source, result)); ++ l::SendLogMessage(GetOnTrackStartedLogString(request_id(), source, result)); + auto** it = std::find(sources_waiting_for_callback_.begin(), + sources_waiting_for_callback_.end(), source); + DCHECK(it != sources_waiting_for_callback_.end()); +@@ -605,7 +607,7 @@ void UserMediaProcessor::ProcessRequest( + DCHECK(!current_request_info_); + request_completed_cb_ = std::move(callback); + current_request_info_ = MakeGarbageCollected(std::move(request)); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "ProcessRequest({request_id=%d}, {audio=%d}, " + "{video=%d})", + current_request_info_->request_id(), +@@ -623,7 +625,7 @@ void UserMediaProcessor::SetupAudioInput() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); + DCHECK(current_request_info_->web_request().Audio()); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("SetupAudioInput({request_id=%d}, {constraints=%s})", + current_request_info_->request_id(), + current_request_info_->request() +@@ -643,7 +645,7 @@ void UserMediaProcessor::SetupAudioInput() { + } + + if (blink::IsDeviceMediaType(audio_controls.stream_type)) { +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("SetupAudioInput({request_id=%d}) => " + "(Requesting device capabilities)", + current_request_info_->request_id())); +@@ -712,7 +714,7 @@ void UserMediaProcessor::SelectAudioSettings( + return; + + DCHECK(current_request_info_->stream_controls()->audio.requested); +- SendLogMessage(base::StringPrintf("SelectAudioSettings({request_id=%d})", ++ l::SendLogMessage(base::StringPrintf("SelectAudioSettings({request_id=%d})", + current_request_info_->request_id())); + auto settings = SelectSettingsAudioCapture( + capabilities, web_request.AudioConstraints(), +@@ -790,7 +792,7 @@ void UserMediaProcessor::SetupVideoInput() { + : StreamSelectionStrategy::FORCE_NEW_STREAM); + return; + } +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("SetupVideoInput. request_id=%d, video constraints=%s", + current_request_info_->request_id(), + current_request_info_->request() +@@ -836,7 +838,7 @@ void UserMediaProcessor::SelectVideoDeviceSettings( + DCHECK(current_request_info_->stream_controls()->video.requested); + DCHECK(blink::IsDeviceMediaType( + current_request_info_->stream_controls()->video.stream_type)); +- SendLogMessage(base::StringPrintf("SelectVideoDeviceSettings. request_id=%d.", ++ l::SendLogMessage(base::StringPrintf("SelectVideoDeviceSettings. request_id=%d.", + current_request_info_->request_id())); + + blink::VideoDeviceCaptureCapabilities capabilities; +@@ -879,7 +881,7 @@ void UserMediaProcessor::SelectVideoDeviceSettings( + void UserMediaProcessor::SelectVideoContentSettings() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("SelectVideoContentSettings. request_id=%d.", + current_request_info_->request_id())); + gfx::Size screen_size = GetScreenSize(); +@@ -912,7 +914,7 @@ void UserMediaProcessor::GenerateStreamForCurrentRequestInfo( + blink::mojom::StreamSelectionStrategy strategy) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "GenerateStreamForCurrentRequestInfo({request_id=%d}, " + "{audio.device_id=%s}, {video.device_id=%s})", + current_request_info_->request_id(), +@@ -965,7 +967,7 @@ void UserMediaProcessor::OnStreamGenerated( + if (!IsCurrentRequestInfo(request_id)) { + // This can happen if the request is canceled or the frame reloads while + // MediaStreamDispatcherHost is processing the request. +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "OnStreamGenerated([request_id=%d]) => (ERROR: invalid request ID)", + request_id)); + OnStreamGeneratedForCancelledRequest(audio_devices, video_devices); +@@ -976,7 +978,7 @@ void UserMediaProcessor::OnStreamGenerated( + + for (const auto* devices : {&audio_devices, &video_devices}) { + for (const auto& device : *devices) { +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "OnStreamGenerated({request_id=%d}, {label=%s}, {device=[id: %s, " + "name: " + "%s]})", +@@ -1007,7 +1009,7 @@ void UserMediaProcessor::OnStreamGenerated( + } + + for (const auto& video_device : video_devices) { +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "OnStreamGenerated({request_id=%d}, {label=%s}, {device=[id: %s, " + "name: %s]}) => (Requesting video device formats)", + request_id, label.Utf8().c_str(), video_device.id.c_str(), +@@ -1044,7 +1046,7 @@ void UserMediaProcessor::GotAllVideoInputFormatsForDevice( + if (!IsCurrentRequestInfo(web_request)) + return; + +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "GotAllVideoInputFormatsForDevice({request_id=%d}, " + "{label=%s}, {device=[id: %s]}, {success=%d})", + current_request_info_->request_id(), label.Utf8().c_str(), +@@ -1081,7 +1083,7 @@ gfx::Size UserMediaProcessor::GetScreenSize() { + void UserMediaProcessor::OnStreamGeneratedForCancelledRequest( + const Vector& audio_devices, + const Vector& video_devices) { +- SendLogMessage("OnStreamGeneratedForCancelledRequest()"); ++ l::SendLogMessage("OnStreamGeneratedForCancelledRequest()"); + // Only stop the device if the device is not used in another MediaStream. + for (auto* it = audio_devices.begin(); it != audio_devices.end(); ++it) { + if (!FindLocalSource(*it)) { +@@ -1155,7 +1157,7 @@ void UserMediaProcessor::OnStreamGenerationFailed( + // MediaStreamDispatcherHost is processing the request. + return; + } +- SendLogMessage(base::StringPrintf("OnStreamGenerationFailed({request_id=%d})", ++ l::SendLogMessage(base::StringPrintf("OnStreamGenerationFailed({request_id=%d})", + current_request_info_->request_id())); + + GetUserMediaRequestFailed(result); +@@ -1164,7 +1166,7 @@ void UserMediaProcessor::OnStreamGenerationFailed( + + void UserMediaProcessor::OnDeviceStopped(const MediaStreamDevice& device) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "OnDeviceStopped({session_id=%s}, {device_id=%s})", + device.session_id().ToString().c_str(), device.id.c_str())); + +@@ -1227,7 +1229,7 @@ blink::WebMediaStreamSource UserMediaProcessor::InitializeVideoSourceObject( + const MediaStreamDevice& device) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "UMP::InitializeVideoSourceObject({request_id=%d}, {device=[id: %s, " + "name: %s]})", + current_request_info_->request_id(), device.id.c_str(), +@@ -1255,7 +1257,7 @@ blink::WebMediaStreamSource UserMediaProcessor::InitializeAudioSourceObject( + bool* is_pending) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("InitializeAudioSourceObject({session_id=%s})", + device.session_id().ToString().c_str())); + +@@ -1398,7 +1400,7 @@ UserMediaProcessor::CreateVideoSource( + + void UserMediaProcessor::StartTracks(const String& label) { + DCHECK(!current_request_info_->web_request().IsNull()); +- SendLogMessage(base::StringPrintf("StartTracks({request_id=%d}, {label=%s})", ++ l::SendLogMessage(base::StringPrintf("StartTracks({request_id=%d}, {label=%s})", + current_request_info_->request_id(), + label.Utf8().c_str())); + if (auto* media_stream_device_observer = GetMediaStreamDeviceObserver()) { +@@ -1438,7 +1440,7 @@ void UserMediaProcessor::CreateVideoTracks( + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(current_request_info_); + DCHECK_EQ(devices.size(), webkit_tracks->size()); +- SendLogMessage(base::StringPrintf("UMP::CreateVideoTracks({request_id=%d})", ++ l::SendLogMessage(base::StringPrintf("UMP::CreateVideoTracks({request_id=%d})", + current_request_info_->request_id())); + + for (WTF::wtf_size_t i = 0; i < devices.size(); ++i) { +@@ -1461,7 +1463,7 @@ void UserMediaProcessor::CreateAudioTracks( + current_request_info_->audio_capture_settings().HasValue() && + current_request_info_->audio_capture_settings() + .render_to_associated_sink(); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("CreateAudioTracks({render_to_associated_sink=%d})", + render_to_associated_sink)); + if (!render_to_associated_sink) { +@@ -1491,7 +1493,7 @@ void UserMediaProcessor::OnCreateNativeTracksCompleted( + MediaStreamRequestResult result, + const String& constraint_name) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "UMP::OnCreateNativeTracksCompleted({request_id = %d}, {label=%s})", + request_info->request_id(), label.Utf8().c_str())); + if (result == MediaStreamRequestResult::OK) { +@@ -1524,7 +1526,7 @@ void UserMediaProcessor::GetUserMediaRequestSucceeded( + blink::WebUserMediaRequest web_request) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(IsCurrentRequestInfo(web_request)); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("GetUserMediaRequestSucceeded({request_id=%d})", + current_request_info_->request_id())); + +@@ -1544,7 +1546,7 @@ void UserMediaProcessor::DelayedGetUserMediaRequestSucceeded( + const blink::WebMediaStream& stream, + blink::WebUserMediaRequest web_request) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "DelayedGetUserMediaRequestSucceeded({request_id=%d}, {result=%s})", + request_id, + MediaStreamRequestResultToString(MediaStreamRequestResult::OK))); +@@ -1558,7 +1560,7 @@ void UserMediaProcessor::GetUserMediaRequestFailed( + const String& constraint_name) { + DCHECK(current_request_info_); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage( ++ l::SendLogMessage( + base::StringPrintf("GetUserMediaRequestFailed({request_id=%d})", + current_request_info_->request_id())); + +@@ -1580,7 +1582,7 @@ void UserMediaProcessor::DelayedGetUserMediaRequestFailed( + const String& constraint_name) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + blink::LogUserMediaRequestResult(result); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "DelayedGetUserMediaRequestFailed({request_id=%d}, {result=%s})", + request_id, MediaStreamRequestResultToString(result))); + DeleteWebRequest(web_request); +@@ -1700,7 +1702,7 @@ blink::WebMediaStreamSource UserMediaProcessor::FindOrInitializeSourceObject( + bool UserMediaProcessor::RemoveLocalSource( + const blink::WebMediaStreamSource& source) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "RemoveLocalSource({id=%s}, {name=%s}, {group_id=%s})", + source.Id().Utf8().c_str(), source.GetName().Utf8().c_str(), + source.GroupId().Utf8().c_str())); +@@ -1797,7 +1799,7 @@ void UserMediaProcessor::OnLocalSourceStopped( + const blink::WebMediaStreamSource& source) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + blink::WebPlatformMediaStreamSource* source_impl = source.GetPlatformSource(); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "OnLocalSourceStopped({session_id=%s})", + source_impl->device().session_id().ToString().c_str())); + +@@ -1816,7 +1818,7 @@ void UserMediaProcessor::StopLocalSource( + const blink::WebMediaStreamSource& source, + bool notify_dispatcher) { + blink::WebPlatformMediaStreamSource* source_impl = source.GetPlatformSource(); +- SendLogMessage(base::StringPrintf( ++ l::SendLogMessage(base::StringPrintf( + "StopLocalSource({session_id=%s})", + source_impl->device().session_id().ToString().c_str())); + +diff --git third_party/blink/renderer/modules/peerconnection/BUILD.gn third_party/blink/renderer/modules/peerconnection/BUILD.gn +index 467410d76984..2cdb84e6bdae 100644 +--- third_party/blink/renderer/modules/peerconnection/BUILD.gn ++++ third_party/blink/renderer/modules/peerconnection/BUILD.gn +@@ -5,6 +5,7 @@ + import("//third_party/blink/renderer/modules/modules.gni") + + blink_modules_sources("peerconnection") { ++ never_build_jumbo = true + sources = [ + "adapters/dtls_transport_proxy.cc", + "adapters/dtls_transport_proxy.h", diff --git third_party/blink/renderer/modules/xr/xr_hit_test_source.cc third_party/blink/renderer/modules/xr/xr_hit_test_source.cc -index 8a49f3591a73..0345548ec18f 100644 +index a7903d985d0b..e3bcef51a01e 100644 --- third_party/blink/renderer/modules/xr/xr_hit_test_source.cc +++ third_party/blink/renderer/modules/xr/xr_hit_test_source.cc @@ -10,10 +10,12 @@ @@ -432,8 +1442,44 @@ index 8a49f3591a73..0345548ec18f 100644 } } +diff --git third_party/blink/renderer/platform/audio/audio_delay_dsp_kernel.cc third_party/blink/renderer/platform/audio/audio_delay_dsp_kernel.cc +index 3e2f1a5a3fad..613745b93595 100644 +--- third_party/blink/renderer/platform/audio/audio_delay_dsp_kernel.cc ++++ third_party/blink/renderer/platform/audio/audio_delay_dsp_kernel.cc +@@ -32,7 +32,9 @@ + namespace blink { + + // Delay nodes have a max allowed delay time of this many seconds. ++namespace i { + const float kMaxDelayTimeSeconds = 30; ++} + + AudioDelayDSPKernel::AudioDelayDSPKernel(AudioDSPKernelProcessor* processor, + size_t processing_size_in_frames) +@@ -46,7 +48,7 @@ AudioDelayDSPKernel::AudioDelayDSPKernel(double max_delay_time, + max_delay_time_(max_delay_time), + write_index_(0) { + DCHECK_GT(max_delay_time_, 0.0); +- DCHECK_LE(max_delay_time_, kMaxDelayTimeSeconds); ++ DCHECK_LE(max_delay_time_, i::kMaxDelayTimeSeconds); + DCHECK(std::isfinite(max_delay_time_)); + + size_t buffer_length = BufferLengthForDelay(max_delay_time, sample_rate); +diff --git third_party/blink/renderer/platform/exported/web_cursor_info.cc third_party/blink/renderer/platform/exported/web_cursor_info.cc +index 21c245ecef6e..851861b0e7fd 100644 +--- third_party/blink/renderer/platform/exported/web_cursor_info.cc ++++ third_party/blink/renderer/platform/exported/web_cursor_info.cc +@@ -42,7 +42,7 @@ static SkBitmap GetCursorBitmap(const Cursor& cursor) { + + WebCursorInfo::WebCursorInfo(const Cursor& cursor) + : type(static_cast(cursor.GetType())), +- hot_spot(cursor.HotSpot()), ++ hot_spot(cursor.HotSpot().X(), cursor.HotSpot().Y()), + image_scale_factor(cursor.ImageScaleFactor()), + custom_image(GetCursorBitmap(cursor)) {} + diff --git third_party/blink/renderer/platform/fonts/font_matching_metrics.cc third_party/blink/renderer/platform/fonts/font_matching_metrics.cc -index 5e1005a2e4d3..ef83cadc9957 100644 +index a9a0511de039..0d3db36ad37f 100644 --- third_party/blink/renderer/platform/fonts/font_matching_metrics.cc +++ third_party/blink/renderer/platform/fonts/font_matching_metrics.cc @@ -14,6 +14,7 @@ constexpr double kUkmFontLoadCountBucketSpacing = 1.3; @@ -452,7 +1498,7 @@ index 5e1005a2e4d3..ef83cadc9957 100644 } // namespace -@@ -52,16 +54,16 @@ void FontMatchingMetrics::PublishUkmMetrics() { +@@ -74,16 +76,16 @@ void FontMatchingMetrics::PublishUkmMetrics() { ukm::builders::FontMatchAttempts(source_id_) .SetLoadContext(top_level_ ? kTopLevel : kSubFrame) .SetSystemFontFamilySuccesses(ukm::GetExponentialBucketMin( @@ -471,5 +1517,391 @@ index 5e1005a2e4d3..ef83cadc9957 100644 - Intersection(failed_font_families_, web_font_families_).size(), + i::Intersection(failed_font_families_, web_font_families_).size(), kUkmFontLoadCountBucketSpacing)) - .Record(ukm_recorder_); + .SetLocalFontFailures(ukm::GetExponentialBucketMin( + local_fonts_failed_.size(), kUkmFontLoadCountBucketSpacing)) +diff --git third_party/blink/renderer/platform/mediastream/media_stream_audio_source.cc third_party/blink/renderer/platform/mediastream/media_stream_audio_source.cc +index 4c60ce0cff03..a3ebe396867f 100644 +--- third_party/blink/renderer/platform/mediastream/media_stream_audio_source.cc ++++ third_party/blink/renderer/platform/mediastream/media_stream_audio_source.cc +@@ -21,9 +21,11 @@ namespace blink { + + namespace { + ++namespace m { + void SendLogMessage(const std::string& message) { + blink::WebRtcLogMessage("MSAS::" + message); } ++} // namespace m + + } // namespace + +@@ -55,7 +57,7 @@ MediaStreamAudioSource::MediaStreamAudioSource( + disable_local_echo_(disable_local_echo), + is_stopped_(false), + task_runner_(std::move(task_runner)) { +- SendLogMessage(base::StringPrintf( ++ m::SendLogMessage(base::StringPrintf( + "MediaStreamAudioSource([this=%p] {is_local_source=%s})", this, + (is_local_source ? "local" : "remote"))); + } +@@ -69,7 +71,7 @@ MediaStreamAudioSource::MediaStreamAudioSource( + + MediaStreamAudioSource::~MediaStreamAudioSource() { + DCHECK(task_runner_->BelongsToCurrentThread()); +- SendLogMessage( ++ m::SendLogMessage( + base::StringPrintf("~MediaStreamAudioSource([this=%p])", this)); + } + +@@ -86,7 +88,7 @@ bool MediaStreamAudioSource::ConnectToTrack( + const WebMediaStreamTrack& blink_track) { + DCHECK(task_runner_->BelongsToCurrentThread()); + DCHECK(!blink_track.IsNull()); +- SendLogMessage(base::StringPrintf("ConnectToTrack({track_id=%s})", ++ m::SendLogMessage(base::StringPrintf("ConnectToTrack({track_id=%s})", + blink_track.Id().Utf8().c_str())); + + // Sanity-check that there is not already a MediaStreamAudioTrack instance +@@ -181,7 +183,7 @@ void MediaStreamAudioSource::DoChangeSource( + std::unique_ptr + MediaStreamAudioSource::CreateMediaStreamAudioTrack(const std::string& id) { + DCHECK(task_runner_->BelongsToCurrentThread()); +- SendLogMessage( ++ m::SendLogMessage( + base::StringPrintf("CreateMediaStreamAudioTrack({id=%s})", id.c_str())); + return std::unique_ptr( + new MediaStreamAudioTrack(is_local_source())); +@@ -206,7 +208,7 @@ void MediaStreamAudioSource::ChangeSourceImpl( + } + + void MediaStreamAudioSource::SetFormat(const media::AudioParameters& params) { +- SendLogMessage(base::StringPrintf( ++ m::SendLogMessage(base::StringPrintf( + "SetFormat([this=%p] {params=[%s]}, {old_params=[%s]})", this, + params.AsHumanReadableString().c_str(), + deliverer_.GetAudioParameters().AsHumanReadableString().c_str())); +@@ -227,7 +229,7 @@ void MediaStreamAudioSource::DoStopSource() { + + void MediaStreamAudioSource::StopAudioDeliveryTo(MediaStreamAudioTrack* track) { + DCHECK(task_runner_->BelongsToCurrentThread()); +- SendLogMessage(base::StringPrintf("StopAudioDeliveryTo([this=%p])", this)); ++ m::SendLogMessage(base::StringPrintf("StopAudioDeliveryTo([this=%p])", this)); + + const bool did_remove_last_track = deliverer_.RemoveConsumer(track); + DVLOG(1) << "Removed MediaStreamAudioTrack@" << track +@@ -240,7 +242,7 @@ void MediaStreamAudioSource::StopAudioDeliveryTo(MediaStreamAudioTrack* track) { + } + + void MediaStreamAudioSource::StopSourceOnError(const std::string& why) { +- SendLogMessage(base::StringPrintf("StopSourceOnError([this=%p] {why=%s})", ++ m::SendLogMessage(base::StringPrintf("StopSourceOnError([this=%p] {why=%s})", + this, why.c_str())); + // Stop source when error occurs. + PostCrossThreadTask( +@@ -250,7 +252,7 @@ void MediaStreamAudioSource::StopSourceOnError(const std::string& why) { + } + + void MediaStreamAudioSource::SetMutedState(bool muted_state) { +- SendLogMessage(base::StringPrintf("SetMutedState([this=%p] {muted_state=%s})", ++ m::SendLogMessage(base::StringPrintf("SetMutedState([this=%p] {muted_state=%s})", + this, (muted_state ? "true" : "false"))); + PostCrossThreadTask( + *task_runner_, FROM_HERE, +diff --git third_party/blink/renderer/platform/mediastream/media_stream_audio_track.cc third_party/blink/renderer/platform/mediastream/media_stream_audio_track.cc +index 2c73fb0c88bd..5d5a852b0699 100644 +--- third_party/blink/renderer/platform/mediastream/media_stream_audio_track.cc ++++ third_party/blink/renderer/platform/mediastream/media_stream_audio_track.cc +@@ -18,22 +18,24 @@ namespace blink { + + namespace { + ++namespace i { + void SendLogMessage(const std::string& message) { + blink::WebRtcLogMessage("MSAT::" + message); + } ++} + + } // namespace + + MediaStreamAudioTrack::MediaStreamAudioTrack(bool is_local_track) + : WebPlatformMediaStreamTrack(is_local_track), is_enabled_(1) { +- SendLogMessage( ++ i::SendLogMessage( + base::StringPrintf("MediaStreamAudioTrack([this=%p] {is_local_track=%s})", + this, (is_local_track ? "local" : "remote"))); + } + + MediaStreamAudioTrack::~MediaStreamAudioTrack() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("~MediaStreamAudioTrack([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("~MediaStreamAudioTrack([this=%p])", this)); + Stop(); + } + +@@ -49,7 +51,7 @@ MediaStreamAudioTrack* MediaStreamAudioTrack::From( + + void MediaStreamAudioTrack::AddSink(WebMediaStreamAudioSink* sink) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("AddSink([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("AddSink([this=%p])", this)); + + // If the track has already stopped, just notify the sink of this fact without + // adding it. +@@ -64,7 +66,7 @@ void MediaStreamAudioTrack::AddSink(WebMediaStreamAudioSink* sink) { + + void MediaStreamAudioTrack::RemoveSink(WebMediaStreamAudioSink* sink) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("RemoveSink([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("RemoveSink([this=%p])", this)); + deliverer_.RemoveConsumer(sink); + } + +@@ -74,7 +76,7 @@ media::AudioParameters MediaStreamAudioTrack::GetOutputFormat() const { + + void MediaStreamAudioTrack::SetEnabled(bool enabled) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("SetEnabled([this=%p] {enabled=%s})", this, ++ i::SendLogMessage(base::StringPrintf("SetEnabled([this=%p] {enabled=%s})", this, + (enabled ? "true" : "false"))); + + const bool previously_enabled = +@@ -106,13 +108,13 @@ void MediaStreamAudioTrack::Start(base::OnceClosure stop_callback) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(!stop_callback.is_null()); + DCHECK(stop_callback_.is_null()); +- SendLogMessage(base::StringPrintf("Start([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("Start([this=%p])", this)); + stop_callback_ = std::move(stop_callback); + } + + void MediaStreamAudioTrack::StopAndNotify(base::OnceClosure callback) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("StopAndNotify([this=%p])", this)); ++ i::SendLogMessage(base::StringPrintf("StopAndNotify([this=%p])", this)); + + if (!stop_callback_.is_null()) + std::move(stop_callback_).Run(); +@@ -130,7 +132,7 @@ void MediaStreamAudioTrack::StopAndNotify(base::OnceClosure callback) { + } + + void MediaStreamAudioTrack::OnSetFormat(const media::AudioParameters& params) { +- SendLogMessage(base::StringPrintf("OnSetFormat([this=%p] {params: [%s]})", ++ i::SendLogMessage(base::StringPrintf("OnSetFormat([this=%p] {params: [%s]})", + this, + params.AsHumanReadableString().c_str())); + deliverer_.OnSetFormat(params); +@@ -141,7 +143,7 @@ void MediaStreamAudioTrack::OnData(const media::AudioBus& audio_bus, + if (!received_audio_callback_) { + // Add log message with unique this pointer id to mark the audio track as + // alive at the first data callback. +- SendLogMessage(base::StringPrintf( ++ i::SendLogMessage(base::StringPrintf( + "OnData([this=%p] => (audio track is alive))", this)); + received_audio_callback_ = true; + } +diff --git third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc +index cb12d36124c2..341845474fc3 100644 +--- third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc ++++ third_party/blink/renderer/platform/peerconnection/rtc_video_decoder_factory.cc +@@ -25,7 +25,9 @@ namespace { + + const int kDefaultFps = 30; + // Any reasonable size, will be overridden by the decoder anyway. ++namespace i { + const gfx::Size kDefaultSize(640, 480); ++} + + struct CodecConfig { + media::VideoCodec codec; +@@ -182,8 +184,8 @@ RTCVideoDecoderFactory::GetSupportedFormats() const { + media::VideoDecoderConfig config( + codec_config.codec, codec_config.profile, + media::VideoDecoderConfig::AlphaMode::kIsOpaque, +- media::VideoColorSpace(), media::kNoTransformation, kDefaultSize, +- gfx::Rect(kDefaultSize), kDefaultSize, media::EmptyExtraData(), ++ media::VideoColorSpace(), media::kNoTransformation, i::kDefaultSize, ++ gfx::Rect(i::kDefaultSize), i::kDefaultSize, media::EmptyExtraData(), + media::EncryptionScheme::kUnencrypted); + if (gpu_factories_->IsDecoderConfigSupported( + RTCVideoDecoderAdapter::kImplementation, config) == +diff --git third_party/blink/renderer/platform/peerconnection/webrtc_audio_sink.cc third_party/blink/renderer/platform/peerconnection/webrtc_audio_sink.cc +index 7d747bc50090..59a6c42e3281 100644 +--- third_party/blink/renderer/platform/peerconnection/webrtc_audio_sink.cc ++++ third_party/blink/renderer/platform/peerconnection/webrtc_audio_sink.cc +@@ -19,9 +19,11 @@ + + namespace { + ++namespace j { + void SendLogMessage(const std::string& message) { + blink::WebRtcLogMessage("WRAS::" + message); + } ++} + + } // namespace + +@@ -58,13 +60,13 @@ WebRtcAudioSink::WebRtcAudioSink( + fifo_(ConvertToBaseRepeatingCallback( + CrossThreadBindRepeating(&WebRtcAudioSink::DeliverRebufferedAudio, + CrossThreadUnretained(this)))) { +- SendLogMessage(base::StringPrintf("WebRtcAudioSink({label=%s})", ++ j::SendLogMessage(base::StringPrintf("WebRtcAudioSink({label=%s})", + adapter_->label().c_str())); + } + + WebRtcAudioSink::~WebRtcAudioSink() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("~WebRtcAudioSink([label=%s])", ++ j::SendLogMessage(base::StringPrintf("~WebRtcAudioSink([label=%s])", + adapter_->label().c_str())); + } + +@@ -84,7 +86,7 @@ void WebRtcAudioSink::SetLevel( + + void WebRtcAudioSink::OnEnabledChanged(bool enabled) { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +- SendLogMessage(base::StringPrintf("OnEnabledChanged([label=%s] {enabled=%s})", ++ j::SendLogMessage(base::StringPrintf("OnEnabledChanged([label=%s] {enabled=%s})", + adapter_->label().c_str(), + (enabled ? "true" : "false"))); + PostCrossThreadTask( +@@ -105,7 +107,7 @@ void WebRtcAudioSink::OnData(const media::AudioBus& audio_bus, + + void WebRtcAudioSink::OnSetFormat(const media::AudioParameters& params) { + DCHECK(params.IsValid()); +- SendLogMessage(base::StringPrintf("OnSetFormat([label=%s] {params=[%s]})", ++ j::SendLogMessage(base::StringPrintf("OnSetFormat([label=%s] {params=[%s]})", + adapter_->label().c_str(), + params.AsHumanReadableString().c_str())); + params_ = params; +@@ -153,12 +155,12 @@ WebRtcAudioSink::Adapter::Adapter( + main_task_runner_(std::move(main_task_runner)) { + DCHECK(signaling_task_runner_); + DCHECK(main_task_runner_); +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::Adapter({label=%s})", label_.c_str())); + } + + WebRtcAudioSink::Adapter::~Adapter() { +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::~Adapter([label=%s])", label_.c_str())); + if (audio_processor_) { + PostCrossThreadTask(*main_task_runner_.get(), FROM_HERE, +@@ -186,7 +188,7 @@ std::string WebRtcAudioSink::Adapter::kind() const { + bool WebRtcAudioSink::Adapter::set_enabled(bool enable) { + DCHECK(!signaling_task_runner_ || + signaling_task_runner_->RunsTasksInCurrentSequence()); +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::set_enabled([label=%s] {enable=%s})", + label_.c_str(), (enable ? "true" : "false"))); + return webrtc::MediaStreamTrack::set_enabled( +@@ -197,7 +199,7 @@ void WebRtcAudioSink::Adapter::AddSink(webrtc::AudioTrackSinkInterface* sink) { + DCHECK(!signaling_task_runner_ || + signaling_task_runner_->RunsTasksInCurrentSequence()); + DCHECK(sink); +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::AddSink({label=%s})", label_.c_str())); + base::AutoLock auto_lock(lock_); + DCHECK(!base::Contains(sinks_, sink)); +@@ -208,7 +210,7 @@ void WebRtcAudioSink::Adapter::RemoveSink( + webrtc::AudioTrackSinkInterface* sink) { + DCHECK(!signaling_task_runner_ || + signaling_task_runner_->RunsTasksInCurrentSequence()); +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::RemoveSink([label=%s])", label_.c_str())); + base::AutoLock auto_lock(lock_); + const auto it = std::find(sinks_.begin(), sinks_.end(), sink); +@@ -230,7 +232,7 @@ bool WebRtcAudioSink::Adapter::GetSignalLevel(int* level) { + // Convert from float in range [0.0,1.0] to an int in range [0,32767]. + *level = static_cast(signal_level * std::numeric_limits::max() + + 0.5f /* rounding to nearest int */); +- SendLogMessage( ++ j::SendLogMessage( + base::StringPrintf("Adapter::GetSignalLevel([label=%s]) => (level=%d)", + label_.c_str(), *level)); + return true; +diff --git ui/base/x/x11_drag_context.cc ui/base/x/x11_drag_context.cc +index 3ed9e98b2a20..8ada19c7afd9 100644 +--- ui/base/x/x11_drag_context.cc ++++ ui/base/x/x11_drag_context.cc +@@ -13,6 +13,7 @@ + namespace ui { + + namespace { ++namespace i { + + // Window property that holds the supported drag and drop data types. + // This property is set on the XDND source window when the drag and drop data +@@ -34,6 +35,7 @@ const char kXdndActionLink[] = "XdndActionLink"; + // Window property that will receive the drag and drop selection data. + const char kChromiumDragReciever[] = "_CHROMIUM_DRAG_RECEIVER"; + ++} // namespace i + } // namespace + + XDragContext::XDragContext(XID local_window, +@@ -47,7 +49,7 @@ XDragContext::XDragContext(XID local_window, + bool get_types_from_property = ((event.data.l[1] & 1) != 0); + + if (get_types_from_property) { +- if (!GetAtomArrayProperty(source_window_, kXdndTypeList, ++ if (!GetAtomArrayProperty(source_window_, i::kXdndTypeList, + &unfetched_targets_)) { + return; + } +@@ -111,8 +113,8 @@ void XDragContext::RequestNextTarget() { + Atom target = unfetched_targets_.back(); + unfetched_targets_.pop_back(); + +- XConvertSelection(gfx::GetXDisplay(), gfx::GetAtom(kXdndSelection), target, +- gfx::GetAtom(kChromiumDragReciever), local_window_, ++ XConvertSelection(gfx::GetXDisplay(), gfx::GetAtom(i::kXdndSelection), target, ++ gfx::GetAtom(i::kChromiumDragReciever), local_window_, + position_time_stamp_); + } + +@@ -127,7 +129,7 @@ void XDragContext::OnSelectionNotify(const XSelectionEvent& event) { + DVLOG(1) << "SelectionNotify, format " << event.target; + + if (event.property != x11::None) { +- DCHECK_EQ(event.property, gfx::GetAtom(kChromiumDragReciever)); ++ DCHECK_EQ(event.property, gfx::GetAtom(i::kChromiumDragReciever)); + + scoped_refptr data; + Atom type = x11::None; +@@ -155,7 +157,7 @@ void XDragContext::OnSelectionNotify(const XSelectionEvent& event) { + void XDragContext::ReadActions() { + if (!source_client_) { + std::vector atom_array; +- if (!GetAtomArrayProperty(source_window_, kXdndActionList, &atom_array)) ++ if (!GetAtomArrayProperty(source_window_, i::kXdndActionList, &atom_array)) + actions_.clear(); + else + actions_.swap(atom_array); +@@ -179,17 +181,17 @@ int XDragContext::GetDragOperation() const { + + void XDragContext::MaskOperation(Atom xdnd_operation, + int* drag_operation) const { +- if (xdnd_operation == gfx::GetAtom(kXdndActionCopy)) ++ if (xdnd_operation == gfx::GetAtom(i::kXdndActionCopy)) + *drag_operation |= DragDropTypes::DRAG_COPY; +- else if (xdnd_operation == gfx::GetAtom(kXdndActionMove)) ++ else if (xdnd_operation == gfx::GetAtom(i::kXdndActionMove)) + *drag_operation |= DragDropTypes::DRAG_MOVE; +- else if (xdnd_operation == gfx::GetAtom(kXdndActionLink)) ++ else if (xdnd_operation == gfx::GetAtom(i::kXdndActionLink)) + *drag_operation |= DragDropTypes::DRAG_LINK; + } + + bool XDragContext::DispatchXEvent(XEvent* xev) { + if (xev->type == PropertyNotify && +- xev->xproperty.atom == gfx::GetAtom(kXdndActionList)) { ++ xev->xproperty.atom == gfx::GetAtom(i::kXdndActionList)) { + ReadActions(); + return true; + } diff --git a/patch/patches/chrome_browser.patch b/patch/patches/chrome_browser.patch index 8e04f96b3..48fd822cd 100644 --- a/patch/patches/chrome_browser.patch +++ b/patch/patches/chrome_browser.patch @@ -1,16 +1,16 @@ diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn -index 6751a787272b..751b62c50a81 100644 +index 477e30a34cd2..7a24ff410e7e 100644 --- chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn -@@ -10,6 +10,7 @@ import("//build/config/features.gni") +@@ -11,6 +11,7 @@ import("//build/config/features.gni") import("//build/config/jumbo.gni") import("//build/config/linux/gtk/gtk.gni") import("//build/config/ui.gni") +import("//cef/libcef/features/features.gni") import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") - import("//components/feature_engagement/features.gni") -@@ -1959,6 +1960,7 @@ jumbo_static_library("browser") { + import("//components/captive_portal/core/features.gni") +@@ -1956,6 +1957,7 @@ jumbo_static_library("browser") { "//base/util/values:values_util", "//build:branding_buildflags", "//cc", @@ -18,7 +18,7 @@ index 6751a787272b..751b62c50a81 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -2263,6 +2265,10 @@ jumbo_static_library("browser") { +@@ -2275,6 +2277,10 @@ jumbo_static_library("browser") { ] } diff --git a/patch/patches/chrome_browser_content_settings.patch b/patch/patches/chrome_browser_content_settings.patch index e8faf0721..cae165682 100644 --- a/patch/patches/chrome_browser_content_settings.patch +++ b/patch/patches/chrome_browser_content_settings.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc -index 47b1443298ec..c1e07075fec4 100644 +index 1610e0ecc707..f231d5033983 100644 --- chrome/browser/content_settings/host_content_settings_map_factory.cc +++ chrome/browser/content_settings/host_content_settings_map_factory.cc @@ -7,6 +7,7 @@ diff --git a/patch/patches/chrome_browser_net_export.patch b/patch/patches/chrome_browser_net_export.patch index 41456b987..3065c86f1 100644 --- a/patch/patches/chrome_browser_net_export.patch +++ b/patch/patches/chrome_browser_net_export.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn -index faa1344bd0a9..4528f101adb8 100644 +index c820df8447f0..58cb1279b7bf 100644 --- chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn @@ -9,6 +9,7 @@ import("//build/config/features.gni") @@ -7,10 +7,10 @@ index faa1344bd0a9..4528f101adb8 100644 import("//build/config/linux/gtk/gtk.gni") import("//build/config/ui.gni") +import("//cef/libcef/features/features.gni") + import("//chrome/browser/buildflags.gni") import("//chrome/common/features.gni") import("//chromeos/assistant/assistant.gni") - import("//components/feature_engagement/features.gni") -@@ -355,6 +356,10 @@ jumbo_static_library("ui") { +@@ -362,6 +363,10 @@ jumbo_static_library("ui") { "//build/config/compiler:wexit_time_destructors", ] @@ -21,7 +21,7 @@ index faa1344bd0a9..4528f101adb8 100644 # Since browser and browser_ui actually depend on each other, # we must omit the dependency from browser_ui to browser. # However, this means browser_ui and browser should more or less -@@ -376,6 +381,7 @@ jumbo_static_library("ui") { +@@ -383,6 +388,7 @@ jumbo_static_library("ui") { "//base/allocator:buildflags", "//build:branding_buildflags", "//cc/paint", @@ -29,7 +29,7 @@ index faa1344bd0a9..4528f101adb8 100644 "//chrome:extra_resources", "//chrome:resources", "//chrome:strings", -@@ -1403,6 +1409,7 @@ jumbo_static_library("ui") { +@@ -1438,6 +1444,7 @@ jumbo_static_library("ui") { "//components/keep_alive_registry", "//components/network_session_configurator/common", "//components/page_load_metrics/browser", @@ -38,10 +38,10 @@ index faa1344bd0a9..4528f101adb8 100644 "//components/ui_metrics", "//components/url_formatter", diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc -index 0924a6d73069..2fbdc6588a2c 100644 +index 93bfc84f49a1..eeee229e943f 100644 --- chrome/browser/ui/webui/net_export_ui.cc +++ chrome/browser/ui/webui/net_export_ui.cc -@@ -20,13 +20,12 @@ +@@ -21,13 +21,12 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/values.h" @@ -55,8 +55,8 @@ index 0924a6d73069..2fbdc6588a2c 100644 -#include "chrome/browser/ui/chrome_select_file_policy.h" #include "chrome/common/channel_info.h" #include "chrome/common/url_constants.h" - #include "components/grit/components_resources.h" -@@ -41,7 +40,14 @@ + #include "components/grit/dev_ui_components_resources.h" +@@ -42,7 +41,14 @@ #include "content/public/browser/web_ui_message_handler.h" #include "extensions/buildflags/buildflags.h" #include "net/log/net_log_capture_mode.h" @@ -71,7 +71,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 #if defined(OS_ANDROID) #include "chrome/browser/android/intent_helper.h" -@@ -67,6 +73,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() { +@@ -68,6 +74,7 @@ content::WebUIDataSource* CreateNetExportHTMLSource() { return source; } @@ -79,7 +79,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 void SetIfNotNull(base::DictionaryValue* dict, const base::StringPiece& path, std::unique_ptr in_value) { -@@ -74,6 +81,7 @@ void SetIfNotNull(base::DictionaryValue* dict, +@@ -75,6 +82,7 @@ void SetIfNotNull(base::DictionaryValue* dict, dict->Set(path, std::move(in_value)); } } @@ -87,7 +87,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 // This class receives javascript messages from the renderer. // Note that the WebUI infrastructure runs on the UI thread, therefore all of -@@ -81,7 +89,9 @@ void SetIfNotNull(base::DictionaryValue* dict, +@@ -82,7 +90,9 @@ void SetIfNotNull(base::DictionaryValue* dict, class NetExportMessageHandler : public WebUIMessageHandler, public base::SupportsWeakPtr, @@ -97,7 +97,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 public net_log::NetExportFileWriter::StateObserver { public: NetExportMessageHandler(); -@@ -97,11 +107,13 @@ class NetExportMessageHandler +@@ -98,11 +108,13 @@ class NetExportMessageHandler void OnSendNetLog(const base::ListValue* list); void OnShowFile(const base::ListValue* list); @@ -111,7 +111,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 // net_log::NetExportFileWriter::StateObserver implementation. void OnNewState(const base::DictionaryValue& state) override; -@@ -131,9 +143,16 @@ class NetExportMessageHandler +@@ -132,9 +144,16 @@ class NetExportMessageHandler // renderer. void NotifyUIWithState(std::unique_ptr state); @@ -128,7 +128,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 // Cached pointer to SystemNetworkContextManager's NetExportFileWriter. net_log::NetExportFileWriter* file_writer_; -@@ -149,7 +168,9 @@ class NetExportMessageHandler +@@ -150,7 +169,9 @@ class NetExportMessageHandler net::NetLogCaptureMode capture_mode_; uint64_t max_log_file_size_; @@ -138,7 +138,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 base::WeakPtrFactory weak_ptr_factory_{this}; -@@ -166,8 +187,10 @@ NetExportMessageHandler::NetExportMessageHandler() +@@ -167,8 +188,10 @@ NetExportMessageHandler::NetExportMessageHandler() NetExportMessageHandler::~NetExportMessageHandler() { // There may be a pending file dialog, it needs to be told that the user // has gone away so that it doesn't try to call back. @@ -149,7 +149,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 file_writer_->StopNetLog(nullptr); } -@@ -230,6 +253,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { +@@ -231,6 +254,7 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { if (UsingMobileUI()) { StartNetLog(base::FilePath()); } else { @@ -157,7 +157,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 base::FilePath initial_dir = last_save_dir.Pointer()->empty() ? DownloadPrefs::FromBrowserContext( web_ui()->GetWebContents()->GetBrowserContext())->DownloadPath() : -@@ -237,6 +261,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { +@@ -238,6 +262,9 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { base::FilePath initial_path = initial_dir.Append(FILE_PATH_LITERAL("chrome-net-export-log.json")); ShowSelectFileDialog(initial_path); @@ -167,7 +167,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 } } -@@ -246,6 +273,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -247,6 +274,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { std::unique_ptr ui_thread_polled_data( new base::DictionaryValue()); @@ -175,7 +175,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 Profile* profile = Profile::FromWebUI(web_ui()); SetIfNotNull(ui_thread_polled_data.get(), "prerenderInfo", chrome_browser_net::GetPrerenderInfo(profile)); -@@ -255,6 +283,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { +@@ -256,6 +284,7 @@ void NetExportMessageHandler::OnStopNetLog(const base::ListValue* list) { SetIfNotNull(ui_thread_polled_data.get(), "serviceProviders", chrome_browser_net::GetWindowsServiceProviders()); #endif @@ -183,7 +183,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 file_writer_->StopNetLog(std::move(ui_thread_polled_data)); } -@@ -271,6 +300,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) { +@@ -272,6 +301,7 @@ void NetExportMessageHandler::OnShowFile(const base::ListValue* list) { base::Bind(&NetExportMessageHandler::ShowFileInShell, AsWeakPtr())); } @@ -191,7 +191,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 void NetExportMessageHandler::FileSelected(const base::FilePath& path, int index, void* params) { -@@ -289,6 +319,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) { +@@ -290,6 +320,7 @@ void NetExportMessageHandler::FileSelectionCanceled(void* params) { DCHECK(select_file_dialog_); select_file_dialog_ = nullptr; } @@ -199,7 +199,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 void NetExportMessageHandler::OnNewState(const base::DictionaryValue& state) { NotifyUIWithState(state.CreateDeepCopy()); -@@ -353,6 +384,7 @@ void NetExportMessageHandler::NotifyUIWithState( +@@ -354,6 +385,7 @@ void NetExportMessageHandler::NotifyUIWithState( *state); } @@ -207,7 +207,7 @@ index 0924a6d73069..2fbdc6588a2c 100644 void NetExportMessageHandler::ShowSelectFileDialog( const base::FilePath& default_path) { // User may have clicked more than once before the save dialog appears. -@@ -371,6 +403,43 @@ void NetExportMessageHandler::ShowSelectFileDialog( +@@ -372,6 +404,43 @@ void NetExportMessageHandler::ShowSelectFileDialog( ui::SelectFileDialog::SELECT_SAVEAS_FILE, base::string16(), default_path, &file_type_info, 0, base::FilePath::StringType(), owning_window, nullptr); } diff --git a/patch/patches/chrome_browser_product_override.patch b/patch/patches/chrome_browser_product_override.patch index d51047251..c6e706b9e 100644 --- a/patch/patches/chrome_browser_product_override.patch +++ b/patch/patches/chrome_browser_product_override.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc -index 5cdfec3a834b..99a06ed3332c 100644 +index 6cdca1affb9f..f875ba1a5d75 100644 --- chrome/browser/chrome_content_browser_client.cc +++ chrome/browser/chrome_content_browser_client.cc -@@ -990,10 +990,6 @@ void LaunchURL(const GURL& url, +@@ -1027,10 +1027,6 @@ void LaunchURL(const GURL& url, } } @@ -13,7 +13,7 @@ index 5cdfec3a834b..99a06ed3332c 100644 void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) { // |allowlist| combines pref/policy + cmdline switch in the browser process. // For renderer and utility (e.g. NetworkService) processes the switch is the -@@ -1088,6 +1084,14 @@ void MaybeRecordSameSiteCookieEngagementHistogram( +@@ -1125,6 +1121,14 @@ void MaybeRecordSameSiteCookieEngagementHistogram( } // namespace @@ -29,10 +29,10 @@ index 5cdfec3a834b..99a06ed3332c 100644 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kUserAgent)) { diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h -index d6b48bfa4314..bc4266755dc7 100644 +index e4a98f0bb2f6..cbc986303fd2 100644 --- chrome/browser/chrome_content_browser_client.h +++ chrome/browser/chrome_content_browser_client.h -@@ -87,7 +87,8 @@ enum class Channel; +@@ -86,7 +86,8 @@ enum class Channel; class ChromeHidDelegate; class ChromeSerialDelegate; diff --git a/patch/patches/chrome_browser_profiles.patch b/patch/patches/chrome_browser_profiles.patch index fb876fe9b..2128700e8 100644 --- a/patch/patches/chrome_browser_profiles.patch +++ b/patch/patches/chrome_browser_profiles.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc -index 1abea76ebc02..d9fc9c0450c2 100644 +index 3c43cc752511..fbc476cc9023 100644 --- chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc -@@ -359,7 +359,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) +@@ -362,7 +362,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, content::NotificationService::AllSources()); @@ -12,10 +12,10 @@ index 1abea76ebc02..d9fc9c0450c2 100644 } diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h -index 7d02af7f8f60..eb70e533dbfb 100644 +index f4c3c9e25190..dd91e00d3001 100644 --- chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h -@@ -99,7 +99,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -101,7 +101,7 @@ class ProfileManager : public content::NotificationObserver, // acceptable. Returns null if creation of the new profile fails. // TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then // make this method private. @@ -24,7 +24,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644 // Returns total number of profiles available on this machine. size_t GetNumberOfProfiles(); -@@ -129,7 +129,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -131,7 +131,7 @@ class ProfileManager : public content::NotificationObserver, // Returns true if the profile pointer is known to point to an existing // profile. @@ -33,7 +33,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644 // Returns the directory where the first created profile is stored, // relative to the user data directory currently in use. -@@ -138,7 +138,7 @@ class ProfileManager : public content::NotificationObserver, +@@ -140,7 +140,7 @@ class ProfileManager : public content::NotificationObserver, // Get the Profile last used (the Profile to which owns the most recently // focused window) with this Chrome build. If no signed profile has been // stored in Local State, hand back the Default profile. @@ -43,7 +43,7 @@ index 7d02af7f8f60..eb70e533dbfb 100644 // Get the path of the last used profile, or if that's undefined, the default // profile. diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc -index 07e6f8d726df..9a3c6b38b8eb 100644 +index ce50c9ee3f92..eba0894ee2b4 100644 --- chrome/browser/profiles/renderer_updater.cc +++ chrome/browser/profiles/renderer_updater.cc @@ -7,6 +7,7 @@ @@ -54,7 +54,7 @@ index 07e6f8d726df..9a3c6b38b8eb 100644 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/signin/identity_manager_factory.h" -@@ -67,8 +68,12 @@ void GetGuestViewDefaultContentSettingRules( +@@ -62,8 +63,12 @@ void GetGuestViewDefaultContentSettingRules( RendererUpdater::RendererUpdater(Profile* profile) : profile_(profile), identity_manager_observer_(this) { @@ -67,7 +67,7 @@ index 07e6f8d726df..9a3c6b38b8eb 100644 #if defined(OS_CHROMEOS) oauth2_login_manager_ = chromeos::OAuth2LoginManagerFactory::GetForProfile(profile_); -@@ -238,7 +243,7 @@ void RendererUpdater::UpdateRenderer( +@@ -233,7 +238,7 @@ void RendererUpdater::UpdateRenderer( force_google_safesearch_.GetValue(), force_youtube_restrict_.GetValue(), allowed_domains_for_apps_.GetValue(), diff --git a/patch/patches/chrome_browser_safe_browsing.patch b/patch/patches/chrome_browser_safe_browsing.patch index c76e4cae4..dff60b6bb 100644 --- a/patch/patches/chrome_browser_safe_browsing.patch +++ b/patch/patches/chrome_browser_safe_browsing.patch @@ -1,12 +1,12 @@ diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn -index 0f60694e2d9f..35eeee3233a1 100644 +index 7bd46afdfd34..f3d2d056d6a0 100644 --- chrome/browser/safe_browsing/BUILD.gn +++ chrome/browser/safe_browsing/BUILD.gn -@@ -237,6 +237,7 @@ jumbo_static_library("safe_browsing") { +@@ -243,6 +243,7 @@ jumbo_static_library("safe_browsing") { "//chrome/common/safe_browsing:download_type_util", "//chrome/services/file_util/public/cpp", "//components/content_settings/core/browser", + "//components/gcm_driver:gcm_buildflags", "//components/language/core/common", "//components/prefs", - "//components/safe_browsing/db", + "//components/safe_browsing/core/db", diff --git a/patch/patches/chrome_browser_themes.patch b/patch/patches/chrome_browser_themes.patch index f562aa9c9..ffb61d579 100644 --- a/patch/patches/chrome_browser_themes.patch +++ b/patch/patches/chrome_browser_themes.patch @@ -1,18 +1,18 @@ diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc -index 3f065778092c..3661a9ece2a6 100644 +index 5a0d5e736cb9..f1c9da3f73b1 100644 --- chrome/browser/themes/theme_service_factory.cc +++ chrome/browser/themes/theme_service_factory.cc -@@ -6,6 +6,7 @@ - +@@ -7,6 +7,7 @@ #include "base/logging.h" + #include "base/no_destructor.h" #include "build/build_config.h" +#include "cef/libcef/features/features.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -@@ -25,6 +26,10 @@ - #include "ui/views/linux_ui/linux_ui.h" - #endif +@@ -42,6 +43,10 @@ const ThemeHelper& GetThemeHelper() { + + } // namespace +#if BUILDFLAG(ENABLE_CEF) +#include "cef/libcef/common/extensions/extensions_util.h" @@ -21,7 +21,7 @@ index 3f065778092c..3661a9ece2a6 100644 // static ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) { return static_cast( -@@ -54,7 +59,13 @@ ThemeServiceFactory::ThemeServiceFactory() +@@ -71,7 +76,13 @@ ThemeServiceFactory::ThemeServiceFactory() BrowserContextDependencyManager::GetInstance()) { DependsOn(extensions::ExtensionRegistryFactory::GetInstance()); DependsOn(extensions::ExtensionPrefsFactory::GetInstance()); diff --git a/patch/patches/chrome_plugins.patch b/patch/patches/chrome_plugins.patch index 96e8751e4..04dfc53bf 100644 --- a/patch/patches/chrome_plugins.patch +++ b/patch/patches/chrome_plugins.patch @@ -165,17 +165,16 @@ index 4e64db143b8a..71322b0261a1 100644 Profile* profile = Profile::FromBrowserContext(browser_context); std::vector whitelist = MimeTypesHandler::GetMIMETypeWhitelist(); diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc -index 69539de7b1ec..001cf1d1fe0d 100644 +index a7e5caea5add..f9d11b317946 100644 --- chrome/common/google_url_loader_throttle.cc +++ chrome/common/google_url_loader_throttle.cc -@@ -4,11 +4,16 @@ +@@ -4,10 +4,15 @@ #include "chrome/common/google_url_loader_throttle.h" +#include "cef/libcef/features/features.h" #include "chrome/common/net/safe_search_util.h" #include "components/variations/net/variations_http_headers.h" - #include "services/network/public/cpp/resource_response.h" #include "services/network/public/mojom/url_response_head.mojom.h" +#if BUILDFLAG(ENABLE_CEF) @@ -185,7 +184,7 @@ index 69539de7b1ec..001cf1d1fe0d 100644 #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/extension_urls.h" #endif -@@ -97,6 +102,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( +@@ -96,6 +101,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse( const GURL& response_url, network::mojom::URLResponseHead* response_head, bool* defer) { @@ -198,10 +197,10 @@ index 69539de7b1ec..001cf1d1fe0d 100644 GURL webstore_url(extension_urls::GetWebstoreLaunchURL()); if (response_url.SchemeIsHTTPOrHTTPS() && diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc -index ffde51cd276a..3ef2ad8d3945 100644 +index e03ad3a5a115..12adcae6cf84 100644 --- chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc -@@ -814,6 +814,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -811,6 +811,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( if ((status == chrome::mojom::PluginStatus::kUnauthorized || status == chrome::mojom::PluginStatus::kBlocked) && @@ -209,7 +208,7 @@ index ffde51cd276a..3ef2ad8d3945 100644 content_settings_agent->IsPluginTemporarilyAllowed(identifier)) { status = chrome::mojom::PluginStatus::kAllowed; } -@@ -1012,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1009,7 +1010,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( render_frame->GetRemoteAssociatedInterfaces()->GetInterface( plugin_auth_host.BindNewEndpointAndPassReceiver()); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); @@ -219,7 +218,7 @@ index ffde51cd276a..3ef2ad8d3945 100644 break; } case chrome::mojom::PluginStatus::kBlocked: { -@@ -1021,7 +1023,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1018,7 +1020,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); placeholder->AllowLoading(); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); @@ -229,7 +228,7 @@ index ffde51cd276a..3ef2ad8d3945 100644 break; } case chrome::mojom::PluginStatus::kBlockedByPolicy: { -@@ -1031,7 +1034,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1028,7 +1031,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( group_name)); RenderThread::Get()->RecordAction( UserMetricsAction("Plugin_BlockedByPolicy")); @@ -239,7 +238,7 @@ index ffde51cd276a..3ef2ad8d3945 100644 break; } case chrome::mojom::PluginStatus::kBlockedNoLoading: { -@@ -1039,7 +1043,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( +@@ -1036,7 +1040,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( IDR_BLOCKED_PLUGIN_HTML, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, group_name)); @@ -250,10 +249,10 @@ index ffde51cd276a..3ef2ad8d3945 100644 } case chrome::mojom::PluginStatus::kComponentUpdateRequired: { diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc -index b86b883882cf..442bfa6753d8 100644 +index ed7a8e4d9c7b..19af355cac2a 100644 --- chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ chrome/renderer/plugins/chrome_plugin_placeholder.cc -@@ -358,8 +358,11 @@ void ChromePluginPlaceholder::OnBlockedContent( +@@ -359,8 +359,11 @@ void ChromePluginPlaceholder::OnBlockedContent( if (status == content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) { diff --git a/patch/patches/chrome_pref_watcher.patch b/patch/patches/chrome_pref_watcher.patch index ce0c45021..743c1d9e2 100644 --- a/patch/patches/chrome_pref_watcher.patch +++ b/patch/patches/chrome_pref_watcher.patch @@ -1,5 +1,5 @@ diff --git chrome/browser/ui/prefs/pref_watcher.h chrome/browser/ui/prefs/pref_watcher.h -index dd06c6d22b16..1f3a5aa7ac2b 100644 +index a439b2ce1b32..21c7b97639f4 100644 --- chrome/browser/ui/prefs/pref_watcher.h +++ chrome/browser/ui/prefs/pref_watcher.h @@ -29,10 +29,10 @@ class PrefWatcher : public KeyedService { @@ -13,4 +13,4 @@ index dd06c6d22b16..1f3a5aa7ac2b 100644 + private: void UpdateRendererPreferences(); void OnWebPrefChanged(const std::string& pref_name); - + void OnLiveCaptionEnabledPrefChanged(const std::string& pref_name); diff --git a/patch/patches/chrome_renderer.patch b/patch/patches/chrome_renderer.patch index 15946d1be..4f08a9fc3 100644 --- a/patch/patches/chrome_renderer.patch +++ b/patch/patches/chrome_renderer.patch @@ -1,16 +1,16 @@ diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn -index 4e229c16628f..17741b4d83a1 100644 +index b2eaaf2b29fd..842e99c37e95 100644 --- chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn -@@ -4,6 +4,7 @@ - +@@ -5,6 +5,7 @@ + import("//build/config/buildflags_paint_preview.gni") import("//build/config/features.gni") import("//build/config/jumbo.gni") +import("//cef/libcef/features/features.gni") import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") -@@ -128,6 +129,7 @@ jumbo_static_library("renderer") { +@@ -129,6 +130,7 @@ jumbo_static_library("renderer") { defines = [] deps = [ @@ -18,7 +18,7 @@ index 4e229c16628f..17741b4d83a1 100644 "//chrome:resources", "//chrome:strings", "//chrome/common", -@@ -196,6 +198,10 @@ jumbo_static_library("renderer") { +@@ -194,6 +196,10 @@ jumbo_static_library("renderer") { configs += [ "//build/config/compiler:wexit_time_destructors" ] diff --git a/patch/patches/chrome_widevine.patch b/patch/patches/chrome_widevine.patch index 8d69eb934..c99058eb8 100644 --- a/patch/patches/chrome_widevine.patch +++ b/patch/patches/chrome_widevine.patch @@ -1,5 +1,5 @@ diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn -index 60757fdc2eee..29012ea670cf 100644 +index 1919784f5f93..6a8d2d5140f2 100644 --- third_party/widevine/cdm/BUILD.gn +++ third_party/widevine/cdm/BUILD.gn @@ -5,6 +5,7 @@ diff --git a/patch/patches/component_build.patch b/patch/patches/component_build.patch index 0016ef95a..44f9d14e9 100644 --- a/patch/patches/component_build.patch +++ b/patch/patches/component_build.patch @@ -20,7 +20,7 @@ index 544ed223ac8e..490330c87453 100644 bool is_navigation, bool is_download, diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h -index 33a2d55e47ac..1700b3df2468 100644 +index a1f57138a24f..f6dd542ab89e 100644 --- content/browser/renderer_host/input/synthetic_gesture_target_base.h +++ content/browser/renderer_host/input/synthetic_gesture_target_base.h @@ -8,6 +8,7 @@ @@ -28,10 +28,10 @@ index 33a2d55e47ac..1700b3df2468 100644 #include "base/time/time.h" #include "content/browser/renderer_host/input/synthetic_gesture_target.h" +#include "content/common/content_export.h" + #include "ui/gfx/geometry/point_f.h" namespace ui { - class LatencyInfo; -@@ -24,7 +25,8 @@ namespace content { +@@ -25,7 +26,8 @@ namespace content { class RenderWidgetHostImpl; @@ -55,7 +55,7 @@ index 886bdf0edf8f..1d714000cce5 100644 blink::mojom::V8CacheOptions GetV8CacheOptions(); diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn -index afb225949027..d0647753af2b 100644 +index ea7f0d6dbdac..d586c2900861 100644 --- third_party/blink/renderer/controller/BUILD.gn +++ third_party/blink/renderer/controller/BUILD.gn @@ -25,6 +25,7 @@ jumbo_component("controller") { @@ -74,14 +74,14 @@ index afb225949027..d0647753af2b 100644 + "//cef/libcef/renderer/blink_glue.h", ] - if (is_android) { + if (is_linux) { diff --git ui/events/keycodes/BUILD.gn ui/events/keycodes/BUILD.gn -index 97e5fd499c81..8508a8fbcc8e 100644 +index 772d0ef90e03..7d6d9aaf8014 100644 --- ui/events/keycodes/BUILD.gn +++ ui/events/keycodes/BUILD.gn -@@ -18,6 +18,8 @@ jumbo_source_set("xkb") { - "//ui/base:buildflags", - ] +@@ -16,6 +16,8 @@ jumbo_source_set("xkb") { + + public_deps = [ "//ui/base:buildflags" ] + defines = [ "KEYCODES_X_IMPLEMENTATION" ] + diff --git a/patch/patches/content_2015.patch b/patch/patches/content_2015.patch index f0798f221..ecd185e27 100644 --- a/patch/patches/content_2015.patch +++ b/patch/patches/content_2015.patch @@ -1,8 +1,8 @@ diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc -index 2d5b195caecb..827fcc962640 100644 +index c07ba782b810..7ae3ab09a15a 100644 --- chrome/browser/download/download_target_determiner.cc +++ chrome/browser/download/download_target_determiner.cc -@@ -636,7 +636,7 @@ void IsHandledBySafePlugin(int render_process_id, +@@ -639,7 +639,7 @@ void IsHandledBySafePlugin(int render_process_id, content::PluginService* plugin_service = content::PluginService::GetInstance(); bool plugin_found = plugin_service->GetPluginInfo( @@ -49,25 +49,23 @@ index 8d7b5276955d..787f338e7ca6 100644 false /* allow_wildcard */, is_stale, &plugin_info, nullptr /* actual_mime_type */); diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc -index 000ce05d8712..5806aef4d696 100644 +index e622e8099e95..2b08fc4e3727 100644 --- chrome/browser/ui/views/frame/browser_root_view.cc +++ chrome/browser/ui/views/frame/browser_root_view.cc -@@ -69,8 +69,8 @@ void OnFindURLMimeType(const GURL& url, - std::move(callback).Run( - url, mime_type.empty() || blink::IsSupportedMimeType(mime_type) || - content::PluginService::GetInstance()->GetPluginInfo( -- process_id, routing_id, url, url::Origin(), mime_type, false, -- nullptr, &plugin, nullptr)); -+ process_id, routing_id, url, true, url::Origin(), mime_type, -+ false, nullptr, &plugin, nullptr)); - } +@@ -75,7 +75,7 @@ void OnFindURLMimeType(const GURL& url, + #if BUILDFLAG(ENABLE_PLUGINS) + content::WebPluginInfo plugin; + result = result || content::PluginService::GetInstance()->GetPluginInfo( +- process_id, routing_id, url, url::Origin(), mime_type, ++ process_id, routing_id, url, true, url::Origin(), mime_type, + false, nullptr, &plugin, nullptr); + #endif - bool GetURLForDrop(const ui::DropTargetEvent& event, GURL* url) { diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc -index 23565fc63987..88caf430a0c9 100644 +index 6518a57a5f16..e88984c8150c 100644 --- content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc -@@ -570,7 +570,7 @@ void DevToolsHttpHandler::OnJsonRequest( +@@ -571,7 +571,7 @@ void DevToolsHttpHandler::OnJsonRequest( version.SetString("Protocol-Version", DevToolsAgentHost::GetProtocolVersion()); version.SetString("WebKit-Version", GetWebKitVersion()); @@ -77,7 +75,7 @@ index 23565fc63987..88caf430a0c9 100644 GetContentClient()->browser()->GetUserAgent()); version.SetString("V8-Version", V8_VERSION_STRING); diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc -index c194f7a03838..450b6cb2c3ca 100644 +index c80e4075de69..7bc702749974 100644 --- content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc @@ -308,6 +308,7 @@ void RenderFrameMessageFilter::OnAre3DAPIsBlocked(int render_frame_id, @@ -101,7 +99,7 @@ index c194f7a03838..450b6cb2c3ca 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 307a119bb9d8..c522bfcf3298 100644 +index 9ce9487ef40c..78421b32149c 100644 --- content/browser/frame_host/render_frame_message_filter.h +++ content/browser/frame_host/render_frame_message_filter.h @@ -90,6 +90,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter { @@ -113,10 +111,10 @@ index 307a119bb9d8..c522bfcf3298 100644 const std::string& mime_type, bool* found, diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc -index a223fcaccd46..9ca82d7c1c8d 100644 +index 7f322176a102..9301825b8b59 100644 --- content/browser/loader/navigation_url_loader_impl.cc +++ content/browser/loader/navigation_url_loader_impl.cc -@@ -697,6 +697,13 @@ class NavigationURLLoaderImpl::URLLoaderRequestController +@@ -716,6 +716,13 @@ class NavigationURLLoaderImpl::URLLoaderRequestController resource_request_->has_user_gesture, resource_request_->request_initiator, &loader_factory); @@ -130,7 +128,7 @@ index a223fcaccd46..9ca82d7c1c8d 100644 if (loader_factory) { factory = base::MakeRefCounted( -@@ -905,7 +912,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController +@@ -924,7 +931,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController frame_tree_node->current_frame_host()->GetProcess()->GetID(); int routing_id = frame_tree_node->current_frame_host()->GetRoutingID(); bool has_plugin = PluginService::GetInstance()->GetPluginInfo( @@ -140,10 +138,10 @@ index a223fcaccd46..9ca82d7c1c8d 100644 if (stale) { diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc -index 4461a489227e..fea615b44abe 100644 +index 848431a0cad6..9001ad4c9e68 100644 --- content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc -@@ -302,6 +302,7 @@ bool PluginServiceImpl::GetPluginInfoArray( +@@ -311,6 +311,7 @@ bool PluginServiceImpl::GetPluginInfoArray( bool PluginServiceImpl::GetPluginInfo(int render_process_id, int render_frame_id, const GURL& url, @@ -151,7 +149,7 @@ index 4461a489227e..fea615b44abe 100644 const url::Origin& main_frame_origin, const std::string& mime_type, bool allow_wildcard, -@@ -319,7 +320,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, +@@ -328,7 +329,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, for (size_t i = 0; i < plugins.size(); ++i) { if (!filter_ || filter_->IsPluginAvailable(render_process_id, render_frame_id, url, @@ -162,7 +160,7 @@ index 4461a489227e..fea615b44abe 100644 if (actual_mime_type) *actual_mime_type = mime_types[i]; diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h -index 6c39259a2c67..b3d18b1135d3 100644 +index 79ac3b705511..71d73d3da158 100644 --- content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h @@ -54,6 +54,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { @@ -226,10 +224,10 @@ index 632ae86c6fd6..55b749ec1242 100644 const std::vector& all_plugins); diff --git content/common/frame_messages.h content/common/frame_messages.h -index 06c8e08ba8d5..1e349e3c06b6 100644 +index 4370f99c9a51..8dc0736e2b59 100644 --- content/common/frame_messages.h +++ content/common/frame_messages.h -@@ -1060,9 +1060,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, +@@ -826,9 +826,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, // type. If there is no matching plugin, |found| is false. // |actual_mime_type| is the actual mime type supported by the // found plugin. @@ -242,10 +240,10 @@ index 06c8e08ba8d5..1e349e3c06b6 100644 std::string /* mime_type */, bool /* found */, diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h -index b70473936db0..0cb62733520b 100644 +index 51f31b2c7e43..85faf2c0486b 100644 --- content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h -@@ -24,6 +24,7 @@ +@@ -26,6 +26,7 @@ #include "content/common/content_export.h" #include "content/public/browser/certificate_request_result_type.h" #include "content/public/browser/generated_code_cache_settings.h" @@ -253,7 +251,7 @@ index b70473936db0..0cb62733520b 100644 #include "content/public/common/page_visibility_state.h" #include "content/public/common/previews_state.h" #include "content/public/common/window_container_type.mojom-forward.h" -@@ -1611,6 +1612,14 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1626,6 +1627,14 @@ class CONTENT_EXPORT ContentBrowserClient { const base::Optional& initiating_origin, mojo::PendingRemote* out_factory); @@ -268,7 +266,7 @@ index b70473936db0..0cb62733520b 100644 // Creates an OverlayWindow to be used for Picture-in-Picture. This window // will house the content shown when in Picture-in-Picture mode. This will // return a new OverlayWindow. -@@ -1674,6 +1683,10 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1689,6 +1698,10 @@ class CONTENT_EXPORT ContentBrowserClient { // Used as part of the user agent string. virtual std::string GetProduct(); @@ -304,7 +302,7 @@ index 98c59005599e..69752184745d 100644 WebPluginInfo* plugin) = 0; diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h -index 6002ce70bb17..4198134b1b73 100644 +index 87df60c52d1e..c3841a7845dd 100644 --- content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h @@ -80,6 +80,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -317,7 +315,7 @@ index 6002ce70bb17..4198134b1b73 100644 // Notifies that a new RenderFrame has been created. virtual void RenderFrameCreated(RenderFrame* render_frame) {} -@@ -328,6 +331,10 @@ class CONTENT_EXPORT ContentRendererClient { +@@ -321,6 +324,10 @@ class CONTENT_EXPORT ContentRendererClient { // This method may invalidate the frame. virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} @@ -329,10 +327,10 @@ index 6002ce70bb17..4198134b1b73 100644 // started. virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc -index 32a6927eaa93..540a6cbf450b 100644 +index 00bbbdc9b82d..a3c923fcc442 100644 --- content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc -@@ -3892,7 +3892,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( +@@ -3796,7 +3796,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( std::string mime_type; bool found = false; Send(new FrameHostMsg_GetPluginInfo( @@ -343,10 +341,10 @@ index 32a6927eaa93..540a6cbf450b 100644 if (!found) return nullptr; diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc -index 078c895fe5cd..f763acde4d66 100644 +index ae1a77a219f1..f91dd6477bf3 100644 --- content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc -@@ -624,6 +624,8 @@ void RenderThreadImpl::Init() { +@@ -620,6 +620,8 @@ void RenderThreadImpl::Init() { GetContentClient()->renderer()->CreateURLLoaderThrottleProvider( URLLoaderThrottleProviderType::kFrame); @@ -356,10 +354,10 @@ index 078c895fe5cd..f763acde4d66 100644 &RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this))); diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc -index 17e84479f922..6bf6c2ab93ac 100644 +index 58c1b0e78a66..e8efa7277f33 100644 --- content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc -@@ -918,6 +918,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() { +@@ -914,6 +914,15 @@ RendererBlinkPlatformImpl::GetGpuFactories() { //------------------------------------------------------------------------------ @@ -376,7 +374,7 @@ index 17e84479f922..6bf6c2ab93ac 100644 if (!code_cache_host_) { code_cache_host_ = mojo::SharedRemote( diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h -index edbf232175e4..27e4c87dd4c1 100644 +index 096cd162c7d5..c409b6eb08ca 100644 --- content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h @@ -197,6 +197,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { diff --git a/patch/patches/content_app_shutdown_2798.patch b/patch/patches/content_app_shutdown_2798.patch index 29744e288..9934541e6 100644 --- a/patch/patches/content_app_shutdown_2798.patch +++ b/patch/patches/content_app_shutdown_2798.patch @@ -1,5 +1,5 @@ diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc -index 8b3b16ff94f6..96e5ead655e5 100644 +index 3b37ef6a284e..466c0331311e 100644 --- content/app/content_main_runner_impl.cc +++ content/app/content_main_runner_impl.cc @@ -43,6 +43,7 @@ @@ -10,7 +10,7 @@ index 8b3b16ff94f6..96e5ead655e5 100644 #include "base/trace_event/trace_event.h" #include "components/discardable_memory/service/discardable_shared_memory_manager.h" #include "components/download/public/common/download_task_runner.h" -@@ -996,6 +997,11 @@ void ContentMainRunnerImpl::Shutdown() { +@@ -1001,6 +1002,11 @@ void ContentMainRunnerImpl::Shutdown() { is_shutdown_ = true; } @@ -23,10 +23,10 @@ index 8b3b16ff94f6..96e5ead655e5 100644 ContentMainRunner* ContentMainRunner::Create() { return ContentMainRunnerImpl::Create(); diff --git content/app/content_main_runner_impl.h content/app/content_main_runner_impl.h -index 9575db7e2311..6b449160565d 100644 +index 72098b4d06f8..2c2091576aa8 100644 --- content/app/content_main_runner_impl.h +++ content/app/content_main_runner_impl.h -@@ -51,6 +51,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { +@@ -50,6 +50,8 @@ class ContentMainRunnerImpl : public ContentMainRunner { int Run(bool start_service_manager_only) override; void Shutdown() override; diff --git a/patch/patches/content_pepper_flash_1586.patch b/patch/patches/content_pepper_flash_1586.patch index 5d5e29b63..276ab1e47 100644 --- a/patch/patches/content_pepper_flash_1586.patch +++ b/patch/patches/content_pepper_flash_1586.patch @@ -1,5 +1,5 @@ diff --git content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc -index 6c40589cc989..a34b0eb0eb15 100644 +index fe3311bc5e54..e4b5385ff3bf 100644 --- content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc +++ content/browser/renderer_host/pepper/pepper_flash_file_message_filter.cc @@ -55,7 +55,7 @@ PepperFlashFileMessageFilter::PepperFlashFileMessageFilter( diff --git a/patch/patches/crashpad_1995.patch b/patch/patches/crashpad_1995.patch index cba9d6881..dfa565d4b 100644 --- a/patch/patches/crashpad_1995.patch +++ b/patch/patches/crashpad_1995.patch @@ -1,5 +1,5 @@ diff --git chrome/chrome_elf/BUILD.gn chrome/chrome_elf/BUILD.gn -index 99ef45605fb5..2e16fc44a242 100644 +index abd8ceba1896..f92981183aad 100644 --- chrome/chrome_elf/BUILD.gn +++ chrome/chrome_elf/BUILD.gn @@ -7,6 +7,7 @@ @@ -10,7 +10,7 @@ index 99ef45605fb5..2e16fc44a242 100644 import("//chrome/process_version_rc_template.gni") import("//testing/test.gni") -@@ -110,9 +111,6 @@ source_set("constants") { +@@ -104,9 +105,6 @@ source_set("constants") { static_library("crash") { sources = [ @@ -20,7 +20,7 @@ index 99ef45605fb5..2e16fc44a242 100644 "crash/crash_helper.cc", "crash/crash_helper.h", ] -@@ -120,6 +118,7 @@ static_library("crash") { +@@ -114,6 +112,7 @@ static_library("crash") { ":hook_util", "//base", # This needs to go. DEP of app, crash_keys, client. "//base:base_static", # pe_image @@ -28,7 +28,7 @@ index 99ef45605fb5..2e16fc44a242 100644 "//chrome/install_static:install_static_util", "//components/crash/content/app", "//components/crash/core/common", # crash_keys -@@ -127,6 +126,17 @@ static_library("crash") { +@@ -121,6 +120,17 @@ static_library("crash") { "//content/public/common:result_codes", "//third_party/crashpad/crashpad/client", # DumpWithoutCrash ] @@ -47,7 +47,7 @@ index 99ef45605fb5..2e16fc44a242 100644 source_set("dll_hash") { diff --git chrome/chrome_elf/crash/crash_helper.cc chrome/chrome_elf/crash/crash_helper.cc -index 381322aca895..a5622ddfe66d 100644 +index a02aa37c566a..0d0581132bdd 100644 --- chrome/chrome_elf/crash/crash_helper.cc +++ chrome/chrome_elf/crash/crash_helper.cc @@ -11,12 +11,17 @@ @@ -68,7 +68,7 @@ index 381322aca895..a5622ddfe66d 100644 namespace { // Crash handling from elf is only enabled for the chrome.exe process. -@@ -74,7 +79,11 @@ bool InitializeCrashReporting() { +@@ -77,7 +82,11 @@ bool InitializeCrashReporting() { g_crash_reports = new std::vector; g_set_unhandled_exception_filter = new elf_hook::IATHook(); @@ -514,7 +514,7 @@ index c2de9fe867c5..29cda67a1f72 100644 handler_path, database_path, metrics_path, url, GetProcessSimpleAnnotations(), arguments, true, false); diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc -index d13ae5cf7e40..f87f84d3121c 100644 +index 4e6d3052b315..f8c4dfb37e5d 100644 --- components/crash/content/app/crashpad_win.cc +++ components/crash/content/app/crashpad_win.cc @@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations( @@ -548,9 +548,9 @@ index d13ae5cf7e40..f87f84d3121c 100644 const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL"; +#endif std::unique_ptr env(base::Environment::Create()); - if (initial_client) { - CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); -@@ -86,13 +88,13 @@ base::FilePath PlatformCrashpadInitialization( + + CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); +@@ -87,13 +89,13 @@ base::FilePath PlatformCrashpadInitialization( #if BUILDFLAG(GOOGLE_CHROME_BRANDING) std::string url = "https://clients2.google.com/cr/report"; @@ -567,8 +567,8 @@ index d13ae5cf7e40..f87f84d3121c 100644 base::FilePath exe_file(exe_path); if (exe_file.empty()) { -@@ -110,13 +112,14 @@ base::FilePath PlatformCrashpadInitialization( - crashpad::TriState::kEnabled, kIndirectMemoryLimit); +@@ -104,13 +106,14 @@ base::FilePath PlatformCrashpadInitialization( + exe_file = base::FilePath(exe_file_path); } - // If the handler is embedded in the binary (e.g. chrome, setup), we @@ -587,7 +587,7 @@ index d13ae5cf7e40..f87f84d3121c 100644 if (!user_data_dir.empty()) { start_arguments.push_back(std::string("--user-data-dir=") + user_data_dir); -@@ -127,9 +130,12 @@ base::FilePath PlatformCrashpadInitialization( +@@ -121,9 +124,12 @@ base::FilePath PlatformCrashpadInitialization( start_arguments.push_back("/prefetch:7"); } else { base::FilePath exe_dir = exe_file.DirName(); diff --git a/patch/patches/crashpad_tp_1995.patch b/patch/patches/crashpad_tp_1995.patch index a11d73806..fbac98718 100644 --- a/patch/patches/crashpad_tp_1995.patch +++ b/patch/patches/crashpad_tp_1995.patch @@ -146,7 +146,7 @@ index a2b0c74636f4..01370fdc20d9 100644 struct Data; diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn -index 550f686a4562..b6cc04846d42 100644 +index b06f68af3baa..42b47ab40109 100644 --- third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn @@ -12,6 +12,7 @@ @@ -248,7 +248,7 @@ index 2ec1147d2620..8ff9a72e0bd7 100644 //! \brief Calls ProcessPendingReports() in response to ReportPending() having //! been called on any thread, as well as periodically on a timer. diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc -index 7d9701c0bf08..767a3c23fb4f 100644 +index 1cf655aec466..50ff7ed6fdbf 100644 --- third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc @@ -36,8 +36,10 @@ @@ -273,7 +273,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644 namespace crashpad { namespace { -@@ -200,6 +206,9 @@ struct Options { +@@ -204,6 +210,9 @@ struct Options { bool periodic_tasks; bool rate_limit; bool upload_gzip; @@ -281,9 +281,9 @@ index 7d9701c0bf08..767a3c23fb4f 100644 + int max_database_size; + int max_database_age; #if defined(OS_CHROMEOS) - bool use_cros_crash_reporter; + bool use_cros_crash_reporter = false; base::FilePath minidump_dir_for_tests; -@@ -558,6 +567,9 @@ int HandlerMain(int argc, +@@ -563,6 +572,9 @@ int HandlerMain(int argc, kOptionTraceParentWithException, #endif kOptionURL, @@ -293,7 +293,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644 #if defined(OS_CHROMEOS) kOptionUseCrosCrashReporter, kOptionMinidumpDirForTests, -@@ -639,6 +651,9 @@ int HandlerMain(int argc, +@@ -649,6 +661,9 @@ int HandlerMain(int argc, #endif // OS_CHROMEOS {"help", no_argument, nullptr, kOptionHelp}, {"version", no_argument, nullptr, kOptionVersion}, @@ -303,7 +303,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644 {nullptr, 0, nullptr, 0}, }; -@@ -778,6 +793,27 @@ int HandlerMain(int argc, +@@ -788,6 +803,27 @@ int HandlerMain(int argc, options.url = optarg; break; } @@ -331,7 +331,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644 #if defined(OS_CHROMEOS) case kOptionUseCrosCrashReporter: { options.use_cros_crash_reporter = true; -@@ -909,8 +945,14 @@ int HandlerMain(int argc, +@@ -923,8 +959,14 @@ int HandlerMain(int argc, upload_thread_options.upload_gzip = options.upload_gzip; upload_thread_options.watch_pending_reports = options.periodic_tasks; @@ -346,7 +346,7 @@ index 7d9701c0bf08..767a3c23fb4f 100644 upload_thread.Get()->Start(); } -@@ -966,7 +1008,8 @@ int HandlerMain(int argc, +@@ -984,7 +1026,8 @@ int HandlerMain(int argc, ScopedStoppable prune_thread; if (options.periodic_tasks) { prune_thread.Reset(new PruneCrashReportThread( diff --git a/patch/patches/extensions_1947.patch b/patch/patches/extensions_1947.patch index a8bae1dc2..9bed2045c 100644 --- a/patch/patches/extensions_1947.patch +++ b/patch/patches/extensions_1947.patch @@ -27,7 +27,7 @@ index 3841b7adf65d..41ca32ea5e2f 100644 auto* browser_context = web_contents->GetBrowserContext(); diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc -index 55284840012b..c24e5ee96ae0 100644 +index 524c0603c138..f10ecd683aae 100644 --- extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc @@ -66,11 +66,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -97,7 +97,7 @@ index 55284840012b..c24e5ee96ae0 100644 ExtensionRegistry::Get(browser_context_)->RemoveObserver(this); diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h -index a2914294a795..5140f9f5b165 100644 +index 093fb25589a9..3e6247802c52 100644 --- extensions/browser/extension_host.h +++ extensions/browser/extension_host.h @@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost, @@ -132,10 +132,10 @@ index a2914294a795..5140f9f5b165 100644 // A weak pointer to the current or pending RenderViewHost. We don't access // this through the host_contents because we want to deal with the pending diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h -index 72defe9fa9de..31041cd2a459 100644 +index e697984786c5..dc84cfd92669 100644 --- extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h -@@ -57,6 +57,7 @@ class ComponentExtensionResourceManager; +@@ -56,6 +56,7 @@ class ComponentExtensionResourceManager; class Extension; class ExtensionCache; class ExtensionError; @@ -143,7 +143,7 @@ index 72defe9fa9de..31041cd2a459 100644 class ExtensionHostDelegate; class ExtensionSet; class ExtensionSystem; -@@ -196,6 +197,14 @@ class ExtensionsBrowserClient { +@@ -195,6 +196,14 @@ class ExtensionsBrowserClient { virtual std::unique_ptr CreateExtensionHostDelegate() = 0; @@ -159,10 +159,10 @@ index 72defe9fa9de..31041cd2a459 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 6c235f6a15b3..b0b907b63d32 100644 +index 3c02c62162f1..13c355db03e0 100644 --- extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc -@@ -385,9 +385,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, +@@ -386,9 +386,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, return true; // TODO(kalman): return false here? It might break things... DVLOG(1) << "CreateBackgroundHost " << extension->id(); diff --git a/patch/patches/gn_config.patch b/patch/patches/gn_config.patch index 8cfd6a193..214ec3196 100644 --- a/patch/patches/gn_config.patch +++ b/patch/patches/gn_config.patch @@ -1,8 +1,8 @@ diff --git .gn .gn -index 62f3a6199ac3..fb0eb9b4b6ca 100644 +index 1bd5722a6ca5..c8919a7b4ab2 100644 --- .gn +++ .gn -@@ -649,6 +649,8 @@ exec_script_whitelist = +@@ -647,6 +647,8 @@ exec_script_whitelist = "//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn", @@ -12,10 +12,10 @@ index 62f3a6199ac3..fb0eb9b4b6ca 100644 # https://crbug.com/474506. "//clank/java/BUILD.gn", diff --git BUILD.gn BUILD.gn -index efaf5b31ee37..2d9abf7a5e96 100644 +index d4c2158d938c..b58ce91305fe 100644 --- BUILD.gn +++ BUILD.gn -@@ -213,6 +213,7 @@ group("gn_all") { +@@ -219,6 +219,7 @@ group("gn_all") { if (!is_ios && !is_fuchsia) { deps += [ @@ -56,7 +56,7 @@ index 982fbe8d3f0d..e757be4688f1 100644 + "studio path") } diff --git build/toolchain/win/setup_toolchain.py build/toolchain/win/setup_toolchain.py -index 53fac69229a2..4eacf06265d1 100644 +index fa31688f36a2..69d74aa31c47 100644 --- build/toolchain/win/setup_toolchain.py +++ build/toolchain/win/setup_toolchain.py @@ -142,22 +142,25 @@ def _LoadToolchainEnv(cpu, sdk_dir, target_store): @@ -100,10 +100,10 @@ index 53fac69229a2..4eacf06265d1 100644 diff --git build/vs_toolchain.py build/vs_toolchain.py -index 2101755c6694..4410ece82aa2 100755 +index 97600e73ba10..36773b159453 100755 --- build/vs_toolchain.py +++ build/vs_toolchain.py -@@ -90,11 +90,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): +@@ -89,9 +89,16 @@ def SetEnvironmentAndGetRuntimeDllDirs(): runtime_path = os.path.pathsep.join(vs_runtime_dll_dirs) os.environ['PATH'] = runtime_path + os.path.pathsep + os.environ['PATH'] elif sys.platform == 'win32' and not depot_tools_win_toolchain: @@ -111,8 +111,6 @@ index 2101755c6694..4410ece82aa2 100755 if not 'GYP_MSVS_OVERRIDE_PATH' in os.environ: + has_override_path = False os.environ['GYP_MSVS_OVERRIDE_PATH'] = DetectVisualStudioPath() - if not 'GYP_MSVS_VERSION' in os.environ: - os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion() + if has_override_path: + # Don't attempt to copy DLLs when using a custom toolchain. @@ -122,11 +120,22 @@ index 2101755c6694..4410ece82aa2 100755 # When using an installed toolchain these files aren't needed in the output # directory in order to run binaries locally, but they are needed in order # to create isolates or the mini_installer. Copying them to the output +@@ -140,6 +147,10 @@ def _RegistryGetValue(key, value): + def GetVisualStudioVersion(): + """Return best available version of Visual Studio. + """ ++ # Return the explicitly requested version, if any. ++ if 'GYP_MSVS_VERSION' in os.environ: ++ return os.environ['GYP_MSVS_VERSION'] ++ + supported_versions = list(MSVS_VERSIONS.keys()) + + # VS installed in depot_tools for Googlers diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni -index 6469473e6a79..f9f630bfe0df 100644 +index 5121fa721a06..b5ab128722f0 100644 --- chrome/chrome_paks.gni +++ chrome/chrome_paks.gni -@@ -284,7 +284,7 @@ template("chrome_paks") { +@@ -291,7 +291,7 @@ template("chrome_paks") { } input_locales = locales @@ -136,10 +145,10 @@ index 6469473e6a79..f9f630bfe0df 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 bebec015f85d..cf4151a0f23e 100644 +index 7d835183ab85..b8553902c1a9 100644 --- chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn -@@ -140,7 +140,7 @@ template("generate_mini_installer") { +@@ -134,7 +134,7 @@ template("generate_mini_installer") { inputs = [ "$chrome_dll_file", "$root_out_dir/chrome.exe", diff --git a/patch/patches/gritsettings.patch b/patch/patches/gritsettings.patch index 877796a07..beb4cf73d 100644 --- a/patch/patches/gritsettings.patch +++ b/patch/patches/gritsettings.patch @@ -1,16 +1,18 @@ -diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids -index 12bbb5759e64..ededefbf6814 100644 ---- tools/gritsettings/resource_ids -+++ tools/gritsettings/resource_ids -@@ -577,4 +577,11 @@ +diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec +index cd531c9abd2d..b6eb6ed923a7 100644 +--- tools/gritsettings/resource_ids.spec ++++ tools/gritsettings/resource_ids.spec +@@ -586,4 +586,13 @@ # Please read the header and find the right section above instead. # Resource ids starting at 31000 are reserved for projects built on Chromium. + + "cef/libcef/resources/cef_resources.grd": { ++ "META": {"align": 31500}, + "includes": [31500], + }, + "cef/libcef/resources/cef_strings.grd": { ++ "META": {"align": 32000}, + "messages": [32000], + }, } diff --git a/patch/patches/libxml_visibility.patch b/patch/patches/libxml_visibility.patch index 001a3ee22..dad5e021f 100644 --- a/patch/patches/libxml_visibility.patch +++ b/patch/patches/libxml_visibility.patch @@ -1,8 +1,8 @@ diff --git third_party/libxml/BUILD.gn third_party/libxml/BUILD.gn -index 28b7c9d20c05..5b5d865b6ea8 100644 +index 3fe4dfd2990b..64848dfd33d7 100644 --- third_party/libxml/BUILD.gn +++ third_party/libxml/BUILD.gn -@@ -145,6 +145,7 @@ static_library("libxml") { +@@ -141,6 +141,7 @@ static_library("libxml") { "//third_party/blink/renderer/*", "//third_party/fontconfig", "//third_party/libxslt", diff --git a/patch/patches/linux_assets_path_1936.patch b/patch/patches/linux_assets_path_1936.patch index ec1ef5327..3c5634117 100644 --- a/patch/patches/linux_assets_path_1936.patch +++ b/patch/patches/linux_assets_path_1936.patch @@ -12,7 +12,7 @@ index ea5258a03f83..843f28411eea 100644 base::File file(exe_dir.Append(path), base::File::FLAG_OPEN | base::File::FLAG_READ); diff --git sandbox/linux/suid/client/setuid_sandbox_host.cc sandbox/linux/suid/client/setuid_sandbox_host.cc -index a277ffa5eb59..3935b9f8c17c 100644 +index 0aaed76c1dda..517c3d8b5772 100644 --- sandbox/linux/suid/client/setuid_sandbox_host.cc +++ sandbox/linux/suid/client/setuid_sandbox_host.cc @@ -120,7 +120,7 @@ bool SetuidSandboxHost::IsDisabledViaEnvironment() { @@ -25,7 +25,7 @@ index a277ffa5eb59..3935b9f8c17c 100644 if (base::PathExists(sandbox_candidate)) sandbox_binary = sandbox_candidate; diff --git ui/gl/init/gl_initializer_x11.cc ui/gl/init/gl_initializer_x11.cc -index 60f73ddc504e..3d19011257aa 100644 +index 995d4399165e..b0381d77a507 100644 --- ui/gl/init/gl_initializer_x11.cc +++ ui/gl/init/gl_initializer_x11.cc @@ -86,7 +86,7 @@ bool InitializeStaticEGLInternal(GLImplementation implementation) { diff --git a/patch/patches/linux_gtk_2014.patch b/patch/patches/linux_gtk_2014.patch index 3949a66c1..98593e0c9 100644 --- a/patch/patches/linux_gtk_2014.patch +++ b/patch/patches/linux_gtk_2014.patch @@ -1,22 +1,22 @@ diff --git chrome/test/BUILD.gn chrome/test/BUILD.gn -index 5c45bc5e6b75..97282b45f57e 100644 +index 7d23fc08f7ea..24a41cf936da 100644 --- chrome/test/BUILD.gn +++ chrome/test/BUILD.gn -@@ -4720,7 +4720,7 @@ test("unit_tests") { +@@ -4852,7 +4852,7 @@ test("unit_tests") { if (use_gio) { configs += [ "//build/linux:gio_config" ] } - if (!is_chromeos && !use_ozone && is_linux) { + if (!is_chromeos && !use_ozone && is_linux && use_gtk) { - deps += [ "//chrome/browser/ui/libgtkui" ] + deps += [ "//chrome/browser/ui/gtk" ] } -@@ -5708,7 +5708,7 @@ if (!is_android) { +@@ -5833,7 +5833,7 @@ if (!is_android) { # suites, it seems like one or another starts timing out too. "../browser/ui/views/keyboard_access_browsertest.cc", ] - if (!use_ozone) { + if (!use_ozone && use_gtk) { - sources += [ - "../browser/ui/libgtkui/select_file_dialog_interactive_uitest.cc", - ] + sources += + [ "../browser/ui/gtk/select_file_dialog_interactive_uitest.cc" ] + deps += [ "//build/config/linux/gtk" ] diff --git a/patch/patches/mac_gpu.patch b/patch/patches/mac_gpu.patch index 7203d3c03..2bf44f815 100644 --- a/patch/patches/mac_gpu.patch +++ b/patch/patches/mac_gpu.patch @@ -1,5 +1,5 @@ diff --git ui/gl/init/gl_initializer_mac.cc ui/gl/init/gl_initializer_mac.cc -index c2725a66342d..5dfad8be2f8d 100644 +index e486fb0d16e3..312ff3d3703c 100644 --- ui/gl/init/gl_initializer_mac.cc +++ ui/gl/init/gl_initializer_mac.cc @@ -46,11 +46,8 @@ bool InitializeOneOffForSandbox() { diff --git a/patch/patches/message_loop.patch b/patch/patches/message_loop.patch index a7289b952..11099f308 100644 --- a/patch/patches/message_loop.patch +++ b/patch/patches/message_loop.patch @@ -12,10 +12,10 @@ index 7688ba3d7b0d..9acaaa0d5c7f 100644 current_->RemoveDestructionObserver(destruction_observer); } diff --git base/message_loop/message_loop_current.h base/message_loop/message_loop_current.h -index a3b48b58d367..57f8dc7fe2fa 100644 +index 61b8c6fcc42d..d439b00a87bb 100644 --- base/message_loop/message_loop_current.h +++ base/message_loop/message_loop_current.h -@@ -120,6 +120,12 @@ class BASE_EXPORT MessageLoopCurrent { +@@ -117,6 +117,12 @@ class BASE_EXPORT MessageLoopCurrent { // posted tasks. void SetAddQueueTimeToTasks(bool enable); @@ -28,7 +28,7 @@ index a3b48b58d367..57f8dc7fe2fa 100644 // Enables or disables the recursive task processing. This happens in the case // of recursive message loops. Some unwanted message loops may occur when // using common controls or printer functions. By default, recursive task -@@ -190,6 +196,13 @@ class BASE_EXPORT MessageLoopCurrent { +@@ -186,6 +192,13 @@ class BASE_EXPORT MessageLoopCurrent { friend class web::WebTaskEnvironment; sequence_manager::internal::SequenceManagerImpl* current_; diff --git a/patch/patches/mime_handler_view_guest_1565_2727.patch b/patch/patches/mime_handler_view_guest_1565_2727.patch index 8d8879d5a..aeaee7599 100644 --- a/patch/patches/mime_handler_view_guest_1565_2727.patch +++ b/patch/patches/mime_handler_view_guest_1565_2727.patch @@ -12,7 +12,7 @@ index 4c5fb180bf82..f97991e11694 100644 virtual ~WebContentsView() {} diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc -index 487f031c08c7..172884179b16 100644 +index 068b22336fac..a970f5be0428 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -207,6 +207,8 @@ void MimeHandlerViewGuest::CreateWebContents( diff --git a/patch/patches/osr_fling_2745.patch b/patch/patches/osr_fling_2745.patch index 7800a6006..b0a35b0eb 100644 --- a/patch/patches/osr_fling_2745.patch +++ b/patch/patches/osr_fling_2745.patch @@ -1,8 +1,8 @@ diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc -index cf220cb41b00..5ebff06e6031 100644 +index c7a4f1f0c3d0..7e6e3b4e56d4 100644 --- content/browser/renderer_host/input/fling_scheduler.cc +++ content/browser/renderer_host/input/fling_scheduler.cc -@@ -71,6 +71,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded( +@@ -68,6 +68,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded( } ui::Compositor* FlingScheduler::GetCompositor() { @@ -41,11 +41,11 @@ index cc4b13a7b9c6..84f3b9ed7cf4 100644 } // namespace content diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc -index a91a66bca29d..bff1662c7323 100644 +index 954011b5d562..da67cd106cec 100644 --- content/browser/renderer_host/render_widget_host_impl.cc +++ content/browser/renderer_host/render_widget_host_impl.cc -@@ -2692,6 +2692,11 @@ void RenderWidgetHostImpl::SetNeedsBeginFrameForFlingProgress() { - SetNeedsBeginFrame(true); +@@ -2606,6 +2606,11 @@ void RenderWidgetHostImpl::DidStartScrollingViewport() { + view_->set_is_currently_scrolling_viewport(true); } +void RenderWidgetHostImpl::SetCompositorForFlingScheduler(ui::Compositor* compositor) @@ -55,15 +55,15 @@ index a91a66bca29d..bff1662c7323 100644 + void RenderWidgetHostImpl::AddPendingUserActivation( const WebInputEvent& event) { - if (base::FeatureList::IsEnabled(features::kBrowserVerifiedUserActivation) && + if ((base::FeatureList::IsEnabled( diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h -index 15a23f954089..87715137b8b4 100644 +index 9faf49a3fd83..26c6845c53c3 100644 --- content/browser/renderer_host/render_widget_host_impl.h +++ content/browser/renderer_host/render_widget_host_impl.h -@@ -736,6 +736,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -701,6 +701,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl + void ProgressFlingIfNeeded(base::TimeTicks current_time); void StopFling(); - void SetNeedsBeginFrameForFlingProgress(); + void SetCompositorForFlingScheduler(ui::Compositor* compositor); // The RenderWidgetHostImpl will keep showing the old page (for a while) after diff --git a/patch/patches/prefs_content_1161.patch b/patch/patches/prefs_content_1161.patch index f305d139f..b383a808b 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 fcbfa6b8a81e..9bf5ad6a581b 100644 +index fe4ca0fafd45..025424a1654c 100644 --- content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h -@@ -184,6 +184,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) +@@ -178,6 +178,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) @@ -35,10 +35,10 @@ index 04c03cfcb774..4f5488ef1699 100644 bool record_whole_document; diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc -index 556a107ed038..2dbf8cc69c7e 100644 +index bd44565e78aa..dcb7bbd6d875 100644 --- content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc -@@ -1015,6 +1015,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, +@@ -968,6 +968,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs, #endif WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available); diff --git a/patch/patches/print_preview_123.patch b/patch/patches/print_preview_123.patch index 338f9d855..3ec9d0138 100644 --- a/patch/patches/print_preview_123.patch +++ b/patch/patches/print_preview_123.patch @@ -34,7 +34,7 @@ index c880e6ba1766..d168a5fb44bb 100644 bool DownloadPrefs::IsFromTrustedSource(const download::DownloadItem& item) { diff --git chrome/browser/printing/print_preview_dialog_controller.cc chrome/browser/printing/print_preview_dialog_controller.cc -index ba6cbab2e2e0..ce4c9953abfb 100644 +index 8c2609b8447c..f113149a30e8 100644 --- chrome/browser/printing/print_preview_dialog_controller.cc +++ chrome/browser/printing/print_preview_dialog_controller.cc @@ -16,6 +16,7 @@ @@ -45,7 +45,7 @@ index ba6cbab2e2e0..ce4c9953abfb 100644 #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" #include "chrome/browser/printing/print_view_manager.h" -@@ -446,8 +447,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( +@@ -450,8 +451,11 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( content::HostZoomMap::Get(preview_dialog->GetSiteInstance()) ->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0); PrintViewManager::CreateForWebContents(preview_dialog); @@ -58,10 +58,10 @@ index ba6cbab2e2e0..ce4c9953abfb 100644 // Add an entry to the map. preview_dialog_map_[preview_dialog] = initiator; diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html -index a9873cd3c0eb..127b8cba461e 100644 +index 56a6a8d8ee67..5fecf7ad1780 100644 --- chrome/browser/resources/print_preview/ui/destination_dialog.html +++ chrome/browser/resources/print_preview/ui/destination_dialog.html -@@ -147,9 +147,7 @@ +@@ -141,9 +141,7 @@
@@ -73,7 +73,7 @@ index a9873cd3c0eb..127b8cba461e 100644 $i18n{cancel} diff --git chrome/browser/resources/print_preview/ui/destination_select.html chrome/browser/resources/print_preview/ui/destination_select.html -index 92127e580c67..df902f18f46d 100644 +index c93947a7634c..c60cada63ef8 100644 --- chrome/browser/resources/print_preview/ui/destination_select.html +++ chrome/browser/resources/print_preview/ui/destination_select.html @@ -31,10 +31,6 @@ @@ -81,7 +81,7 @@ index 92127e580c67..df902f18f46d 100644 $i18n{printToPDF} -