2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc
|
2017-10-20 19:45:20 +02:00
|
|
|
index 71bf90c54ae5..d3308da307d7 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/appcache/appcache_internals_ui.cc
|
|
|
|
+++ content/browser/appcache/appcache_internals_ui.cc
|
2017-09-06 23:40:58 +02:00
|
|
|
@@ -372,8 +372,8 @@ void AppCacheInternalsUI::CreateProxyForPartition(
|
2016-08-24 11:28:52 +02:00
|
|
|
StoragePartition* storage_partition) {
|
|
|
|
scoped_refptr<Proxy> proxy =
|
|
|
|
new Proxy(weak_ptr_factory_.GetWeakPtr(), storage_partition->GetPath());
|
|
|
|
- proxy->Initialize(static_cast<StoragePartitionImpl*>(storage_partition)
|
|
|
|
- ->GetAppCacheService());
|
|
|
|
+ proxy->Initialize(static_cast<ChromeAppCacheService*>(
|
|
|
|
+ storage_partition->GetAppCacheService()));
|
|
|
|
appcache_proxies_.push_back(proxy);
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index bf41a25bcd29..9e6dd89497e7 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/blob_storage/chrome_blob_storage_context.cc
|
|
|
|
+++ content/browser/blob_storage/chrome_blob_storage_context.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -76,6 +76,11 @@ class BlobHandleImpl : public BlobHandle {
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
ChromeBlobStorageContext::ChromeBlobStorageContext() {}
|
|
|
|
|
|
|
|
+// static
|
|
|
|
+const void* ChromeBlobStorageContext::GetUserDataKey() {
|
|
|
|
+ return kBlobStorageContextKeyName;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
ChromeBlobStorageContext* ChromeBlobStorageContext::GetFor(
|
|
|
|
BrowserContext* context) {
|
2017-07-27 01:19:27 +02:00
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
|
2017-12-07 22:44:24 +01:00
|
|
|
index 2412f15c5fb7..3434d129af64 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/blob_storage/chrome_blob_storage_context.h
|
|
|
|
+++ content/browser/blob_storage/chrome_blob_storage_context.h
|
2017-07-27 01:19:27 +02:00
|
|
|
@@ -47,6 +47,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext
|
2016-08-24 11:28:52 +02:00
|
|
|
public:
|
|
|
|
ChromeBlobStorageContext();
|
|
|
|
|
2016-08-31 13:25:56 +02:00
|
|
|
+ static const void* GetUserDataKey();
|
2017-07-27 01:19:27 +02:00
|
|
|
+
|
|
|
|
// Must be called on the UI thread.
|
2016-08-24 11:28:52 +02:00
|
|
|
static ChromeBlobStorageContext* GetFor(
|
|
|
|
BrowserContext* browser_context);
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/browser/bluetooth/web_bluetooth_service_impl.cc content/browser/bluetooth/web_bluetooth_service_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index e5c7291dcc8f..0eec8a11db35 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/browser/bluetooth/web_bluetooth_service_impl.cc
|
|
|
|
+++ content/browser/bluetooth/web_bluetooth_service_impl.cc
|
2017-09-06 23:40:58 +02:00
|
|
|
@@ -1233,9 +1233,9 @@ url::Origin WebBluetoothServiceImpl::GetOrigin() {
|
2017-05-31 17:33:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BluetoothAllowedDevices& WebBluetoothServiceImpl::allowed_devices() {
|
|
|
|
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
+ StoragePartition* partition =
|
|
|
|
BrowserContext::GetDefaultStoragePartition(
|
|
|
|
- web_contents()->GetBrowserContext()));
|
|
|
|
+ web_contents()->GetBrowserContext());
|
|
|
|
scoped_refptr<BluetoothAllowedDevicesMap> allowed_devices_map =
|
|
|
|
partition->GetBluetoothAllowedDevicesMap();
|
|
|
|
return allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin());
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/browser_context.cc content/browser/browser_context.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 125078b9cb44..b24609a807ba 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/browser_context.cc
|
|
|
|
+++ content/browser/browser_context.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -127,11 +127,18 @@ StoragePartition* GetStoragePartitionFromConfig(
|
2017-10-30 21:52:39 +01:00
|
|
|
StoragePartitionImplMap* partition_map =
|
|
|
|
GetStoragePartitionMap(browser_context);
|
|
|
|
|
|
|
|
- if (browser_context->IsOffTheRecord())
|
|
|
|
+ if (browser_context->IsOffTheRecord() || browser_context->GetPath().empty())
|
2016-08-24 11:28:52 +02:00
|
|
|
in_memory = true;
|
|
|
|
|
2017-10-20 19:45:20 +02:00
|
|
|
- return partition_map->Get(partition_domain, partition_name, in_memory,
|
|
|
|
- can_create);
|
2016-08-24 11:28:52 +02:00
|
|
|
+ StoragePartitionImpl* partition_impl =
|
2017-10-20 19:45:20 +02:00
|
|
|
+ partition_map->Get(partition_domain, partition_name, in_memory,
|
|
|
|
+ can_create);
|
2016-08-24 11:28:52 +02:00
|
|
|
+ if (partition_impl->browser_context() == browser_context)
|
|
|
|
+ return partition_impl;
|
|
|
|
+
|
|
|
|
+ // |browser_context| is a CefBrowserContextProxy object.
|
|
|
|
+ return partition_impl->browser_context()->
|
|
|
|
+ GetStoragePartitionProxy(browser_context, partition_impl);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SaveSessionStateOnIOThread(
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -553,6 +560,11 @@ ServiceManagerConnection* BrowserContext::GetServiceManagerConnectionFor(
|
2017-05-31 17:33:30 +02:00
|
|
|
BrowserContext::BrowserContext()
|
|
|
|
: media_device_id_salt_(CreateRandomMediaDeviceIDSalt()) {}
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
+// static
|
|
|
|
+const void* BrowserContext::GetStoragePartitionMapUserDataKey() {
|
|
|
|
+ return kStoragePartitionMapKeyName;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
BrowserContext::~BrowserContext() {
|
|
|
|
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
|
2017-12-07 22:44:24 +01:00
|
|
|
index d2478ae31473..5fd30c1cd72c 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/devtools/protocol/service_worker_handler.cc
|
|
|
|
+++ content/browser/devtools/protocol/service_worker_handler.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -337,8 +337,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
|
2016-08-24 11:28:52 +02:00
|
|
|
if (!base::StringToInt64(registration_id, &id))
|
|
|
|
return CreateInvalidVersionIdErrorResponse();
|
|
|
|
|
|
|
|
- StoragePartitionImpl* partition =
|
2017-10-20 19:45:20 +02:00
|
|
|
- static_cast<StoragePartitionImpl*>(process_->GetStoragePartition());
|
|
|
|
+ StoragePartition* partition = process_->GetStoragePartition();
|
2016-08-24 11:28:52 +02:00
|
|
|
BackgroundSyncContext* sync_context = partition->GetBackgroundSyncContext();
|
|
|
|
|
|
|
|
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
|
2017-09-06 23:40:58 +02:00
|
|
|
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 0992aad5fe6c..788d432c48d9 100644
|
2017-09-06 23:40:58 +02:00
|
|
|
--- content/browser/download/download_manager_impl.cc
|
|
|
|
+++ content/browser/download/download_manager_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -83,9 +83,9 @@ WebContents* GetWebContents(int render_process_id,
|
|
|
|
return WebContents::FromFrameTreeNodeId(frame_tree_node_id);
|
|
|
|
}
|
2017-10-20 19:45:20 +02:00
|
|
|
|
|
|
|
-StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
|
|
|
|
- int render_process_id,
|
|
|
|
- int render_frame_id) {
|
|
|
|
+StoragePartition* GetStoragePartition(BrowserContext* context,
|
|
|
|
+ int render_process_id,
|
|
|
|
+ int render_frame_id) {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
|
|
|
|
SiteInstance* site_instance = nullptr;
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -95,8 +95,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
|
2017-09-06 23:40:58 +02:00
|
|
|
if (render_frame_host_)
|
|
|
|
site_instance = render_frame_host_->GetSiteInstance();
|
|
|
|
}
|
2017-10-20 19:45:20 +02:00
|
|
|
- return static_cast<StoragePartitionImpl*>(
|
2017-09-06 23:40:58 +02:00
|
|
|
- BrowserContext::GetStoragePartition(context, site_instance));
|
2017-10-20 19:45:20 +02:00
|
|
|
+ return BrowserContext::GetStoragePartition(context, site_instance);
|
2017-09-06 23:40:58 +02:00
|
|
|
}
|
|
|
|
|
2017-10-20 19:45:20 +02:00
|
|
|
bool CanRequestURLFromRenderer(int render_process_id, GURL url) {
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -987,16 +986,17 @@ void DownloadManagerImpl::BeginDownloadInternal(
|
2017-10-20 19:45:20 +02:00
|
|
|
if (base::FeatureList::IsEnabled(features::kNetworkService)) {
|
|
|
|
std::unique_ptr<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(
|
|
|
|
BrowserThread::IO, FROM_HERE,
|
|
|
|
base::BindOnce(
|
|
|
|
&BeginResourceDownload, std::move(params), std::move(request),
|
|
|
|
- storage_partition->url_loader_factory_getter(),
|
2017-12-07 22:44:24 +01:00
|
|
|
- base::WrapRefCounted(storage_partition->GetFileSystemContext()),
|
|
|
|
- id, weak_factory_.GetWeakPtr()),
|
2017-10-20 19:45:20 +02:00
|
|
|
+ base::WrapRefCounted(
|
|
|
|
+ storage_partition->url_loader_factory_getter()),
|
2017-12-07 22:44:24 +01:00
|
|
|
+ base::WrapRefCounted(storage_partition->GetFileSystemContext()),
|
|
|
|
+ id, weak_factory_.GetWeakPtr()),
|
2017-10-20 19:45:20 +02:00
|
|
|
base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler,
|
2017-12-07 22:44:24 +01:00
|
|
|
weak_factory_.GetWeakPtr()));
|
|
|
|
} else {
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 70148056059b..599b068dfdea 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/browser/loader/navigation_url_loader_network_service.cc
|
|
|
|
+++ content/browser/loader/navigation_url_loader_network_service.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -615,11 +615,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
|
|
|
|
|
|
|
|
g_next_request_id--;
|
|
|
|
|
|
|
|
- auto* partition = static_cast<StoragePartitionImpl*>(storage_partition);
|
|
|
|
+ auto* partition = storage_partition;
|
2017-07-27 01:19:27 +02:00
|
|
|
DCHECK(!request_controller_);
|
2017-12-07 22:44:24 +01:00
|
|
|
request_controller_ = std::make_unique<URLLoaderRequestController>(
|
2017-10-20 19:45:20 +02:00
|
|
|
std::move(initial_handlers), std::move(new_request), resource_context,
|
2017-12-07 22:44:24 +01:00
|
|
|
- partition->url_loader_factory_getter(), weak_factory_.GetWeakPtr());
|
|
|
|
+ base::WrapRefCounted(partition->url_loader_factory_getter()),
|
|
|
|
+ weak_factory_.GetWeakPtr());
|
2017-07-27 01:19:27 +02:00
|
|
|
BrowserThread::PostTask(
|
|
|
|
BrowserThread::IO, FROM_HERE,
|
2017-12-07 22:44:24 +01:00
|
|
|
base::BindOnce(&URLLoaderRequestController::Start,
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 8816724941ff..6b9a26b7c615 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/browser/payments/payment_app_provider_impl.cc
|
|
|
|
+++ content/browser/payments/payment_app_provider_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -329,10 +329,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
|
2017-09-06 23:40:58 +02:00
|
|
|
ServiceWorkerStartCallback callback) {
|
2017-05-31 17:33:30 +02:00
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
|
|
|
|
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetDefaultStoragePartition(browser_context));
|
|
|
|
+ StoragePartition* partition =
|
|
|
|
+ BrowserContext::GetDefaultStoragePartition(browser_context);
|
2017-09-06 23:40:58 +02:00
|
|
|
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context =
|
|
|
|
- partition->GetServiceWorkerContext();
|
|
|
|
+ static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
+ partition->GetServiceWorkerContext());
|
2017-05-31 17:33:30 +02:00
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
BrowserThread::PostTask(
|
|
|
|
BrowserThread::IO, FROM_HERE,
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -358,8 +359,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
|
2017-09-06 23:40:58 +02:00
|
|
|
GetAllPaymentAppsCallback callback) {
|
2017-05-31 17:33:30 +02:00
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
|
|
|
|
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetDefaultStoragePartition(browser_context));
|
|
|
|
+ StoragePartition* partition =
|
|
|
|
+ BrowserContext::GetDefaultStoragePartition(browser_context);
|
2017-09-06 23:40:58 +02:00
|
|
|
scoped_refptr<PaymentAppContextImpl> payment_app_context =
|
|
|
|
partition->GetPaymentAppContext();
|
2017-05-31 17:33:30 +02:00
|
|
|
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index a61b8ab0886e..5be550085df1 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/renderer_host/render_process_host_impl.cc
|
|
|
|
+++ content/browser/renderer_host/render_process_host_impl.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -500,9 +500,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
|
2017-07-27 01:19:27 +02:00
|
|
|
SpareRenderProcessHostManager() {}
|
|
|
|
|
|
|
|
void WarmupSpareRenderProcessHost(BrowserContext* browser_context) {
|
|
|
|
- StoragePartitionImpl* current_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartition(browser_context, nullptr));
|
|
|
|
+ StoragePartition* current_partition =
|
|
|
|
+ BrowserContext::GetStoragePartition(browser_context, nullptr);
|
|
|
|
|
|
|
|
if (spare_render_process_host_ &&
|
|
|
|
matching_browser_context_ == browser_context &&
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -641,11 +640,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
|
2017-07-27 01:19:27 +02:00
|
|
|
// Gets the correct render process to use for this SiteInstance.
|
|
|
|
RenderProcessHost* GetProcessHost(SiteInstance* site_instance,
|
|
|
|
bool is_for_guests_only) {
|
|
|
|
- StoragePartitionImpl* default_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetDefaultStoragePartition(browser_context_));
|
|
|
|
- StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartition(browser_context_, site_instance));
|
|
|
|
+ StoragePartition* default_partition =
|
|
|
|
+ BrowserContext::GetDefaultStoragePartition(browser_context_);
|
|
|
|
+ StoragePartition* partition =
|
|
|
|
+ BrowserContext::GetStoragePartition(browser_context_, site_instance);
|
|
|
|
|
|
|
|
// Is this the default storage partition? If it isn't, then just give it its
|
2017-05-31 17:33:30 +02:00
|
|
|
// own non-shared process.
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1240,7 +1238,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
|
2017-07-27 01:19:27 +02:00
|
|
|
// static
|
|
|
|
RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
|
|
|
|
BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
SiteInstance* site_instance,
|
|
|
|
bool is_for_guests_only) {
|
|
|
|
if (g_render_process_host_factory_) {
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1249,8 +1247,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
|
2017-07-27 01:19:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!storage_partition_impl) {
|
|
|
|
- storage_partition_impl = static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartition(browser_context, site_instance));
|
|
|
|
+ storage_partition_impl =
|
|
|
|
+ BrowserContext::GetStoragePartition(browser_context, site_instance);
|
|
|
|
}
|
|
|
|
|
|
|
|
return new RenderProcessHostImpl(browser_context, storage_partition_impl,
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1260,7 +1258,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
|
2017-07-27 01:19:27 +02:00
|
|
|
// static
|
|
|
|
RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
|
|
|
|
BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
SiteInstance* site_instance,
|
|
|
|
bool is_for_guests_only) {
|
|
|
|
RenderProcessHost* render_process_host =
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1280,7 +1278,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
RenderProcessHostImpl::RenderProcessHostImpl(
|
|
|
|
BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
bool is_for_guests_only)
|
|
|
|
: fast_shutdown_started_(false),
|
|
|
|
deleting_soon_(false),
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1316,7 +1314,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
|
2017-01-23 18:36:54 +01:00
|
|
|
indexed_db_factory_(new IndexedDBDispatcherHost(
|
|
|
|
id_,
|
|
|
|
storage_partition_impl_->GetURLRequestContext(),
|
|
|
|
- storage_partition_impl_->GetIndexedDBContext(),
|
|
|
|
+ static_cast<IndexedDBContextImpl*>(
|
|
|
|
+ storage_partition_impl_->GetIndexedDBContext()),
|
|
|
|
ChromeBlobStorageContext::GetFor(browser_context_))),
|
|
|
|
channel_connected_(false),
|
|
|
|
sent_render_process_ready_(false),
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1350,7 +1349,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
|
2017-03-03 23:37:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
push_messaging_manager_.reset(new PushMessagingManager(
|
|
|
|
- GetID(), storage_partition_impl_->GetServiceWorkerContext()));
|
|
|
|
+ GetID(), static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetServiceWorkerContext())));
|
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
AddObserver(indexed_db_factory_.get());
|
2017-02-14 19:09:42 +01:00
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1665,6 +1665,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
void RenderProcessHostImpl::CreateMessageFilters() {
|
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
|
+
|
|
|
|
+ // Cast to the derived type from StoragePartitionImpl.
|
|
|
|
+ auto app_cache_service = static_cast<ChromeAppCacheService*>(
|
|
|
|
+ storage_partition_impl_->GetAppCacheService());
|
|
|
|
+ auto dom_storage_context = static_cast<DOMStorageContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetDOMStorageContext());
|
|
|
|
+ auto cache_storage_context = static_cast<CacheStorageContextImpl*>(
|
|
|
|
+ storage_partition_impl_->GetCacheStorageContext());
|
|
|
|
+ auto service_worker_context = static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetServiceWorkerContext());
|
|
|
|
+ auto platform_notification_context =
|
|
|
|
+ static_cast<PlatformNotificationContextImpl*>(
|
|
|
|
+ storage_partition_impl_->GetPlatformNotificationContext());
|
|
|
|
+
|
|
|
|
AddFilter(new ResourceSchedulerFilter(GetID()));
|
|
|
|
MediaInternals* media_internals = MediaInternals::GetInstance();
|
2016-08-31 13:25:56 +02:00
|
|
|
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1679,8 +1693,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2016-08-24 11:28:52 +02:00
|
|
|
new RenderMessageFilter(
|
|
|
|
GetID(), GetBrowserContext(), request_context.get(),
|
2016-08-31 13:25:56 +02:00
|
|
|
widget_helper_.get(), media_internals,
|
2016-08-24 11:28:52 +02:00
|
|
|
- storage_partition_impl_->GetDOMStorageContext(),
|
|
|
|
- storage_partition_impl_->GetCacheStorageContext()));
|
|
|
|
+ dom_storage_context,
|
|
|
|
+ cache_storage_context));
|
|
|
|
AddFilter(render_message_filter.get());
|
|
|
|
|
2016-08-31 13:25:56 +02:00
|
|
|
render_frame_message_filter_ = new RenderFrameMessageFilter(
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1709,10 +1723,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2017-01-23 18:36:54 +01:00
|
|
|
ChromeBlobStorageContext::GetFor(browser_context);
|
2016-08-31 13:25:56 +02:00
|
|
|
|
|
|
|
resource_message_filter_ = new ResourceMessageFilter(
|
2017-01-23 18:36:54 +01:00
|
|
|
- GetID(), storage_partition_impl_->GetAppCacheService(),
|
|
|
|
+ GetID(), app_cache_service,
|
|
|
|
blob_storage_context.get(),
|
2016-08-24 11:28:52 +02:00
|
|
|
storage_partition_impl_->GetFileSystemContext(),
|
2017-04-20 21:28:17 +02:00
|
|
|
- storage_partition_impl_->GetServiceWorkerContext(), get_contexts_callback,
|
|
|
|
+ service_worker_context, get_contexts_callback,
|
|
|
|
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2016-11-23 21:54:29 +01:00
|
|
|
AddFilter(resource_message_filter_.get());
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1735,9 +1749,9 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2016-08-24 11:28:52 +02:00
|
|
|
AddFilter(
|
2017-01-23 18:36:54 +01:00
|
|
|
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
|
|
|
|
AddFilter(new AppCacheDispatcherHost(
|
2016-08-24 11:28:52 +02:00
|
|
|
- storage_partition_impl_->GetAppCacheService(), GetID()));
|
2017-01-23 18:36:54 +01:00
|
|
|
+ app_cache_service, GetID()));
|
|
|
|
AddFilter(new DOMStorageMessageFilter(
|
2016-08-24 11:28:52 +02:00
|
|
|
- storage_partition_impl_->GetDOMStorageContext()));
|
2017-01-23 18:36:54 +01:00
|
|
|
+ dom_storage_context));
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2017-01-23 18:36:54 +01:00
|
|
|
#if BUILDFLAG(ENABLE_WEBRTC)
|
|
|
|
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1765,13 +1779,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
|
|
|
|
new CacheStorageDispatcherHost();
|
|
|
|
- cache_storage_filter->Init(storage_partition_impl_->GetCacheStorageContext());
|
|
|
|
+ cache_storage_filter->Init(cache_storage_context);
|
|
|
|
AddFilter(cache_storage_filter.get());
|
|
|
|
|
|
|
|
scoped_refptr<ServiceWorkerDispatcherHost> service_worker_filter =
|
2017-03-03 23:37:23 +01:00
|
|
|
new ServiceWorkerDispatcherHost(GetID(), resource_context);
|
2016-08-24 11:28:52 +02:00
|
|
|
- service_worker_filter->Init(
|
|
|
|
- storage_partition_impl_->GetServiceWorkerContext());
|
|
|
|
+ service_worker_filter->Init(service_worker_context);
|
|
|
|
AddFilter(service_worker_filter.get());
|
|
|
|
|
2017-10-20 19:45:20 +02:00
|
|
|
#if BUILDFLAG(ENABLE_WEBRTC)
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -1783,11 +1796,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
|
|
|
AddFilter(new TraceMessageFilter(GetID()));
|
|
|
|
AddFilter(new ResolveProxyMsgHelper(request_context.get()));
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2016-08-31 13:25:56 +02:00
|
|
|
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
|
|
|
|
- static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
- storage_partition_impl_->GetServiceWorkerContext()));
|
2016-08-24 11:28:52 +02:00
|
|
|
notification_message_filter_ = new NotificationMessageFilter(
|
|
|
|
- GetID(), storage_partition_impl_->GetPlatformNotificationContext(),
|
|
|
|
+ GetID(), platform_notification_context,
|
2016-08-31 13:25:56 +02:00
|
|
|
resource_context, service_worker_context, browser_context);
|
2016-08-24 11:28:52 +02:00
|
|
|
AddFilter(notification_message_filter_.get());
|
|
|
|
|
|
|
|
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
|
2017-12-07 22:44:24 +01:00
|
|
|
index b5528d49e678..aaecb9f0b0f7 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/renderer_host/render_process_host_impl.h
|
|
|
|
+++ content/browser/renderer_host/render_process_host_impl.h
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -84,7 +84,6 @@ class ResourceMessageFilter;
|
2017-07-27 01:19:27 +02:00
|
|
|
class SiteInstance;
|
2017-05-31 17:33:30 +02:00
|
|
|
class SiteInstanceImpl;
|
2016-08-24 11:28:52 +02:00
|
|
|
class StoragePartition;
|
|
|
|
-class StoragePartitionImpl;
|
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
#if BUILDFLAG(ENABLE_WEBRTC)
|
|
|
|
class MediaStreamDispatcherHost;
|
|
|
|
@@ -128,7 +127,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
|
2017-07-27 01:19:27 +02:00
|
|
|
// legal).
|
|
|
|
static RenderProcessHost* CreateOrUseSpareRenderProcessHost(
|
|
|
|
BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
SiteInstance* site_instance,
|
|
|
|
bool is_for_guests_only);
|
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -140,7 +139,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
|
2017-07-27 01:19:27 +02:00
|
|
|
// null.
|
|
|
|
static RenderProcessHost* CreateRenderProcessHost(
|
|
|
|
BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
SiteInstance* site_instance,
|
|
|
|
bool is_for_guests_only);
|
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -422,7 +421,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
|
2017-07-27 01:19:27 +02:00
|
|
|
// Use CreateRenderProcessHost() instead of calling this constructor
|
|
|
|
// directly.
|
2016-08-24 11:28:52 +02:00
|
|
|
RenderProcessHostImpl(BrowserContext* browser_context,
|
|
|
|
- StoragePartitionImpl* storage_partition_impl,
|
|
|
|
+ StoragePartition* storage_partition_impl,
|
|
|
|
bool is_for_guests_only);
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -657,10 +656,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
|
2017-04-20 21:28:17 +02:00
|
|
|
// called.
|
|
|
|
int instance_id_ = 1;
|
|
|
|
|
|
|
|
- BrowserContext* const browser_context_;
|
|
|
|
+ BrowserContext* browser_context_;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
// Owned by |browser_context_|.
|
|
|
|
- StoragePartitionImpl* storage_partition_impl_;
|
|
|
|
+ StoragePartition* storage_partition_impl_;
|
|
|
|
|
|
|
|
// The observers watching our lifetime.
|
|
|
|
base::ObserverList<RenderProcessHostObserver> observers_;
|
2017-12-07 22:44:24 +01:00
|
|
|
diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc
|
|
|
|
index 082e5c990dcc..8398a8613b08 100644
|
|
|
|
--- content/browser/renderer_interface_binders.cc
|
|
|
|
+++ content/browser/renderer_interface_binders.cc
|
|
|
|
@@ -112,7 +112,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
|
|
|
parameterized_binder_registry_.AddInterface(
|
|
|
|
base::Bind([](payments::mojom::PaymentManagerRequest request,
|
|
|
|
RenderProcessHost* host, const url::Origin& origin) {
|
|
|
|
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
|
|
|
+ host->GetStoragePartition()
|
|
|
|
->GetPaymentAppContext()
|
|
|
|
->CreatePaymentManager(std::move(request));
|
|
|
|
}));
|
|
|
|
@@ -128,9 +128,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
|
|
|
parameterized_binder_registry_.AddInterface(
|
|
|
|
base::Bind([](blink::mojom::NotificationServiceRequest request,
|
|
|
|
RenderProcessHost* host, const url::Origin& origin) {
|
|
|
|
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
|
|
|
- ->GetPlatformNotificationContext()
|
|
|
|
- ->CreateService(host->GetID(), origin, std::move(request));
|
|
|
|
+ static_cast<PlatformNotificationContextImpl*>(
|
|
|
|
+ host->GetStoragePartition()
|
|
|
|
+ ->GetPlatformNotificationContext())
|
|
|
|
+ ->CreateService(host->GetID(), origin, std::move(request));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc
|
|
|
|
index 4fb7fcdb85c9..bf0155992715 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();
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
|
2017-12-07 22:44:24 +01:00
|
|
|
index 54818f596e4c..58bd25f9bd24 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/storage_partition_impl.h
|
|
|
|
+++ content/browser/storage_partition_impl.h
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -119,13 +119,13 @@ class CONTENT_EXPORT StoragePartitionImpl
|
2017-03-03 23:37:23 +01:00
|
|
|
void ClearBluetoothAllowedDevicesMapForTesting() override;
|
2017-12-07 22:44:24 +01:00
|
|
|
void SetNetworkFactoryForTesting(
|
|
|
|
mojom::URLLoaderFactory* test_factory) override;
|
2017-04-20 21:28:17 +02:00
|
|
|
- BackgroundFetchContext* GetBackgroundFetchContext();
|
2016-08-24 11:28:52 +02:00
|
|
|
- BackgroundSyncContext* GetBackgroundSyncContext();
|
2017-01-23 18:36:54 +01:00
|
|
|
- PaymentAppContextImpl* GetPaymentAppContext();
|
2016-08-31 13:25:56 +02:00
|
|
|
- BroadcastChannelProvider* GetBroadcastChannelProvider();
|
2017-03-03 23:37:23 +01:00
|
|
|
- BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap();
|
2017-07-27 01:19:27 +02:00
|
|
|
- BlobURLLoaderFactory* GetBlobURLLoaderFactory();
|
|
|
|
- BlobRegistryWrapper* GetBlobRegistry();
|
2017-04-20 21:28:17 +02:00
|
|
|
+ BackgroundFetchContext* GetBackgroundFetchContext() override;
|
2016-08-24 11:28:52 +02:00
|
|
|
+ BackgroundSyncContext* GetBackgroundSyncContext() override;
|
2017-01-23 18:36:54 +01:00
|
|
|
+ PaymentAppContextImpl* GetPaymentAppContext() override;
|
2016-08-31 13:25:56 +02:00
|
|
|
+ BroadcastChannelProvider* GetBroadcastChannelProvider() override;
|
2017-03-03 23:37:23 +01:00
|
|
|
+ BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
|
2017-07-27 01:19:27 +02:00
|
|
|
+ BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
|
|
|
|
+ BlobRegistryWrapper* GetBlobRegistry() override;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
// mojom::StoragePartitionService interface.
|
|
|
|
void OpenLocalStorage(
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -136,18 +136,18 @@ class CONTENT_EXPORT StoragePartitionImpl
|
2017-09-06 23:40:58 +02:00
|
|
|
const url::Origin& origin,
|
|
|
|
mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override;
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
- scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter() {
|
|
|
|
- return url_loader_factory_getter_;
|
|
|
|
+ URLLoaderFactoryGetter* url_loader_factory_getter() override {
|
|
|
|
+ return url_loader_factory_getter_.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Can return nullptr while |this| is being destroyed.
|
|
|
|
- BrowserContext* browser_context() const;
|
|
|
|
+ BrowserContext* browser_context() const override;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2017-10-20 19:45:20 +02:00
|
|
|
// Called by each renderer process once. Returns the id of the created
|
|
|
|
// binding.
|
|
|
|
mojo::BindingId Bind(
|
|
|
|
int process_id,
|
|
|
|
- mojo::InterfaceRequest<mojom::StoragePartitionService> request);
|
|
|
|
+ mojo::InterfaceRequest<mojom::StoragePartitionService> request) override;
|
|
|
|
|
|
|
|
auto& bindings_for_testing() { return bindings_; }
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 7aafca3aafcd..aac07962f6a5 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/streams/stream_context.cc
|
|
|
|
+++ content/browser/streams/stream_context.cc
|
2017-05-31 17:33:30 +02:00
|
|
|
@@ -22,6 +22,11 @@ namespace content {
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
StreamContext::StreamContext() {}
|
|
|
|
|
|
|
|
+// static
|
|
|
|
+const void* StreamContext::GetUserDataKey() {
|
|
|
|
+ return kStreamContextKeyName;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
StreamContext* StreamContext::GetFor(BrowserContext* context) {
|
|
|
|
if (!context->GetUserData(kStreamContextKeyName)) {
|
|
|
|
scoped_refptr<StreamContext> stream = new StreamContext();
|
|
|
|
diff --git content/browser/streams/stream_context.h content/browser/streams/stream_context.h
|
2017-09-06 23:40:58 +02:00
|
|
|
index 075ae3e7431e..57fb5fd2c4a8 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/streams/stream_context.h
|
|
|
|
+++ content/browser/streams/stream_context.h
|
|
|
|
@@ -29,6 +29,7 @@ class StreamContext
|
|
|
|
public:
|
|
|
|
StreamContext();
|
|
|
|
|
|
|
|
+ CONTENT_EXPORT static const void* GetUserDataKey();
|
|
|
|
CONTENT_EXPORT static StreamContext* GetFor(BrowserContext* browser_context);
|
|
|
|
|
|
|
|
void InitializeOnIOThread();
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index 8996f11d328e..75b658f5a2d2 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/browser/webui/web_ui_url_loader_factory.cc
|
|
|
|
+++ content/browser/webui/web_ui_url_loader_factory.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -20,13 +20,13 @@
|
2017-05-31 17:33:30 +02:00
|
|
|
#include "content/browser/histogram_internals_url_loader.h"
|
2017-12-07 22:44:24 +01:00
|
|
|
#include "content/browser/loader/global_routing_id.h"
|
2017-05-31 17:33:30 +02:00
|
|
|
#include "content/browser/resource_context_impl.h"
|
|
|
|
-#include "content/browser/storage_partition_impl.h"
|
|
|
|
#include "content/browser/webui/network_error_url_loader.h"
|
|
|
|
#include "content/browser/webui/url_data_manager_backend.h"
|
|
|
|
#include "content/browser/webui/url_data_source_impl.h"
|
|
|
|
#include "content/public/browser/browser_context.h"
|
|
|
|
#include "content/public/browser/browser_thread.h"
|
|
|
|
#include "content/public/browser/render_process_host.h"
|
|
|
|
+#include "content/public/browser/storage_partition.h"
|
|
|
|
#include "content/public/browser/web_contents.h"
|
2017-12-07 22:44:24 +01:00
|
|
|
#include "content/public/browser/web_contents_observer.h"
|
2017-07-27 01:19:27 +02:00
|
|
|
#include "content/public/common/network_service.mojom.h"
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -296,9 +296,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory,
|
|
|
|
const std::string& scheme() const { return scheme_; }
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
private:
|
2017-12-07 22:44:24 +01:00
|
|
|
- StoragePartitionImpl* GetStoragePartition() {
|
|
|
|
- return static_cast<StoragePartitionImpl*>(
|
|
|
|
- render_frame_host_->GetProcess()->GetStoragePartition());
|
|
|
|
+ StoragePartition* GetStoragePartition() {
|
|
|
|
+ return render_frame_host_->GetProcess()->GetStoragePartition();
|
|
|
|
}
|
2017-05-31 17:33:30 +02:00
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
RenderFrameHost* render_frame_host_;
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/public/browser/browser_context.h content/public/browser/browser_context.h
|
2017-12-07 22:44:24 +01:00
|
|
|
index f75be61ccdef..84f1063fb081 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/public/browser/browser_context.h
|
|
|
|
+++ content/public/browser/browser_context.h
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -200,6 +200,8 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
BrowserContext();
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
+ static const void* GetStoragePartitionMapUserDataKey();
|
|
|
|
+
|
|
|
|
~BrowserContext() override;
|
|
|
|
|
2016-08-31 13:25:56 +02:00
|
|
|
// Shuts down the storage partitions associated to this browser context.
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -288,6 +290,14 @@ class CONTENT_EXPORT BrowserContext : public base::SupportsUserData {
|
2016-08-24 11:28:52 +02:00
|
|
|
const base::FilePath& partition_path,
|
|
|
|
bool in_memory) = 0;
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2016-08-24 11:28:52 +02:00
|
|
|
+ // CEF returns a proxy object that forwards method calls to |partition_impl|.
|
|
|
|
+ virtual content::StoragePartition* GetStoragePartitionProxy(
|
|
|
|
+ BrowserContext* browser_context,
|
|
|
|
+ content::StoragePartition* partition_impl) {
|
|
|
|
+ NOTREACHED();
|
|
|
|
+ return nullptr;
|
|
|
|
+ }
|
2017-04-20 21:28:17 +02:00
|
|
|
+
|
2017-07-27 01:19:27 +02:00
|
|
|
using StaticServiceMap =
|
|
|
|
std::map<std::string, service_manager::EmbeddedServiceInfo>;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
|
2017-12-07 22:44:24 +01:00
|
|
|
index fa9a14e82472..7ed0814308aa 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/public/browser/storage_partition.h
|
|
|
|
+++ content/public/browser/storage_partition.h
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -14,6 +14,7 @@
|
2016-08-24 11:28:52 +02:00
|
|
|
#include "base/time/time.h"
|
|
|
|
#include "content/common/content_export.h"
|
2017-12-07 22:44:24 +01:00
|
|
|
#include "content/public/common/url_loader_factory.mojom.h"
|
2016-08-24 11:28:52 +02:00
|
|
|
+#include "mojo/public/cpp/bindings/binding_set.h"
|
|
|
|
#include "net/cookies/cookie_store.h"
|
|
|
|
|
|
|
|
class GURL;
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -42,12 +43,20 @@ class DatabaseTracker;
|
2016-08-24 11:28:52 +02:00
|
|
|
namespace content {
|
|
|
|
|
|
|
|
class AppCacheService;
|
2017-04-20 21:28:17 +02:00
|
|
|
+class BackgroundFetchContext;
|
2016-08-24 11:28:52 +02:00
|
|
|
+class BackgroundSyncContext;
|
2017-07-27 01:19:27 +02:00
|
|
|
+class BlobRegistryWrapper;
|
|
|
|
+class BlobURLLoaderFactory;
|
2017-03-03 23:37:23 +01:00
|
|
|
+class BluetoothAllowedDevicesMap;
|
2016-08-31 13:25:56 +02:00
|
|
|
+class BroadcastChannelProvider;
|
2016-08-24 11:28:52 +02:00
|
|
|
class BrowserContext;
|
|
|
|
class CacheStorageContext;
|
|
|
|
class DOMStorageContext;
|
2016-11-23 21:54:29 +01:00
|
|
|
class IndexedDBContext;
|
2017-01-23 18:36:54 +01:00
|
|
|
+class PaymentAppContextImpl;
|
2016-11-23 21:54:29 +01:00
|
|
|
class PlatformNotificationContext;
|
|
|
|
class ServiceWorkerContext;
|
2017-05-31 17:33:30 +02:00
|
|
|
+class URLLoaderFactoryGetter;
|
|
|
|
|
|
|
|
#if !defined(OS_ANDROID)
|
|
|
|
class HostZoomLevelContext;
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -60,6 +69,11 @@ class NetworkContext;
|
2017-10-20 19:45:20 +02:00
|
|
|
class URLLoaderFactory;
|
2017-09-06 23:40:58 +02:00
|
|
|
}
|
2017-02-14 17:47:27 +01:00
|
|
|
|
|
|
|
+namespace mojom {
|
2017-05-31 17:33:30 +02:00
|
|
|
+class NetworkContext;
|
2017-02-14 17:47:27 +01:00
|
|
|
+class StoragePartitionService;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
// Defines what persistent state a child process can access.
|
|
|
|
//
|
|
|
|
// The StoragePartition defines the view each child process has of the
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -92,6 +106,13 @@ class CONTENT_EXPORT StoragePartition {
|
2016-08-24 11:28:52 +02:00
|
|
|
virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0;
|
2017-05-31 17:33:30 +02:00
|
|
|
#endif // !defined(OS_ANDROID)
|
2016-08-24 11:28:52 +02:00
|
|
|
virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0;
|
2017-04-20 21:28:17 +02:00
|
|
|
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
|
2016-08-24 11:28:52 +02:00
|
|
|
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
|
2017-01-23 18:36:54 +01:00
|
|
|
+ virtual PaymentAppContextImpl* GetPaymentAppContext() = 0;
|
2016-08-31 13:25:56 +02:00
|
|
|
+ virtual BroadcastChannelProvider* GetBroadcastChannelProvider() = 0;
|
2017-03-03 23:37:23 +01:00
|
|
|
+ virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0;
|
2017-07-27 01:19:27 +02:00
|
|
|
+ virtual BlobURLLoaderFactory* GetBlobURLLoaderFactory() = 0;
|
|
|
|
+ virtual BlobRegistryWrapper* GetBlobRegistry() = 0;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
|
|
|
enum : uint32_t {
|
|
|
|
REMOVE_DATA_MASK_APPCACHE = 1 << 0,
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -200,6 +221,14 @@ class CONTENT_EXPORT StoragePartition {
|
|
|
|
virtual void SetNetworkFactoryForTesting(
|
|
|
|
mojom::URLLoaderFactory* test_factory) = 0;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2017-05-31 17:33:30 +02:00
|
|
|
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
|
|
|
|
+ virtual BrowserContext* browser_context() const = 0;
|
|
|
|
+
|
2016-08-24 11:28:52 +02:00
|
|
|
+ // Called by each renderer process once.
|
2017-10-20 19:45:20 +02:00
|
|
|
+ virtual mojo::BindingId Bind(
|
2017-09-06 23:40:58 +02:00
|
|
|
+ int process_id,
|
2016-08-24 11:28:52 +02:00
|
|
|
+ mojo::InterfaceRequest<mojom::StoragePartitionService> request) = 0;
|
|
|
|
+
|
|
|
|
protected:
|
|
|
|
virtual ~StoragePartition() {}
|
|
|
|
};
|
2017-10-30 21:52:39 +01:00
|
|
|
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
index e4ee15fd49ab..5adc8867d6df 100644
|
2017-10-30 21:52:39 +01:00
|
|
|
--- storage/browser/database/database_tracker.cc
|
|
|
|
+++ storage/browser/database/database_tracker.cc
|
2017-12-07 22:44:24 +01:00
|
|
|
@@ -492,7 +492,7 @@ bool DatabaseTracker::LazyInit() {
|
2017-10-30 21:52:39 +01:00
|
|
|
meta_table_.reset(new sql::MetaTable());
|
|
|
|
|
|
|
|
is_initialized_ =
|
|
|
|
- base::CreateDirectory(db_dir_) &&
|
|
|
|
+ (is_incognito_ ? true : base::CreateDirectory(db_dir_)) &&
|
|
|
|
(db_->is_open() ||
|
|
|
|
(is_incognito_ ? db_->OpenInMemory() :
|
|
|
|
db_->Open(kTrackerDatabaseFullPath))) &&
|