Update to Chromium revision bc084a8b (#530369)

This commit is contained in:
Marshall Greenblatt
2018-02-14 19:12:09 -05:00
parent ac86b61139
commit 9e644b7538
113 changed files with 1930 additions and 1797 deletions

View File

@ -13,8 +13,22 @@ index 71bf90c54ae5..d3308da307d7 100644
appcache_proxies_.push_back(proxy);
}
diff --git content/browser/background_fetch/background_fetch_service_impl.cc content/browser/background_fetch/background_fetch_service_impl.cc
index be53f5115d3d..92f09f04f3a1 100644
--- content/browser/background_fetch/background_fetch_service_impl.cc
+++ content/browser/background_fetch/background_fetch_service_impl.cc
@@ -38,8 +38,7 @@ void BackgroundFetchServiceImpl::Create(
BrowserThread::IO, FROM_HERE,
base::BindOnce(
BackgroundFetchServiceImpl::CreateOnIoThread,
- WrapRefCounted(static_cast<StoragePartitionImpl*>(
- render_process_host->GetStoragePartition())
+ WrapRefCounted(render_process_host->GetStoragePartition()
->GetBackgroundFetchContext()),
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 bf41a25bcd29..9e6dd89497e7 100644
index 0478c2f4dccf..4faa6c1d4b46 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 {
@ -30,10 +44,10 @@ index bf41a25bcd29..9e6dd89497e7 100644
BrowserContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
index 2412f15c5fb7..3434d129af64 100644
index 8c5b031e1e65..bbe6fa6525a6 100644
--- content/browser/blob_storage/chrome_blob_storage_context.h
+++ content/browser/blob_storage/chrome_blob_storage_context.h
@@ -47,6 +47,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext
@@ -50,6 +50,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext
public:
ChromeBlobStorageContext();
@ -97,7 +111,7 @@ 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 d2478ae31473..5fd30c1cd72c 100644
index 64dff1f030bb..244f62ec40dc 100644
--- content/browser/devtools/protocol/service_worker_handler.cc
+++ content/browser/devtools/protocol/service_worker_handler.cc
@@ -337,8 +337,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
@ -111,12 +125,12 @@ index d2478ae31473..5fd30c1cd72c 100644
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
index 0992aad5fe6c..788d432c48d9 100644
index 11eb1d3b732a..52962a868999 100644
--- content/browser/download/download_manager_impl.cc
+++ content/browser/download/download_manager_impl.cc
@@ -83,9 +83,9 @@ WebContents* GetWebContents(int render_process_id,
return WebContents::FromFrameTreeNodeId(frame_tree_node_id);
}
@@ -73,9 +73,9 @@
namespace content {
namespace {
-StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
- int render_process_id,
@ -127,7 +141,7 @@ index 0992aad5fe6c..788d432c48d9 100644
DCHECK_CURRENTLY_ON(BrowserThread::UI);
SiteInstance* site_instance = nullptr;
@@ -95,8 +95,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
@@ -85,8 +85,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
if (render_frame_host_)
site_instance = render_frame_host_->GetSiteInstance();
}
@ -137,52 +151,49 @@ index 0992aad5fe6c..788d432c48d9 100644
}
bool CanRequestURLFromRenderer(int render_process_id, GURL url) {
@@ -987,16 +986,17 @@ void DownloadManagerImpl::BeginDownloadInternal(
@@ -1069,7 +1068,7 @@ void DownloadManagerImpl::BeginDownloadInternal(
if (base::FeatureList::IsEnabled(features::kNetworkService)) {
std::unique_ptr<ResourceRequest> request = CreateResourceRequest(
params.get());
std::unique_ptr<network::ResourceRequest> request =
CreateResourceRequest(params.get());
- StoragePartitionImpl* storage_partition =
+ StoragePartition* storage_partition =
GetStoragePartition(browser_context_, params->render_process_host_id(),
params->render_frame_host_routing_id());
BrowserThread::PostTaskAndReplyWithResult(
@@ -1090,7 +1089,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->GetFileSystemContext()),
- id, weak_factory_.GetWeakPtr()),
+ base::WrapRefCounted(
+ storage_partition->url_loader_factory_getter()),
+ base::WrapRefCounted(storage_partition->GetFileSystemContext()),
+ id, weak_factory_.GetWeakPtr()),
base::WrapRefCounted(storage_partition->GetFileSystemContext()), id,
weak_factory_.GetWeakPtr(), site_url, tab_url, tab_referrer_url),
base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler,
weak_factory_.GetWeakPtr()));
} else {
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
index 70148056059b..599b068dfdea 100644
index d9297fa8365e..38a3fb629a7a 100644
--- content/browser/loader/navigation_url_loader_network_service.cc
+++ content/browser/loader/navigation_url_loader_network_service.cc
@@ -615,11 +615,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
g_next_request_id--;
@@ -868,11 +868,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
.PassInterface();
}
- auto* partition = static_cast<StoragePartitionImpl*>(storage_partition);
+ auto* partition = storage_partition;
DCHECK(!request_controller_);
request_controller_ = std::make_unique<URLLoaderRequestController>(
std::move(initial_handlers), std::move(new_request), resource_context,
- partition->url_loader_factory_getter(), weak_factory_.GetWeakPtr());
- partition->url_loader_factory_getter(), request_info->common_params.url,
+ base::WrapRefCounted(partition->url_loader_factory_getter()),
+ weak_factory_.GetWeakPtr());
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
base::BindOnce(&URLLoaderRequestController::Start,
+ request_info->common_params.url,
request_info->begin_params->initiator_origin,
request_info->begin_params->suggested_filename,
weak_factory_.GetWeakPtr());
diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc
index 8816724941ff..6b9a26b7c615 100644
index b9d2670514c0..004939aa055a 100644
--- content/browser/payments/payment_app_provider_impl.cc
+++ content/browser/payments/payment_app_provider_impl.cc
@@ -329,10 +329,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
@@ -328,10 +328,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
ServiceWorkerStartCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -197,7 +208,7 @@ index 8816724941ff..6b9a26b7c615 100644
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE,
@@ -358,8 +359,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
@@ -357,8 +358,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
GetAllPaymentAppsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -209,10 +220,10 @@ index 8816724941ff..6b9a26b7c615 100644
partition->GetPaymentAppContext();
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index a61b8ab0886e..5be550085df1 100644
index 22c72f3ac929..c12815670521 100644
--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -500,9 +500,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
@@ -497,9 +497,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
SpareRenderProcessHostManager() {}
void WarmupSpareRenderProcessHost(BrowserContext* browser_context) {
@ -224,7 +235,7 @@ index a61b8ab0886e..5be550085df1 100644
if (spare_render_process_host_ &&
matching_browser_context_ == browser_context &&
@@ -641,11 +640,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
@@ -638,11 +637,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) {
@ -240,7 +251,7 @@ index a61b8ab0886e..5be550085df1 100644
// Is this the default storage partition? If it isn't, then just give it its
// own non-shared process.
@@ -1240,7 +1238,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
@@ -1237,7 +1235,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
// static
RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
BrowserContext* browser_context,
@ -249,7 +260,7 @@ index a61b8ab0886e..5be550085df1 100644
SiteInstance* site_instance,
bool is_for_guests_only) {
if (g_render_process_host_factory_) {
@@ -1249,8 +1247,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
@@ -1246,8 +1244,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
}
if (!storage_partition_impl) {
@ -258,9 +269,9 @@ index a61b8ab0886e..5be550085df1 100644
+ storage_partition_impl =
+ BrowserContext::GetStoragePartition(browser_context, site_instance);
}
return new RenderProcessHostImpl(browser_context, storage_partition_impl,
@@ -1260,7 +1258,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
// 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(
// static
RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context,
@ -269,7 +280,7 @@ index a61b8ab0886e..5be550085df1 100644
SiteInstance* site_instance,
bool is_for_guests_only) {
RenderProcessHost* render_process_host =
@@ -1280,7 +1278,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
@@ -1289,7 +1287,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
@ -278,7 +289,7 @@ index a61b8ab0886e..5be550085df1 100644
bool is_for_guests_only)
: fast_shutdown_started_(false),
deleting_soon_(false),
@@ -1316,7 +1314,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -1322,7 +1320,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(new IndexedDBDispatcherHost(
id_,
storage_partition_impl_->GetURLRequestContext(),
@ -288,7 +299,7 @@ index a61b8ab0886e..5be550085df1 100644
ChromeBlobStorageContext::GetFor(browser_context_))),
channel_connected_(false),
sent_render_process_ready_(false),
@@ -1350,7 +1349,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
@@ -1356,7 +1355,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
}
push_messaging_manager_.reset(new PushMessagingManager(
@ -298,7 +309,7 @@ index a61b8ab0886e..5be550085df1 100644
AddObserver(indexed_db_factory_.get());
@@ -1665,6 +1665,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
@@ -1671,6 +1671,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -319,7 +330,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1679,8 +1693,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1685,8 +1699,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals,
@ -330,7 +341,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1709,10 +1723,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1715,10 +1729,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
ChromeBlobStorageContext::GetFor(browser_context);
resource_message_filter_ = new ResourceMessageFilter(
@ -343,19 +354,17 @@ index a61b8ab0886e..5be550085df1 100644
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
AddFilter(resource_message_filter_.get());
@@ -1735,9 +1749,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1743,8 +1757,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
}
AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
AddFilter(new AppCacheDispatcherHost(
- storage_partition_impl_->GetAppCacheService(), GetID()));
+ app_cache_service, GetID()));
AddFilter(new DOMStorageMessageFilter(
- AddFilter(new DOMStorageMessageFilter(
- storage_partition_impl_->GetDOMStorageContext()));
+ dom_storage_context));
+ AddFilter(new DOMStorageMessageFilter(dom_storage_context));
#if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(
@@ -1765,13 +1779,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
@@ -1767,13 +1780,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost();
@ -371,7 +380,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(service_worker_filter.get());
#if BUILDFLAG(ENABLE_WEBRTC)
@@ -1783,11 +1796,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
@@ -1785,11 +1797,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new TraceMessageFilter(GetID()));
AddFilter(new ResolveProxyMsgHelper(request_context.get()));
@ -384,11 +393,21 @@ index a61b8ab0886e..5be550085df1 100644
resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get());
@@ -1931,7 +1940,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&AppCacheDispatcherHost::Create,
- base::Unretained(storage_partition_impl_->GetAppCacheService()),
+ base::Unretained(static_cast<ChromeAppCacheService*>(
+ storage_partition_impl_->GetAppCacheService())),
GetID()));
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 b5528d49e678..aaecb9f0b0f7 100644
index f81189990b1f..39afa6c9ecfd 100644
--- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h
@@ -84,7 +84,6 @@ class ResourceMessageFilter;
@@ -83,7 +83,6 @@ class ResourceMessageFilter;
class SiteInstance;
class SiteInstanceImpl;
class StoragePartition;
@ -396,7 +415,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
#if BUILDFLAG(ENABLE_WEBRTC)
class MediaStreamDispatcherHost;
@@ -128,7 +127,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -127,7 +126,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// legal).
static RenderProcessHost* CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context,
@ -405,7 +424,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -140,7 +139,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -139,7 +138,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// null.
static RenderProcessHost* CreateRenderProcessHost(
BrowserContext* browser_context,
@ -414,7 +433,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
SiteInstance* site_instance,
bool is_for_guests_only);
@@ -422,7 +421,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -420,7 +419,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Use CreateRenderProcessHost() instead of calling this constructor
// directly.
RenderProcessHostImpl(BrowserContext* browser_context,
@ -423,7 +442,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
bool is_for_guests_only);
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
@@ -657,10 +656,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
@@ -656,10 +655,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// called.
int instance_id_ = 1;
@ -437,10 +456,10 @@ index b5528d49e678..aaecb9f0b0f7 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 082e5c990dcc..8398a8613b08 100644
index 01ba96322f69..6dde251b3d1b 100644
--- content/browser/renderer_interface_binders.cc
+++ content/browser/renderer_interface_binders.cc
@@ -112,7 +112,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -133,7 +133,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(
base::Bind([](payments::mojom::PaymentManagerRequest request,
RenderProcessHost* host, const url::Origin& origin) {
@ -449,7 +468,16 @@ index 082e5c990dcc..8398a8613b08 100644
->GetPaymentAppContext()
->CreatePaymentManager(std::move(request));
}));
@@ -128,9 +128,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
@@ -147,7 +147,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(base::BindRepeating(
[](blink::mojom::LockManagerRequest request, RenderProcessHost* host,
const url::Origin& origin) {
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
+ host->GetStoragePartition()
->GetLockManager()
->CreateService(std::move(request), origin);
}));
@@ -156,9 +156,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(
base::Bind([](blink::mojom::NotificationServiceRequest request,
RenderProcessHost* host, const url::Origin& origin) {
@ -461,77 +489,43 @@ index 082e5c990dcc..8398a8613b08 100644
+ ->GetPlatformNotificationContext())
+ ->CreateService(host->GetID(), origin, std::move(request));
}));
}
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 4fb7fcdb85c9..bf0155992715 100644
index 1e95910e7168..45adb88b1e96 100644
--- content/browser/shared_worker/shared_worker_connector_impl.cc
+++ content/browser/shared_worker/shared_worker_connector_impl.cc
@@ -23,20 +23,22 @@ void SharedWorkerConnectorImpl::Create(
RenderProcessHost* host = RenderProcessHost::FromID(process_id);
ResourceContext* resource_context =
host->GetBrowserContext()->GetResourceContext();
- StoragePartitionImpl* storage_partition_impl =
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition());
+ StoragePartition* storage_partition_impl = host->GetStoragePartition();
// TODO(darin): Surely there can be a better way to extract a comparable
// identifier from a StoragePartition instance.
WorkerStoragePartition worker_storage_partition(
storage_partition_impl->GetURLRequestContext(),
storage_partition_impl->GetMediaURLRequestContext(),
- storage_partition_impl->GetAppCacheService(),
+ static_cast<ChromeAppCacheService*>(
+ storage_partition_impl->GetAppCacheService()),
storage_partition_impl->GetQuotaManager(),
storage_partition_impl->GetFileSystemContext(),
storage_partition_impl->GetDatabaseTracker(),
- storage_partition_impl->GetIndexedDBContext(),
- storage_partition_impl->GetServiceWorkerContext());
+ static_cast<IndexedDBContextImpl*>(
+ storage_partition_impl->GetIndexedDBContext()),
+ static_cast<ServiceWorkerContextWrapper*>(
+ storage_partition_impl->GetServiceWorkerContext()));
CreateInternal(process_id, frame_id, resource_context,
worker_storage_partition, std::move(request));
diff --git content/browser/shared_worker/shared_worker_service_impl.cc content/browser/shared_worker/shared_worker_service_impl.cc
index ecf29e7851da..bba93010b3ad 100644
--- content/browser/shared_worker/shared_worker_service_impl.cc
+++ content/browser/shared_worker/shared_worker_service_impl.cc
@@ -63,17 +63,19 @@ bool SharedWorkerServiceImpl::TerminateWorker(
const url::Origin& constructor_origin,
StoragePartition* storage_partition,
ResourceContext* resource_context) {
- StoragePartitionImpl* storage_partition_impl =
- static_cast<StoragePartitionImpl*>(storage_partition);
+ StoragePartition* storage_partition_impl = storage_partition;
WorkerStoragePartitionId partition_id(WorkerStoragePartition(
storage_partition_impl->GetURLRequestContext(),
storage_partition_impl->GetMediaURLRequestContext(),
- storage_partition_impl->GetAppCacheService(),
+ static_cast<ChromeAppCacheService*>(
+ storage_partition_impl->GetAppCacheService()),
storage_partition_impl->GetQuotaManager(),
storage_partition_impl->GetFileSystemContext(),
storage_partition_impl->GetDatabaseTracker(),
- storage_partition_impl->GetIndexedDBContext(),
- storage_partition_impl->GetServiceWorkerContext()));
+ static_cast<IndexedDBContextImpl*>(
+ storage_partition_impl->GetIndexedDBContext()),
+ static_cast<ServiceWorkerContextWrapper*>(
+ storage_partition_impl->GetServiceWorkerContext())));
for (const auto& iter : worker_hosts_) {
SharedWorkerHost* host = iter.second.get();
@@ -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())
- ->GetSharedWorkerService();
+ SharedWorkerServiceImpl* service = static_cast<SharedWorkerServiceImpl*>(
+ RenderProcessHost::FromID(process_id_)->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 54818f596e4c..58bd25f9bd24 100644
index 4fb38a200f04..182f14ead806 100644
--- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h
@@ -119,13 +119,13 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -87,7 +87,7 @@ class CONTENT_EXPORT StoragePartitionImpl
storage::FileSystemContext* GetFileSystemContext() override;
storage::DatabaseTracker* GetDatabaseTracker() override;
DOMStorageContextWrapper* GetDOMStorageContext() override;
- LockManager* GetLockManager(); // override; TODO: Add to interface
+ LockManager* GetLockManager() override;
IndexedDBContextImpl* GetIndexedDBContext() override;
CacheStorageContextImpl* GetCacheStorageContext() override;
ServiceWorkerContextWrapper* GetServiceWorkerContext() override;
@@ -124,13 +124,13 @@ class CONTENT_EXPORT StoragePartitionImpl
void ClearBluetoothAllowedDevicesMapForTesting() override;
void SetNetworkFactoryForTesting(
mojom::URLLoaderFactory* test_factory) override;
void FlushNetworkInterfaceForTesting() override;
- BackgroundFetchContext* GetBackgroundFetchContext();
- BackgroundSyncContext* GetBackgroundSyncContext();
- PaymentAppContextImpl* GetPaymentAppContext();
@ -549,7 +543,7 @@ index 54818f596e4c..58bd25f9bd24 100644
// mojom::StoragePartitionService interface.
void OpenLocalStorage(
@@ -136,18 +136,18 @@ class CONTENT_EXPORT StoragePartitionImpl
@@ -141,18 +141,18 @@ class CONTENT_EXPORT StoragePartitionImpl
const url::Origin& origin,
mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override;
@ -572,6 +566,20 @@ index 54818f596e4c..58bd25f9bd24 100644
auto& bindings_for_testing() { return bindings_; }
@@ -163,10 +163,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.
- void set_site_for_service_worker(const GURL& site_for_service_worker) {
+ void set_site_for_service_worker(
+ const GURL& site_for_service_worker) override {
site_for_service_worker_ = site_for_service_worker;
}
- const GURL& site_for_service_worker() const {
+ const GURL& site_for_service_worker() const override {
return site_for_service_worker_;
}
diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc
index 7aafca3aafcd..aac07962f6a5 100644
--- content/browser/streams/stream_context.cc
@ -601,7 +609,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 8996f11d328e..75b658f5a2d2 100644
index 53845bd346ed..e2c023cd688e 100644
--- content/browser/webui/web_ui_url_loader_factory.cc
+++ content/browser/webui/web_ui_url_loader_factory.cc
@@ -20,13 +20,13 @@
@ -618,8 +626,8 @@ index 8996f11d328e..75b658f5a2d2 100644
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/network_service.mojom.h"
@@ -296,9 +296,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory,
#include "content/public/common/url_constants.h"
@@ -302,9 +302,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory,
const std::string& scheme() const { return scheme_; }
private:
@ -660,18 +668,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 fa9a14e82472..7ed0814308aa 100644
index 9bf0a872f380..73ede1ccdedf 100644
--- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h
@@ -14,6 +14,7 @@
@@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/public/common/url_loader_factory.mojom.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
#include "net/cookies/cookie_store.h"
class GURL;
@@ -42,12 +43,20 @@ class DatabaseTracker;
@@ -49,13 +50,22 @@ class DatabaseTracker;
namespace content {
class AppCacheService;
@ -685,29 +693,38 @@ index fa9a14e82472..7ed0814308aa 100644
class CacheStorageContext;
class DOMStorageContext;
class IndexedDBContext;
+class LockManager;
+class PaymentAppContextImpl;
class PlatformNotificationContext;
class ServiceWorkerContext;
class SharedWorkerService;
+class URLLoaderFactoryGetter;
#if !defined(OS_ANDROID)
class HostZoomLevelContext;
@@ -60,6 +69,11 @@ class NetworkContext;
class URLLoaderFactory;
}
@@ -63,6 +73,10 @@ class HostZoomMap;
class ZoomLevelDelegate;
#endif // !defined(OS_ANDROID)
+namespace mojom {
+class NetworkContext;
+class StoragePartitionService;
+}
+
// Defines what persistent state a child process can access.
//
// The StoragePartition defines the view each child process has of the
@@ -92,6 +106,13 @@ class CONTENT_EXPORT StoragePartition {
virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0;
#endif // !defined(OS_ANDROID)
virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0;
@@ -88,6 +102,7 @@ class CONTENT_EXPORT StoragePartition {
virtual storage::FileSystemContext* GetFileSystemContext() = 0;
virtual storage::DatabaseTracker* GetDatabaseTracker() = 0;
virtual DOMStorageContext* GetDOMStorageContext() = 0;
+ virtual LockManager* GetLockManager() = 0;
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;
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
+ virtual PaymentAppContextImpl* GetPaymentAppContext() = 0;
@ -715,29 +732,26 @@ index fa9a14e82472..7ed0814308aa 100644
+ virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0;
+ virtual BlobURLLoaderFactory* GetBlobURLLoaderFactory() = 0;
+ virtual BlobRegistryWrapper* GetBlobRegistry() = 0;
enum : uint32_t {
REMOVE_DATA_MASK_APPCACHE = 1 << 0,
@@ -200,6 +221,14 @@ class CONTENT_EXPORT StoragePartition {
virtual void SetNetworkFactoryForTesting(
mojom::URLLoaderFactory* test_factory) = 0;
+
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
+ virtual BrowserContext* browser_context() const = 0;
+
+ // Called by each renderer process once.
+ virtual mojo::BindingId Bind(
+ int process_id,
+ mojo::InterfaceRequest<mojom::StoragePartitionService> request) = 0;
+
+ virtual void set_site_for_service_worker(
+ const GURL& site_for_service_worker) = 0;
+ virtual const GURL& site_for_service_worker() const = 0;
+
protected:
virtual ~StoragePartition() {}
};
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
index e4ee15fd49ab..5adc8867d6df 100644
index e1e508e205be..10432c7d833e 100644
--- storage/browser/database/database_tracker.cc
+++ storage/browser/database/database_tracker.cc
@@ -492,7 +492,7 @@ bool DatabaseTracker::LazyInit() {
@@ -491,7 +491,7 @@ bool DatabaseTracker::LazyInit() {
meta_table_.reset(new sql::MetaTable());
is_initialized_ =