Update to Chromium version 74.0.3729.0 (#638880)

- Windows: 10.0.17763.0 SDK is now required.
- Mac: 10.13 SDK is now required.
- Removed CefRequestContext::ResolveHostCached which is no longer supported by Chromium.
This commit is contained in:
Alexander Guettler 2019-03-13 21:27:37 +00:00 committed by Marshall Greenblatt
parent 58e1149c71
commit 725ed88529
133 changed files with 1733 additions and 1368 deletions

1
.gitignore vendored
View File

@ -47,3 +47,4 @@ Thumbs.db
/docs
# CEF generated files
/include/cef_version.h
.ccls-cache/

View File

@ -457,6 +457,8 @@ static_library("libcef_static") {
"libcef/browser/osr/render_widget_host_view_osr.h",
"libcef/browser/osr/software_output_device_osr.cc",
"libcef/browser/osr/software_output_device_osr.h",
"libcef/browser/osr/synthetic_gesture_target_osr.cc",
"libcef/browser/osr/synthetic_gesture_target_osr.h",
"libcef/browser/osr/web_contents_view_osr.cc",
"libcef/browser/osr/web_contents_view_osr.h",
"libcef/browser/path_util_impl.cc",

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/74.0.3706.0'
'chromium_checkout': 'refs/tags/74.0.3729.0'
}

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=cd2b70b906b9f07923d69d9ec0b32488125b0af3$
// $hash=f7f1ec971c726a6a74bcc7f5cee7a8eb1911078d$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@ -259,17 +259,6 @@ typedef struct _cef_request_context_t {
const cef_string_t* origin,
struct _cef_resolve_callback_t* callback);
///
// Attempts to resolve |origin| to a list of associated IP addresses using
// cached data. |resolved_ips| will be populated with the list of resolved IP
// addresses or NULL if no cached data is available. Returns ERR_NONE on
// success. This function must be called on the browser process IO thread.
///
cef_errorcode_t(CEF_CALLBACK* resolve_host_cached)(
struct _cef_request_context_t* self,
const cef_string_t* origin,
cef_string_list_t resolved_ips);
///
// Load an extension.
//

View File

@ -139,7 +139,7 @@ class CefRefCount {
} \
\
private: \
CefRefCount ref_count_;
CefRefCount ref_count_
///
// Macro that provides a locking implementation. Use the Lock() and Unlock()

View File

@ -270,17 +270,6 @@ class CefRequestContext : public virtual CefBaseRefCounted {
virtual void ResolveHost(const CefString& origin,
CefRefPtr<CefResolveCallback> callback) = 0;
///
// Attempts to resolve |origin| to a list of associated IP addresses using
// cached data. |resolved_ips| will be populated with the list of resolved IP
// addresses or empty if no cached data is available. Returns ERR_NONE on
// success. This method must be called on the browser process IO thread.
///
/*--cef(default_retval=ERR_FAILED)--*/
virtual cef_errorcode_t ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) = 0;
///
// Load an extension.
//

View File

@ -59,7 +59,7 @@ class CefButtonDelegate : public CefViewDelegate {
// Called when the state of |button| changes.
///
/*--cef()--*/
virtual void OnButtonStateChanged(CefRefPtr<CefButton> button){};
virtual void OnButtonStateChanged(CefRefPtr<CefButton> button) {}
};
#endif // CEF_INCLUDE_VIEWS_CEF_BUTTON_DELEGATE_H_

View File

@ -500,6 +500,10 @@ const PrefService* CefBrowserContextImpl::GetPrefs() const {
return pref_service_.get();
}
SimpleFactoryKey* CefBrowserContextImpl::GetSimpleFactoryKey() const {
return nullptr;
}
CefRequestContextImpl* CefBrowserContextImpl::GetCefRequestContext() const {
return GetCefRequestContext(false);
}

View File

@ -87,7 +87,9 @@ class CefBrowserContextImpl : public CefBrowserContext,
// Profile methods.
PrefService* GetPrefs() override;
bool AllowsBrowserWindows() const override { return false; }
const PrefService* GetPrefs() const override;
SimpleFactoryKey* GetSimpleFactoryKey() const override;
// CefBrowserContext methods.
CefRequestContextImpl* GetCefRequestContext() const override;

View File

@ -208,10 +208,18 @@ PrefService* CefBrowserContextProxy::GetPrefs() {
return parent_->GetPrefs();
}
bool CefBrowserContextProxy::AllowsBrowserWindows() const {
return parent_->AllowsBrowserWindows();
}
const PrefService* CefBrowserContextProxy::GetPrefs() const {
return parent_->GetPrefs();
}
SimpleFactoryKey* CefBrowserContextProxy::GetSimpleFactoryKey() const {
return parent_->GetSimpleFactoryKey();
}
CefRequestContextImpl* CefBrowserContextProxy::GetCefRequestContext() const {
return request_context_;
}

View File

@ -64,7 +64,9 @@ class CefBrowserContextProxy : public CefBrowserContext {
// Profile methods.
PrefService* GetPrefs() override;
bool AllowsBrowserWindows() const override;
const PrefService* GetPrefs() const override;
SimpleFactoryKey* GetSimpleFactoryKey() const override;
// CefBrowserContext methods.
CefRequestContextImpl* GetCefRequestContext() const override;

View File

@ -512,7 +512,7 @@ CefRefPtr<CefBrowserHostImpl> CefBrowserHostImpl::GetBrowserForRequest(
return GetBrowserForFrame(render_process_id, render_frame_id);
}
const content::ResourceRequestInfo* request_info =
content::ResourceRequestInfo* request_info =
content::ResourceRequestInfo::ForRequest(request);
if (request_info)
return GetBrowserForFrameTreeNode(request_info->GetFrameTreeNodeId());
@ -1644,7 +1644,7 @@ void CefBrowserHostImpl::CancelContextMenu() {
CefRefPtr<CefFrame> CefBrowserHostImpl::GetFrameForRequest(
const net::URLRequest* request) {
CEF_REQUIRE_IOT();
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (!info)
return nullptr;
@ -2435,6 +2435,7 @@ bool CefBrowserHostImpl::TakeFocus(content::WebContents* source, bool reverse) {
}
bool CefBrowserHostImpl::HandleContextMenu(
content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) {
return HandleContextMenu(web_contents(), params);
}

View File

@ -426,7 +426,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
bool proceed,
bool* proceed_to_fire_unload) override;
bool TakeFocus(content::WebContents* source, bool reverse) override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
bool HandleContextMenu(content::RenderFrameHost* render_frame_host,
const content::ContextMenuParams& params) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;

View File

@ -85,7 +85,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
CefBrowserInfo(int browser_id, bool is_popup);
int browser_id() const { return browser_id_; };
int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; }

View File

@ -7,11 +7,16 @@
#include "libcef/common/content_client.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_pump_for_ui.h"
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/message_loop/message_pump_mac.h"
#endif
#include "content/public/browser/browser_thread.h"
namespace {
// MessagePump implementation that delegates to OnScheduleMessagePumpWork() for
@ -82,23 +87,27 @@ CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() {
return nullptr;
}
std::unique_ptr<base::MessagePump> CreatePump() {
const CefSettings& settings = CefContext::Get()->settings();
if (settings.external_message_pump) {
std::unique_ptr<base::MessagePump> MessagePumpFactoryForUI() {
if (!content::BrowserThread::IsThreadInitialized(
content::BrowserThread::UI) ||
content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
CefRefPtr<CefBrowserProcessHandler> handler = GetBrowserProcessHandler();
if (handler)
return base::WrapUnique(new MessagePumpExternal(0.01f, handler));
return std::make_unique<MessagePumpExternal>(0.01f, handler);
}
return base::MessageLoop::CreateMessagePumpForType(
base::MessageLoop::TYPE_UI);
#if defined(OS_MACOSX)
return base::MessagePumpMac::Create();
#else
return std::make_unique<base::MessagePumpForUI>();
#endif
}
} // namespace
CefBrowserMessageLoop::CefBrowserMessageLoop()
: base::MessageLoopForUI(CreatePump()) {
BindToCurrentThread();
void InitMessagePumpFactoryForUI() {
const CefSettings& settings = CefContext::Get()->settings();
if (settings.external_message_pump) {
base::MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactoryForUI);
}
}
CefBrowserMessageLoop::~CefBrowserMessageLoop() {}

View File

@ -4,21 +4,7 @@
#ifndef CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_
#define CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_
#pragma once
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
// Class used to process events on the current message loop.
class CefBrowserMessageLoop : public base::MessageLoopForUI {
typedef base::MessageLoopForUI inherited;
public:
CefBrowserMessageLoop();
~CefBrowserMessageLoop() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefBrowserMessageLoop);
};
void InitMessagePumpFactoryForUI();
#endif // CEF_LIBCEF_BROWSER_BROWSER_MESSAGE_LOOP_H_

View File

@ -75,11 +75,11 @@ void ChromeBrowserProcessStub::Shutdown() {
void ChromeBrowserProcessStub::ResourceDispatcherHostCreated() {
NOTREACHED();
};
}
void ChromeBrowserProcessStub::EndSession() {
NOTREACHED();
};
}
void ChromeBrowserProcessStub::FlushLocalStateAndReply(
base::OnceClosure reply) {

View File

@ -553,6 +553,34 @@ bool CefContentBrowserClient::ShouldUseProcessPerSite(
return true;
}
// Based on
// ChromeContentBrowserClientExtensionsPart::DoesSiteRequireDedicatedProcess.
bool CefContentBrowserClient::DoesSiteRequireDedicatedProcess(
content::BrowserContext* browser_context,
const GURL& effective_site_url) {
if (!extensions::ExtensionsEnabled())
return false;
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(browser_context);
const extensions::Extension* extension =
registry->enabled_extensions().GetExtensionOrAppByURL(effective_site_url);
if (!extension)
return false;
// Always isolate Chrome Web Store.
if (extension->id() == extensions::kWebStoreAppId)
return true;
// Extensions should be isolated, except for hosted apps. Isolating hosted
// apps is a good idea, but ought to be a separate knob.
if (extension->is_hosted_app())
return false;
// Isolate all extensions.
return true;
}
bool CefContentBrowserClient::IsHandledURL(const GURL& url) {
if (!url.is_valid())
return false;
@ -1126,6 +1154,7 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
content::RenderFrameHost* frame,
int render_process_id,
bool is_navigation,
bool is_download,
const url::Origin& request_initiator,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,
@ -1137,8 +1166,8 @@ bool CefContentBrowserClient::WillCreateURLLoaderFactory(
extensions::BrowserContextKeyedAPIFactory<extensions::WebRequestAPI>::Get(
browser_context);
bool use_proxy = web_request_api->MaybeProxyURLLoaderFactory(
browser_context, frame, render_process_id, is_navigation, factory_request,
header_client);
browser_context, frame, render_process_id, is_navigation, is_download,
factory_request, header_client);
if (bypass_redirect_checks)
*bypass_redirect_checks = use_proxy;
return use_proxy;
@ -1191,7 +1220,7 @@ blink::UserAgentMetadata CefContentBrowserClient::GetUserAgentMetadata() const {
blink::UserAgentMetadata metadata;
metadata.brand = version_info::GetProductName();
metadata.version = version_info::GetVersionNumber();
metadata.full_version = version_info::GetVersionNumber();
metadata.platform = version_info::GetOSType();
// TODO(mkwst): Poke at BuildUserAgentFromProduct to split out these pieces.

View File

@ -48,6 +48,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
service_manager::mojom::ServiceRequest* service_request) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
const GURL& effective_site_url) override;
bool IsHandledURL(const GURL& url) override;
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
void SiteInstanceDeleting(content::SiteInstance* site_instance) override;
@ -147,6 +149,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
content::RenderFrameHost* frame,
int render_process_id,
bool is_navigation,
bool is_download,
const url::Origin& request_initiator,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::TrustedURLLoaderHeaderClientPtrInfo* header_client,

View File

@ -420,21 +420,17 @@ bool CefContext::Initialize(const CefMainArgs& args,
// gets called by some call down the line of service_manager::MainRun.
content::SetUpFieldTrialsAndFeatureList();
if (!main_delegate_->CreateUIThread()) {
return false;
}
initialized_ = true;
// Can't use CEF_POST_TASK here yet, because the TaskRunner is not yet set.
main_delegate_->ui_thread()->task_runner()->PostTask(
FROM_HERE,
base::BindOnce(
if (!main_delegate_->CreateUIThread(base::BindOnce(
[](CefContext* context, base::WaitableEvent* event) {
service_manager::MainRun(*context->sm_main_params_);
event->Signal();
},
base::Unretained(this), base::Unretained(&uithread_startup_event)));
base::Unretained(this),
base::Unretained(&uithread_startup_event)))) {
return false;
}
initialized_ = true;
// We need to wait until service_manager::MainRun has finished.
uithread_startup_event.Wait();

View File

@ -107,11 +107,14 @@ void DeleteCookiesCallbackImpl(CefRefPtr<CefDeleteCookiesCallback> callback,
// Always execute the callback asynchronously.
void SetCookieCallbackImpl(CefRefPtr<CefSetCookieCallback> callback,
bool success) {
net::CanonicalCookie::CookieInclusionStatus status) {
if (!callback.get())
return;
CEF_POST_TASK(CEF_IOT, base::Bind(&CefSetCookieCallback::OnComplete,
callback.get(), success));
CEF_POST_TASK(
CEF_IOT,
base::Bind(
&CefSetCookieCallback::OnComplete, callback.get(),
status == net::CanonicalCookie::CookieInclusionStatus::INCLUDE));
}
net::CookieStore* GetExistingCookieStoreHelper(
@ -560,7 +563,7 @@ void CefCookieManagerImpl::SetCookieInternal(
base::Time(), // Last access time.
cookie.secure ? true : false, cookie.httponly ? true : false,
net::CookieSameSite::DEFAULT_MODE, net::COOKIE_PRIORITY_DEFAULT),
cookie.secure ? true : false, cookie.httponly ? true : false,
url.scheme(), cookie.httponly ? true : false,
base::Bind(SetCookieCallbackImpl, callback));
}

View File

@ -249,7 +249,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
std::string method;
base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL;
std::unique_ptr<base::Value> parsed_message = base::JSONReader::Read(message);
base::Optional<base::Value> parsed_message = base::JSONReader::Read(message);
if (!parsed_message || !parsed_message->GetAsDictionary(&dict) ||
!dict->GetString("method", &method)) {
return;

View File

@ -14,7 +14,7 @@
namespace extensions {
class Extension;
};
}
// CefNavigationEntry implementation
class CefExtensionImpl : public CefExtension {

View File

@ -21,8 +21,8 @@
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/common/error_utils.h"
using content::WebContents;
using content::RenderViewHost;
using content::WebContents;
namespace extensions {
@ -92,7 +92,7 @@ class CefGetExtensionLoadFileCallbackImpl
static std::unique_ptr<std::string> LoadFileFromStream(
const std::string& file,
CefRefPtr<CefStreamReader> stream) {
base::AssertBlockingAllowedDeprecated();
CEF_REQUIRE_BLOCKING();
// Move to the end of the stream.
stream->Seek(0, SEEK_END);

View File

@ -19,4 +19,8 @@ void CefPDFWebContentsHelperClient::OnPDFHasUnsupportedFeature(
void CefPDFWebContentsHelperClient::OnSaveURL(content::WebContents* contents) {}
void CefPDFWebContentsHelperClient::SetPluginCanSave(
content::WebContents* contents,
bool can_save) {}
} // namespace extensions

View File

@ -21,6 +21,7 @@ class CefPDFWebContentsHelperClient : public pdf::PDFWebContentsHelperClient {
int content_restrictions) override;
void OnPDFHasUnsupportedFeature(content::WebContents* contents) override;
void OnSaveURL(content::WebContents* contents) override;
void SetPluginCanSave(content::WebContents* contents, bool can_save) override;
DISALLOW_COPY_AND_ASSIGN(CefPDFWebContentsHelperClient);
};

View File

@ -29,7 +29,7 @@ const blink::MediaStreamDevice* FindDefaultDeviceWithId(
}
return &(*devices.begin());
};
}
} // namespace

View File

@ -305,7 +305,6 @@ void CefMenuManager::CreateDefaultModel() {
model_->AddItem(MENU_ID_CUT, GetLabel(IDS_CONTENT_CONTEXT_CUT));
model_->AddItem(MENU_ID_COPY, GetLabel(IDS_CONTENT_CONTEXT_COPY));
model_->AddItem(MENU_ID_PASTE, GetLabel(IDS_CONTENT_CONTEXT_PASTE));
model_->AddItem(MENU_ID_DELETE, GetLabel(IDS_CONTENT_CONTEXT_DELETE));
model_->AddSeparator();
model_->AddItem(MENU_ID_SELECT_ALL,

View File

@ -17,7 +17,7 @@
namespace content {
class RenderFrameHost;
class WebContents;
};
} // namespace content
class CefBrowserHostImpl;
class CefRunContextMenuCallback;

View File

@ -64,22 +64,24 @@ void CefCookieStoreProxy::SetCookieWithOptionsAsync(
cookie_store->SetCookieWithOptionsAsync(url, cookie_line, options,
std::move(callback));
} else if (!callback.is_null()) {
std::move(callback).Run(false);
std::move(callback).Run(
net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE);
}
}
void CefCookieStoreProxy::SetCanonicalCookieAsync(
std::unique_ptr<net::CanonicalCookie> cookie,
bool secure_source,
std::string source_scheme,
bool modify_http_only,
SetCookiesCallback callback) {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
cookie_store->SetCanonicalCookieAsync(std::move(cookie), secure_source,
cookie_store->SetCanonicalCookieAsync(std::move(cookie), source_scheme,
modify_http_only,
std::move(callback));
} else if (!callback.is_null()) {
std::move(callback).Run(false);
std::move(callback).Run(
net::CanonicalCookie::CookieInclusionStatus::EXCLUDE_FAILURE_TO_STORE);
}
}

View File

@ -23,7 +23,7 @@ class CefCookieStoreProxy : public net::CookieStore {
const net::CookieOptions& options,
SetCookiesCallback callback) override;
void SetCanonicalCookieAsync(std::unique_ptr<net::CanonicalCookie> cookie,
bool secure_source,
std::string source_scheme,
bool modify_http_only,
SetCookiesCallback callback) override;
void GetCookieListWithOptionsAsync(const GURL& url,

View File

@ -19,4 +19,4 @@ bool IsInternalRequest(const net::URLRequest* request) {
return false;
}
}; // namespace net_util
} // namespace net_util

View File

@ -16,6 +16,6 @@ namespace net_util {
// the CEF API.
bool IsInternalRequest(const net::URLRequest* request);
}; // namespace net_util
} // namespace net_util
#endif // CEF_LIBCEF_BROWSER_NET_NET_UTIL_H_

View File

