Update to Chromium revision 66afc5e5 (#540276)

This commit is contained in:
Marshall Greenblatt
2018-03-20 16:15:08 -04:00
parent 4fb6e1ba29
commit 7a59914f97
128 changed files with 1921 additions and 1477 deletions

View File

@ -1,8 +1,8 @@
diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc
index 71bf90c54ae5..d3308da307d7 100644
index b5f06abaeb8a..dd0fac00e45e 100644
--- content/browser/appcache/appcache_internals_ui.cc
+++ content/browser/appcache/appcache_internals_ui.cc
@@ -372,8 +372,8 @@ void AppCacheInternalsUI::CreateProxyForPartition(
@@ -371,8 +371,8 @@ void AppCacheInternalsUI::CreateProxyForPartition(
StoragePartition* storage_partition) {
scoped_refptr<Proxy> proxy =
new Proxy(weak_ptr_factory_.GetWeakPtr(), storage_partition->GetPath());
@ -28,10 +28,10 @@ index be53f5115d3d..92f09f04f3a1 100644
origin, std::move(request)));
}
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index 0478c2f4dccf..4faa6c1d4b46 100644
index 05e3cc192262..3775eab5323b 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -76,6 +76,11 @@ class BlobHandleImpl : public BlobHandle {
@@ -85,6 +85,11 @@ class BlobHandleImpl : public BlobHandle {
ChromeBlobStorageContext::ChromeBlobStorageContext() {}
@ -73,10 +73,10 @@ index e5c7291dcc8f..0eec8a11db35 100644
partition->GetBluetoothAllowedDevicesMap();
return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin());
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
index 125078b9cb44..b24609a807ba 100644
index 0cf6cde723e6..ae04e57bfcbb 100644
--- content/browser/browser_context.cc
+++ content/browser/browser_context.cc
@@ -127,11 +127,18 @@ StoragePartition* GetStoragePartitionFromConfig(
@@ -132,11 +132,18 @@ StoragePartition* GetStoragePartitionFromConfig(
StoragePartitionImplMap* partition_map =
GetStoragePartitionMap(browser_context);
@ -98,7 +98,7 @@ index 125078b9cb44..b24609a807ba 100644
}
void SaveSessionStateOnIOThread(
@@ -553,6 +560,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
@@ -579,6 +586,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
BrowserContext::BrowserContext()
: media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {}
@ -111,24 +111,46 @@ index 125078b9cb44..b24609a807ba 100644
CHECK(GetUserData(kMojoWasInitialized))
<< "Attempting to destroy a BrowserContext that never called "
diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc
index 64dff1f030bb..244f62ec40dc 100644
index 5501f6ad645d..7ecacac8c92d 100644
--- content/browser/devtools/protocol/service_worker_handler.cc
+++ content/browser/devtools/protocol/service_worker_handler.cc
@@ -337,8 +337,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
if (!base::StringToInt64(registration_id, &id))
return CreateInvalidVersionIdErrorResponse();
@@ -170,8 +170,7 @@ void ServiceWorkerHandler::SetRenderer(int process_host_id,
return;
}
- StoragePartitionImpl* partition =
- static_cast<StoragePartitionImpl*>(process_->GetStoragePartition());
+ StoragePartition* partition = process_->GetStoragePartition();
BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext();
- storage_partition_ =
- static_cast<StoragePartitionImpl*>(process_host->GetStoragePartition());
+ storage_partition_ = process_host->GetStoragePartition();
DCHECK(storage_partition_);
context_ = static_cast<ServiceWorkerContextWrapper*>(
storage_partition_->GetServiceWorkerContext());
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
+++ content/browser/devtools/protocol/service_worker_handler.h
@@ -24,7 +24,7 @@ class BrowserContext;
class RenderFrameHostImpl;
class ServiceWorkerContextWatcher;
class ServiceWorkerContextWrapper;
-class StoragePartitionImpl;
+class StoragePartition;
namespace protocol {
@@ -74,7 +74,7 @@ class ServiceWorkerHandler : public DevToolsDomainHandler,
bool enabled_;
scoped_refptr<ServiceWorkerContextWatcher> context_watcher_;
BrowserContext* browser_context_;
- StoragePartitionImpl* storage_partition_;
+ StoragePartition* storage_partition_;
base::WeakPtrFactory<ServiceWorkerHandler> weak_factory_;
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
index 11eb1d3b732a..52962a868999 100644
index 02470e87915b..38caa4e8a936 100644
--- content/browser/download/download_manager_impl.cc
+++ content/browser/download/download_manager_impl.cc
@@ -73,9 +73,9 @@
@@ -78,9 +78,9 @@
namespace content {
namespace {
@ -141,7 +163,7 @@ index 11eb1d3b732a..52962a868999 100644
DCHECK_CURRENTLY_ON(BrowserThread::UI);
SiteInstance* site_instance = nullptr;
@@ -85,8 +85,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
@@ -90,8 +90,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
if (render_frame_host_)
site_instance = render_frame_host_->GetSiteInstance();
}
@ -151,8 +173,8 @@ index 11eb1d3b732a..52962a868999 100644
}
bool CanRequestURLFromRenderer(int render_process_id, GURL url) {
@@ -1069,7 +1068,7 @@ void DownloadManagerImpl::BeginDownloadInternal(
if (base::FeatureList::IsEnabled(features::kNetworkService)) {
@@ -1161,7 +1160,7 @@ void DownloadManagerImpl::BeginDownloadInternal(
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
std::unique_ptr<network::ResourceRequest> request =
CreateResourceRequest(params.get());
- StoragePartitionImpl* storage_partition =
@ -160,22 +182,36 @@ index 11eb1d3b732a..52962a868999 100644
GetStoragePartition(browser_context_, params->render_process_host_id(),
params->render_frame_host_routing_id());
@@ -1090,7 +1089,8 @@ void DownloadManagerImpl::BeginDownloadInternal(
@@ -1182,7 +1181,8 @@ void DownloadManagerImpl::BeginDownloadInternal(
BrowserThread::IO, FROM_HERE,
base::BindOnce(
&BeginResourceDownload, std::move(params), std::move(request),
- storage_partition->url_loader_factory_getter(),
+ base::WrapRefCounted(
+ storage_partition->url_loader_factory_getter()),
base::WrapRefCounted(storage_partition->GetFileSystemContext()), id,
weak_factory_.GetWeakPtr(), site_url, tab_url, tab_referrer_url),
base::BindOnce(&BeginResourceDownload, std::move(params),
std::move(request), std::move(blob_data_handle),
- storage_partition->url_loader_factory_getter(), id,
+ base::WrapRefCounted(
+ storage_partition->url_loader_factory_getter()), id,
weak_factory_.GetWeakPtr(), site_url, tab_url,
tab_referrer_url),
base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler,
diff --git content/browser/download/parallel_download_job.cc content/browser/download/parallel_download_job.cc
index de25ae93f74d..73f490f783c9 100644
--- content/browser/download/parallel_download_job.cc
+++ content/browser/download/parallel_download_job.cc
@@ -304,8 +304,7 @@ void ParallelDownloadJob::CreateRequest(int64_t offset, int64_t length) {
// Send the request.
worker->SendRequest(std::move(download_params),
- static_cast<StoragePartitionImpl*>(storage_partition)
- ->url_loader_factory_getter());
+ storage_partition->url_loader_factory_getter());
DCHECK(workers_.find(offset) == workers_.end());
workers_[offset] = std::move(worker);
}
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
index d9297fa8365e..38a3fb629a7a 100644
index 8e4c4a42b0a0..f78f3d3817ae 100644
--- content/browser/loader/navigation_url_loader_network_service.cc
+++ content/browser/loader/navigation_url_loader_network_service.cc
@@ -868,11 +868,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
.PassInterface();
@@ -1020,11 +1020,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
}
}
- auto* partition = static_cast<StoragePartitionImpl*>(storage_partition);
@ -187,13 +223,29 @@ index d9297fa8365e..38a3fb629a7a 100644
+ base::WrapRefCounted(partition->url_loader_factory_getter()),
+ request_info->common_params.url,
request_info->begin_params->initiator_origin,
request_info->begin_params->suggested_filename,
weak_factory_.GetWeakPtr());
request_info->common_params.suggested_filename,
std::move(proxied_factory_request), std::move(proxied_factory_info),
diff --git content/browser/payments/payment_app_installer.cc content/browser/payments/payment_app_installer.cc
index d01fb931d358..962d10d44141 100644
--- content/browser/payments/payment_app_installer.cc
+++ content/browser/payments/payment_app_installer.cc
@@ -125,9 +125,9 @@ class SelfDeleteInstaller
void SetPaymentAppIntoDatabase() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
+ StoragePartition* partition =
BrowserContext::GetDefaultStoragePartition(
- web_contents()->GetBrowserContext()));
+ web_contents()->GetBrowserContext());
scoped_refptr<PaymentAppContextImpl> payment_app_context =
partition->GetPaymentAppContext();
diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc
index b9d2670514c0..004939aa055a 100644
index d899d32fd383..7e62c70fc70a 100644
--- content/browser/payments/payment_app_provider_impl.cc
+++ content/browser/payments/payment_app_provider_impl.cc
@@ -328,10 +328,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
@@ -329,10 +329,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
ServiceWorkerStartCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -208,7 +260,7 @@ index b9d2670514c0..004939aa055a 100644
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -357,8 +358,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
@@ -373,8 +374,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
GetAllPaymentAppsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -220,10 +272,10 @@ index b9d2670514c0..004939aa055a 100644
partition->GetPaymentAppContext();
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index 22c72f3ac929..c12815670521 100644
index 8c34d8e7af5e..55c0060a6c81 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -497,9 +497,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
@@ -500,9 +500,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
SpareRenderProcessHostManager() {}
void WarmupSpareRenderProcessHost(BrowserContext* browser_context) {
@ -235,7 +287,7 @@ index 22c72f3ac929..c12815670521 100644
if (spare_render_process_host_ &&
matching_browser_context_ == browser_context &&
@@ -638,11 +637,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
@@ -641,11 +640,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
// Gets the correct render process to use for this SiteInstance.
RenderProcessHost* GetProcessHost(SiteInstance* site_instance,
bool is_for_guests_only) {
@ -251,7 +303,7 @@ index 22c72f3ac929..c12815670521 100644
// Is this the default storage partition? If it isn't, then just give it its
// own non-shared process.
@@ -1237,7 +1235,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
@@ -1240,7 +1238,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
// static
RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
BrowserContext* browser_context,
@ -260,7 +312,7 @@ index 22c72f3ac929..c12815670521 100644
SiteInstance* site_instance,
bool is_for_guests_only) {
if (g_render_process_host_factory_) {
@@ -1246,8 +1244,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
@@ -1249,8 +1247,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
}
if (!storage_partition_impl) {
@ -271,7 +323,7 @@ index 22c72f3ac929..c12815670521 100644
}
// If we've made a StoragePartition for guests (e.g., for the <webview> tag),
// stash the Site URL on it. This way, when we start a service worker inside
@@ -1269,7 +1267,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
@@ -1272,7 +1270,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
// static
RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context,
@ -280,7 +332,7 @@ index 22c72f3ac929..c12815670521 100644
SiteInstance* site_instance,
bool is_for_guests_only) {
RenderProcessHost* render_process_host =
@@ -1289,7 +1287,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
@@ -1292,7 +1290,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
@ -289,7 +341,7 @@ index 22c72f3ac929..c12815670521 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -1322,7 +1320,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -1325,7 +1323,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(new IndexedDBDispatcherHost(
id_,
storage_partition_impl_->GetURLRequestContext(),
@ -299,7 +351,7 @@ index 22c72f3ac929..c12815670521 100644
ChromeBlobStorageContext::GetFor(browser_context_))),
channel_connected_(false),
sent_render_process_ready_(false),
@@ -1356,7 +1355,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -1359,7 +1358,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
}
push_messaging_manager_.reset(new PushMessagingManager(
@ -309,7 +361,7 @@ index 22c72f3ac929..c12815670521 100644
AddObserver(indexed_db_factory_.get());
@@ -1671,6 +1671,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1680,6 +1680,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -330,7 +382,7 @@ index 22c72f3ac929..c12815670521 100644
AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1685,8 +1699,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1694,8 +1708,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals,
@ -341,7 +393,7 @@ index 22c72f3ac929..c12815670521 100644
AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1715,10 +1729,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1724,10 +1738,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
ChromeBlobStorageContext::GetFor(browser_context);
resource_message_filter_ = new ResourceMessageFilter(
@ -349,12 +401,12 @@ index 22c72f3ac929..c12815670521 100644
+ GetID(), app_cache_service,
blob_storage_context.get(),
storage_partition_impl_->GetFileSystemContext(),
- storage_partition_impl_->GetServiceWorkerContext(), get_contexts_callback,
+ service_worker_context, get_contexts_callback,
- storage_partition_impl_->GetServiceWorkerContext(),
+ service_worker_context,
storage_partition_impl_->GetPrefetchURLLoaderService(),
get_contexts_callback,
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
AddFilter(resource_message_filter_.get());
@@ -1743,8 +1757,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1754,8 +1768,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
}
AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
@ -364,7 +416,7 @@ index 22c72f3ac929..c12815670521 100644
#if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
@@ -1767,13 +1780,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1778,13 +1791,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost();
@ -380,7 +432,7 @@ index 22c72f3ac929..c12815670521 100644
AddFilter(service_worker_filter.get());
#if BUILDFLAG(ENABLE_WEBRTC)
@@ -1785,11 +1797,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1796,11 +1808,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new TraceMessageFilter(GetID()));
AddFilter(new ResolveProxyMsgHelper(request_context.get()));
@ -393,7 +445,7 @@ index 22c72f3ac929..c12815670521 100644
resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get());
@@ -1931,7 +1940,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
@@ -1934,7 +1943,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&AppCacheDispatcherHost::Create,
@ -404,7 +456,7 @@ index 22c72f3ac929..c12815670521 100644
AddUIThreadInterface(registry.get(), base::Bind(&FieldTrialRecorder::Create));
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index f81189990b1f..39afa6c9ecfd 100644
index 51c2ff46b9ad..5e830df5d433 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -83,7 +83,6 @@ class ResourceMessageFilter;
@ -414,8 +466,8 @@ index f81189990b1f..39afa6c9ecfd 100644
-class StoragePartitionImpl;
#if BUILDFLAG(ENABLE_WEBRTC)
class MediaStreamDispatcherHost;
@@ -127,7 +126,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
class P2PSocketDispatcherHost;
@@ -126,7 +125,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// legal).
static RenderProcessHost* CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context,
@ -424,7 +476,7 @@ index f81189990b1f..39afa6c9ecfd 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -139,7 +138,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -138,7 +137,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// null.
static RenderProcessHost* CreateRenderProcessHost(
BrowserContext* browser_context,
@ -433,7 +485,7 @@ index f81189990b1f..39afa6c9ecfd 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -420,7 +419,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -419,7 +418,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Use CreateRenderProcessHost() instead of calling this constructor
// directly.
RenderProcessHostImpl(BrowserContext* browser_context,
@ -442,7 +494,7 @@ index f81189990b1f..39afa6c9ecfd 100644
bool is_for_guests_only);
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
@@ -656,10 +655,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -655,10 +654,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// called.
int instance_id_ = 1;
@ -456,10 +508,10 @@ index f81189990b1f..39afa6c9ecfd 100644
// The observers watching our lifetime.
base::ObserverList<RenderProcessHostObserver> observers_;
diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc
index 01ba96322f69..6dde251b3d1b 100644
index 9b1c71bdb19c..891969b30d79 100644
--- content/browser/renderer_interface_binders.cc
+++ content/browser/renderer_interface_binders.cc
@@ -133,7 +133,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -134,7 +134,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(
base::Bind([](payments::mojom::PaymentManagerRequest request,
RenderProcessHost* host, const url::Origin& origin) {
@ -468,7 +520,7 @@ index 01ba96322f69..6dde251b3d1b 100644
->GetPaymentAppContext()
->CreatePaymentManager(std::move(request));
}));
@@ -147,7 +147,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -148,7 +148,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(base::BindRepeating(
[](blink::mojom::LockManagerRequest request, RenderProcessHost* host,
const url::Origin& origin) {
@ -477,7 +529,7 @@ index 01ba96322f69..6dde251b3d1b 100644
->GetLockManager()
->CreateService(std::move(request), origin);
}));
@@ -156,9 +156,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -157,9 +157,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(
base::Bind([](blink::mojom::NotificationServiceRequest request,
RenderProcessHost* host, const url::Origin& origin) {
@ -492,28 +544,25 @@ index 01ba96322f69..6dde251b3d1b 100644
parameterized_binder_registry_.AddInterface(
base::BindRepeating(&BackgroundFetchServiceImpl::Create));
diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc
index 1e95910e7168..45adb88b1e96 100644
index 11b579bdeca4..8dcbe5ff390e 100644
--- content/browser/shared_worker/shared_worker_connector_impl.cc
+++ content/browser/shared_worker/shared_worker_connector_impl.cc
@@ -34,10 +34,9 @@ void SharedWorkerConnectorImpl::Connect(
mojom::SharedWorkerClientPtr client,
blink::mojom::SharedWorkerCreationContextType creation_context_type,
mojo::ScopedMessagePipeHandle message_port) {
- SharedWorkerServiceImpl* service =
- static_cast<StoragePartitionImpl*>(
- RenderProcessHost::FromID(process_id_)->GetStoragePartition())
@@ -41,8 +41,8 @@ void SharedWorkerConnectorImpl::Connect(
return;
}
SharedWorkerServiceImpl* service =
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
- ->GetSharedWorkerService();
+ SharedWorkerServiceImpl* service = static_cast<SharedWorkerServiceImpl*>(
+ RenderProcessHost::FromID(process_id_)->GetStoragePartition()
+ static_cast<SharedWorkerServiceImpl*>(host->GetStoragePartition()
+ ->GetSharedWorkerService());
service->ConnectToWorker(process_id_, frame_id_, std::move(info),
std::move(client), creation_context_type,
blink::MessagePortChannel(std::move(message_port)));
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
index 4fb38a200f04..182f14ead806 100644
index 580d2e0d78d9..0309f5c1df48 100644
--- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h
@@ -87,7 +87,7 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -99,7 +99,7 @@ class CONTENT_EXPORT StoragePartitionImpl
storage::FileSystemContext* GetFileSystemContext() override;
storage::DatabaseTracker* GetDatabaseTracker() override;
DOMStorageContextWrapper* GetDOMStorageContext() override;
@ -522,9 +571,9 @@ index 4fb38a200f04..182f14ead806 100644
IndexedDBContextImpl* GetIndexedDBContext() override;
CacheStorageContextImpl* GetCacheStorageContext() override;
ServiceWorkerContextWrapper* GetServiceWorkerContext() override;
@@ -124,13 +124,13 @@ class CONTENT_EXPORT StoragePartitionImpl
void ClearBluetoothAllowedDevicesMapForTesting() override;
@@ -137,14 +137,14 @@ class CONTENT_EXPORT StoragePartitionImpl
void FlushNetworkInterfaceForTesting() override;
void WaitForDeletionTasksForTesting() override;
- BackgroundFetchContext* GetBackgroundFetchContext();
- BackgroundSyncContext* GetBackgroundSyncContext();
@ -533,6 +582,7 @@ index 4fb38a200f04..182f14ead806 100644
- BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap();
- BlobURLLoaderFactory* GetBlobURLLoaderFactory();
- BlobRegistryWrapper* GetBlobRegistry();
- PrefetchURLLoaderService* GetPrefetchURLLoaderService();
+ BackgroundFetchContext* GetBackgroundFetchContext() override;
+ BackgroundSyncContext* GetBackgroundSyncContext() override;
+ PaymentAppContextImpl* GetPaymentAppContext() override;
@ -540,12 +590,13 @@ index 4fb38a200f04..182f14ead806 100644
+ BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
+ BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
+ BlobRegistryWrapper* GetBlobRegistry() override;
+ PrefetchURLLoaderService* GetPrefetchURLLoaderService() override;
// mojom::StoragePartitionService interface.
void OpenLocalStorage(
@@ -141,18 +141,18 @@ class CONTENT_EXPORT StoragePartitionImpl
const url::Origin& origin,
mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override;
void OpenLocalStorage(const url::Origin& origin,
@@ -153,18 +153,18 @@ class CONTENT_EXPORT StoragePartitionImpl
const std::string& namespace_id,
mojom::SessionStorageNamespaceRequest request) override;
- scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter() {
- return url_loader_factory_getter_;
@ -566,7 +617,7 @@ index 4fb38a200f04..182f14ead806 100644
auto& bindings_for_testing() { return bindings_; }
@@ -163,10 +163,11 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -175,10 +175,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.
@ -609,7 +660,7 @@ index 075ae3e7431e..57fb5fd2c4a8 100644
void InitializeOnIOThread();
diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc
index 53845bd346ed..e2c023cd688e 100644
index 32457c8510f9..27f3012f76f5 100644
--- content/browser/webui/web_ui_url_loader_factory.cc
+++ content/browser/webui/web_ui_url_loader_factory.cc
@@ -20,13 +20,13 @@
@ -627,7 +678,7 @@ index 53845bd346ed..e2c023cd688e 100644
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/url_constants.h"
@@ -302,9 +302,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory,
@@ -296,9 +296,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory,
const std::string& scheme() const { return scheme_; }
private:
@ -640,10 +691,10 @@ index 53845bd346ed..e2c023cd688e 100644
RenderFrameHost* render_frame_host_;
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
index f75be61ccdef..84f1063fb081 100644
index 9edd7b1d9123..c61b034c68cc 100644
--- content/public/browser/browser_context.h
+++ content/public/browser/browser_context.h
@@ -200,6 +200,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
@@ -207,6 +207,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
BrowserContext();
@ -652,7 +703,7 @@ index f75be61ccdef..84f1063fb081 100644
~BrowserContext() override;
// Shuts down the storage partitions associated to this browser context.
@@ -288,6 +290,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
@@ -295,6 +297,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
const base::FilePath& partition_path,
bool in_memory) = 0;
@ -668,18 +719,18 @@ index f75be61ccdef..84f1063fb081 100644
std::map<std::string, service_manager::EmbeddedServiceInfo>;
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
index 9bf0a872f380..73ede1ccdedf 100644
index 55c298e02b57..b277e50ab372 100644
--- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
@@ -14,6 +14,7 @@
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/public/common/shared_url_loader_factory.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "net/cookies/cookie_store.h"
class GURL;
@@ -49,13 +50,22 @@ class DatabaseTracker;
@@ -49,13 +50,23 @@ class DatabaseTracker;
namespace content {
class AppCacheService;
@ -696,13 +747,14 @@ index 9bf0a872f380..73ede1ccdedf 100644
+class LockManager;
+class PaymentAppContextImpl;
class PlatformNotificationContext;
+class PrefetchURLLoaderService;
class ServiceWorkerContext;
class SharedWorkerService;
+class URLLoaderFactoryGetter;
#if !defined(OS_ANDROID)
class HostZoomLevelContext;
@@ -63,6 +73,10 @@ class HostZoomMap;
@@ -63,6 +74,10 @@ class HostZoomMap;
class ZoomLevelDelegate;
#endif // !defined(OS_ANDROID)
@ -713,7 +765,7 @@ index 9bf0a872f380..73ede1ccdedf 100644
// Defines what persistent state a child process can access.
//
// The StoragePartition defines the view each child process has of the
@@ -88,6 +102,7 @@ class CONTENT_EXPORT StoragePartition {
@@ -90,6 +105,7 @@ class CONTENT_EXPORT StoragePartition {
virtual storage::FileSystemContext* GetFileSystemContext() = 0;
virtual storage::DatabaseTracker* GetDatabaseTracker() = 0;
virtual DOMStorageContext* GetDOMStorageContext() = 0;
@ -721,9 +773,9 @@ index 9bf0a872f380..73ede1ccdedf 100644
virtual IndexedDBContext* GetIndexedDBContext() = 0;
virtual ServiceWorkerContext* GetServiceWorkerContext() = 0;
virtual SharedWorkerService* GetSharedWorkerService() = 0;
@@ -204,6 +219,25 @@ class CONTENT_EXPORT StoragePartition {
// use only.
virtual void FlushNetworkInterfaceForTesting() = 0;
@@ -209,6 +225,26 @@ 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;
@ -732,6 +784,7 @@ index 9bf0a872f380..73ede1ccdedf 100644
+ virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0;
+ virtual BlobURLLoaderFactory* GetBlobURLLoaderFactory() = 0;
+ virtual BlobRegistryWrapper* GetBlobRegistry() = 0;
+ virtual PrefetchURLLoaderService* GetPrefetchURLLoaderService() = 0;
+
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
+ virtual BrowserContext* browser_context() const = 0;
@ -748,10 +801,10 @@ index 9bf0a872f380..73ede1ccdedf 100644
virtual ~StoragePartition() {}
};
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
index e1e508e205be..10432c7d833e 100644
index f6986c4babc4..1a467451e351 100644
--- storage/browser/database/database_tracker.cc
+++ storage/browser/database/database_tracker.cc
@@ -491,7 +491,7 @@ bool DatabaseTracker::LazyInit() {
@@ -492,7 +492,7 @@ bool DatabaseTracker::LazyInit() {
meta_table_.reset(new sql::MetaTable());
is_initialized_ =