@ -9,6 +9,7 @@
#include <vector>
#include "include/cef_callback.h"
#include "include/cef_parser.h"
#include "libcef/browser/cookie_manager_impl.h"
#include "libcef/browser/thread_util.h"
#include "libcef/common/request_impl.h"
@ -565,7 +566,7 @@ void CefResourceRequestJob::SaveNextCookie() {
if (can_set_cookie) {
request_->context()->cookie_store()->SetCanonicalCookieAsync(
std::move(cookie), request_->url().SchemeIsCryptographic(),
std::move(cookie), request_->url().scheme(),
!options.exclude_httponly(),
base::Bind(&CefResourceRequestJob::OnCookieSaved,
weak_factory_.GetWeakPtr()));
@ -575,7 +576,8 @@ void CefResourceRequestJob::SaveNextCookie() {
CookieHandled();
}
void CefResourceRequestJob::OnCookieSaved(bool cookie_status) {
void CefResourceRequestJob::OnCookieSaved(
net::CanonicalCookie::CookieInclusionStatus status) {
CookieHandled();
}

View File

@ -61,7 +61,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
net::HttpResponseHeaders* GetResponseHeaders();
void SaveCookiesAndNotifyHeadersComplete();
void SaveNextCookie();
void OnCookieSaved(bool cookie_status);
void OnCookieSaved(net::CanonicalCookie::CookieInclusionStatus status);
void CookieHandled();
void FetchResponseCookies(std::vector<std::string>* cookies);

View File

@ -363,7 +363,6 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
io_state_->storage_->set_http_auth_handler_factory(
net::HttpAuthHandlerRegistryFactory::Create(
io_state_->url_request_context_->host_resolver(),
io_state_->http_auth_preferences_.get(), supported_schemes
#if defined(OS_POSIX) && !defined(OS_ANDROID)
,

View File

@ -191,6 +191,9 @@ struct PopulateAxNodeAttributes {
}
attributes->SetList(ToString(attr.first), list);
} break;
case ax::mojom::IntAttribute::kImageAnnotationStatus: {
// TODO(cef): Implement support for Image Annotation Status
} break;
}
}

View File

@ -12,6 +12,7 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/osr/osr_util.h"
#include "libcef/browser/osr/software_output_device_osr.h"
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
#include "libcef/browser/thread_util.h"
#include "base/callback_helpers.h"
@ -161,7 +162,7 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
void InvalidateLocalSurfaceIdOnEviction() override {}
bool ShouldShowStaleContentOnEviction() override { return false; };
bool ShouldShowStaleContentOnEviction() override { return false; }
private:
CefRenderWidgetHostViewOSR* const view_;
@ -1133,10 +1134,7 @@ viz::FrameSinkId CefRenderWidgetHostViewOSR::GetRootFrameSinkId() {
std::unique_ptr<content::SyntheticGestureTarget>
CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() {
// TODO(cef): This is likely incorrect for OOPIF.
// See https://crrev.com/5375957bb5.
return std::unique_ptr<content::SyntheticGestureTarget>(
new content::SyntheticGestureTargetBase(host()));
return std::make_unique<CefSyntheticGestureTargetOSR>(host());
}
#if !defined(OS_MACOSX)
@ -1193,8 +1191,7 @@ bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpaceLegacy(
bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView(
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
gfx::PointF* transformed_point,
viz::EventSource source) {
gfx::PointF* transformed_point) {
if (target_view == this) {
*transformed_point = point;
return true;

View File

@ -194,8 +194,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool TransformPointToCoordSpaceForView(
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
gfx::PointF* transformed_point,
viz::EventSource source = viz::EventSource::ANY) override;
gfx::PointF* transformed_point) override;
void DidNavigate() override;
void SelectionChanged(const base::string16& text,
size_t offset,
@ -369,8 +368,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
std::unique_ptr<content::BrowserCompositorMac> browser_compositor_;
MacHelper* mac_helper_;
#elif defined(USE_X11)
CefWindowX11* window_;
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
CefWindowX11* window_;
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
#endif
std::unique_ptr<content::CursorManager> cursor_manager_;

View File

@ -0,0 +1,61 @@
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.
#include "libcef/browser/osr/synthetic_gesture_target_osr.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/common/screen_info.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
CefSyntheticGestureTargetOSR::CefSyntheticGestureTargetOSR(
content::RenderWidgetHostImpl* host)
: SyntheticGestureTargetBase(host) {}
void CefSyntheticGestureTargetOSR::DispatchWebTouchEventToPlatform(
const blink::WebTouchEvent& web_touch,
const ui::LatencyInfo& latency_info) {
// We assume that platforms supporting touch have their own implementation of
// SyntheticGestureTarget to route the events through their respective input
// stack.
LOG(ERROR) << "Touch events not supported for this browser.";
}
void CefSyntheticGestureTargetOSR::DispatchWebMouseWheelEventToPlatform(
const blink::WebMouseWheelEvent& web_wheel,
const ui::LatencyInfo& latency_info) {
render_widget_host()->ForwardWheelEventWithLatencyInfo(web_wheel,
latency_info);
}
void CefSyntheticGestureTargetOSR::DispatchWebGestureEventToPlatform(
const blink::WebGestureEvent& web_gesture,
const ui::LatencyInfo& latency_info) {
render_widget_host()->ForwardGestureEventWithLatencyInfo(web_gesture,
latency_info);
}
void CefSyntheticGestureTargetOSR::DispatchWebMouseEventToPlatform(
const blink::WebMouseEvent& web_mouse,
const ui::LatencyInfo& latency_info) {
render_widget_host()->ForwardMouseEventWithLatencyInfo(web_mouse,
latency_info);
}
content::SyntheticGestureParams::GestureSourceType
CefSyntheticGestureTargetOSR::GetDefaultSyntheticGestureSourceType() const {
return content::SyntheticGestureParams::MOUSE_INPUT;
}
float CefSyntheticGestureTargetOSR::GetTouchSlopInDips() const {
return ui::GestureConfiguration::GetInstance()
->max_touch_move_in_pixels_for_click();
}
float CefSyntheticGestureTargetOSR::GetSpanSlopInDips() const {
return ui::GestureConfiguration::GetInstance()->span_slop();
}
float CefSyntheticGestureTargetOSR::GetMinScalingSpanInDips() const {
return ui::GestureConfiguration::GetInstance()->min_scaling_span_in_pixels();
}

View File

@ -0,0 +1,42 @@
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that can
// be found in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_
#define CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_
#include "base/macros.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
// SyntheticGestureTarget implementation for OSR.
class CefSyntheticGestureTargetOSR
: public content::SyntheticGestureTargetBase {
public:
explicit CefSyntheticGestureTargetOSR(content::RenderWidgetHostImpl* host);
// SyntheticGestureTargetBase:
void DispatchWebTouchEventToPlatform(
const blink::WebTouchEvent& web_touch,
const ui::LatencyInfo& latency_info) override;
void DispatchWebMouseWheelEventToPlatform(
const blink::WebMouseWheelEvent& web_wheel,
const ui::LatencyInfo& latency_info) override;
void DispatchWebGestureEventToPlatform(
const blink::WebGestureEvent& web_gesture,
const ui::LatencyInfo& latency_info) override;
void DispatchWebMouseEventToPlatform(
const blink::WebMouseEvent& web_mouse,
const ui::LatencyInfo& latency_info) override;
// SyntheticGestureTarget:
content::SyntheticGestureParams::GestureSourceType
GetDefaultSyntheticGestureSourceType() const override;
float GetTouchSlopInDips() const override;
float GetSpanSlopInDips() const override;
float GetMinScalingSpanInDips() const override;
private:
DISALLOW_COPY_AND_ASSIGN(CefSyntheticGestureTargetOSR);
};
#endif // CEF_LIBCEF_BROWSER_OSR_SYNTHETIC_GESTURE_TARGET_OSR_H_

View File

@ -151,11 +151,9 @@ void CefWebContentsViewOSR::RenderViewHostChanged(
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
#if defined(OS_MACOSX)
bool CefWebContentsViewOSR::IsEventTracking() const {
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
return false;
}
void CefWebContentsViewOSR::CloseTabAfterEventTracking() {}
#endif // defined(OS_MACOSX)
void CefWebContentsViewOSR::StartDragging(

View File

@ -59,8 +59,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
void SetOverscrollControllerEnabled(bool enabled) override;
#if defined(OS_MACOSX)
bool IsEventTracking() const override;
void CloseTabAfterEventTracking() override;
bool CloseTabAfterEventTrackingIfNeeded() override;
#endif
// RenderViewHostDelegateView methods.

View File

@ -61,11 +61,13 @@ struct ResolveHostHelper {
void OnResolveCompleted(int result) {
std::vector<CefString> resolved_ips;
net::AddressList::const_iterator iter = address_list_.begin();
for (; iter != address_list_.end(); ++iter)
base::Optional<net::AddressList> maybe_address_list =
request_->GetAddressResults();
if (maybe_address_list) {
net::AddressList::const_iterator iter = maybe_address_list->begin();
for (; iter != maybe_address_list->end(); ++iter)
resolved_ips.push_back(iter->ToStringWithoutPort());
}
CEF_POST_TASK(
CEF_UIT,
base::Bind(&CefResolveCallback::OnResolveCompleted, callback_,
@ -75,8 +77,7 @@ struct ResolveHostHelper {
}
CefRefPtr<CefResolveCallback> callback_;
net::AddressList address_list_;
std::unique_ptr<net::HostResolver::Request> request_;
std::unique_ptr<net::HostResolver::ResolveHostRequest> request_;
};
} // namespace
@ -475,39 +476,6 @@ void CefRequestContextImpl::ResolveHost(
callback));
}
cef_errorcode_t CefRequestContextImpl::ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) {
resolved_ips.clear();
if (!CEF_CURRENTLY_ON_IOT()) {
NOTREACHED() << "called on invalid thread";
return ERR_FAILED;
}
if (!request_context_getter_impl_)
return ERR_FAILED;
int retval = ERR_FAILED;
net::HostResolver* host_resolver =
request_context_getter_impl_->GetHostResolver();
if (host_resolver) {
net::HostResolver::RequestInfo request_info(
net::HostPortPair::FromURL(GURL(origin.ToString())));
net::AddressList address_list;
retval = host_resolver->ResolveFromCache(request_info, &address_list,
net::NetLogWithSource());
if (retval == net::OK) {
net::AddressList::const_iterator iter = address_list.begin();
for (; iter != address_list.end(); ++iter)
resolved_ips.push_back(iter->ToString());
}
}
return static_cast<cef_errorcode_t>(retval);
}
void CefRequestContextImpl::LoadExtension(
const CefString& root_directory,
CefRefPtr<CefDictionaryValue> manifest,
@ -801,13 +769,11 @@ void CefRequestContextImpl::ResolveHostInternal(
net::HostResolver* host_resolver = request_context->GetHostResolver();
if (host_resolver) {
net::HostResolver::RequestInfo request_info(
net::HostPortPair::FromURL(GURL(origin.ToString())));
retval = host_resolver->Resolve(
request_info, net::DEFAULT_PRIORITY, &helper->address_list_,
base::Bind(&ResolveHostHelper::OnResolveCompleted,
base::Unretained(helper)),
&helper->request_, net::NetLogWithSource());
helper->request_ = host_resolver->CreateRequest(
net::HostPortPair::FromURL(GURL(origin.ToString())),
net::NetLogWithSource(), {});
retval = helper->request_->Start(base::Bind(
&ResolveHostHelper::OnResolveCompleted, base::Unretained(helper)));
if (retval == net::ERR_IO_PENDING) {
// The result will be delivered asynchronously via the callback.
return;

View File

@ -77,9 +77,6 @@ class CefRequestContextImpl : public CefRequestContext {
void CloseAllConnections(CefRefPtr<CefCompletionCallback> callback) override;
void ResolveHost(const CefString& origin,
CefRefPtr<CefResolveCallback> callback) override;
cef_errorcode_t ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) override;
void LoadExtension(const CefString& root_directory,
CefRefPtr<CefDictionaryValue> manifest,
CefRefPtr<CefExtensionHandler> handler) override;

View File

@ -46,7 +46,7 @@ bool CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
if (!extensions::ExtensionsEnabled())
return false;
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
CefResourceContext* context =
static_cast<CefResourceContext*>(info->GetContext());
@ -91,7 +91,7 @@ void CefResourceDispatcherHostDelegate::OnStreamCreated(
net::URLRequest* request,
std::unique_ptr<content::StreamInfo> stream) {
DCHECK(extensions::ExtensionsEnabled());
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
std::map<net::URLRequest*, StreamTargetInfo>::iterator ix =
stream_target_info_.find(request);

View File

@ -16,7 +16,7 @@
namespace base {
class Thread;
};
}
class CefServerImpl : public CefServer, net::HttpServer::Delegate {
public:

View File

@ -9,6 +9,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/task/post_task.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
@ -73,7 +74,9 @@
CEF_POST_BLOCKING_TASK(base::TaskPriority::BEST_EFFORT, task)
// Assert that blocking is allowed on the current thread.
#define CEF_REQUIRE_BLOCKING() base::AssertBlockingAllowedDeprecated()
#define CEF_REQUIRE_BLOCKING() \
base::ScopedBlockingCall scoped_blocking_call( \
FROM_HERE, base::BlockingType::WILL_BLOCK)
// Same as IMPLEMENT_REFCOUNTING() but using the specified Destructor.
#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \
@ -92,7 +95,7 @@
} \
\
private: \
CefRefCount ref_count_;
CefRefCount ref_count_
#define IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(ClassName) \
IMPLEMENT_REFCOUNTING_EX(ClassName, content::BrowserThread::DeleteOnUIThread)

View File

@ -10,7 +10,7 @@
namespace views {
class LayoutManager;
};
}
// Exposes a common interface from all CefLayout implementation objects to
// simplify the layout_util implementation. See comments in view_impl.h for a

View File

@ -35,6 +35,7 @@
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#if defined(OS_LINUX)
@ -161,8 +162,10 @@ bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) {
std::string manifest_data;
if (!base::ReadFileToString(manifest_path, &manifest_data))
return false;
std::unique_ptr<base::Value> manifest_value(
base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS));
std::unique_ptr<base::Value> manifest_value(base::Value::ToUniquePtrValue(
std::move(base::JSONReader::Read(manifest_data,
base::JSON_ALLOW_TRAILING_COMMAS)
.value())));
if (!manifest_value.get())
return false;
base::DictionaryValue* manifest = NULL;
@ -242,6 +245,16 @@ base::string16 CefContentClient::GetLocalizedString(int message_id) const {
return value;
}
base::string16 CefContentClient::GetLocalizedString(
int message_id,
const base::string16& replacement) const {
base::string16 value = l10n_util::GetStringFUTF16(message_id, replacement);
if (value.empty())
LOG(ERROR) << "No localized string available for id " << message_id;
return value;
}
base::StringPiece CefContentClient::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const {

View File

@ -38,6 +38,9 @@ class CefContentClient : public content::ContentClient,
std::vector<media::CdmHostFilePath>* cdm_host_file_paths) override;
void AddAdditionalSchemes(Schemes* schemes) override;
base::string16 GetLocalizedString(int message_id) const override;
base::string16 GetLocalizedString(
int message_id,
const base::string16& replacement) const override;
base::StringPiece GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const override;

View File

@ -34,10 +34,13 @@ int GetJSONWriterOptions(cef_json_writer_options_t options) {
CefRefPtr<CefValue> CefParseJSON(const CefString& json_string,
cef_json_parser_options_t options) {
const std::string& json = json_string.ToString();
std::unique_ptr<base::Value> parse_result =
base::Optional<base::Value> parse_result =
base::JSONReader::Read(json, GetJSONReaderOptions(options));
if (parse_result)
return new CefValueImpl(parse_result.release());
if (parse_result) {
return new CefValueImpl(
base::Value::ToUniquePtrValue(std::move(parse_result.value()))
.release());
}
return NULL;
}
@ -48,16 +51,19 @@ CefRefPtr<CefValue> CefParseJSONAndReturnError(
CefString& error_msg_out) {
const std::string& json = json_string.ToString();
int error_code;
std::string error_msg;
std::unique_ptr<base::Value> parse_result =
base::JSONReader::ReadAndReturnError(json, GetJSONReaderOptions(options),
&error_code, &error_msg);
if (parse_result)
return new CefValueImpl(parse_result.release());
base::JSONReader::ValueWithError value_and_error =
base::JSONReader::ReadAndReturnValueWithError(
json, GetJSONReaderOptions(options));
if (value_and_error.value) {
return new CefValueImpl(
base::Value::ToUniquePtrValue(std::move(value_and_error.value.value()))
.release());
}
error_code_out = static_cast<cef_json_parser_error_t>(error_code);
error_msg_out = error_msg;
error_code_out =
static_cast<cef_json_parser_error_t>(value_and_error.error_code);
error_msg_out = value_and_error.error_message;
return NULL;
}

View File

@ -37,6 +37,7 @@
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/viz/common/features.h"
#include "content/browser/browser_process_sub_thread.h"
#include "content/browser/scheduler/browser_task_executor.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
@ -45,6 +46,7 @@
#include "extensions/common/constants.h"
#include "ipc/ipc_buildflags.h"
#include "pdf/pdf_ppapi.h"
#include "services/network/public/cpp/features.h"
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
@ -274,22 +276,52 @@ void OverrideAssetPath() {
}
#endif
// Used to run the UI on a separate thread.
class CefUIThread : public base::Thread {
public:
CefUIThread() : base::Thread("CefUIThread") {}
} // namespace
void Init() override {
#if defined(OS_WIN)
// Initializes the COM library on the current thread.
CoInitialize(NULL);
#endif
// Used to run the UI on a separate thread.
class CefUIThread : public base::PlatformThread::Delegate {
public:
explicit CefUIThread(base::OnceClosure setup_callback)
: setup_callback_(std::move(setup_callback)) {}
~CefUIThread() override { Stop(); }
void Start() {
base::AutoLock lock(thread_lock_);
bool success = base::PlatformThread::CreateWithPriority(
0, this, &thread_, base::ThreadPriority::NORMAL);
if (!success) {
LOG(FATAL) << "failed to UI create thread";
}
}
void Stop() {
base::AutoLock lock(thread_lock_);
if (!stopping_) {
stopping_ = true;
base::PostTaskWithTraits(
FROM_HERE, {content::BrowserThread::UI},
base::BindOnce(&CefUIThread::ThreadQuitHelper, Unretained(this)));
}
// Can't join if the |thread_| is either already gone or is non-joinable.
if (thread_.is_null())
return;
base::PlatformThread::Join(thread_);
thread_ = base::PlatformThreadHandle();
stopping_ = false;
}
bool WaitUntilThreadStarted() const {
DCHECK(owning_sequence_checker_.CalledOnValidSequence());
start_event_.Wait();
return true;
}
void InitializeBrowserRunner(
const content::MainFunctionParams& main_function_params) {
DCHECK(task_runner()->BelongsToCurrentThread());
// Use our own browser process runner.
browser_runner_ = content::BrowserMainRunner::Create();
@ -298,15 +330,27 @@ class CefUIThread : public base::Thread {
CHECK_EQ(exit_code, -1);
}
void CleanUp() override {
protected:
void ThreadMain() override {
base::PlatformThread::SetName("CefUIThread");
#if defined(OS_WIN)
// Initializes the COM library on the current thread.
CoInitialize(NULL);
#endif
start_event_.Signal();
std::move(setup_callback_).Run();
base::RunLoop run_loop;
run_loop_ = &run_loop;
run_loop.Run();
browser_runner_->Shutdown();
browser_runner_.reset(NULL);
// Release MessagePump resources registered with the AtExitManager.
base::MessageLoop* ml = const_cast<base::MessageLoop*>(message_loop());
base::MessageLoopCurrent::UnbindFromCurrentThreadInternal(
ml->GetMessageLoopBase());
ml->ReleasePump();
content::BrowserTaskExecutor::Shutdown();
// Run exit callbacks on the UI thread to avoid sequence check failures.
base::AtExitManager::ProcessCallbacksNow();
@ -316,13 +360,32 @@ class CefUIThread : public base::Thread {
// be balanced by a corresponding call to CoUninitialize.
CoUninitialize();
#endif
run_loop_ = nullptr;
}
protected:
std::unique_ptr<content::BrowserMainRunner> browser_runner_;
};
void ThreadQuitHelper() {
DCHECK(run_loop_);
run_loop_->QuitWhenIdle();
}
} // namespace
std::unique_ptr<content::BrowserMainRunner> browser_runner_;
base::OnceClosure setup_callback_;
bool stopping_ = false;
// The thread's handle.
base::PlatformThreadHandle thread_;
mutable base::Lock thread_lock_; // Protects |thread_|.
base::RunLoop* run_loop_ = nullptr;
mutable base::WaitableEvent start_event_;
// This class is not thread-safe, use this to verify access from the owning
// sequence of the Thread.
base::SequenceChecker owning_sequence_checker_;
};
CefMainDelegate::CefMainDelegate(CefRefPtr<CefApp> application)
: content_client_(application) {
@ -339,10 +402,7 @@ CefMainDelegate::CefMainDelegate(CefRefPtr<CefApp> application)
CefMainDelegate::~CefMainDelegate() {}
void CefMainDelegate::PreCreateMainMessageLoop() {
if (!message_loop_) {
// Create the main message loop.
message_loop_.reset(new CefBrowserMessageLoop());
}
InitMessagePumpFactoryForUI();
}
bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
@ -506,6 +566,13 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
}
}
// Disable NetworkService for now
// TODO(cef): Implement the required changes for network service
if (network::features::kNetworkService.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
disable_features.push_back(network::features::kNetworkService.name);
}
if (!disable_features.empty()) {
DCHECK(!base::FeatureList::GetInstance());
std::string disable_features_str =
@ -653,8 +720,7 @@ int CefMainDelegate::RunProcess(
} else {
// Running on the separate UI thread.
DCHECK(ui_thread_);
static_cast<CefUIThread*>(ui_thread_.get())
->InitializeBrowserRunner(main_function_params);
ui_thread_->InitializeBrowserRunner(main_function_params);
}
return 0;
@ -663,22 +729,16 @@ int CefMainDelegate::RunProcess(
return -1;
}
bool CefMainDelegate::CreateUIThread() {
bool CefMainDelegate::CreateUIThread(base::OnceClosure setup_callback) {
DCHECK(!ui_thread_);
DCHECK(!message_loop_);
std::unique_ptr<base::Thread> thread;
thread.reset(new CefUIThread());
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_UI;
if (!thread->StartWithOptions(options)) {
NOTREACHED() << "failed to start UI thread";
return false;
}
std::unique_ptr<CefUIThread> thread;
thread.reset(new CefUIThread(std::move(setup_callback)));
thread->Start();
thread->WaitUntilThreadStarted();
ui_thread_.swap(thread);
message_loop_.reset(new CefBrowserMessageLoop());
InitMessagePumpFactoryForUI();
return true;
}
@ -717,8 +777,6 @@ void CefMainDelegate::ShutdownBrowser() {
browser_runner_.reset(NULL);
}
message_loop_.reset();
if (ui_thread_.get()) {
// Blocks until the thread has stopped.
ui_thread_->Stop();

View File

@ -27,6 +27,7 @@ class BrowserMainRunner;
class CefContentBrowserClient;
class CefContentRendererClient;
class CefContentUtilityClient;
class CefUIThread;
class CefMainDelegate : public content::ContentMainDelegate {
public:
@ -48,21 +49,19 @@ class CefMainDelegate : public content::ContentMainDelegate {
content::ContentRendererClient* CreateContentRendererClient() override;
content::ContentUtilityClient* CreateContentUtilityClient() override;
bool CreateUIThread();
bool CreateUIThread(base::OnceClosure setup_callback);
// Shut down the browser runner.
void ShutdownBrowser();
CefContentBrowserClient* browser_client() { return browser_client_.get(); }
CefContentClient* content_client() { return &content_client_; }
base::Thread* ui_thread() { return ui_thread_.get(); }
private:
void InitializeResourceBundle();
std::unique_ptr<base::MessageLoop> message_loop_;
std::unique_ptr<content::BrowserMainRunner> browser_runner_;
std::unique_ptr<base::Thread> ui_thread_;
std::unique_ptr<CefUIThread> ui_thread_;
std::unique_ptr<CefContentBrowserClient> browser_client_;
std::unique_ptr<CefContentRendererClient> renderer_client_;

View File

@ -17,6 +17,6 @@ typedef CefRequest::HeaderMap HeaderMap;
std::string GenerateHeaders(const HeaderMap& map);
void ParseHeaders(const std::string& header_str, HeaderMap& map);
}; // namespace HttpHeaderUtils
} // namespace HttpHeaderUtils
#endif // CEF_LIBCEF_COMMON_NET_HTTP_HEADER_UTILS_H_

View File

@ -448,7 +448,7 @@ void CefRequestImpl::Set(const net::URLRequest* request) {
site_for_cookies_ = request->site_for_cookies();
const content::ResourceRequestInfo* info =
content::ResourceRequestInfo* info =
content::ResourceRequestInfo::ForRequest(request);
if (info) {
resource_type_ = static_cast<cef_resource_type_t>(info->GetResourceType());

View File

@ -29,7 +29,7 @@ class UploadElement;
class UploadElementReader;
class URLFetcher;
class URLRequest;
}; // namespace net
} // namespace net
namespace blink {
class WebURLRequest;

View File

@ -438,11 +438,6 @@ void CefBrowserImpl::DidFinishLoad(blink::WebLocalFrame* frame) {
OnLoadEnd(frame);
}
void CefBrowserImpl::DidStartProvisionalLoad(blink::WebLocalFrame* frame) {
// Send the frame creation notification if necessary.
GetWebFrameImpl(frame);
}
void CefBrowserImpl::DidFailProvisionalLoad(blink::WebLocalFrame* frame,
const blink::WebURLError& error) {
OnLoadError(frame, error);

View File

@ -115,7 +115,6 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
// Forwarded from CefRenderFrameObserver.
void DidFinishLoad(blink::WebLocalFrame* frame);
void DidStartProvisionalLoad(blink::WebLocalFrame* frame);
void FrameDetached(blink::WebLocalFrame* frame);
void FocusedNodeChanged(const blink::WebNode& node);
void DraggableRegionsChanged(blink::WebLocalFrame* frame);

View File

@ -12,7 +12,7 @@
namespace blink {
class WebLocalFrame;
class WebNode;
}; // namespace blink
} // namespace blink
class CefBrowserImpl;

View File

@ -152,7 +152,7 @@ bool CefExtensionsRendererClient::OverrideCreatePlugin(
return true;
bool guest_view_api_available = false;
extension_dispatcher_->script_context_set().ForEach(
extension_dispatcher_->script_context_set_iterator()->ForEach(
render_frame, base::Bind(&IsGuestViewApiAvailableToScriptContext,
&guest_view_api_available));
return !guest_view_api_available;

View File

@ -39,18 +39,6 @@ void CefRenderFrameObserver::OnInterfaceRequestForFrame(
registry_.TryBindInterface(interface_name, interface_pipe);
}
void CefRenderFrameObserver::DidStartProvisionalLoad(
blink::WebDocumentLoader* document_loader,
bool is_content_initiated) {
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());
if (!browserPtr.get())
return;
browserPtr->DidStartProvisionalLoad(frame);
}
void CefRenderFrameObserver::DidFinishLoad() {
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
CefRefPtr<CefBrowserImpl> browserPtr =

View File

@ -21,8 +21,6 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
void OnInterfaceRequestForFrame(
const std::string& interface_name,
mojo::ScopedMessagePipeHandle* interface_pipe) override;
void DidStartProvisionalLoad(blink::WebDocumentLoader* document_loader,
bool is_content_initiated) override;
void DidFinishLoad() override;
void FrameDetached() override;
void FrameFocused() override;

View File

@ -40,8 +40,8 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
~CefWebURLLoaderClient() override;
// blink::WebURLLoaderClient methods.
void DidSendData(unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) override;
void DidSendData(uint64_t bytes_sent,
uint64_t total_bytes_to_be_sent) override;
void DidReceiveResponse(const WebURLResponse& response) override;
void DidReceiveData(const char* data, int dataLength) override;
void DidFinishLoading(
@ -280,10 +280,10 @@ CefWebURLLoaderClient::CefWebURLLoaderClient(
CefWebURLLoaderClient::~CefWebURLLoaderClient() {}
void CefWebURLLoaderClient::DidSendData(unsigned long long bytesSent,
unsigned long long totalBytesToBeSent) {
void CefWebURLLoaderClient::DidSendData(uint64_t bytes_sent,
uint64_t total_bytes_to_be_sent) {
if (request_flags_ & UR_FLAG_REPORT_UPLOAD_PROGRESS)
context_->OnUploadProgress(bytesSent, totalBytesToBeSent);
context_->OnUploadProgress(bytes_sent, total_bytes_to_be_sent);
}
void CefWebURLLoaderClient::DidReceiveResponse(const WebURLResponse& response) {

View File

@ -22,7 +22,7 @@ class GURL;
namespace blink {
class WebLocalFrame;
};
}
// Call after a V8 Isolate has been created and entered for the first time.
void CefV8IsolateCreated();

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=3de63a7f85158f967dd780e98a171b6665f1edb0$
// $hash=f4724d1d945c06c5113ba9e1b7f7ad8d4b735b9c$
//
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
@ -411,41 +411,6 @@ request_context_resolve_host(struct _cef_request_context_t* self,
CefString(origin), CefResolveCallbackCToCpp::Wrap(callback));
}
cef_errorcode_t CEF_CALLBACK
request_context_resolve_host_cached(struct _cef_request_context_t* self,
const cef_string_t* origin,
cef_string_list_t resolved_ips) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return ERR_FAILED;
// Verify param: origin; type: string_byref_const
DCHECK(origin);
if (!origin)
return ERR_FAILED;
// Verify param: resolved_ips; type: string_vec_byref
DCHECK(resolved_ips);
if (!resolved_ips)
return ERR_FAILED;
// Translate param: resolved_ips; type: string_vec_byref
std::vector<CefString> resolved_ipsList;
transfer_string_list_contents(resolved_ips, resolved_ipsList);
// Execute
cef_errorcode_t _retval =
CefRequestContextCppToC::Get(self)->ResolveHostCached(CefString(origin),
resolved_ipsList);
// Restore param: resolved_ips; type: string_vec_byref
cef_string_list_clear(resolved_ips);
transfer_string_list_contents(resolved_ipsList, resolved_ips);
// Return type: simple
return _retval;
}
void CEF_CALLBACK
request_context_load_extension(struct _cef_request_context_t* self,
const cef_string_t* root_directory,
@ -587,7 +552,6 @@ CefRequestContextCppToC::CefRequestContextCppToC() {
request_context_clear_certificate_exceptions;
GetStruct()->close_all_connections = request_context_close_all_connections;
GetStruct()->resolve_host = request_context_resolve_host;
GetStruct()->resolve_host_cached = request_context_resolve_host_cached;
GetStruct()->load_extension = request_context_load_extension;
GetStruct()->did_load_extension = request_context_did_load_extension;
GetStruct()->has_extension = request_context_has_extension;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=37d522682ec51c38bb9b4f0e94a46a49c3820046$
// $hash=ed414e127773ef135584c3c61a386615177feb59$
//
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
@ -395,42 +395,6 @@ void CefRequestContextCToCpp::ResolveHost(
CefResolveCallbackCppToC::Wrap(callback));
}
NO_SANITIZE("cfi-icall")
cef_errorcode_t CefRequestContextCToCpp::ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) {
cef_request_context_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, resolve_host_cached))
return ERR_FAILED;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: origin; type: string_byref_const
DCHECK(!origin.empty());
if (origin.empty())
return ERR_FAILED;
// Translate param: resolved_ips; type: string_vec_byref
cef_string_list_t resolved_ipsList = cef_string_list_alloc();
DCHECK(resolved_ipsList);
if (resolved_ipsList)
transfer_string_list_contents(resolved_ips, resolved_ipsList);
// Execute
cef_errorcode_t _retval = _struct->resolve_host_cached(
_struct, origin.GetStruct(), resolved_ipsList);
// Restore param:resolved_ips; type: string_vec_byref
if (resolved_ipsList) {
resolved_ips.clear();
transfer_string_list_contents(resolved_ipsList, resolved_ips);
cef_string_list_free(resolved_ipsList);
}
// Return type: simple
return _retval;
}
NO_SANITIZE("cfi-icall")
void CefRequestContextCToCpp::LoadExtension(
const CefString& root_directory,

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=376c88ccfd6a48b8d46d7b0493a36a6dc5c1e3b8$
// $hash=52475096e498cd28cbd25676eaab24e14c1438b0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_
@ -64,9 +64,6 @@ class CefRequestContextCToCpp
void CloseAllConnections(CefRefPtr<CefCompletionCallback> callback) OVERRIDE;
void ResolveHost(const CefString& origin,
CefRefPtr<CefResolveCallback> callback) OVERRIDE;
cef_errorcode_t ResolveHostCached(
const CefString& origin,
std::vector<CefString>& resolved_ips) OVERRIDE;
void LoadExtension(const CefString& root_directory,
CefRefPtr<CefDictionaryValue> manifest,
CefRefPtr<CefExtensionHandler> handler) OVERRIDE;

View File

@ -416,5 +416,15 @@ patches = [
# macOS: Fix crash when showing a select popup with CefDoMessageLoopWork.
# https://bitbucket.org/chromiumembedded/cef/issues/2495
'name': 'message_pump_mac_2495',
},
{
# Windows: Fix jumbo build error in AccessibilityTreeFormatterWin
# https://bugs.chromium.org/p/chromium/issues/detail?id=939668
'name': 'accessibility_win_939668',
},
{
# Windows: Revert base::Value change which breaks cef_sandbox build.
# https://bugs.chromium.org/p/chromium/issues/detail?id=646113#c173
'name': 'base_value_646113',
}
]

View File

@ -0,0 +1,31 @@
diff --git content/browser/accessibility/accessibility_tree_formatter_win.cc content/browser/accessibility/accessibility_tree_formatter_win.cc
index 59f85adf85c3..a60cb7aa874c 100644
--- content/browser/accessibility/accessibility_tree_formatter_win.cc
+++ content/browser/accessibility/accessibility_tree_formatter_win.cc
@@ -35,7 +35,7 @@
#include "ui/base/win/atl_module.h"
#include "ui/gfx/win/hwnd_util.h"
-namespace {
+namespace internal {
struct HwndWithProcId {
HwndWithProcId(const base::ProcessId id) : pid(id), hwnd(nullptr) {}
@@ -60,7 +60,7 @@ HWND GetHwndForProcess(base::ProcessId pid) {
return hwnd_with_proc_id.hwnd;
}
-} // namespace
+} // namespace internal
namespace content {
@@ -354,7 +354,7 @@ std::unique_ptr<base::DictionaryValue>
AccessibilityTreeFormatterWin::BuildAccessibilityTreeForProcess(
base::ProcessId pid) {
// Get HWND for process id.
- HWND hwnd = GetHwndForProcess(pid);
+ HWND hwnd = ::internal::GetHwndForProcess(pid);
return BuildAccessibilityTreeForWindow(hwnd);
}

View File

@ -0,0 +1,335 @@
diff --git base/values.cc base/values.cc
index 2b0c6c8163d8..fc12313a7bb5 100644
--- base/values.cc
+++ base/values.cc
@@ -22,20 +22,6 @@
namespace base {
-// base::Value must be standard layout to guarantee that writing to
-// |bool_type_| then reading |type_| is defined behaviour. See:
-//
-// [class.union]:
-// If a standard-layout union contains several standard-layout structs that
-// share a common initial sequence (9.2), and if an object of this
-// standard-layout union type contains one of the standard-layout structs,
-// it is permitted to inspect the common initial sequence of any of
-// standard-layout struct members;
-//
-static_assert(std::is_standard_layout<Value>::value,
- "base::Value should be a standard-layout C++ class in order "
- "to avoid undefined behaviour in its implementation!");
-
namespace {
const char* const kTypeNames[] = {"null", "boolean", "integer", "double",
@@ -90,7 +76,7 @@ std::unique_ptr<Value> CopyWithoutEmptyChildren(const Value& node) {
} // namespace
-constexpr uint16_t Value::kMagicIsAlive;
+constexpr uint32_t Value::kMagicIsAlive;
// static
std::unique_ptr<Value> Value::CreateWithCopiedBuffer(const char* buffer,
@@ -112,9 +98,9 @@ Value::Value(Value&& that) noexcept {
InternalMoveConstructFrom(std::move(that));
}
-Value::Value() noexcept : type_(Type::NONE), is_alive_(kMagicIsAlive) {}
+Value::Value() noexcept : type_(Type::NONE) {}
-Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) {
+Value::Value(Type type) : type_(type) {
// Initialize with the default value.
switch (type_) {
case Type::NONE:
@@ -144,20 +130,11 @@ Value::Value(Type type) : type_(type), is_alive_(kMagicIsAlive) {
}
}
-Value::Value(bool in_bool)
- : bool_type_(Type::BOOLEAN),
- bool_is_alive_(kMagicIsAlive),
- bool_value_(in_bool) {}
+Value::Value(bool in_bool) : type_(Type::BOOLEAN), bool_value_(in_bool) {}
-Value::Value(int in_int)
- : int_type_(Type::INTEGER),
- int_is_alive_(kMagicIsAlive),
- int_value_(in_int) {}
+Value::Value(int in_int) : type_(Type::INTEGER), int_value_(in_int) {}
-Value::Value(double in_double)
- : double_type_(Type::DOUBLE),
- double_is_alive_(kMagicIsAlive),
- double_value_(in_double) {
+Value::Value(double in_double) : type_(Type::DOUBLE), double_value_(in_double) {
if (!std::isfinite(double_value_)) {
NOTREACHED() << "Non-finite (i.e. NaN or positive/negative infinity) "
<< "values cannot be represented in JSON";
@@ -170,9 +147,7 @@ Value::Value(const char* in_string) : Value(std::string(in_string)) {}
Value::Value(StringPiece in_string) : Value(std::string(in_string)) {}
Value::Value(std::string&& in_string) noexcept
- : string_type_(Type::STRING),
- string_is_alive_(kMagicIsAlive),
- string_value_(std::move(in_string)) {
+ : type_(Type::STRING), string_value_(std::move(in_string)) {
DCHECK(IsStringUTF8(string_value_));
}
@@ -181,22 +156,15 @@ Value::Value(const char16* in_string16) : Value(StringPiece16(in_string16)) {}
Value::Value(StringPiece16 in_string16) : Value(UTF16ToUTF8(in_string16)) {}
Value::Value(const std::vector<char>& in_blob)
- : binary_type_(Type::BINARY),
- binary_is_alive_(kMagicIsAlive),
- binary_value_(in_blob.begin(), in_blob.end()) {}
+ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {}
Value::Value(base::span<const uint8_t> in_blob)
- : binary_type_(Type::BINARY),
- binary_is_alive_(kMagicIsAlive),
- binary_value_(in_blob.begin(), in_blob.end()) {}
+ : type_(Type::BINARY), binary_value_(in_blob.begin(), in_blob.end()) {}
Value::Value(BlobStorage&& in_blob) noexcept
- : binary_type_(Type::BINARY),
- binary_is_alive_(kMagicIsAlive),
- binary_value_(std::move(in_blob)) {}
+ : type_(Type::BINARY), binary_value_(std::move(in_blob)) {}
-Value::Value(const DictStorage& in_dict)
- : dict_type_(Type::DICTIONARY), dict_is_alive_(kMagicIsAlive), dict_() {
+Value::Value(const DictStorage& in_dict) : type_(Type::DICTIONARY), dict_() {
dict_.reserve(in_dict.size());
for (const auto& it : in_dict) {
dict_.try_emplace(dict_.end(), it.first,
@@ -205,21 +173,16 @@ Value::Value(const DictStorage& in_dict)
}
Value::Value(DictStorage&& in_dict) noexcept
- : dict_type_(Type::DICTIONARY),
- dict_is_alive_(kMagicIsAlive),
- dict_(std::move(in_dict)) {}
+ : type_(Type::DICTIONARY), dict_(std::move(in_dict)) {}
-Value::Value(const ListStorage& in_list)
- : list_type_(Type::LIST), list_is_alive_(kMagicIsAlive), list_() {
+Value::Value(const ListStorage& in_list) : type_(Type::LIST), list_() {
list_.reserve(in_list.size());
for (const auto& val : in_list)
list_.emplace_back(val.Clone());
}
Value::Value(ListStorage&& in_list) noexcept
- : list_type_(Type::LIST),
- list_is_alive_(kMagicIsAlive),
- list_(std::move(in_list)) {}
+ : type_(Type::LIST), list_(std::move(in_list)) {}
Value& Value::operator=(Value&& that) noexcept {
InternalCleanup();
@@ -733,7 +696,6 @@ size_t Value::EstimateMemoryUsage() const {
void Value::InternalMoveConstructFrom(Value&& that) {
type_ = that.type_;
- is_alive_ = that.is_alive_;
switch (type_) {
case Type::NONE:
diff --git base/values.h base/values.h
index 7546fa53756d..00a357342d23 100644
--- base/values.h
+++ base/values.h
@@ -96,6 +96,10 @@ class BASE_EXPORT Value {
// Note: Do not add more types. See the file-level comment above for why.
};
+ // Magic IsAlive signature to debug double frees.
+ // TODO(crbug.com/859477): Remove once root cause is found.
+ static constexpr uint32_t kMagicIsAlive = 0x15272f19;
+
// For situations where you want to keep ownership of your buffer, this
// factory method creates a new BinaryValue by copying the contents of the
// buffer that's passed in.
@@ -375,100 +379,28 @@ class BASE_EXPORT Value {
size_t EstimateMemoryUsage() const;
protected:
- // Magic IsAlive signature to debug double frees.
- // TODO(crbug.com/859477): Remove once root cause is found.
- static constexpr uint16_t kMagicIsAlive = 0x2f19;
+ // TODO(crbug.com/646113): Make these private once DictionaryValue and
+ // ListValue are properly inlined.
+ Type type_;
- // Technical note:
- // The naive way to implement a tagged union leads to wasted bytes
- // in the object on CPUs like ARM ones, which impose an 8-byte alignment
- // for double values. I.e. if one does something like:
- //
- // struct TaggedValue {
- // int type_; // size = 1, align = 4
- // union {
- // bool bool_value_; // size = 1, align = 1
- // int int_value_; // size = 4, align = 4
- // double double_value_; // size = 8, align = 8
- // std::string string_value_; // size = 12, align = 4 (32-bit)
- // };
- // };
- //
- // The end result is that the union will have an alignment of 8, and a size
- // of 16, due to 4 extra padding bytes following |string_value_| to respect
- // the alignment requirement.
- //
- // As a consequence, the struct TaggedValue will have a size of 24 bytes,
- // due to the size of the union (16), the size of |type_| (4) and 4 bytes
- // of padding between |type_| and the union to respect its alignment.
- //
- // This means 8 bytes of unused memory per instance on 32-bit ARM!
- //
- // To reclaim these, a union of structs is used instead, in order to ensure
- // that |double_value_| below is always located at an offset that is a
- // multiple of 8, relative to the start of the overall data structure.
- //
- // Each struct must declare its own |type_| and |is_alive_| field, which
- // must have a different name, to appease the C++ compiler.
- //
- // Using this technique sizeof(base::Value) == 16 on 32-bit ARM instead
- // of 24, without losing any information. Results are unchanged for x86,
- // x86_64 and arm64 (16, 32 and 32 bytes respectively).
union {
- struct {
- // TODO(crbug.com/646113): Make these private once DictionaryValue and
- // ListValue are properly inlined.
- Type type_ : 8;
-
- // IsAlive member to debug double frees.
- // TODO(crbug.com/859477): Remove once root cause is found.
- uint16_t is_alive_ = kMagicIsAlive;
- };
- struct {
- Type bool_type_ : 8;
- uint16_t bool_is_alive_;
- bool bool_value_;
- };
- struct {
- Type int_type_ : 8;
- uint16_t int_is_alive_;
- int int_value_;
- };
- struct {
- Type double_type_ : 8;
- uint16_t double_is_alive_;
- // Subtle: On architectures that require it, the compiler will ensure
- // that |double_value_|'s offset is a multiple of 8 (e.g. 32-bit ARM).
- // See technical note above to understand why it is important.
- double double_value_;
- };
- struct {
- Type string_type_ : 8;
- uint16_t string_is_alive_;
- std::string string_value_;
- };
- struct {
- Type binary_type_ : 8;
- uint16_t binary_is_alive_;
- BlobStorage binary_value_;
- };
- struct {
- Type dict_type_ : 8;
- uint16_t dict_is_alive_;
- DictStorage dict_;
- };
- struct {
- Type list_type_ : 8;
- uint16_t list_is_alive_;
- ListStorage list_;
- };
+ bool bool_value_;
+ int int_value_;
+ double double_value_;
+ std::string string_value_;
+ BlobStorage binary_value_;
+ DictStorage dict_;
+ ListStorage list_;
};
private:
- friend class ValuesTest_SizeOfValue_Test;
void InternalMoveConstructFrom(Value&& that);
void InternalCleanup();
+ // IsAlive member to debug double frees.
+ // TODO(crbug.com/859477): Remove once root cause is found.
+ uint32_t is_alive_ = kMagicIsAlive;
+
DISALLOW_COPY_AND_ASSIGN(Value);
};
diff --git base/values_unittest.cc base/values_unittest.cc
index 0a641bcc7ef4..bedacd9b1dee 100644
--- base/values_unittest.cc
+++ base/values_unittest.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include <algorithm>
#include <functional>
#include <limits>
#include <memory>
@@ -16,7 +15,6 @@
#include <vector>
#include "base/containers/adapters.h"
-#include "base/logging.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
@@ -25,43 +23,6 @@
namespace base {
-TEST(ValuesTest, SizeOfValue) {
- // Ensure that base::Value is as small as possible, i.e. that there is
- // no wasted space after the inner value due to alignment constraints.
- // Distinguish between the 'header' that includes |type_| and |is_alive_|
- // and the inner value that follows it, which can be a bool, int, double,
- // string, blob, list or dict.
-#define INNER_TYPES_LIST(X) \
- X(bool, bool_value_) \
- X(int, int_value_) \
- X(double, double_value_) \
- X(std::string, string_value_) \
- X(Value::BlobStorage, binary_value_) \
- X(Value::ListStorage, list_) \
- X(Value::DictStorage, dict_)
-
-#define INNER_STRUCT_LIMIT(type, value) offsetof(Value, value) + sizeof(type),
-
- // Return the maximum size in bytes of each inner struct inside base::Value
- size_t max_inner_struct_limit =
- std::max({INNER_TYPES_LIST(INNER_STRUCT_LIMIT)});
-
- // Ensure that base::Value is not larger than necessary, i.e. that there is
- // no un-necessary padding afte the structs due to alignment constraints of
- // one of the inner fields.
- EXPECT_EQ(max_inner_struct_limit, sizeof(Value));
- if (max_inner_struct_limit != sizeof(Value)) {
- // The following are useful to understand what's wrong when the EXPECT_EQ()
- // above actually fails.
-#define PRINT_INNER_FIELD_INFO(x, y) \
- LOG(INFO) << #y " type=" #x " size=" << sizeof(x) << " align=" << alignof(x);
-
- LOG(INFO) << "Value size=" << sizeof(Value) << " align=" << alignof(Value);
- INNER_TYPES_LIST(PRINT_INNER_FIELD_INFO)
- LOG(INFO) << "max_inner_struct_limit=" << max_inner_struct_limit;
- }
-}
-
TEST(ValuesTest, TestNothrow) {
static_assert(std::is_nothrow_move_constructible<Value>::value,
"IsNothrowMoveConstructible");

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_child_frame.cc content/browser/renderer_host/render_widget_host_view_child_frame.cc
index 5d42110bf368..146cc5c81eba 100644
index 1e2a66d449be..639bb2096cf4 100644
--- content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -652,6 +652,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
@@ -650,6 +650,7 @@ void RenderWidgetHostViewChildFrame::SubmitCompositorFrame(
"RenderWidgetHostViewChildFrame::OnSwapCompositorFrame");
support_->SubmitCompositorFrame(local_surface_id, std::move(frame),
std::move(hit_test_region_list));
@ -10,7 +10,7 @@ index 5d42110bf368..146cc5c81eba 100644
}
void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
@@ -660,6 +661,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
@@ -658,6 +659,15 @@ void RenderWidgetHostViewChildFrame::OnDidNotProduceFrame(
support_->DidNotProduceFrame(ack);
}
@ -26,7 +26,7 @@ index 5d42110bf368..146cc5c81eba 100644
void RenderWidgetHostViewChildFrame::TransformPointToRootSurface(
gfx::PointF* point) {
// This function is called by RenderWidgetHostInputEventRouter only for
@@ -845,6 +855,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
@@ -842,6 +852,11 @@ void RenderWidgetHostViewChildFrame::ShowDefinitionForSelection() {
void RenderWidgetHostViewChildFrame::SpeakSelection() {}
#endif // defined(OS_MACOSX)

View File

@ -50,7 +50,7 @@ index dbc6281ef737..e413bf418b25 100644
render_view_host_->GetMainFrame()->AllowBindings(
BINDINGS_POLICY_DOM_AUTOMATION);
diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h
index 5426d600906c..4bf4537514eb 100644
index 2960f298ff54..218743f1847c 100644
--- content/browser/web_contents/web_contents_view.h
+++ content/browser/web_contents/web_contents_view.h
@@ -24,7 +24,7 @@ struct ScreenInfo;
@ -114,7 +114,7 @@ index c917d912bbdf..36b9d9b8e3e9 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_child_frame.cc content/browser/web_contents/web_contents_view_child_frame.cc
index 7b339bf9407a..ffb0668ecf74 100644
index 1a68298648a2..a54af8a7f735 100644
--- content/browser/web_contents/web_contents_view_child_frame.cc
+++ content/browser/web_contents/web_contents_view_child_frame.cc
@@ -84,7 +84,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
@ -127,7 +127,7 @@ index 7b339bf9407a..ffb0668ecf74 100644
}
diff --git content/browser/web_contents/web_contents_view_child_frame.h content/browser/web_contents/web_contents_view_child_frame.h
index e82cced4364b..7ed27a6b39b3 100644
index 8aaa80183dd1..b9df8a87be07 100644
--- content/browser/web_contents/web_contents_view_child_frame.h
+++ content/browser/web_contents/web_contents_view_child_frame.h
@@ -40,7 +40,7 @@ class WebContentsViewChildFrame : public WebContentsView,
@ -140,7 +140,7 @@ index e82cced4364b..7ed27a6b39b3 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index 5de4d7cf8a7a..e24e5c88d8dc 100644
index 9d91d225fd9f..381b5a1743ae 100644
--- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc
@@ -69,6 +69,8 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
@ -195,7 +195,7 @@ index 5de4d7cf8a7a..e24e5c88d8dc 100644
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget(
diff --git content/browser/web_contents/web_contents_view_guest.h content/browser/web_contents/web_contents_view_guest.h
index 1f0e661628aa..f896c842ff0d 100644
index 913fbc4bb00e..731a81c72803 100644
--- content/browser/web_contents/web_contents_view_guest.h
+++ content/browser/web_contents/web_contents_view_guest.h
@@ -58,7 +58,7 @@ class WebContentsViewGuest : public WebContentsView,
@ -208,7 +208,7 @@ index 1f0e661628aa..f896c842ff0d 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
index c0c553023138..39b8fe0bd57c 100644
index be73ba6b3aca..3ba5aba86462 100644
--- content/browser/web_contents/web_contents_view_mac.h
+++ content/browser/web_contents/web_contents_view_mac.h
@@ -74,7 +74,7 @@ class WebContentsViewMac : public WebContentsView,
@ -221,10 +221,10 @@ index c0c553023138..39b8fe0bd57c 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
index 7f4308b56a14..d17b8b8ef44d 100644
index 92ac389639d8..83a2ddb344ba 100644
--- content/browser/web_contents/web_contents_view_mac.mm
+++ content/browser/web_contents/web_contents_view_mac.mm
@@ -312,7 +312,8 @@ void WebContentsViewMac::CreateView(
@@ -319,7 +319,8 @@ void WebContentsViewMac::CreateView(
}
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@ -234,7 +234,7 @@ index 7f4308b56a14..d17b8b8ef44d 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -324,6 +325,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -331,6 +332,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
render_widget_host->GetView());
}
@ -266,10 +266,10 @@ index bf2226b53dd7..782a320ab788 100644
// a BrowserPlugin even when we are using cross process frames for guests. It
// should be removed after resolving https://crbug.com/642826).
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 7a1f8c1caffd..a6bff0e50a04 100644
index 5bc11895ea38..656fa0f62114 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
@@ -208,6 +208,8 @@ void MimeHandlerViewGuest::CreateWebContents(
@@ -211,6 +211,8 @@ void MimeHandlerViewGuest::CreateWebContents(
WebContents::CreateParams params(browser_context(),
guest_site_instance.get());
params.guest_delegate = this;
@ -278,7 +278,7 @@ index 7a1f8c1caffd..a6bff0e50a04 100644
// TODO(erikchen): Fix ownership semantics for guest views.
// https://crbug.com/832879.
std::move(callback).Run(
@@ -252,6 +254,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
@@ -255,6 +257,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
return true;
}
@ -298,10 +298,10 @@ index 7a1f8c1caffd..a6bff0e50a04 100644
WebContents* source,
const content::OpenURLParams& params) {
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index cfa759b4b826..4d53d6bcc492 100644
index a0e702bdfd0c..a389ca9b948a 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -114,6 +114,10 @@ class MimeHandlerViewGuest
@@ -119,6 +119,10 @@ class MimeHandlerViewGuest
bool ZoomPropagatesFromEmbedderToGuest() const final;
bool ShouldDestroyOnDetach() const final;

View File

@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 0b18059e72df..fd82d5b14efd 100644
index ca6ff2b13809..c48e65157f5b 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -166,7 +166,7 @@ declare_args() {
@@ -168,7 +168,7 @@ declare_args() {
!use_clang_coverage && !(is_android && use_order_profiling) &&
(use_lld ||
(use_gold &&
@ -11,7 +11,7 @@ index 0b18059e72df..fd82d5b14efd 100644
!(current_cpu == "x86" || current_cpu == "x64"))))
}
@@ -1696,8 +1696,6 @@ config("thin_archive") {
@@ -1709,8 +1709,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" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 809f1819b37e..697ef3f97926 100644
index f8dfe8e20824..ec6fc42d11de 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
@ -10,7 +10,7 @@ index 809f1819b37e..697ef3f97926 100644
import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni")
import("//components/feed/features.gni")
@@ -1794,6 +1795,7 @@ jumbo_split_static_library("browser") {
@@ -1812,6 +1813,7 @@ jumbo_split_static_library("browser") {
"//base:i18n",
"//base/allocator:buildflags",
"//cc",
@ -18,7 +18,7 @@ index 809f1819b37e..697ef3f97926 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2083,6 +2085,10 @@ jumbo_split_static_library("browser") {
@@ -2109,6 +2111,10 @@ jumbo_split_static_library("browser") {
]
}
@ -29,7 +29,7 @@ index 809f1819b37e..697ef3f97926 100644
if (is_android) {
sources += [
"after_startup_task_utils_android.cc",
@@ -3810,7 +3816,7 @@ jumbo_split_static_library("browser") {
@@ -3858,7 +3864,7 @@ jumbo_split_static_library("browser") {
]
}

View File

@ -24,7 +24,7 @@ index cac72c6a2fd1..2ed83a4af1b3 100644
// network quality change events.
virtual network::NetworkQualityTracker* network_quality_tracker() = 0;
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 31234258792d..36ba13242a9c 100644
index 27092f6375c4..b8ce740e4a08 100644
--- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc
@@ -665,6 +665,10 @@ BrowserProcessImpl::system_network_context_manager() {
@ -51,7 +51,7 @@ index 7168c719aa25..bae7162a539c 100644
override;
network::NetworkQualityTracker* network_quality_tracker() override;
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 6a0e84303ff0..8a902419f474 100644
index 911e49e41313..eecbca982a92 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/features.gni")
@ -62,7 +62,7 @@ index 6a0e84303ff0..8a902419f474 100644
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
import("//components/feature_engagement/features.gni")
@@ -349,6 +350,10 @@ jumbo_split_static_library("ui") {
@@ -350,6 +351,10 @@ jumbo_split_static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@ -73,7 +73,7 @@ index 6a0e84303ff0..8a902419f474 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
@@ -365,6 +370,7 @@ jumbo_split_static_library("ui") {
@@ -366,6 +371,7 @@ jumbo_split_static_library("ui") {
"//base:i18n",
"//base/allocator:buildflags",
"//cc/paint",
@ -91,7 +91,7 @@ index 6a0e84303ff0..8a902419f474 100644
deps += [ "//chrome/browser/ui/libgtkui" ]
}
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
index 62796358a2a7..8ba23a87b982 100644
index 6357cea3ca36..9ac953d5a885 100644
--- chrome/browser/ui/webui/net_export_ui.cc
+++ chrome/browser/ui/webui/net_export_ui.cc
@@ -20,14 +20,13 @@

View File

@ -71,7 +71,7 @@ index e8e76ce5b954..1dd338dd0142 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 9ab37ce7d4ca..71632ab3534e 100644
index d66a0216832f..25c5ea80cb07 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -384,7 +384,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)

View File

@ -125,10 +125,10 @@ index 989d5d02cedb..e05810db6824 100644
// If we broke out of the loop, we have found an enabled plugin.
bool enabled = i < matching_plugins.size();
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 2e90fc9add69..9d644676e15f 100644
index d007c018c95f..1c48ced4abc2 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -785,6 +785,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -807,6 +807,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@ -136,7 +136,7 @@ index 2e90fc9add69..9d644676e15f 100644
observer->IsPluginTemporarilyAllowed(identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
}
@@ -969,7 +970,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -991,7 +992,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
&plugin_auth_host);
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -146,7 +146,7 @@ index 2e90fc9add69..9d644676e15f 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -978,7 +980,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1000,7 +1002,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -156,7 +156,7 @@ index 2e90fc9add69..9d644676e15f 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -988,7 +991,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1010,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@ -166,7 +166,7 @@ index 2e90fc9add69..9d644676e15f 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -996,7 +1000,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1018,7 +1022,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name));

View File

@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 80146842a974..24cbe9d80640 100644
index 245a7102ec7b..6ca00c19f881 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -4,6 +4,7 @@
@ -18,7 +18,7 @@ index 80146842a974..24cbe9d80640 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -186,6 +188,10 @@ jumbo_static_library("renderer") {
@@ -187,6 +189,10 @@ jumbo_static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index cbfea8ee06b3..125a12b9c33f 100644
index 45f0aa95dbde..83d4d5bb5eb9 100644
--- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc
@@ -98,7 +98,8 @@

View File

@ -12,42 +12,8 @@ index 864f2a5a315a..78b71d523e86 100644
public:
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
~ContentServiceManagerMainDelegate() override;
diff --git content/browser/renderer_host/input/mouse_wheel_phase_handler.h content/browser/renderer_host/input/mouse_wheel_phase_handler.h
index fc252b6ceffd..b0dfd847ec03 100644
--- content/browser/renderer_host/input/mouse_wheel_phase_handler.h
+++ content/browser/renderer_host/input/mouse_wheel_phase_handler.h
@@ -7,6 +7,7 @@
#include "base/timer/timer.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
+#include "content/common/content_export.h"
#include "content/public/common/input_event_ack_state.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
@@ -55,7 +56,7 @@ enum class FirstScrollUpdateAckState {
// The MouseWheelPhaseHandler is responsible for adding the proper phase to
// wheel events. Phase information is necessary for wheel scrolling since it
// shows the start and end of a scrolling sequence.
-class MouseWheelPhaseHandler {
+class CONTENT_EXPORT MouseWheelPhaseHandler {
public:
MouseWheelPhaseHandler(RenderWidgetHostViewBase* const host_view);
~MouseWheelPhaseHandler() {}
diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h
index 886bdf0edf8f..1d714000cce5 100644
--- content/common/content_switches_internal.h
+++ content/common/content_switches_internal.h
@@ -15,7 +15,7 @@ class CommandLine;
namespace content {
-bool IsPinchToZoomEnabled();
+CONTENT_EXPORT bool IsPinchToZoomEnabled();
blink::mojom::V8CacheOptions GetV8CacheOptions();
diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h
index 53476354343e..fd1a7a24455b 100644
index 33a2d55e47ac..1700b3df2468 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 @@
@ -68,6 +34,19 @@ index 53476354343e..fd1a7a24455b 100644
public:
explicit SyntheticGestureTargetBase(RenderWidgetHostImpl* host);
~SyntheticGestureTargetBase() override;
diff --git content/common/content_switches_internal.h content/common/content_switches_internal.h
index 886bdf0edf8f..1d714000cce5 100644
--- content/common/content_switches_internal.h
+++ content/common/content_switches_internal.h
@@ -15,7 +15,7 @@ class CommandLine;
namespace content {
-bool IsPinchToZoomEnabled();
+CONTENT_EXPORT bool IsPinchToZoomEnabled();
blink::mojom::V8CacheOptions GetV8CacheOptions();
diff --git third_party/blink/renderer/controller/BUILD.gn third_party/blink/renderer/controller/BUILD.gn
index 65c03e2a2f7d..f44826c38236 100644
--- third_party/blink/renderer/controller/BUILD.gn

View File

@ -53,7 +53,7 @@ index 2eb7f21919fd..4218d3352d70 100644
}
#endif
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
index e877397f869b..d3040b01cf6a 100644
index be77d0e074e9..949873b9bb22 100644
--- chrome/browser/ui/views/frame/browser_root_view.cc
+++ chrome/browser/ui/views/frame/browser_root_view.cc
@@ -70,7 +70,7 @@ void OnFindURLMimeType(const GURL& url,
@ -66,10 +66,10 @@ index e877397f869b..d3040b01cf6a 100644
}
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 48b56d92a82a..06d463660a94 100644
index 1e912186c32c..38d03aafc8b0 100644
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -348,12 +348,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
@@ -308,12 +308,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
@ -81,23 +81,15 @@ index 48b56d92a82a..06d463660a94 100644
- "picked for this navigation.";
static_assert(WILL_FAIL_REQUEST < WILL_PROCESS_RESPONSE,
"WillFailRequest state should come before WillProcessResponse");
return render_frame_host_;
return navigation_request_->render_frame_host();
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index 2d6227362f32..4aa419238e94 100644
index 21f84cc3f922..020017584cd9 100644
--- content/browser/frame_host/render_frame_host_impl.cc
+++ content/browser/frame_host/render_frame_host_impl.cc
@@ -2125,6 +2125,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (GetNavigationHandle()) {
GetNavigationHandle()->set_net_error_code(
static_cast<net::Error>(params.error_code));
+ GetNavigationHandle()->set_render_frame_host(this);
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -4741,9 +4742,9 @@ void RenderFrameHostImpl::CommitNavigation(
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService) ||
base::FeatureList::IsEnabled(
blink::features::kServiceWorkerServicification));
@@ -4777,9 +4777,9 @@ void RenderFrameHostImpl::CommitNavigation(
// factories. TODO(kinuko): Consider setting this up only when prefetch
// is used. Currently we have this here to make sure we have non-racy
// situation (https://crbug.com/849929).
- auto* storage_partition = static_cast<StoragePartitionImpl*>(
+ auto* storage_partition =
BrowserContext::GetStoragePartition(
@ -107,7 +99,7 @@ index 2d6227362f32..4aa419238e94 100644
FROM_HERE, {BrowserThread::IO},
base::BindOnce(&PrefetchURLLoaderService::GetFactory,
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index e17622d6221a..a44c7d6a577d 100644
index 09095ba2dc8e..2fb0becabf88 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -704,6 +704,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
@ -142,7 +134,7 @@ index 641c7bcbf1b8..3faf6a6452c4 100644
const std::string& mime_type,
bool* found,
diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc
index 3b788c4a564d..7f16dccdb712 100644
index 31aa4bc38442..0314343499d3 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -510,8 +510,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
@ -263,10 +255,10 @@ index 3009401dac6b..b4c5a9e2db50 100644
};
diff --git content/common/frame_messages.h content/common/frame_messages.h
index b48fee6e264a..24665ed6fe07 100644
index f1b940d02a3e..7ba4495c34b0 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1349,9 +1349,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -1319,9 +1319,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.
@ -303,7 +295,7 @@ index 3b610b1f554e..7c439e060779 100644
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index 0bca8dc6a55e..bd40da8b5396 100644
index 3b5c53a10c8d..bb56c4ed5c77 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -73,6 +73,9 @@ class CONTENT_EXPORT ContentRendererClient {
@ -316,7 +308,7 @@ index 0bca8dc6a55e..bd40da8b5396 100644
// Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -328,6 +331,10 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -333,6 +336,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
@ -328,10 +320,10 @@ index 0bca8dc6a55e..bd40da8b5396 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
index 8136604d267a..be7fde2f1a38 100644
index c9ce48e3c3ec..0a3448b194a3 100644
--- content/public/renderer/render_frame_observer.h
+++ content/public/renderer/render_frame_observer.h
@@ -161,6 +161,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -193,6 +193,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
virtual void DidReceiveTransferSizeUpdate(int resource_id,
int received_data_length) {}
@ -342,10 +334,10 @@ index 8136604d267a..be7fde2f1a38 100644
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 104e48abf3b8..0fbdbfc44fd7 100644
index b82743edbc63..cae550657487 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -3893,7 +3893,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -3922,7 +3922,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
@ -355,7 +347,7 @@ index 104e48abf3b8..0fbdbfc44fd7 100644
params.mime_type.Utf8(), &found, &info, &mime_type));
if (!found)
return nullptr;
@@ -4276,6 +4277,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
@@ -4340,6 +4341,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
void RenderFrameImpl::FrameFocused() {
Send(new FrameHostMsg_FrameFocused(routing_id_));
@ -365,10 +357,10 @@ index 104e48abf3b8..0fbdbfc44fd7 100644
void RenderFrameImpl::WillCommitProvisionalLoad() {
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index b5669f996bb7..6c51c2e6699a 100644
index 9d029d4ee65b..d5aff5825371 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -819,6 +819,8 @@ void RenderThreadImpl::Init() {
@@ -806,6 +806,8 @@ void RenderThreadImpl::Init() {
StartServiceManagerConnection();
@ -378,12 +370,12 @@ index b5669f996bb7..6c51c2e6699a 100644
base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 6fa35ba65753..eb9731d0ea48 100644
index 1277a3b2c1e4..9e62e5ce6dd6 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -1082,6 +1082,14 @@ void RendererBlinkPlatformImpl::SetMemoryPressureNotificationsSuppressed(
base::MemoryPressureListener::SetNotificationsSuppressed(suppressed);
}
@@ -1070,6 +1070,14 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
//------------------------------------------------------------------------------
+void RendererBlinkPlatformImpl::DevToolsAgentAttached() {
+ GetContentClient()->renderer()->DevToolsAgentAttached();
@ -397,12 +389,12 @@ index 6fa35ba65753..eb9731d0ea48 100644
if (!web_database_host_) {
web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create(
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index e3d39d775eff..7e75b0267c11 100644
index 38ff3be90843..6514d37afe00 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -237,6 +237,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
void RequestPurgeMemory() override;
void SetMemoryPressureNotificationsSuppressed(bool suppressed) override;
@@ -235,6 +235,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
std::unique_ptr<blink::WebDataConsumerHandle> CreateDataConsumerHandle(
mojo::ScopedDataPipeConsumerHandle handle) override;
+ void DevToolsAgentAttached() override;
+ void DevToolsAgentDetached() override;

View File

@ -241,7 +241,7 @@ index 6e95af6ca7f5..061fb189d60f 100644
extern void InitCrashKeysForTesting();
diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc
index b3b09cee8d6f..4bc2afc7bd6e 100644
index c3c3f9db07d4..c532a5a46740 100644
--- components/crash/content/app/crash_reporter_client.cc
+++ components/crash/content/app/crash_reporter_client.cc
@@ -88,7 +88,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@ -300,7 +300,7 @@ index b3b09cee8d6f..4bc2afc7bd6e 100644
+#endif
+
#if defined(OS_ANDROID)
unsigned int CrashReporterClient::GetCrashDumpPercentageForWebView() {
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
@@ -194,9 +222,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
return false;
@ -318,7 +318,7 @@ index b3b09cee8d6f..4bc2afc7bd6e 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h
index caebf67a7e0f..5e7cf3d8c1a6 100644
index 1d35caa36716..7b96fb687b98 100644
--- components/crash/content/app/crash_reporter_client.h
+++ components/crash/content/app/crash_reporter_client.h
@@ -5,7 +5,9 @@
@ -388,10 +388,10 @@ index caebf67a7e0f..5e7cf3d8c1a6 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
index 72c9703b692d..6f0464a78012 100644
index 5eba3742684b..9bc66b0dbfb9 100644
--- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc
@@ -151,7 +151,8 @@ void InitializeCrashpadImpl(bool initial_client,
@@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client,
// fallback. Forwarding is turned off for debug-mode builds even for the
// browser process, because the system's crash reporter can take a very long
// time to chew on symbols.
@ -598,10 +598,10 @@ index cc16c40ea320..3bb03459adf4 100644
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index 8dd06415ce2f..b809cf14d9d1 100644
index d47b0305167e..d5941ed0e2af 100644
--- content/browser/frame_host/debug_urls.cc
+++ content/browser/frame_host/debug_urls.cc
@@ -135,7 +135,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
@@ -136,7 +136,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {
cc::switches::kEnableGpuBenchmarking) &&
(PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_TYPED));

View File

@ -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 32d4d6c11a15..7c1b1a344831 100644
index b22ab2c4b912..223e43e910d7 100644
--- third_party/crashpad/crashpad/handler/BUILD.gn
+++ third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,7 @@
@ -156,8 +156,8 @@ index 32d4d6c11a15..7c1b1a344831 100644
+import("//cef/libcef/features/features.gni")
import("../build/crashpad_buildconfig.gni")
static_library("handler") {
@@ -65,6 +66,17 @@ static_library("handler") {
if (crashpad_is_in_chromium) {
@@ -69,6 +70,17 @@ static_library("handler") {
]
}
@ -175,7 +175,7 @@ index 32d4d6c11a15..7c1b1a344831 100644
public_configs = [ "..:crashpad_config" ]
public_deps = [
@@ -77,6 +89,7 @@ static_library("handler") {
@@ -81,6 +93,7 @@ static_library("handler") {
"../minidump",
"../snapshot",
"../tools:tool_support",
@ -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 b3e0a68a1c0a..087a4e4c6b9c 100644
index 31686b3eb899..f361f5759976 100644
--- third_party/crashpad/crashpad/handler/handler_main.cc
+++ third_party/crashpad/crashpad/handler/handler_main.cc
@@ -36,8 +36,10 @@
@ -283,7 +283,7 @@ index b3e0a68a1c0a..087a4e4c6b9c 100644
};
// Splits |key_value| on '=' and inserts the resulting key and value into |map|.
@@ -541,6 +550,9 @@ int HandlerMain(int argc,
@@ -553,6 +562,9 @@ int HandlerMain(int argc,
kOptionSanitizationInformation,
#endif
kOptionURL,
@ -293,7 +293,7 @@ index b3e0a68a1c0a..087a4e4c6b9c 100644
// Standard options.
kOptionHelp = -2,
@@ -602,6 +614,9 @@ int HandlerMain(int argc,
@@ -614,6 +626,9 @@ int HandlerMain(int argc,
{"url", required_argument, nullptr, kOptionURL},
{"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion},
@ -303,7 +303,7 @@ index b3e0a68a1c0a..087a4e4c6b9c 100644
{nullptr, 0, nullptr, 0},
};
@@ -737,6 +752,27 @@ int HandlerMain(int argc,
@@ -749,6 +764,27 @@ int HandlerMain(int argc,
options.url = optarg;
break;
}
@ -331,7 +331,7 @@ index b3e0a68a1c0a..087a4e4c6b9c 100644
case kOptionHelp: {
Usage(me);
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
@@ -851,8 +887,14 @@ int HandlerMain(int argc,
@@ -863,8 +899,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 b3e0a68a1c0a..087a4e4c6b9c 100644
upload_thread.Get()->Start();
}
@@ -880,7 +922,8 @@ int HandlerMain(int argc,
@@ -892,7 +934,8 @@ int HandlerMain(int argc,
ScopedStoppable prune_thread;
if (options.periodic_tasks) {
prune_thread.Reset(new PruneCrashReportThread(

View File

@ -27,10 +27,10 @@ index 9e81f0a33ede..b796e79ae7ef 100644
auto* browser_context = web_contents->GetBrowserContext();
diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc
index 11643f592dee..687e9da19789 100644
index cc7c7b4ffab5..24cab4f980a5 100644
--- content/browser/frame_host/render_frame_host_manager.cc
+++ content/browser/frame_host/render_frame_host_manager.cc
@@ -955,10 +955,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
@@ -967,10 +967,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
// TODO(alexmos): This check should've been enforced earlier in the
// navigation, in chrome::Navigate(). Verify this, and then convert this to
// a CHECK and remove the fallback.
@ -46,7 +46,7 @@ index 11643f592dee..687e9da19789 100644
return true;
}
@@ -1097,7 +1098,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
@@ -1109,7 +1110,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
// Double-check that the new SiteInstance is associated with the right
// BrowserContext.
@ -57,10 +57,10 @@ index 11643f592dee..687e9da19789 100644
// If |new_instance| is a new SiteInstance for a subframe that requires a
// dedicated process, set its process reuse policy so that such subframes are
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index a013031c6e2a..d43890a109e9 100644
index 7fc0a70f4e79..96a887d5e8e5 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -456,6 +456,13 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -460,6 +460,13 @@ class CONTENT_EXPORT ContentBrowserClient {
// Returns true if error page should be isolated in its own process.
virtual bool ShouldIsolateErrorPage(bool in_main_frame);
@ -74,7 +74,7 @@ index a013031c6e2a..d43890a109e9 100644
// Returns true if the passed in URL should be assigned as the site of the
// current SiteInstance, if it does not yet have a site.
virtual bool ShouldAssignSiteForURL(const GURL& url);
@@ -1461,6 +1468,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1491,6 +1498,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct() const;
@ -230,10 +230,10 @@ index 93dce1cad08c..fdb7ad2193d7 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 30847850a812..9b59574c1bf1 100644
index 14fa00f41564..9487425a5627 100644
--- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc
@@ -382,9 +382,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
@@ -383,9 +383,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id();

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/browser_compositor_output_surface.cc content/browser/compositor/browser_compositor_output_surface.cc
index d96efe91eea8..1345025b6fd8 100644
index 0a1231d4e16c..11e1cbc521d4 100644
--- content/browser/compositor/browser_compositor_output_surface.cc
+++ content/browser/compositor/browser_compositor_output_surface.cc
@@ -62,6 +62,10 @@ void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) {
@@ -53,6 +53,10 @@ void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) {
OnReflectorChanged();
}
@ -14,10 +14,10 @@ index d96efe91eea8..1345025b6fd8 100644
}
diff --git content/browser/compositor/browser_compositor_output_surface.h content/browser/compositor/browser_compositor_output_surface.h
index 941d70bd2a7e..ef14a7dd7d4f 100644
index 3c4d448b972f..fa3f01f59484 100644
--- content/browser/compositor/browser_compositor_output_surface.h
+++ content/browser/compositor/browser_compositor_output_surface.h
@@ -41,6 +41,8 @@ class CONTENT_EXPORT BrowserCompositorOutputSurface
@@ -40,6 +40,8 @@ class CONTENT_EXPORT BrowserCompositorOutputSurface
void SetReflector(ReflectorImpl* reflector);
@ -27,7 +27,7 @@ index 941d70bd2a7e..ef14a7dd7d4f 100644
virtual void OnReflectorChanged();
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index bc1934e2c7b4..c139815caa52 100644
index 4768ac1a3bac..9432533a3db2 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -209,6 +209,18 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
@ -49,7 +49,7 @@ index bc1934e2c7b4..c139815caa52 100644
std::unique_ptr<viz::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
gfx::AcceleratedWidget widget,
@@ -451,11 +463,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
@@ -452,11 +464,20 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// surfaces as they are not following the correct mode.
DisableGpuCompositing(compositor.get());
}
@ -73,7 +73,7 @@ index bc1934e2c7b4..c139815caa52 100644
} else {
DCHECK(context_provider);
const auto& capabilities = context_provider->ContextCapabilities();
@@ -463,7 +484,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
@@ -464,7 +485,8 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
display_output_surface =
std::make_unique<OffscreenBrowserCompositorOutputSurface>(
context_provider, std::move(vsync_callback),
@ -83,7 +83,7 @@ index bc1934e2c7b4..c139815caa52 100644
} else if (capabilities.surfaceless) {
#if defined(OS_MACOSX)
const auto& gpu_feature_info = context_provider->GetGpuFeatureInfo();
@@ -908,7 +930,8 @@ GpuProcessTransportFactory::CreatePerCompositorData(
@@ -909,7 +931,8 @@ GpuProcessTransportFactory::CreatePerCompositorData(
gfx::AcceleratedWidget widget = compositor->widget();
auto data = std::make_unique<PerCompositorData>();
@ -106,7 +106,7 @@ index 4c4548058be5..335099597a9d 100644
// ImageTransportFactory implementation.
void DisableGpuCompositing() override;
diff --git content/browser/compositor/offscreen_browser_compositor_output_surface.cc content/browser/compositor/offscreen_browser_compositor_output_surface.cc
index ac661d7e0234..0059e9123e99 100644
index e719683c37e9..a51294913fc4 100644
--- content/browser/compositor/offscreen_browser_compositor_output_surface.cc
+++ content/browser/compositor/offscreen_browser_compositor_output_surface.cc
@@ -34,10 +34,12 @@ OffscreenBrowserCompositorOutputSurface::
@ -254,7 +254,7 @@ index ac661d7e0234..0059e9123e99 100644
if (fbo_) {
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo_);
gl->DeleteFramebuffers(1, &fbo_);
@@ -126,15 +172,20 @@ void OffscreenBrowserCompositorOutputSurface::Reshape(
@@ -124,15 +170,20 @@ void OffscreenBrowserCompositorOutputSurface::Reshape(
}
void OffscreenBrowserCompositorOutputSurface::BindFramebuffer() {
@ -279,7 +279,7 @@ index ac661d7e0234..0059e9123e99 100644
}
}
@@ -155,6 +206,12 @@ void OffscreenBrowserCompositorOutputSurface::SwapBuffers(
@@ -153,6 +204,12 @@ void OffscreenBrowserCompositorOutputSurface::SwapBuffers(
// The original implementation had a flickering issue (crbug.com/515332).
gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
@ -292,7 +292,7 @@ index ac661d7e0234..0059e9123e99 100644
gpu::SyncToken sync_token;
gl->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData());
context_provider_->ContextSupport()->SignalSyncToken(
@@ -194,7 +251,9 @@ void OffscreenBrowserCompositorOutputSurface::OnSwapBuffersComplete(
@@ -192,7 +249,9 @@ void OffscreenBrowserCompositorOutputSurface::OnSwapBuffersComplete(
const std::vector<ui::LatencyInfo>& latency_info) {
latency_tracker_.OnGpuSwapBuffersCompleted(latency_info);
client_->DidReceiveSwapBuffersAck();
@ -302,12 +302,12 @@ index ac661d7e0234..0059e9123e99 100644
+ client_->DidReceivePresentationFeedback(feedback);
}
#if BUILDFLAG(ENABLE_VULKAN)
unsigned OffscreenBrowserCompositorOutputSurface::UpdateGpuFence() {
diff --git content/browser/compositor/offscreen_browser_compositor_output_surface.h content/browser/compositor/offscreen_browser_compositor_output_surface.h
index b028dc136e7f..fa83865087dc 100644
index 71830777ae56..6a0857b02a04 100644
--- content/browser/compositor/offscreen_browser_compositor_output_surface.h
+++ content/browser/compositor/offscreen_browser_compositor_output_surface.h
@@ -32,7 +32,8 @@ class OffscreenBrowserCompositorOutputSurface
@@ -31,7 +31,8 @@ class OffscreenBrowserCompositorOutputSurface
scoped_refptr<ws::ContextProviderCommandBuffer> context,
const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
std::unique_ptr<viz::CompositorOverlayCandidateValidator>
@ -317,7 +317,7 @@ index b028dc136e7f..fa83865087dc 100644
~OffscreenBrowserCompositorOutputSurface() override;
@@ -54,6 +55,8 @@ class OffscreenBrowserCompositorOutputSurface
@@ -53,11 +54,15 @@ class OffscreenBrowserCompositorOutputSurface
gfx::BufferFormat GetOverlayBufferFormat() const override;
uint32_t GetFramebufferCopyTextureFormat() override;
@ -326,8 +326,6 @@ index b028dc136e7f..fa83865087dc 100644
// BrowserCompositorOutputSurface implementation.
void OnReflectorChanged() override;
@@ -63,6 +66,8 @@ class OffscreenBrowserCompositorOutputSurface
unsigned UpdateGpuFence() override;
+ void NotifyRenderHost(const std::vector<ui::LatencyInfo>& latency_info);
@ -335,7 +333,7 @@ index b028dc136e7f..fa83865087dc 100644
void OnSwapBuffersComplete(const std::vector<ui::LatencyInfo>& latency_info);
viz::OutputSurfaceClient* client_ = nullptr;
@@ -70,6 +75,11 @@ class OffscreenBrowserCompositorOutputSurface
@@ -65,6 +70,11 @@ class OffscreenBrowserCompositorOutputSurface
uint32_t fbo_ = 0;
bool reflector_changed_ = false;
std::unique_ptr<ReflectorTexture> reflector_texture_;
@ -348,10 +346,10 @@ index b028dc136e7f..fa83865087dc 100644
base::WeakPtrFactory<OffscreenBrowserCompositorOutputSurface>
weak_ptr_factory_;
diff --git gpu/GLES2/gl2chromium_autogen.h gpu/GLES2/gl2chromium_autogen.h
index 3065b8b9ea47..ba39222f3d87 100644
index 404c05cee78b..d2ce3e8de6e9 100644
--- gpu/GLES2/gl2chromium_autogen.h
+++ gpu/GLES2/gl2chromium_autogen.h
@@ -414,6 +414,10 @@
@@ -416,6 +416,10 @@
GLES2_GET_FUN(CreateClientGpuFenceCHROMIUM)
#define glWaitGpuFenceCHROMIUM GLES2_GET_FUN(WaitGpuFenceCHROMIUM)
#define glDestroyGpuFenceCHROMIUM GLES2_GET_FUN(DestroyGpuFenceCHROMIUM)
@ -363,10 +361,10 @@ index 3065b8b9ea47..ba39222f3d87 100644
GLES2_GET_FUN(InvalidateReadbackBufferShadowDataCHROMIUM)
#define glFramebufferTextureMultiviewLayeredANGLE \
diff --git gpu/command_buffer/build_gles2_cmd_buffer.py gpu/command_buffer/build_gles2_cmd_buffer.py
index 7fe7fed028b5..c6f8ee684dc9 100755
index 4032b2491109..02639f9b2080 100755
--- gpu/command_buffer/build_gles2_cmd_buffer.py
+++ gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -4244,6 +4244,35 @@ _FUNCTION_INFO = {
@@ -4254,6 +4254,35 @@ _FUNCTION_INFO = {
'extension': 'CHROMIUM_gpu_fence',
'extension_flag': 'chromium_gpu_fence',
},
@ -403,10 +401,10 @@ index 7fe7fed028b5..c6f8ee684dc9 100755
'decoder_func': 'DoUnpremultiplyAndDitherCopyCHROMIUM',
'cmd_args': 'GLuint source_id, GLuint dest_id, GLint x, GLint y, '
diff --git gpu/command_buffer/client/gles2_c_lib_autogen.h gpu/command_buffer/client/gles2_c_lib_autogen.h
index ca386c64990c..0adac90e4437 100644
index b68942087179..2248762fcd77 100644
--- gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1899,6 +1899,20 @@ void GL_APIENTRY GLES2WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) {
@@ -1909,6 +1909,20 @@ void GL_APIENTRY GLES2WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) {
void GL_APIENTRY GLES2DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
gles2::GetGLContext()->DestroyGpuFenceCHROMIUM(gpu_fence_id);
}
@ -427,7 +425,7 @@ index ca386c64990c..0adac90e4437 100644
void GL_APIENTRY
GLES2InvalidateReadbackBufferShadowDataCHROMIUM(GLuint buffer_id) {
gles2::GetGLContext()->InvalidateReadbackBufferShadowDataCHROMIUM(buffer_id);
@@ -3411,6 +3425,22 @@ extern const NameToFunc g_gles2_function_table[] = {
@@ -3434,6 +3448,22 @@ extern const NameToFunc g_gles2_function_table[] = {
"glDestroyGpuFenceCHROMIUM",
reinterpret_cast<GLES2FunctionPointer>(glDestroyGpuFenceCHROMIUM),
},
@ -451,10 +449,10 @@ index ca386c64990c..0adac90e4437 100644
"glInvalidateReadbackBufferShadowDataCHROMIUM",
reinterpret_cast<GLES2FunctionPointer>(
diff --git gpu/command_buffer/client/gles2_cmd_helper_autogen.h gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index e0c0ca8e93fb..2998690b8bf8 100644
index 02f89cdad67c..a2da1b7c518a 100644
--- gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -3508,6 +3508,42 @@ void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
@@ -3521,6 +3521,42 @@ void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
}
}
@ -498,10 +496,10 @@ index e0c0ca8e93fb..2998690b8bf8 100644
GLint shm_id,
GLuint shm_offset,
diff --git gpu/command_buffer/client/gles2_implementation.cc gpu/command_buffer/client/gles2_implementation.cc
index 3f15a8c2ceb5..6305875463f7 100644
index 985e6324567b..d2e067f28521 100644
--- gpu/command_buffer/client/gles2_implementation.cc
+++ gpu/command_buffer/client/gles2_implementation.cc
@@ -7651,6 +7651,22 @@ void GLES2Implementation::Viewport(GLint x,
@@ -7680,6 +7680,22 @@ void GLES2Implementation::Viewport(GLint x,
CheckGLError();
}
@ -525,10 +523,10 @@ index 3f15a8c2ceb5..6305875463f7 100644
GLuint id,
uint32_t sync_data_shm_id,
diff --git gpu/command_buffer/client/gles2_implementation_autogen.h gpu/command_buffer/client/gles2_implementation_autogen.h
index 60200cb39bdc..d6b603fde369 100644
index 6882d12a79c4..b237ee953860 100644
--- gpu/command_buffer/client/gles2_implementation_autogen.h
+++ gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1338,6 +1338,16 @@ void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
@@ -1345,6 +1345,16 @@ void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
@ -546,10 +544,10 @@ index 60200cb39bdc..d6b603fde369 100644
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
diff --git gpu/command_buffer/client/gles2_implementation_impl_autogen.h gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index bfbcd6b7741c..9a461a9cc321 100644
index 13b36769ae3d..d2351bb96021 100644
--- gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -3751,6 +3751,30 @@ void GLES2Implementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
@@ -3790,6 +3790,30 @@ void GLES2Implementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
CheckGLError();
}
@ -581,10 +579,10 @@ index bfbcd6b7741c..9a461a9cc321 100644
GLenum target,
GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_autogen.h gpu/command_buffer/client/gles2_interface_autogen.h
index 9daed65b7658..692e72c651a4 100644
index 2071473f0da8..77a29e65cafd 100644
--- gpu/command_buffer/client/gles2_interface_autogen.h
+++ gpu/command_buffer/client/gles2_interface_autogen.h
@@ -1004,6 +1004,12 @@ virtual GLuint CreateGpuFenceCHROMIUM() = 0;
@@ -1010,6 +1010,12 @@ virtual GLuint CreateGpuFenceCHROMIUM() = 0;
virtual GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) = 0;
virtual void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
virtual void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) = 0;
@ -598,10 +596,10 @@ index 9daed65b7658..692e72c651a4 100644
virtual void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_stub_autogen.h gpu/command_buffer/client/gles2_interface_stub_autogen.h
index 35b35b1684cd..320a9661ca63 100644
index 158134cf608e..2990494dcc5e 100644
--- gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -974,6 +974,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
@@ -980,6 +980,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
@ -615,10 +613,10 @@ index 35b35b1684cd..320a9661ca63 100644
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
GLenum attachment,
diff --git gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
index bb14269b85c1..22330e480b6a 100644
index 29d079725c72..444c60df71a4 100644
--- gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -1296,6 +1296,14 @@ GLuint GLES2InterfaceStub::CreateClientGpuFenceCHROMIUM(
@@ -1303,6 +1303,14 @@ GLuint GLES2InterfaceStub::CreateClientGpuFenceCHROMIUM(
}
void GLES2InterfaceStub::WaitGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
void GLES2InterfaceStub::DestroyGpuFenceCHROMIUM(GLuint /* gpu_fence_id */) {}
@ -634,10 +632,10 @@ index bb14269b85c1..22330e480b6a 100644
GLuint /* buffer_id */) {}
void GLES2InterfaceStub::FramebufferTextureMultiviewLayeredANGLE(
diff --git gpu/command_buffer/client/gles2_trace_implementation_autogen.h gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 428d60ef0af5..ec6792d5bb07 100644
index 7e94db26455d..d9de7879ea9a 100644
--- gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -974,6 +974,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
@@ -980,6 +980,12 @@ GLuint CreateGpuFenceCHROMIUM() override;
GLuint CreateClientGpuFenceCHROMIUM(ClientGpuFence source) override;
void WaitGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
void DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) override;
@ -651,10 +649,10 @@ index 428d60ef0af5..ec6792d5bb07 100644
void FramebufferTextureMultiviewLayeredANGLE(GLenum target,
GLenum attachment,
diff --git gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
index b14f102a33ae..5e6dd209e3ad 100644
index 4b7932e147b0..b0f5f2cafae3 100644
--- gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2734,6 +2734,28 @@ void GLES2TraceImplementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
@@ -2747,6 +2747,28 @@ void GLES2TraceImplementation::DestroyGpuFenceCHROMIUM(GLuint gpu_fence_id) {
gl_->DestroyGpuFenceCHROMIUM(gpu_fence_id);
}
@ -684,10 +682,10 @@ index b14f102a33ae..5e6dd209e3ad 100644
GLuint buffer_id) {
TRACE_EVENT_BINARY_EFFICIENT0(
diff --git gpu/command_buffer/common/gles2_cmd_format_autogen.h gpu/command_buffer/common/gles2_cmd_format_autogen.h
index 41836d0a4a4f..ef29fcc644b1 100644
index 68d9861198e0..98e8772b2993 100644
--- gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -17261,6 +17261,193 @@ static_assert(offsetof(DestroyGpuFenceCHROMIUM, header) == 0,
@@ -17336,6 +17336,193 @@ static_assert(offsetof(DestroyGpuFenceCHROMIUM, header) == 0,
static_assert(offsetof(DestroyGpuFenceCHROMIUM, gpu_fence_id) == 4,
"offset of DestroyGpuFenceCHROMIUM gpu_fence_id should be 4");
@ -882,10 +880,10 @@ index 41836d0a4a4f..ef29fcc644b1 100644
typedef SetReadbackBufferShadowAllocationINTERNAL ValueType;
static const CommandId kCmdId = kSetReadbackBufferShadowAllocationINTERNAL;
diff --git gpu/command_buffer/common/gles2_cmd_format_test_autogen.h gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index 23dbbe72f2ff..321dca6d026c 100644
index 790e72622c7d..bf87d86d9386 100644
--- gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -5701,6 +5701,52 @@ TEST_F(GLES2FormatTest, DestroyGpuFenceCHROMIUM) {
@@ -5721,6 +5721,52 @@ TEST_F(GLES2FormatTest, DestroyGpuFenceCHROMIUM) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
@ -939,28 +937,27 @@ index 23dbbe72f2ff..321dca6d026c 100644
cmds::SetReadbackBufferShadowAllocationINTERNAL& cmd =
*GetBufferAs<cmds::SetReadbackBufferShadowAllocationINTERNAL>();
diff --git gpu/command_buffer/common/gles2_cmd_ids_autogen.h gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index 1731b16d3eb2..3bf2b95d2513 100644
index b3dd9b38feba..bcb3656e4481 100644
--- gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -360,7 +360,12 @@
OP(MaxShaderCompilerThreadsKHR) /* 601 */ \
OP(CreateAndTexStorage2DSharedImageINTERNALImmediate) /* 602 */ \
OP(BeginSharedImageAccessDirectCHROMIUM) /* 603 */ \
- OP(EndSharedImageAccessDirectCHROMIUM) /* 604 */
+ OP(EndSharedImageAccessDirectCHROMIUM) /* 604 */ \
+ OP(CreateSharedTexture) /* 605 */ \
+ OP(LockSharedTexture) /* 606 */ \
+ OP(UnlockSharedTexture) /* 607 */ \
+ OP(DeleteSharedTexture) /* 608 */
+
@@ -361,7 +361,11 @@
OP(MaxShaderCompilerThreadsKHR) /* 602 */ \
OP(CreateAndTexStorage2DSharedImageINTERNALImmediate) /* 603 */ \
OP(BeginSharedImageAccessDirectCHROMIUM) /* 604 */ \
- OP(EndSharedImageAccessDirectCHROMIUM) /* 605 */
+ OP(EndSharedImageAccessDirectCHROMIUM) /* 605 */ \
+ OP(CreateSharedTexture) /* 606 */ \
+ OP(LockSharedTexture) /* 607 */ \
+ OP(UnlockSharedTexture) /* 608 */ \
+ OP(DeleteSharedTexture) /* 609 */
enum CommandId {
kOneBeforeStartPoint =
diff --git gpu/command_buffer/gles2_cmd_buffer_functions.txt gpu/command_buffer/gles2_cmd_buffer_functions.txt
index a0227387cf62..da714ca81b62 100644
index aa55852d05dd..4638d070c48c 100644
--- gpu/command_buffer/gles2_cmd_buffer_functions.txt
+++ gpu/command_buffer/gles2_cmd_buffer_functions.txt
@@ -416,6 +416,12 @@ GL_APICALL GLuint GL_APIENTRY glCreateClientGpuFenceCHROMIUM (ClientGpuFen
@@ -417,6 +417,12 @@ GL_APICALL GLuint GL_APIENTRY glCreateClientGpuFenceCHROMIUM (ClientGpuFen
GL_APICALL void GL_APIENTRY glWaitGpuFenceCHROMIUM (GLuint gpu_fence_id);
GL_APICALL void GL_APIENTRY glDestroyGpuFenceCHROMIUM (GLuint gpu_fence_id);
@ -974,10 +971,10 @@ index a0227387cf62..da714ca81b62 100644
GL_APICALL void GL_APIENTRY glInvalidateReadbackBufferShadowDataCHROMIUM (GLidBuffer buffer_id);
// (used for CHROMIUM_nonblocking_readback implementation)
diff --git gpu/command_buffer/service/BUILD.gn gpu/command_buffer/service/BUILD.gn
index 24c15709c327..36264c1665ff 100644
index 6955858281e7..045dee3185bf 100644
--- gpu/command_buffer/service/BUILD.gn
+++ gpu/command_buffer/service/BUILD.gn
@@ -106,6 +106,8 @@ target(link_target_type, "gles2_sources") {
@@ -107,6 +107,8 @@ target(link_target_type, "gles2_sources") {
visibility = [ "//gpu/*" ]
sources = [
@ -987,7 +984,7 @@ index 24c15709c327..36264c1665ff 100644
"buffer_manager.cc",
"buffer_manager.h",
diff --git gpu/command_buffer/service/gles2_cmd_decoder.cc gpu/command_buffer/service/gles2_cmd_decoder.cc
index e3f5d83ca54f..67e1bdee5068 100644
index d7197fe6455c..bfb072283725 100644
--- gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -38,6 +38,7 @@
@ -998,7 +995,7 @@ index e3f5d83ca54f..67e1bdee5068 100644
#include "gpu/command_buffer/common/debug_marker_manager.h"
#include "gpu/command_buffer/common/gles2_cmd_format.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
@@ -909,6 +910,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
@@ -916,6 +917,13 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
return group_->mailbox_manager();
}
@ -1012,7 +1009,7 @@ index e3f5d83ca54f..67e1bdee5068 100644
ImageManager* image_manager() { return group_->image_manager(); }
VertexArrayManager* vertex_array_manager() {
@@ -2620,6 +2628,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
@@ -2643,6 +2651,8 @@ class GLES2DecoderImpl : public GLES2Decoder, public ErrorStateClient {
std::unique_ptr<VertexArrayManager> vertex_array_manager_;
@ -1021,7 +1018,7 @@ index e3f5d83ca54f..67e1bdee5068 100644
base::flat_set<scoped_refptr<Buffer>> writes_submitted_but_not_completed_;
// The format of the back buffer_
@@ -5580,6 +5590,59 @@ error::Error GLES2DecoderImpl::HandleDestroyGpuFenceCHROMIUM(
@@ -5618,6 +5628,59 @@ error::Error GLES2DecoderImpl::HandleDestroyGpuFenceCHROMIUM(
return error::kNoError;
}

View File

@ -1,8 +1,8 @@
diff --git .gn .gn
index b3587587786f..8d3ff106d714 100644
index 0591fc512d52..23d066a9254d 100644
--- .gn
+++ .gn
@@ -671,6 +671,8 @@ exec_script_whitelist =
@@ -669,6 +669,8 @@ exec_script_whitelist =
# in the Chromium repo outside of //build.
"//build_overrides/build.gni",
@ -12,10 +12,10 @@ index b3587587786f..8d3ff106d714 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index b7227438d469..c879fd3d071d 100644
index f50c9f99a36e..33be1efac8f0 100644
--- BUILD.gn
+++ BUILD.gn
@@ -188,6 +188,7 @@ group("gn_all") {
@@ -189,6 +189,7 @@ group("gn_all") {
if (!is_ios && !is_fuchsia) {
deps += [
@ -100,7 +100,7 @@ index 2c8675206f31..d3e419d8fe98 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py
index 83b5e25dfa87..65186ae4780c 100755
index 1ab7be527726..1467d18c1a81 100755
--- build/vs_toolchain.py
+++ build/vs_toolchain.py
@@ -76,11 +76,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@ -123,10 +123,10 @@ index 83b5e25dfa87..65186ae4780c 100755
# directory in order to run binaries locally, but they are needed in order
# to create isolates or the mini_installer. Copying them to the output
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index 4c790d3ee4e6..e9f3768c20d6 100644
index ca18ca7ca65b..b51ebadccd0d 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -265,7 +265,7 @@ template("chrome_paks") {
@@ -263,7 +263,7 @@ template("chrome_paks") {
}
input_locales = locales
@ -136,7 +136,7 @@ index 4c790d3ee4e6..e9f3768c20d6 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 8d19c74ebe9d..7470cc298e36 100644
index ec629333b006..981f3f26548d 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -134,7 +134,7 @@ template("generate_mini_installer") {

View File

@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids
index 6f7cfefd69ac..35ccc5b2ea15 100644
index e823c9b9edfd..2402613c8d44 100644
--- tools/gritsettings/resource_ids
+++ tools/gritsettings/resource_ids
@@ -434,4 +434,11 @@
@@ -431,4 +431,11 @@
# Please read the header and find the right section above instead.
# Resource ids starting at 31000 are reserved for projects built on Chromium.

View File

@ -1,5 +1,5 @@
diff --git build/config/linux/gtk/BUILD.gn build/config/linux/gtk/BUILD.gn
index 6624d138e14a..1ae9cadc4f3a 100644
index d78f7407c179..0bb79883e16c 100644
--- build/config/linux/gtk/BUILD.gn
+++ build/config/linux/gtk/BUILD.gn
@@ -4,8 +4,10 @@
@ -68,10 +68,10 @@ index faae7805435a..5101e0d51bf2 100644
void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() {
diff --git chrome/test/BUILD.gn chrome/test/BUILD.gn
index f691b9c4be33..e9dec0b09c8b 100644
index fd7f3e60a599..9678ad4828cf 100644
--- chrome/test/BUILD.gn
+++ chrome/test/BUILD.gn
@@ -4085,7 +4085,7 @@ test("unit_tests") {
@@ -4115,7 +4115,7 @@ test("unit_tests") {
"../browser/ui/input_method/input_method_engine_unittest.cc",
]
}
@ -80,7 +80,7 @@ index f691b9c4be33..e9dec0b09c8b 100644
sources +=
[ "../browser/ui/libgtkui/select_file_dialog_impl_gtk_unittest.cc" ]
deps += [ "//build/config/linux/gtk" ]
@@ -4106,7 +4106,7 @@ test("unit_tests") {
@@ -4136,7 +4136,7 @@ test("unit_tests") {
if (use_gio) {
configs += [ "//build/linux:gio_config" ]
}
@ -89,7 +89,7 @@ index f691b9c4be33..e9dec0b09c8b 100644
deps += [ "//chrome/browser/ui/libgtkui" ]
}
@@ -5119,7 +5119,7 @@ if (!is_android) {
@@ -5152,7 +5152,7 @@ if (!is_android) {
# suites, it seems like one or another starts timing out too.
"../browser/ui/views/keyboard_access_browsertest.cc",
]
@ -99,10 +99,10 @@ index f691b9c4be33..e9dec0b09c8b 100644
"../browser/ui/libgtkui/select_file_dialog_interactive_uitest.cc",
]
diff --git remoting/host/BUILD.gn remoting/host/BUILD.gn
index ff592fdd56d2..80cdc2093175 100644
index 647f01cfae49..fdbc8f8d49aa 100644
--- remoting/host/BUILD.gn
+++ remoting/host/BUILD.gn
@@ -350,7 +350,7 @@ static_library("common") {
@@ -351,7 +351,7 @@ static_library("common") {
"//build/config/linux:xrandr",
]
deps += [ "//remoting/host/linux:x11" ]
@ -111,7 +111,7 @@ index ff592fdd56d2..80cdc2093175 100644
deps += [ "//build/config/linux/gtk" ]
}
} else {
@@ -732,7 +732,7 @@ if (enable_me2me_host) {
@@ -733,7 +733,7 @@ if (enable_me2me_host) {
deps += [ "//components/policy:generated" ]
}
@ -121,12 +121,12 @@ index ff592fdd56d2..80cdc2093175 100644
}
if ((is_linux && !is_chromeos) || is_mac) {
diff --git remoting/host/file_transfer/BUILD.gn remoting/host/file_transfer/BUILD.gn
index d8985375e279..bf034bc990f5 100644
index ffaaa0b5b423..9fc7f88859a9 100644
--- remoting/host/file_transfer/BUILD.gn
+++ remoting/host/file_transfer/BUILD.gn
@@ -60,7 +60,7 @@ source_set("common") {
"//remoting/protocol",
]
@@ -35,7 +35,7 @@ source_set("file_transfer") {
sources -= [ "get_desktop_directory.cc" ]
}
- if (is_desktop_linux) {
+ if (is_desktop_linux && use_gtk) {
@ -169,10 +169,10 @@ index a07f8b0254af..970c1a54b4d2 100644
}
}
diff --git remoting/test/BUILD.gn remoting/test/BUILD.gn
index 2b7d0d78eef9..4feb3a244da9 100644
index d916fa822a8f..245c0e006cdf 100644
--- remoting/test/BUILD.gn
+++ remoting/test/BUILD.gn
@@ -149,7 +149,7 @@ if (enable_remoting_host && !is_android && !is_chromeos) {
@@ -148,7 +148,7 @@ if (enable_remoting_host && !is_android && !is_chromeos) {
":it2me_standalone_host",
]

View File

@ -1,5 +1,5 @@
diff --git base/files/file_path_watcher_linux.cc base/files/file_path_watcher_linux.cc
index b22421d834c2..8fda7598ba4b 100644
index 22732f2864ef..7d5caef5c3b0 100644
--- base/files/file_path_watcher_linux.cc
+++ base/files/file_path_watcher_linux.cc
@@ -5,6 +5,7 @@
@ -18,7 +18,7 @@ index b22421d834c2..8fda7598ba4b 100644
#include <map>
#include <memory>
#include <set>
@@ -220,21 +222,15 @@ void InotifyReaderThreadDelegate::ThreadMain() {
@@ -220,22 +222,15 @@ void InotifyReaderThreadDelegate::ThreadMain() {
PlatformThread::SetName("inotify_reader");
// Make sure the file descriptors are good for use with select().
@ -34,7 +34,8 @@ index b22421d834c2..8fda7598ba4b 100644
- FD_ZERO(&rfds);
- FD_SET(inotify_fd_, &rfds);
-
- ScopedBlockingCall scoped_blocking_call(BlockingType::WILL_BLOCK);
- ScopedBlockingCall scoped_blocking_call(FROM_HERE,
- BlockingType::WILL_BLOCK);
-
- // Wait until some inotify events are available.
- int select_result =

View File

@ -1,52 +1,22 @@
diff --git base/message_loop/message_loop.cc base/message_loop/message_loop.cc
index cec3a133889d..4b25f540a4af 100644
index fff922d36819..28fea401be5f 100644
--- base/message_loop/message_loop.cc
+++ base/message_loop/message_loop.cc
@@ -151,6 +151,10 @@ void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) {
}
bool MessageLoop::IsBoundToCurrentThread() const {
+ if (!pump_) {
+ // Avoid DCHECKs in the MessageLoop destructor after we call ReleasePump().
+ return false;
+ }
return backend_->IsBoundToCurrentThread();
}
@@ -164,6 +168,9 @@ MessageLoopBase* MessageLoop::GetMessageLoopBase() {
@@ -163,6 +163,9 @@ MessageLoopBase* MessageLoop::GetMessageLoopBase() {
//------------------------------------------------------------------------------
+MessageLoopForUI::MessageLoopForUI(std::unique_ptr<MessagePump> pump)
+ : MessageLoop(TYPE_UI, BindOnce(&ReturnPump, std::move(pump))) {}
+ : MessageLoop(TYPE_UI, std::move(pump)) {}
+
// static
std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound(
Type type,
std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound(Type type) {
return WrapUnique(new MessageLoop(type, nullptr));
diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h
index f49f56285de7..159e645a0c9f 100644
index 46782b49a7f0..78ebaf71cbdf 100644
--- base/message_loop/message_loop.h
+++ base/message_loop/message_loop.h
@@ -185,6 +185,8 @@ class BASE_EXPORT MessageLoopBase {
// can post other tasks when destructed.
virtual void DeletePendingTasks() = 0;
+ virtual void ReleasePump() = 0;
+
protected:
friend class MessageLoop;
friend class MessageLoopForUI;
@@ -286,6 +288,9 @@ class BASE_EXPORT MessageLoop {
MessageLoopBase* GetMessageLoopBase();
+ // Called from Thread::CleanUp() to release resources.
+ void ReleasePump() { pump_ = nullptr; backend_->ReleasePump(); }
+
//----------------------------------------------------------------------------
protected:
using MessagePumpFactoryCallback =
@@ -374,6 +379,7 @@ class BASE_EXPORT MessageLoop {
@@ -377,6 +377,7 @@ class BASE_EXPORT MessageLoop {
class BASE_EXPORT MessageLoopForUI : public MessageLoop {
public:
explicit MessageLoopForUI(Type type = TYPE_UI);
@ -55,7 +25,7 @@ index f49f56285de7..159e645a0c9f 100644
#if defined(OS_IOS)
// On iOS, the main message loop cannot be Run(). Instead call Attach(),
diff --git base/message_loop/message_loop_current.cc base/message_loop/message_loop_current.cc
index e669669c72f5..84cc1bee2c74 100644
index c0b2ff7e0ad6..75802589ca01 100644
--- base/message_loop/message_loop_current.cc
+++ base/message_loop/message_loop_current.cc
@@ -49,6 +49,8 @@ void MessageLoopCurrent::AddDestructionObserver(
@ -68,43 +38,23 @@ index e669669c72f5..84cc1bee2c74 100644
current_->RemoveDestructionObserver(destruction_observer);
}
diff --git base/message_loop/message_loop_current.h base/message_loop/message_loop_current.h
index d469a7214001..76ae4cb77c8e 100644
index bcab89d6e2e7..3160b321990e 100644
--- base/message_loop/message_loop_current.h
+++ base/message_loop/message_loop_current.h
@@ -134,6 +134,16 @@ class BASE_EXPORT MessageLoopCurrent {
@@ -133,6 +133,12 @@ class BASE_EXPORT MessageLoopCurrent {
// posted tasks.
void SetAddQueueTimeToTasks(bool enable);
+#if defined(OS_WIN)
+ void set_os_modal_loop(bool os_modal_loop) {
+ os_modal_loop_ = os_modal_loop;
+ }
+ void set_os_modal_loop(bool os_modal_loop) { os_modal_loop_ = os_modal_loop; }
+
+ bool os_modal_loop() const {
+ return os_modal_loop_;
+ }
+ bool os_modal_loop() const { return os_modal_loop_; }
+#endif // OS_WIN
+
// 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
@@ -187,7 +197,6 @@ class BASE_EXPORT MessageLoopCurrent {
// level.
bool IsIdleForTesting();
- protected:
// Binds |current| to the current thread. It will from then on be the
// MessageLoop driven by MessageLoopCurrent on this thread. This is only meant
// to be invoked by the MessageLoop itself.
@@ -198,6 +207,7 @@ class BASE_EXPORT MessageLoopCurrent {
// meant to be invoked by the MessageLoop itself.
static void UnbindFromCurrentThreadInternal(MessageLoopBase* current);
+ protected:
explicit MessageLoopCurrent(MessageLoopBase* current) : current_(current) {}
friend class MessageLoopImpl;
@@ -215,6 +225,13 @@ class BASE_EXPORT MessageLoopCurrent {
@@ -213,6 +219,13 @@ class BASE_EXPORT MessageLoopCurrent {
MessageLoopBase* ToMessageLoopBaseDeprecated() const { return current_; }
MessageLoopBase* current_;
@ -119,43 +69,24 @@ index d469a7214001..76ae4cb77c8e 100644
#if !defined(OS_NACL)
diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc
index 9de7721c9cfb..13b9bf8660ed 100644
index 3e9562cc4cc5..cf4a700364d3 100644
--- base/message_loop/message_pump_win.cc
+++ base/message_loop/message_pump_win.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/debug/alias.h"
#include "base/memory/ptr_util.h"
+#include "base/message_loop/message_loop_current.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
@@ -390,20 +391,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {
}
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/message_loop/message_loop_current.h"
#include "base/message_loop/message_pump_win.h"
#include <algorithm>
@@ -493,10 +494,18 @@ bool MessagePumpForUI::ProcessPumpReplacementMessage() {
// asynchronous to this thread!!
bool MessagePumpForUI::ProcessPumpReplacementMessage() {
- // When we encounter a kMsgHaveWork message, this method is called to peek and
- // process a replacement message. The goal is to make the kMsgHaveWork as non-
- // intrusive as possible, even though a continuous stream of such messages are
- // posted. This method carefully peeks a message while there is no chance for
- // a kMsgHaveWork to be pending, then resets the |have_work_| flag (allowing a
- // replacement kMsgHaveWork to possibly be posted), and finally dispatches
- // that peeked replacement. Note that the re-post of kMsgHaveWork may be
- // asynchronous to this thread!!
-
+ // When we encounter a kMsgHaveWork message, this method is called to peek
+ // and process a replacement message, such as a WM_PAINT or WM_TIMER. The
+ // goal is to make the kMsgHaveWork as non-intrusive as possible, even though
+ // a continuous stream of such messages are posted. This method carefully
+ // peeks a message while there is no chance for a kMsgHaveWork to be pending,
+ // then resets the have_work_ flag (allowing a replacement kMsgHaveWork to
+ // possibly be posted), and finally dispatches that peeked replacement. Note
+ // that the re-post of kMsgHaveWork may be asynchronous to this thread!!
+
+ bool have_message = false;
MSG msg;
- const bool have_message =
- ::PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE) != FALSE;
+ bool have_message = false;
+ // We should not process all window messages if we are in the context of an
+ // OS modal loop, i.e. in the context of a windows API call like MessageBox.
+ // This is to ensure that these messages are peeked out by the OS modal loop.
@ -171,16 +102,3 @@ index 9de7721c9cfb..13b9bf8660ed 100644
DCHECK(!have_message || kMsgHaveWork != msg.message ||
msg.hwnd != message_window_.hwnd());
diff --git base/task/sequence_manager/sequence_manager_impl.h base/task/sequence_manager/sequence_manager_impl.h
index 6c5c85f0e62f..78d400e609dc 100644
--- base/task/sequence_manager/sequence_manager_impl.h
+++ base/task/sequence_manager/sequence_manager_impl.h
@@ -155,6 +155,8 @@ class BASE_EXPORT SequenceManagerImpl
void BindToCurrentThread(std::unique_ptr<MessagePump> pump) override;
void DeletePendingTasks() override;
bool HasTasks() override;
+
+ void ReleasePump() override {}
// Requests that a task to process work is scheduled.
void ScheduleWork();

View File

@ -1,8 +1,8 @@
diff --git base/message_loop/message_pump_mac.mm base/message_loop/message_pump_mac.mm
index 6ebddfc9f404..85809cf7b134 100644
index 666b6cdca80b..239f6fad81a1 100644
--- base/message_loop/message_pump_mac.mm
+++ base/message_loop/message_pump_mac.mm
@@ -799,7 +799,8 @@ void MessagePumpUIApplication::Attach(Delegate* delegate) {
@@ -800,7 +800,8 @@ void MessagePumpUIApplication::Attach(Delegate* delegate) {
#else
ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@ -12,7 +12,7 @@ index 6ebddfc9f404..85809cf7b134 100644
DCHECK_EQ(kNSApplicationModalSafeModeMask, g_app_pump->GetModeMask());
// Pumping events in private runloop modes is known to interact badly with
// app modal windows like NSAlert.
@@ -811,7 +812,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
@@ -812,7 +813,8 @@ ScopedPumpMessagesInPrivateModes::ScopedPumpMessagesInPrivateModes() {
}
ScopedPumpMessagesInPrivateModes::~ScopedPumpMessagesInPrivateModes() {

View File

@ -22,10 +22,10 @@ index 49fe875c7d22..c1e3df840dc0 100644
THREAD_CHECKER(thread_checker_);
diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc
index dc7c3d2fd023..e2b348746816 100644
index 85a188974509..ec9a15fc9fa5 100644
--- net/url_request/url_request_job.cc
+++ net/url_request/url_request_job.cc
@@ -467,6 +467,12 @@ void URLRequestJob::NotifyHeadersComplete() {
@@ -466,6 +466,12 @@ void URLRequestJob::NotifyHeadersComplete() {
DCHECK(!source_stream_);
source_stream_ = SetUpSourceStream();

View File

@ -1,8 +1,8 @@
diff --git net/url_request/url_request.h net/url_request/url_request.h
index 9301dc42e121..9dbe0e83fc3a 100644
index 33337d91f5cc..7de7579d9f12 100644
--- net/url_request/url_request.h
+++ net/url_request/url_request.h
@@ -753,10 +753,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData {
@@ -754,10 +754,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData {
base::WeakPtr<URLRequest> GetWeakPtr();

View File

@ -1,5 +1,5 @@
diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h
index 37693ee802d2..66d4827146d5 100644
index 39ff86491246..163eaec35230 100644
--- content/public/common/common_param_traits_macros.h
+++ content/public/common/common_param_traits_macros.h
@@ -186,6 +186,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
@ -11,7 +11,7 @@ index 37693ee802d2..66d4827146d5 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc
index bb5de85a28c1..c48451322c00 100644
index b76f327dccca..eecf13a609ca 100644
--- content/public/common/web_preferences.cc
+++ content/public/common/web_preferences.cc
@@ -168,6 +168,7 @@ WebPreferences::WebPreferences()
@ -23,7 +23,7 @@ index bb5de85a28c1..c48451322c00 100644
record_whole_document(false),
cookie_enabled(true),
diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h
index 798b963f5900..86d81ec9a58a 100644
index 9052d1d6f4db..acb7027bb637 100644
--- content/public/common/web_preferences.h
+++ content/public/common/web_preferences.h
@@ -183,6 +183,7 @@ struct CONTENT_EXPORT WebPreferences {
@ -35,10 +35,10 @@ index 798b963f5900..86d81ec9a58a 100644
bool record_whole_document;
diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc
index 2d0908fb291b..33668351b73a 100644
index c748edbf5a32..0d549ad30f4c 100644
--- content/renderer/render_view_impl.cc
+++ content/renderer/render_view_impl.cc
@@ -1008,6 +1008,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
@@ -1028,6 +1028,8 @@ void RenderView::ApplyWebPreferences(const WebPreferences& prefs,
#endif
WebRuntimeFeatures::EnableTranslateService(prefs.translate_service_available);

View File

@ -242,18 +242,18 @@ index 1802034a6e15..ae0d479ecafa 100644
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
diff --git components/printing/renderer/print_render_frame_helper.cc components/printing/renderer/print_render_frame_helper.cc
index 56e2dd5faf2b..9428db8c616d 100644
index 40ea9d21b07a..d45e607cc316 100644
--- components/printing/renderer/print_render_frame_helper.cc
+++ components/printing/renderer/print_render_frame_helper.cc
@@ -351,7 +351,6 @@ bool IsPrintingFrameset(const blink::WebLocalFrame* frame) {
frame->GetDocument().Body().TagName().Equals("FRAMESET");
@@ -344,7 +344,6 @@ bool IsPrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->SupportsPaginatedPrint();
}
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false;
@@ -373,7 +372,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
@@ -366,7 +365,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
}
return frame_has_custom_page_size_style;
}
@ -261,7 +261,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
#if BUILDFLAG(ENABLE_PRINTING)
// Disable scaling when either:
@@ -428,7 +426,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
@@ -421,7 +419,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
: PRINTABLE_AREA_MARGINS;
}
@ -269,7 +269,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
gfx::Size GetPdfPageSize(const gfx::Size& page_size, int dpi) {
return gfx::Size(ConvertUnit(page_size.width(), dpi, kPointsPerInch),
ConvertUnit(page_size.height(), dpi, kPointsPerInch));
@@ -475,7 +472,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
@@ -468,7 +465,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
}
return blink::kWebPrintScalingOptionFitToPrintableArea;
}
@ -277,7 +277,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
// Helper function to scale and round an integer value with a double valued
// scaling.
@@ -1106,10 +1102,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1099,10 +1095,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
return;
if (g_is_preview_enabled) {
@ -288,7 +288,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
} else {
auto weak_this = weak_ptr_factory_.GetWeakPtr();
web_frame->DispatchBeforePrintEvent();
@@ -1137,13 +1131,11 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) {
@@ -1130,13 +1124,11 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(PrintRenderFrameHelper, message)
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
@ -302,7 +302,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
IPC_MESSAGE_HANDLER(PrintMsg_PrintFrameContent, OnPrintFrameContent)
IPC_MESSAGE_HANDLER(PrintMsg_SetPrintingEnabled, OnSetPrintingEnabled)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -1223,7 +1215,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo(
@@ -1216,7 +1208,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
}
@ -310,7 +310,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::OnPrintPreview(
const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1)
@@ -1489,7 +1480,6 @@ int PrintRenderFrameHelper::GetFitToPageScaleFactor(
@@ -1481,7 +1472,6 @@ int PrintRenderFrameHelper::GetFitToPageScaleFactor(
printable_height / static_cast<double>(uniform_page_size.height);
return static_cast<int>(100.0f * std::min(scale_width, scale_height));
}
@ -318,7 +318,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1)
@@ -1504,7 +1494,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) {
@@ -1496,7 +1486,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) {
is_printing_enabled_ = enabled;
}
@ -326,7 +326,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
if (ipc_nesting_level_ > 1)
return;
@@ -1515,7 +1504,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1507,7 +1496,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.IsNull()) {
@ -336,7 +336,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
return;
}
print_preview_context_.InitWithFrame(frame);
@@ -1527,7 +1518,6 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
@@ -1519,7 +1510,6 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
void PrintRenderFrameHelper::OnClosePrintPreviewDialog() {
print_preview_context_.source_frame()->DispatchAfterPrintEvent();
}
@ -344,7 +344,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::OnPrintFrameContent(
const PrintMsg_PrintFrame_Params& params) {
@@ -1611,11 +1601,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1603,11 +1593,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
print_node_in_progress_ = true;
@ -357,7 +357,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
} else {
// Make a copy of the node, in case RenderView::OnContextMenuClosed() resets
// its |context_menu_node_|.
@@ -1696,13 +1684,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -1683,13 +1671,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
int cookie =
print_pages_params_ ? print_pages_params_->params.document_cookie : 0;
@ -371,7 +371,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
switch (result) {
case OK:
break;
@@ -1717,7 +1703,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
@@ -1704,7 +1690,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
}
break;
@ -379,7 +379,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
case FAIL_PREVIEW:
if (!is_print_ready_metafile_sent_) {
if (notify_browser_of_print_failure_) {
@@ -1735,7 +1720,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
@@ -1722,7 +1707,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
cookie, ids));
print_preview_context_.Failed(false);
break;
@ -387,7 +387,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
}
prep_frame_view_.reset();
print_pages_params_.reset();
@@ -1908,7 +1892,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
@@ -1895,7 +1879,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true;
}
@ -395,7 +395,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
bool PrintRenderFrameHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -2001,7 +1984,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings(
@@ -1988,7 +1971,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return false;
}
@ -403,7 +403,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::GetPrintSettingsFromUser(
blink::WebLocalFrame* frame,
@@ -2153,7 +2135,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToReadOnlySharedMem(
@@ -2140,7 +2122,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToReadOnlySharedMem(
return true;
}
@ -411,7 +411,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
void PrintRenderFrameHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false;
@@ -2279,7 +2260,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(
@@ -2266,7 +2247,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params, ids));
return true;
}
@ -420,7 +420,7 @@ index 56e2dd5faf2b..9428db8c616d 100644
PrintRenderFrameHelper::PrintPreviewContext::PrintPreviewContext() = default;
diff --git components/printing/renderer/print_render_frame_helper.h components/printing/renderer/print_render_frame_helper.h
index 34690801675c..bb503ad7f849 100644
index c4effb05d16c..5d225dcab071 100644
--- components/printing/renderer/print_render_frame_helper.h
+++ components/printing/renderer/print_render_frame_helper.h
@@ -150,10 +150,8 @@ class PrintRenderFrameHelper
@ -434,7 +434,7 @@ index 34690801675c..bb503ad7f849 100644
};
// These values are persisted to logs. Entries should not be renumbered and
@@ -194,11 +192,9 @@ class PrintRenderFrameHelper
@@ -195,11 +193,9 @@ class PrintRenderFrameHelper
// Message handlers ---------------------------------------------------------
void OnPrintPages();
void OnPrintForSystemDialog();
@ -446,7 +446,7 @@ index 34690801675c..bb503ad7f849 100644
void OnPrintFrameContent(const PrintMsg_PrintFrame_Params& params);
void OnPrintingDone(bool success);
@@ -212,7 +208,6 @@ class PrintRenderFrameHelper
@@ -213,7 +209,6 @@ class PrintRenderFrameHelper
// Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@ -454,7 +454,7 @@ index 34690801675c..bb503ad7f849 100644
// Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument();
@@ -232,7 +227,6 @@ class PrintRenderFrameHelper
@@ -233,7 +228,6 @@ class PrintRenderFrameHelper
// Helper method to calculate the scale factor for fit-to-page.
int GetFitToPageScaleFactor(const gfx::Rect& printable_area_in_points);
@ -462,7 +462,7 @@ index 34690801675c..bb503ad7f849 100644
// Enable/Disable printing.
void OnSetPrintingEnabled(bool enabled);
@@ -259,7 +253,6 @@ class PrintRenderFrameHelper
@@ -260,7 +254,6 @@ class PrintRenderFrameHelper
const blink::WebNode& node,
int* number_of_pages);
@ -470,7 +470,7 @@ index 34690801675c..bb503ad7f849 100644
// Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -270,7 +263,6 @@ class PrintRenderFrameHelper
@@ -271,7 +264,6 @@ class PrintRenderFrameHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings);
@ -478,7 +478,7 @@ index 34690801675c..bb503ad7f849 100644
// Get final print settings from the user.
// WARNING: |this| may be gone after this method returns.
@@ -352,7 +344,6 @@ class PrintRenderFrameHelper
@@ -353,7 +345,6 @@ class PrintRenderFrameHelper
bool IsScriptInitiatedPrintAllowed(blink::WebLocalFrame* frame,
bool user_initiated);
@ -486,7 +486,7 @@ index 34690801675c..bb503ad7f849 100644
// Shows scripted print preview when options from plugin are available.
void ShowScriptedPrintPreview();
@@ -371,7 +362,6 @@ class PrintRenderFrameHelper
@@ -372,7 +363,6 @@ class PrintRenderFrameHelper
// Returns true if print preview should continue, false on failure.
bool PreviewPageRendered(int page_number,
std::unique_ptr<MetafileSkia> metafile);
@ -494,7 +494,7 @@ index 34690801675c..bb503ad7f849 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -526,6 +516,7 @@ class PrintRenderFrameHelper
@@ -527,6 +517,7 @@ class PrintRenderFrameHelper
ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_ = false;

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/renderer_preferences_util.cc chrome/browser/renderer_preferences_util.cc
index f3fc761cf5d5..3ccb345c41f0 100644
index f5ed7f0683c5..5b31fb309985 100644
--- chrome/browser/renderer_preferences_util.cc
+++ chrome/browser/renderer_preferences_util.cc
@@ -29,7 +29,8 @@

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 071e658ff195..651cc9eedf65 100644
index cbee55a9f87c..c31a358239ff 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -733,10 +733,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const {
@@ -738,10 +738,12 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBounds() const {
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
DCHECK(GetBackgroundColor());
@ -19,7 +19,7 @@ index 071e658ff195..651cc9eedf65 100644
}
void RenderWidgetHostViewAura::WindowTitleChanged() {
@@ -2026,6 +2028,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
@@ -2053,6 +2055,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
if (frame_sink_id_.is_valid())
window_->SetEmbedFrameSinkId(frame_sink_id_);

View File

@ -38,7 +38,7 @@ index a19d29165970..aaf918cd4b71 100644
render_frame_host->GetLastCommittedOrigin(),
render_frame_host->GetFrameTreeNodeId(), std::move(wc_getter),
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index 8c5b2fc028c3..d6848a7e8750 100644
index 5610c0df1c7d..7440b58504ec 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -88,6 +88,11 @@ class BlobHandleImpl : public BlobHandle {
@ -54,7 +54,7 @@ index 8c5b2fc028c3..d6848a7e8750 100644
ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
BrowserContext* context) {
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
index 26cf1ebfdffc..f6de541d25d1 100644
index afd21be63a9a..8ac63336f6e7 100644
--- content/browser/blob_storage/chrome_blob_storage_context.h
+++ content/browser/blob_storage/chrome_blob_storage_context.h
@@ -50,6 +50,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext
@ -83,10 +83,10 @@ index 6952610f8c88..fd8babeb99fd 100644
partition->GetBluetoothAllowedDevicesMap();
return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin());
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index 68e34ea69ecc..da82a4d99a91 100644
index b2b3920da3b0..8ab540f00d3d 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -210,11 +210,18 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -211,11 +211,18 @@ StoragePartition* GetStoragePartitionFromConfig(
StoragePartitionImplMap* partition_map =
GetStoragePartitionMap(browser_context);
@ -108,7 +108,7 @@ index 68e34ea69ecc..da82a4d99a91 100644
}
void SaveSessionStateOnIOThread(
@@ -732,6 +739,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
@@ -741,6 +748,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
BrowserContext::BrowserContext()
: unique_id_(base::UnguessableToken::Create().ToString()) {}
@ -120,25 +120,40 @@ index 68e34ea69ecc..da82a4d99a91 100644
BrowserContext::~BrowserContext() {
CHECK(GetUserData(kServiceInstanceGroup))
<< "Attempting to destroy a BrowserContext that never called "
diff --git content/browser/devtools/protocol/background_service_handler.cc content/browser/devtools/protocol/background_service_handler.cc
index af047913e230..849eeddcfcc5 100644
--- content/browser/devtools/protocol/background_service_handler.cc
+++ content/browser/devtools/protocol/background_service_handler.cc
@@ -49,8 +49,7 @@ void BackgroundServiceHandler::SetRenderer(int process_host_id,
return;
}
- auto* storage_partition =
- static_cast<StoragePartitionImpl*>(process_host->GetStoragePartition());
+ auto* storage_partition = process_host->GetStoragePartition();
devtools_context_ = storage_partition->GetDevToolsBackgroundServicesContext();
DCHECK(devtools_context_);
}
diff --git content/browser/devtools/protocol/network_handler.cc content/browser/devtools/protocol/network_handler.cc
index 69d2ffaea87b..5eb30fe7f22f 100644
index 4fa2f08b626c..84c3be6138c0 100644
--- content/browser/devtools/protocol/network_handler.cc
+++ content/browser/devtools/protocol/network_handler.cc
@@ -807,8 +807,7 @@ class BackgroundSyncRestorer {
@@ -816,8 +816,8 @@ class BackgroundSyncRestorer {
scoped_refptr<ServiceWorkerDevToolsAgentHost> service_worker_host =
static_cast<ServiceWorkerDevToolsAgentHost*>(host.get());
scoped_refptr<BackgroundSyncContext> sync_context =
scoped_refptr<BackgroundSyncContextImpl> sync_context =
- static_cast<StoragePartitionImpl*>(storage_partition_)
- ->GetBackgroundSyncContext();
+ storage_partition_->GetBackgroundSyncContext();
+ static_cast<BackgroundSyncContextImpl*>(
+ storage_partition_->GetBackgroundSyncContext());
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::IO},
base::BindOnce(
diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc
index 3dc663a54995..8ed420d31c0d 100644
index 34381dc45e10..960ba73c1ea8 100644
--- content/browser/devtools/protocol/service_worker_handler.cc
+++ content/browser/devtools/protocol/service_worker_handler.cc
@@ -173,8 +173,7 @@ void ServiceWorkerHandler::SetRenderer(int process_host_id,
@@ -174,8 +174,7 @@ void ServiceWorkerHandler::SetRenderer(int process_host_id,
return;
}
@ -148,6 +163,16 @@ index 3dc663a54995..8ed420d31c0d 100644
DCHECK(storage_partition_);
browser_context_ = process_host->GetBrowserContext();
context_ = static_cast<ServiceWorkerContextWrapper*>(
@@ -338,7 +337,8 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
return CreateInvalidVersionIdErrorResponse();
BackgroundSyncContextImpl* sync_context =
- storage_partition_->GetBackgroundSyncContext();
+ static_cast<BackgroundSyncContextImpl*>(
+ storage_partition_->GetBackgroundSyncContext());
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::IO},
base::BindOnce(&DispatchSyncEventOnIO, context_,
diff --git content/browser/devtools/protocol/service_worker_handler.h content/browser/devtools/protocol/service_worker_handler.h
index ec9ab86d0ca6..0fe5219f1e84 100644
--- content/browser/devtools/protocol/service_worker_handler.h
@ -171,10 +196,10 @@ index ec9ab86d0ca6..0fe5219f1e84 100644
base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_;
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
index 5da8761a8e1b..f573f9f49434 100644
index 5ed0f15fe47b..5452066f9e73 100644
--- content/browser/download/download_manager_impl.cc
+++ content/browser/download/download_manager_impl.cc
@@ -99,9 +99,9 @@ void DeleteDownloadedFileOnUIThread(const base::FilePath& file_path) {
@@ -102,9 +102,9 @@ void DeleteDownloadedFileOnUIThread(const base::FilePath& file_path) {
}
#endif
@ -187,7 +212,7 @@ index 5da8761a8e1b..f573f9f49434 100644
DCHECK_CURRENTLY_ON(BrowserThread::UI);
SiteInstance* site_instance = nullptr;
@@ -111,8 +111,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
@@ -114,8 +114,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
if (render_frame_host_)
site_instance = render_frame_host_->GetSiteInstance();
}
@ -197,7 +222,7 @@ index 5da8761a8e1b..f573f9f49434 100644
}
void OnDownloadStarted(
@@ -270,7 +269,7 @@ base::FilePath GetTemporaryDownloadDirectory() {
@@ -273,7 +272,7 @@ base::FilePath GetTemporaryDownloadDirectory() {
#endif
scoped_refptr<download::DownloadURLLoaderFactoryGetter>
@ -206,16 +231,16 @@ index 5da8761a8e1b..f573f9f49434 100644
RenderFrameHost* rfh,
bool is_download) {
network::mojom::URLLoaderFactoryPtrInfo proxy_factory_ptr_info;
@@ -287,7 +286,7 @@ CreateDownloadURLLoaderFactoryGetter(StoragePartitionImpl* storage_partition,
}
@@ -308,7 +307,7 @@ CreateDownloadURLLoaderFactoryGetter(StoragePartitionImpl* storage_partition,
}
return base::MakeRefCounted<NetworkDownloadURLLoaderFactoryGetter>(
- storage_partition->url_loader_factory_getter(),
+ base::WrapRefCounted(storage_partition->url_loader_factory_getter()),
std::move(proxy_factory_ptr_info), std::move(proxy_factory_request));
}
@@ -1230,7 +1229,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete(
@@ -1252,7 +1251,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete(
tab_referrer_url = entry->GetReferrer().url;
}
}
@ -224,7 +249,7 @@ index 5da8761a8e1b..f573f9f49434 100644
GetStoragePartition(browser_context_, render_process_id, render_frame_id);
in_progress_manager_->InterceptDownloadFromNavigation(
std::move(resource_request), render_process_id, render_frame_id, site_url,
@@ -1281,10 +1280,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
@@ -1303,10 +1302,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
base::MakeRefCounted<WebUIDownloadURLLoaderFactoryGetter>(
rfh, params->url());
} else if (rfh && params->url().SchemeIsFileSystem()) {
@ -237,9 +262,9 @@ index 5da8761a8e1b..f573f9f49434 100644
std::string storage_domain;
auto* site_instance = rfh->GetSiteInstance();
if (site_instance) {
@@ -1299,10 +1296,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
params->url(), rfh, /*is_navigation=*/false,
storage_partition->GetFileSystemContext(), storage_domain);
@@ -1350,10 +1347,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
std::move(wrapper_factory));
}
} else {
- StoragePartitionImpl* storage_partition =
- static_cast<StoragePartitionImpl*>(
@ -251,19 +276,10 @@ index 5da8761a8e1b..f573f9f49434 100644
CreateDownloadURLLoaderFactoryGetter(storage_partition, rfh, true);
}
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index 81809b25675d..fe4b21a71091 100644
index 161ab06fa1dd..f76c1a63362e 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -387,7 +387,7 @@ class AboutURLLoaderFactory : public network::mojom::URLLoaderFactory {
std::unique_ptr<network::SharedURLLoaderFactoryInfo>
CreateNetworkFactoryInfoWithHeaderClient(
network::mojom::TrustedURLLoaderHeaderClientPtrInfo header_client,
- StoragePartitionImpl* partition) {
+ StoragePartition* partition) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
network::mojom::URLLoaderFactoryPtrInfo factory_info;
network::mojom::URLLoaderFactoryParamsPtr params =
@@ -1267,7 +1267,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
@@ -1141,7 +1141,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
// path does as well for navigations.
bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
-1 /* render_process_id */, -1 /* render_frame_id */, resource_context_,
@ -272,7 +288,7 @@ index 81809b25675d..fe4b21a71091 100644
false /* allow_wildcard */, &stale, &plugin, nullptr);
if (stale) {
@@ -1616,7 +1616,7 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
@@ -1505,7 +1505,7 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
CreateResourceRequest(request_info.get(), frame_tree_node_id,
IsNavigationDownloadAllowed(download_policy_));
@ -281,6 +297,28 @@ index 81809b25675d..fe4b21a71091 100644
scoped_refptr<SignedExchangePrefetchMetricRecorder>
signed_exchange_prefetch_metric_recorder =
partition->GetPrefetchURLLoaderService()
@@ -1753,7 +1753,7 @@ void NavigationURLLoaderImpl::SetURLLoaderFactoryInterceptorForTesting(
void NavigationURLLoaderImpl::CreateURLLoaderFactoryWithHeaderClient(
network::mojom::TrustedURLLoaderHeaderClientPtrInfo header_client,
network::mojom::URLLoaderFactoryRequest factory_request,
- StoragePartitionImpl* partition) {
+ StoragePartition* partition) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
network::mojom::URLLoaderFactoryParamsPtr params =
network::mojom::URLLoaderFactoryParams::New();
diff --git content/browser/loader/navigation_url_loader_impl.h content/browser/loader/navigation_url_loader_impl.h
index b99335361248..72a281c12fc3 100644
--- content/browser/loader/navigation_url_loader_impl.h
+++ content/browser/loader/navigation_url_loader_impl.h
@@ -97,7 +97,7 @@ class CONTENT_EXPORT NavigationURLLoaderImpl : public NavigationURLLoader {
static void CreateURLLoaderFactoryWithHeaderClient(
network::mojom::TrustedURLLoaderHeaderClientPtrInfo header_client,
network::mojom::URLLoaderFactoryRequest factory_request,
- StoragePartitionImpl* partition);
+ StoragePartition* partition);
// Returns a Request ID for browser-initiated navigation requests. Called on
// the IO thread.
diff --git content/browser/payments/payment_app_installer.cc content/browser/payments/payment_app_installer.cc
index c2ee504cd0c7..422dc641d0a0 100644
--- content/browser/payments/payment_app_installer.cc
@ -328,7 +366,7 @@ index 9d3bee713440..38cc82d730a5 100644
partition->GetPaymentAppContext();
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index b33f30b3ec0d..9b78bdcd55b0 100644
index 221dc8424f85..840a5533db90 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -700,11 +700,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
@ -376,14 +414,16 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -1503,10 +1502,12 @@ RenderProcessHostImpl::RenderProcessHostImpl(
permission_service_context_(new PermissionServiceContext(this)),
indexed_db_factory_(new IndexedDBDispatcherHost(
@@ -1504,12 +1503,14 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(
new IndexedDBDispatcherHost(
id_,
- storage_partition_impl_->GetIndexedDBContext(),
+ static_cast<IndexedDBContextImpl*>(
+ storage_partition_impl_->GetIndexedDBContext()),
ChromeBlobStorageContext::GetFor(browser_context_))),
ChromeBlobStorageContext::GetFor(browser_context_)),
base::OnTaskRunnerDeleter(
storage_partition_impl_->GetIndexedDBContext()->TaskRunner())),
service_worker_dispatcher_host_(new ServiceWorkerDispatcherHost(
- storage_partition_impl_->GetServiceWorkerContext(),
+ static_cast<ServiceWorkerContextWrapper*>(
@ -391,7 +431,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
id_)),
channel_connected_(false),
sent_render_process_ready_(false),
@@ -1539,7 +1540,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -1542,7 +1543,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
}
push_messaging_manager_.reset(new PushMessagingManager(
@ -401,7 +441,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
AddObserver(indexed_db_factory_.get());
AddObserver(service_worker_dispatcher_host_.get());
@@ -1865,6 +1867,15 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1868,6 +1870,15 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -417,7 +457,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
// from guests.
@@ -1904,10 +1915,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1907,10 +1918,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
media_request_context));
resource_message_filter_ = new ResourceMessageFilter(
@ -430,7 +470,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
storage_partition_impl_->GetPrefetchURLLoaderService(),
browser_context->GetSharedCorsOriginAccessList(),
std::move(get_contexts_callback),
@@ -1916,8 +1927,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1919,8 +1930,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(resource_message_filter_.get());
}
@ -440,7 +480,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
AddFilter(peer_connection_tracker_host_.get());
@@ -1934,10 +1944,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1937,10 +1947,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new TraceMessageFilter(GetID()));
AddFilter(new ResolveProxyMsgHelper(GetID()));
@ -451,7 +491,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
}
void RenderProcessHostImpl::BindCacheStorage(
@@ -1949,7 +1955,8 @@ void RenderProcessHostImpl::BindCacheStorage(
@@ -1952,7 +1958,8 @@ void RenderProcessHostImpl::BindCacheStorage(
cache_storage_dispatcher_host_ =
base::MakeRefCounted<CacheStorageDispatcherHost>();
cache_storage_dispatcher_host_->Init(
@ -461,7 +501,17 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
}
// Send the binding to IO thread, because Cache Storage handles Mojo IPC on IO
// thread entirely.
@@ -2153,7 +2160,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2068,7 +2075,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
base::BindRepeating(
&BackgroundSyncContextImpl::CreateService,
base::Unretained(
- storage_partition_impl_->GetBackgroundSyncContext())));
+ static_cast<BackgroundSyncContextImpl*>(
+ storage_partition_impl_->GetBackgroundSyncContext()))));
AddUIThreadInterface(
registry.get(),
base::BindRepeating(&RenderProcessHostImpl::CreateStoragePartitionService,
@@ -2164,7 +2172,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&CodeCacheHostImpl::Create, GetID(),
@ -471,7 +521,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
base::RetainedRef(
storage_partition_impl_->GetGeneratedCodeCacheContext())));
@@ -2165,7 +2173,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2176,7 +2185,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&ChromeAppCacheService::CreateBackend,
@ -481,7 +531,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
GetID()));
AddUIThreadInterface(
@@ -2211,6 +2220,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -2222,6 +2232,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
plugin_registry_.reset(
new PluginRegistryImpl(GetBrowserContext()->GetResourceContext()));
}
@ -492,7 +542,7 @@ index b33f30b3ec0d..9b78bdcd55b0 100644
&PluginRegistryImpl::Bind, base::Unretained(plugin_registry_.get())));
#endif
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index d5d82b53dd5e..080011133034 100644
index a746e1dae051..59e4316ab2ae 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -101,7 +101,6 @@ class ServiceWorkerDispatcherHost;
@ -512,7 +562,7 @@ index d5d82b53dd5e..080011133034 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -516,7 +515,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -518,7 +517,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Use CreateRenderProcessHost() instead of calling this constructor
// directly.
RenderProcessHostImpl(BrowserContext* browser_context,
@ -521,7 +571,7 @@ index d5d82b53dd5e..080011133034 100644
bool is_for_guests_only);
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
@@ -782,10 +781,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -787,10 +786,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// The globally-unique identifier for this RPH.
const int id_;
@ -586,10 +636,10 @@ index 8e4df0b15aeb..02bcdca69af9 100644
->CreateService(std::move(request), origin);
}));
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
index afc09164afd8..8b6e2cacc9d2 100644
index 84aa3aa2091f..86a3e1ff3206 100644
--- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h
@@ -98,8 +98,8 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -99,8 +99,8 @@ class CONTENT_EXPORT StoragePartitionImpl
storage::FileSystemContext* GetFileSystemContext() override;
storage::DatabaseTracker* GetDatabaseTracker() override;
DOMStorageContextWrapper* GetDOMStorageContext() override;
@ -600,12 +650,11 @@ index afc09164afd8..8b6e2cacc9d2 100644
IndexedDBContextImpl* GetIndexedDBContext() override;
CacheStorageContextImpl* GetCacheStorageContext() override;
ServiceWorkerContextWrapper* GetServiceWorkerContext() override;
@@ -144,15 +144,16 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -145,14 +145,15 @@ class CONTENT_EXPORT StoragePartitionImpl
void FlushNetworkInterfaceForTesting() override;
void WaitForDeletionTasksForTesting() override;
- BackgroundFetchContext* GetBackgroundFetchContext();
- BackgroundSyncContext* GetBackgroundSyncContext();
- PaymentAppContextImpl* GetPaymentAppContext();
- BroadcastChannelProvider* GetBroadcastChannelProvider();
- BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap();
@ -614,7 +663,6 @@ index afc09164afd8..8b6e2cacc9d2 100644
- CookieStoreContext* GetCookieStoreContext();
- DevToolsBackgroundServicesContext* GetDevToolsBackgroundServicesContext();
+ BackgroundFetchContext* GetBackgroundFetchContext() override;
+ BackgroundSyncContext* GetBackgroundSyncContext() override;
+ PaymentAppContextImpl* GetPaymentAppContext() override;
+ BroadcastChannelProvider* GetBroadcastChannelProvider() override;
+ BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
@ -626,7 +674,7 @@ index afc09164afd8..8b6e2cacc9d2 100644
// blink::mojom::StoragePartitionService interface.
void OpenLocalStorage(const url::Origin& origin,
@@ -170,21 +171,22 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -169,21 +170,22 @@ class CONTENT_EXPORT StoragePartitionImpl
const GURL& origin,
OnCanSendDomainReliabilityUploadCallback callback) override;
@ -654,7 +702,7 @@ index afc09164afd8..8b6e2cacc9d2 100644
auto& bindings_for_testing() { return bindings_; }
@@ -195,10 +197,11 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -194,10 +196,11 @@ class CONTENT_EXPORT StoragePartitionImpl
// one must use the "chrome-guest://blahblah" site URL to ensure that the
// service worker stays in this StoragePartition. This is an empty GURL if
// this StoragePartition is not for guests.
@ -729,11 +777,11 @@ index 63fe0125ca1c..698378600723 100644
RenderFrameHost* render_frame_host_;
diff --git content/browser/worker_host/dedicated_worker_host.cc content/browser/worker_host/dedicated_worker_host.cc
index d0eae9ed2150..edf0c88464d8 100644
index d55172625502..22abdeec0c94 100644
--- content/browser/worker_host/dedicated_worker_host.cc
+++ content/browser/worker_host/dedicated_worker_host.cc
@@ -77,8 +77,7 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {
client->OnScriptLoadFailed();
@@ -76,8 +76,7 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {
client->OnScriptLoadStartFailed();
return;
}
- auto* storage_partition_impl = static_cast<StoragePartitionImpl*>(
@ -741,8 +789,8 @@ index d0eae9ed2150..edf0c88464d8 100644
+ auto* storage_partition_impl = render_process_host->GetStoragePartition();
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory;
if (blob_url_token) {
@@ -93,11 +92,13 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {
if (script_url.SchemeIsBlob()) {
@@ -95,11 +94,13 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {
}
appcache_handle_ = std::make_unique<AppCacheNavigationHandle>(
@ -757,17 +805,7 @@ index d0eae9ed2150..edf0c88464d8 100644
+ storage_partition_impl->GetServiceWorkerContext()),
appcache_handle_->core(), std::move(blob_url_loader_factory),
storage_partition_impl,
base::BindOnce(&DedicatedWorkerHost::DidLoadDedicatedWorker,
@@ -141,8 +142,7 @@ class DedicatedWorkerHost : public service_manager::mojom::InterfaceProvider {
client->OnScriptLoadFailed();
return;
}
- auto* storage_partition_impl = static_cast<StoragePartitionImpl*>(
- render_process_host->GetStoragePartition());
+ auto* storage_partition_impl = render_process_host->GetStoragePartition();
// Set up the default network loader factory.
network::mojom::URLLoaderFactoryPtrInfo default_factory_info;
base::BindOnce(&DedicatedWorkerHost::DidStartScriptLoad,
diff --git content/browser/worker_host/shared_worker_connector_impl.cc content/browser/worker_host/shared_worker_connector_impl.cc
index 4b410f1384b0..299e9402b93d 100644
--- content/browser/worker_host/shared_worker_connector_impl.cc
@ -784,7 +822,7 @@ index 4b410f1384b0..299e9402b93d 100644
std::move(client), creation_context_type,
blink::MessagePortChannel(std::move(message_port)),
diff --git content/browser/worker_host/worker_script_fetch_initiator.cc content/browser/worker_host/worker_script_fetch_initiator.cc
index a8f396c70a7b..ba94144b93e0 100644
index 81453c24a3a0..ded1058db7e7 100644
--- content/browser/worker_host/worker_script_fetch_initiator.cc
+++ content/browser/worker_host/worker_script_fetch_initiator.cc
@@ -11,11 +11,11 @@
@ -800,22 +838,15 @@ index a8f396c70a7b..ba94144b93e0 100644
#include "content/browser/url_loader_factory_getter.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/browser/worker_host/worker_script_fetcher.h"
@@ -23,12 +23,14 @@
#include "content/browser/worker_host/worker_script_loader_factory.h"
#include "content/common/content_constants_internal.h"
#include "content/common/navigation_subresource_loader_params.h"
+#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_frame_host.h"
@@ -31,6 +31,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/shared_cors_origin_access_list.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/origin_util.h"
@@ -53,7 +55,7 @@ void WorkerScriptFetchInitiator::Start(
@@ -54,7 +55,7 @@ void WorkerScriptFetchInitiator::Start(
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
AppCacheNavigationHandleCore* appcache_handle_core,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
@ -823,17 +854,17 @@ index a8f396c70a7b..ba94144b93e0 100644
+ StoragePartition* storage_partition,
CompletionCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(blink::ServiceWorkerUtils::IsServicificationEnabled());
@@ -99,7 +101,7 @@ void WorkerScriptFetchInitiator::Start(
DCHECK(storage_partition);
@@ -113,7 +114,7 @@ void WorkerScriptFetchInitiator::Start(
base::BindOnce(
&WorkerScriptFetchInitiator::CreateScriptLoaderOnIO, process_id,
std::move(resource_request),
- storage_partition->url_loader_factory_getter(),
+ base::WrapRefCounted(storage_partition->url_loader_factory_getter()),
std::move(factory_bundle_for_browser),
std::move(subresource_loader_factories),
std::move(subresource_loader_factories), resource_context,
std::move(service_worker_context), appcache_handle_core,
@@ -110,7 +112,7 @@ void WorkerScriptFetchInitiator::Start(
@@ -124,7 +125,7 @@ void WorkerScriptFetchInitiator::Start(
std::unique_ptr<blink::URLLoaderFactoryBundleInfo>
WorkerScriptFetchInitiator::CreateFactoryBundle(
int process_id,
@ -841,21 +872,21 @@ index a8f396c70a7b..ba94144b93e0 100644
+ StoragePartition* storage_partition,
bool file_support) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(blink::ServiceWorkerUtils::IsServicificationEnabled());
diff --git content/browser/worker_host/worker_script_fetch_initiator.h content/browser/worker_host/worker_script_fetch_initiator.h
index 8bf63d954554..47a03e2d3364 100644
index d334e29ed59b..62e3101ac0ce 100644
--- content/browser/worker_host/worker_script_fetch_initiator.h
+++ content/browser/worker_host/worker_script_fetch_initiator.h
@@ -32,7 +32,7 @@ namespace content {
class AppCacheNavigationHandleCore;
class BrowserContext;
@@ -35,7 +35,7 @@ class BrowserContext;
class ResourceContext;
class ServiceWorkerContextWrapper;
class ServiceWorkerObjectHost;
-class StoragePartitionImpl;
+class StoragePartition;
class URLLoaderFactoryGetter;
struct SubresourceLoaderParams;
@@ -59,14 +59,14 @@ class WorkerScriptFetchInitiator {
@@ -63,14 +63,14 @@ class WorkerScriptFetchInitiator {
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
AppCacheNavigationHandleCore* appcache_handle_core,
scoped_refptr<network::SharedURLLoaderFactory> blob_url_loader_factory,
@ -900,7 +931,7 @@ index 0a6913f2ca56..31bda5a84c31 100644
const std::string unique_id_;
bool was_notify_will_be_destroyed_called_ = false;
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
index 911c9e347c33..6f97bbd947a9 100644
index f3bf35ed1ff7..8059c07a44f2 100644
--- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h
@@ -14,8 +14,10 @@
@ -914,12 +945,11 @@ index 911c9e347c33..6f97bbd947a9 100644
class GURL;
@@ -59,12 +61,30 @@ class PlatformNotificationContext;
@@ -60,12 +62,29 @@ class PlatformNotificationContext;
class ServiceWorkerContext;
class SharedWorkerService;
+class BackgroundFetchContext;
+class BackgroundSyncContext;
+class BlobRegistryWrapper;
+class BlobURLLoaderFactory;
+class BluetoothAllowedDevicesMap;
@ -945,7 +975,7 @@ index 911c9e347c33..6f97bbd947a9 100644
// Defines what persistent state a child process can access.
//
// The StoragePartition defines the view each child process has of the
@@ -104,6 +124,8 @@ class CONTENT_EXPORT StoragePartition {
@@ -106,6 +125,8 @@ class CONTENT_EXPORT StoragePartition {
virtual storage::FileSystemContext* GetFileSystemContext() = 0;
virtual storage::DatabaseTracker* GetDatabaseTracker() = 0;
virtual DOMStorageContext* GetDOMStorageContext() = 0;
@ -954,12 +984,11 @@ index 911c9e347c33..6f97bbd947a9 100644
virtual IndexedDBContext* GetIndexedDBContext() = 0;
virtual ServiceWorkerContext* GetServiceWorkerContext() = 0;
virtual SharedWorkerService* GetSharedWorkerService() = 0;
@@ -239,6 +261,30 @@ class CONTENT_EXPORT StoragePartition {
@@ -241,6 +262,29 @@ class CONTENT_EXPORT StoragePartition {
// Wait until all deletions tasks are finished. For test use only.
virtual void WaitForDeletionTasksForTesting() = 0;
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
+ virtual PaymentAppContextImpl* GetPaymentAppContext() = 0;
+ virtual BroadcastChannelProvider* GetBroadcastChannelProvider() = 0;
+ virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0;

View File

@ -1,5 +1,5 @@
diff --git base/trace_event/builtin_categories.h base/trace_event/builtin_categories.h
index 72adf46bf133..1af3dfddb795 100644
index ac68abb4ab2a..310f36e807c3 100644
--- base/trace_event/builtin_categories.h
+++ base/trace_event/builtin_categories.h
@@ -47,6 +47,8 @@

Some files were not shown because too many files have changed in this diff Show More