2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/appcache/appcache_internals_ui.cc content/browser/appcache/appcache_internals_ui.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index cb4f88f4e9a3..b4afa66f973d 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/appcache/appcache_internals_ui.cc
|
|
|
|
+++ content/browser/appcache/appcache_internals_ui.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -378,8 +378,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);
|
|
|
|
}
|
|
|
|
|
2018-02-15 01:12:09 +01:00
|
|
|
diff --git content/browser/background_fetch/background_fetch_service_impl.cc content/browser/background_fetch/background_fetch_service_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index edfea31c08ae..483bd67b7d64 100644
|
2018-02-15 01:12:09 +01:00
|
|
|
--- content/browser/background_fetch/background_fetch_service_impl.cc
|
|
|
|
+++ content/browser/background_fetch/background_fetch_service_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -44,8 +44,7 @@ void BackgroundFetchServiceImpl::CreateForWorker(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
2018-02-15 01:12:09 +01:00
|
|
|
base::BindOnce(
|
|
|
|
BackgroundFetchServiceImpl::CreateOnIoThread,
|
|
|
|
- WrapRefCounted(static_cast<StoragePartitionImpl*>(
|
|
|
|
- render_process_host->GetStoragePartition())
|
|
|
|
+ WrapRefCounted(render_process_host->GetStoragePartition()
|
|
|
|
->GetBackgroundFetchContext()),
|
2018-09-04 11:43:21 +02:00
|
|
|
origin, nullptr /* render_frame_host */, std::move(request)));
|
2018-02-15 01:12:09 +01:00
|
|
|
}
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -66,8 +65,7 @@ void BackgroundFetchServiceImpl::CreateForFrame(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
2018-09-04 11:43:21 +02:00
|
|
|
base::BindOnce(
|
|
|
|
BackgroundFetchServiceImpl::CreateOnIoThread,
|
|
|
|
- WrapRefCounted(static_cast<StoragePartitionImpl*>(
|
|
|
|
- render_process_host->GetStoragePartition())
|
|
|
|
+ WrapRefCounted(render_process_host->GetStoragePartition()
|
|
|
|
->GetBackgroundFetchContext()),
|
|
|
|
render_frame_host->GetLastCommittedOrigin(), render_frame_host,
|
|
|
|
std::move(request)));
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 31bad2ca4cc8..1f8c2c00e427 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -88,6 +88,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
|
2018-07-02 19:11:49 +02:00
|
|
|
index 26cf1ebfdffc..f6de541d25d1 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
|
2018-05-18 12:45:18 +02:00
|
|
|
@@ -50,6 +50,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
|
2018-07-02 19:11:49 +02:00
|
|
|
index f061eca7c86b..0fc07c9c4eb8 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
|
2018-10-02 14:14:11 +02:00
|
|
|
index 9797767f88ea..3da2c6d57154 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/browser_context.cc
|
|
|
|
+++ content/browser/browser_context.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -203,11 +203,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(
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -715,6 +722,11 @@ BrowserContext::BrowserContext()
|
|
|
|
new SharedCorsOriginAccessListImpl()));
|
|
|
|
}
|
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 "
|
2018-05-14 13:24:05 +02:00
|
|
|
diff --git content/browser/devtools/protocol/network_handler.cc content/browser/devtools/protocol/network_handler.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index df186ceb0b24..d4833710d0c7 100644
|
2018-05-14 13:24:05 +02:00
|
|
|
--- content/browser/devtools/protocol/network_handler.cc
|
|
|
|
+++ content/browser/devtools/protocol/network_handler.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -930,8 +930,7 @@ class BackgroundSyncRestorer {
|
2018-05-14 13:24:05 +02:00
|
|
|
scoped_refptr<ServiceWorkerDevToolsAgentHost> service_worker_host =
|
|
|
|
static_cast<ServiceWorkerDevToolsAgentHost*>(host.get());
|
|
|
|
scoped_refptr<BackgroundSyncContext> sync_context =
|
|
|
|
- static_cast<StoragePartitionImpl*>(storage_partition_)
|
|
|
|
- ->GetBackgroundSyncContext();
|
|
|
|
+ storage_partition_->GetBackgroundSyncContext();
|
2018-10-02 14:14:11 +02:00
|
|
|
base::PostTaskWithTraits(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
2018-05-14 13:24:05 +02:00
|
|
|
base::BindOnce(
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 5bf1859267c7..741fafc394be 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -172,8 +172,7 @@ void ServiceWorkerHandler::SetRenderer(int process_host_id,
|
2018-03-20 21:15:08 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
- 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;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-03-20 21:15:08 +01:00
|
|
|
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_;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 4bed3550f84f..8625a8a5c8d0 100644
|
2017-09-06 23:40:58 +02:00
|
|
|
--- content/browser/download/download_manager_impl.cc
|
|
|
|
+++ content/browser/download/download_manager_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -89,9 +89,9 @@
|
2018-02-15 01:12:09 +01:00
|
|
|
namespace content {
|
|
|
|
namespace {
|
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;
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -101,8 +101,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) {
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -268,7 +267,7 @@ base::FilePath GetTemporaryDownloadDirectory() {
|
2018-05-16 11:28:49 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
scoped_refptr<download::DownloadURLLoaderFactoryGetter>
|
|
|
|
-CreateDownloadURLLoaderFactoryGetter(StoragePartitionImpl* storage_partition,
|
|
|
|
+CreateDownloadURLLoaderFactoryGetter(StoragePartition* storage_partition,
|
|
|
|
RenderFrameHost* rfh,
|
2018-05-20 15:51:42 +02:00
|
|
|
bool is_download) {
|
2018-05-16 11:28:49 +02:00
|
|
|
network::mojom::URLLoaderFactoryPtrInfo proxy_factory_ptr_info;
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -285,7 +284,7 @@ CreateDownloadURLLoaderFactoryGetter(StoragePartitionImpl* storage_partition,
|
2018-05-16 11:28:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return base::MakeRefCounted<NetworkDownloadURLLoaderFactoryGetter>(
|
|
|
|
- storage_partition->url_loader_factory_getter(),
|
|
|
|
+ base::WrapRefCounted(storage_partition->url_loader_factory_getter()),
|
|
|
|
std::move(proxy_factory_ptr_info), std::move(proxy_factory_request));
|
|
|
|
}
|
|
|
|
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1129,7 +1128,7 @@ void DownloadManagerImpl::InterceptNavigationOnChecksComplete(
|
2018-04-19 17:44:42 +02:00
|
|
|
tab_referrer_url = entry->GetReferrer().url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
- StoragePartitionImpl* storage_partition =
|
|
|
|
+ StoragePartition* storage_partition =
|
|
|
|
GetStoragePartition(browser_context_, render_process_id, render_frame_id);
|
2018-05-16 11:28:49 +02:00
|
|
|
in_progress_manager_->InterceptDownloadFromNavigation(
|
|
|
|
std::move(resource_request), render_process_id, render_frame_id, site_url,
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1179,10 +1178,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
|
2018-07-13 21:29:20 +02:00
|
|
|
base::MakeRefCounted<WebUIDownloadURLLoaderFactoryGetter>(
|
|
|
|
rfh, params->url());
|
2018-07-31 21:21:39 +02:00
|
|
|
} else if (rfh && params->url().SchemeIsFileSystem()) {
|
|
|
|
- StoragePartitionImpl* storage_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartitionForSite(browser_context_,
|
|
|
|
- site_url));
|
|
|
|
+ StoragePartition* storage_partition =
|
|
|
|
+ BrowserContext::GetStoragePartitionForSite(browser_context_, site_url);
|
|
|
|
std::string storage_domain;
|
|
|
|
auto* site_instance = rfh->GetSiteInstance();
|
|
|
|
if (site_instance) {
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1197,10 +1194,8 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
|
2018-07-31 21:21:39 +02:00
|
|
|
params->url(), rfh, /*is_navigation=*/false,
|
|
|
|
storage_partition->GetFileSystemContext(), storage_domain);
|
2018-06-01 21:16:26 +02:00
|
|
|
} else {
|
|
|
|
- StoragePartitionImpl* storage_partition =
|
|
|
|
- static_cast<StoragePartitionImpl*>(
|
|
|
|
- BrowserContext::GetStoragePartitionForSite(browser_context_,
|
|
|
|
- site_url));
|
|
|
|
+ StoragePartition* storage_partition =
|
|
|
|
+ BrowserContext::GetStoragePartitionForSite(browser_context_, site_url);
|
|
|
|
url_loader_factory_getter =
|
|
|
|
CreateDownloadURLLoaderFactoryGetter(storage_partition, rfh, true);
|
|
|
|
}
|
2018-05-21 14:54:08 +02:00
|
|
|
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 26f09ff67ffd..0393e389dc1e 100644
|
2018-05-21 14:54:08 +02:00
|
|
|
--- content/browser/loader/navigation_url_loader_impl.cc
|
|
|
|
+++ content/browser/loader/navigation_url_loader_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1155,7 +1155,7 @@ class NavigationURLLoaderImpl::URLLoaderRequestController
|
2018-05-17 10:58:21 +02:00
|
|
|
// path does as well for navigations.
|
|
|
|
bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
|
|
|
|
-1 /* render_process_id */, -1 /* render_frame_id */, resource_context_,
|
|
|
|
- resource_request_->url, url::Origin(), head.mime_type,
|
|
|
|
+ resource_request_->url, true, url::Origin(), head.mime_type,
|
|
|
|
false /* allow_wildcard */, &stale, &plugin, nullptr);
|
|
|
|
|
|
|
|
if (stale) {
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1553,7 +1553,7 @@ NavigationURLLoaderImpl::NavigationURLLoaderImpl(
|
2018-06-01 21:16:26 +02:00
|
|
|
network::mojom::URLLoaderFactoryPtrInfo proxied_factory_info;
|
|
|
|
network::mojom::URLLoaderFactoryRequest proxied_factory_request;
|
2018-09-04 11:43:21 +02:00
|
|
|
bool bypass_redirect_checks = false;
|
2017-12-07 22:44:24 +01:00
|
|
|
- auto* partition = static_cast<StoragePartitionImpl*>(storage_partition);
|
|
|
|
+ auto* partition = storage_partition;
|
2018-06-01 21:16:26 +02:00
|
|
|
if (frame_tree_node) {
|
|
|
|
// |frame_tree_node| may be null in some unit test environments.
|
|
|
|
GetContentClient()
|
2018-03-20 21:15:08 +01:00
|
|
|
diff --git content/browser/payments/payment_app_installer.cc content/browser/payments/payment_app_installer.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 9ec51d4332a2..589c4ef5cf8d 100644
|
2018-03-20 21:15:08 +01:00
|
|
|
--- content/browser/payments/payment_app_installer.cc
|
|
|
|
+++ content/browser/payments/payment_app_installer.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -133,9 +133,9 @@ class SelfDeleteInstaller
|
2018-03-20 21:15:08 +01:00
|
|
|
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();
|
|
|
|
|
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
|
2018-10-02 14:14:11 +02:00
|
|
|
index d3042e6a2fc7..07c8478b8ffb 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -373,10 +373,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
|
|
|
|
2018-10-02 14:14:11 +02:00
|
|
|
base::PostTaskWithTraits(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
|
|
|
@@ -450,8 +451,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
|
2018-10-02 14:14:11 +02:00
|
|
|
index 96eb6578f347..3e7b0fc5d196 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -754,11 +754,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.
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1488,7 +1487,7 @@ int RenderProcessHost::GetCurrentRenderProcessCountForTesting() {
|
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_) {
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1497,8 +1496,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);
|
|
|
|
}
|
2018-02-15 01:12:09 +01:00
|
|
|
// 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1523,7 +1522,7 @@ const unsigned int RenderProcessHostImpl::kMaxFrameDepthForPriority =
|
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),
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1576,10 +1575,12 @@ 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_))),
|
2018-07-02 19:11:49 +02:00
|
|
|
service_worker_dispatcher_host_(new ServiceWorkerDispatcherHost(
|
|
|
|
- storage_partition_impl_->GetServiceWorkerContext(),
|
|
|
|
+ static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetServiceWorkerContext()),
|
|
|
|
id_)),
|
2017-01-23 18:36:54 +01:00
|
|
|
channel_connected_(false),
|
|
|
|
sent_render_process_ready_(false),
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1615,7 +1616,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());
|
2018-07-02 19:11:49 +02:00
|
|
|
AddObserver(service_worker_dispatcher_host_.get());
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1951,6 +1953,15 @@ 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());
|
2018-06-19 00:08:20 +02:00
|
|
|
+ auto dom_storage_context = static_cast<DOMStorageContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetDOMStorageContext());
|
2016-08-24 11:28:52 +02:00
|
|
|
+ auto service_worker_context = static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
+ storage_partition_impl_->GetServiceWorkerContext());
|
|
|
|
+
|
|
|
|
MediaInternals* media_internals = MediaInternals::GetInstance();
|
2016-08-31 13:25:56 +02:00
|
|
|
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
|
2018-06-19 00:08:20 +02:00
|
|
|
// from guests.
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -1989,10 +2000,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(),
|
2018-03-20 21:15:08 +01:00
|
|
|
- storage_partition_impl_->GetServiceWorkerContext(),
|
|
|
|
+ service_worker_context,
|
|
|
|
storage_partition_impl_->GetPrefetchURLLoaderService(),
|
2018-10-02 14:14:11 +02:00
|
|
|
BrowserContext::GetSharedCorsOriginAccessList(browser_context),
|
2018-04-19 17:44:42 +02:00
|
|
|
std::move(get_contexts_callback),
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -2002,8 +2013,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2018-05-14 13:24:05 +02:00
|
|
|
|
2016-08-24 11:28:52 +02:00
|
|
|
AddFilter(
|
2017-01-23 18:36:54 +01:00
|
|
|
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
|
2018-02-15 01:12:09 +01:00
|
|
|
- AddFilter(new DOMStorageMessageFilter(
|
2016-08-24 11:28:52 +02:00
|
|
|
- storage_partition_impl_->GetDOMStorageContext()));
|
2018-02-15 01:12:09 +01:00
|
|
|
+ AddFilter(new DOMStorageMessageFilter(dom_storage_context));
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-02-15 01:12:09 +01:00
|
|
|
peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
|
2018-06-01 21:16:26 +02:00
|
|
|
AddFilter(peer_connection_tracker_host_.get());
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -2020,10 +2030,6 @@ void RenderProcessHostImpl::CreateMessageFilters() {
|
2018-05-21 14:54:08 +02:00
|
|
|
|
2017-12-07 22:44:24 +01:00
|
|
|
AddFilter(new TraceMessageFilter(GetID()));
|
2018-08-09 22:18:24 +02:00
|
|
|
AddFilter(new ResolveProxyMsgHelper(GetID()));
|
2018-05-21 14:54:08 +02:00
|
|
|
-
|
2016-08-31 13:25:56 +02:00
|
|
|
- scoped_refptr<ServiceWorkerContextWrapper> service_worker_context(
|
|
|
|
- static_cast<ServiceWorkerContextWrapper*>(
|
|
|
|
- storage_partition_impl_->GetServiceWorkerContext()));
|
2018-05-14 13:24:05 +02:00
|
|
|
}
|
2018-05-21 14:54:08 +02:00
|
|
|
|
|
|
|
void RenderProcessHostImpl::BindCacheStorage(
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -2035,7 +2041,8 @@ void RenderProcessHostImpl::BindCacheStorage(
|
2018-04-19 17:44:42 +02:00
|
|
|
cache_storage_dispatcher_host_ =
|
|
|
|
base::MakeRefCounted<CacheStorageDispatcherHost>();
|
|
|
|
cache_storage_dispatcher_host_->Init(
|
|
|
|
- storage_partition_impl_->GetCacheStorageContext());
|
|
|
|
+ static_cast<CacheStorageContextImpl*>(
|
|
|
|
+ storage_partition_impl_->GetCacheStorageContext()));
|
|
|
|
}
|
|
|
|
// Send the binding to IO thread, because Cache Storage handles Mojo IPC on IO
|
|
|
|
// thread entirely.
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -2205,7 +2212,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
|
|
|
|
|
|
|
registry->AddInterface(base::BindRepeating(
|
|
|
|
&CodeCacheHostImpl::Create, GetID(),
|
|
|
|
- base::RetainedRef(storage_partition_impl_->GetCacheStorageContext()),
|
|
|
|
+ base::RetainedRef(static_cast<CacheStorageContextImpl*>(
|
|
|
|
+ storage_partition_impl_->GetCacheStorageContext())),
|
|
|
|
base::RetainedRef(
|
|
|
|
storage_partition_impl_->GetGeneratedCodeCacheContext())));
|
|
|
|
|
|
|
|
@@ -2216,7 +2224,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
registry->AddInterface(base::BindRepeating(
|
|
|
|
&AppCacheDispatcherHost::Create,
|
|
|
|
- base::Unretained(storage_partition_impl_->GetAppCacheService()),
|
|
|
|
+ base::Unretained(static_cast<ChromeAppCacheService*>(
|
|
|
|
+ storage_partition_impl_->GetAppCacheService())),
|
|
|
|
GetID()));
|
|
|
|
|
2018-08-09 22:18:24 +02:00
|
|
|
AddUIThreadInterface(
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -2253,6 +2262,9 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
|
2018-07-02 19:11:49 +02:00
|
|
|
plugin_registry_.reset(
|
|
|
|
new PluginRegistryImpl(GetBrowserContext()->GetResourceContext()));
|
|
|
|
}
|
|
|
|
+ // Needed for proper routing of IsPluginAvailable callbacks.
|
|
|
|
+ DCHECK_GE(GetID(), 0);
|
|
|
|
+ plugin_registry_->set_render_process_id(GetID());
|
|
|
|
registry->AddInterface(base::BindRepeating(
|
|
|
|
&PluginRegistryImpl::Bind, base::Unretained(plugin_registry_.get())));
|
|
|
|
#endif
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
|
2018-10-02 14:14:11 +02:00
|
|
|
index 95c1a4766444..5f4f2cd7baff 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -99,7 +99,6 @@ class ServiceWorkerDispatcherHost;
|
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;
|
2018-05-17 10:58:21 +02:00
|
|
|
struct ChildProcessTerminationInfo;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-06-01 21:16:26 +02:00
|
|
|
typedef base::Thread* (*RendererMainThreadFactoryFunction)(
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -142,7 +141,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);
|
|
|
|
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -487,7 +486,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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -756,10 +755,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.
|
2018-09-04 11:43:21 +02:00
|
|
|
base::ObserverList<RenderProcessHostObserver>::Unchecked observers_;
|
2017-12-07 22:44:24 +01:00
|
|
|
diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc
|
2018-09-04 11:43:21 +02:00
|
|
|
index c3a8bdc572de..73f66acbe200 100644
|
2017-12-07 22:44:24 +01:00
|
|
|
--- content/browser/renderer_interface_binders.cc
|
|
|
|
+++ content/browser/renderer_interface_binders.cc
|
2018-06-08 18:53:10 +02:00
|
|
|
@@ -139,7 +139,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
2017-12-07 22:44:24 +01:00
|
|
|
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));
|
|
|
|
}));
|
2018-07-02 19:11:49 +02:00
|
|
|
@@ -159,15 +159,16 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
2018-02-15 01:12:09 +01:00
|
|
|
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);
|
|
|
|
}));
|
2017-12-07 22:44:24 +01:00
|
|
|
parameterized_binder_registry_.AddInterface(
|
|
|
|
base::Bind([](blink::mojom::NotificationServiceRequest request,
|
|
|
|
RenderProcessHost* host, const url::Origin& origin) {
|
|
|
|
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
|
|
|
- ->GetPlatformNotificationContext()
|
|
|
|
+ static_cast<PlatformNotificationContextImpl*>(
|
2018-07-02 19:11:49 +02:00
|
|
|
+ host->GetStoragePartition()
|
|
|
|
+ ->GetPlatformNotificationContext())
|
|
|
|
->CreateService(origin, std::move(request));
|
2017-12-07 22:44:24 +01:00
|
|
|
}));
|
2018-02-15 01:12:09 +01:00
|
|
|
parameterized_binder_registry_.AddInterface(
|
2018-06-08 18:53:10 +02:00
|
|
|
@@ -179,7 +180,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
|
2018-05-21 14:54:08 +02:00
|
|
|
parameterized_binder_registry_.AddInterface(base::BindRepeating(
|
|
|
|
[](blink::mojom::CookieStoreRequest request, RenderProcessHost* host,
|
|
|
|
const url::Origin& origin) {
|
|
|
|
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
|
|
|
+ host->GetStoragePartition()
|
|
|
|
->GetCookieStoreContext()
|
|
|
|
->CreateService(std::move(request), origin);
|
|
|
|
}));
|
2017-12-07 22:44:24 +01:00
|
|
|
diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 454febaba66b..90d430bb95d3 100644
|
2017-12-07 22:44:24 +01:00
|
|
|
--- content/browser/shared_worker/shared_worker_connector_impl.cc
|
|
|
|
+++ content/browser/shared_worker/shared_worker_connector_impl.cc
|
2018-07-02 19:11:49 +02:00
|
|
|
@@ -52,8 +52,8 @@ void SharedWorkerConnectorImpl::Connect(
|
|
|
|
host->GetBrowserContext(), std::move(blob_url_token));
|
2018-03-20 21:15:08 +01:00
|
|
|
}
|
|
|
|
SharedWorkerServiceImpl* service =
|
|
|
|
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
|
2018-02-15 01:12:09 +01:00
|
|
|
- ->GetSharedWorkerService();
|
2018-03-20 21:15:08 +01:00
|
|
|
+ static_cast<SharedWorkerServiceImpl*>(host->GetStoragePartition()
|
2018-02-15 01:12:09 +01:00
|
|
|
+ ->GetSharedWorkerService());
|
|
|
|
service->ConnectToWorker(process_id_, frame_id_, std::move(info),
|
|
|
|
std::move(client), creation_context_type,
|
2018-07-02 19:11:49 +02:00
|
|
|
blink::MessagePortChannel(std::move(message_port)),
|
2018-04-19 17:44:42 +02:00
|
|
|
diff --git content/browser/shared_worker/shared_worker_service_impl.cc content/browser/shared_worker/shared_worker_service_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 1033953db1e6..8dc848dfb0b5 100644
|
2018-04-19 17:44:42 +02:00
|
|
|
--- content/browser/shared_worker/shared_worker_service_impl.cc
|
|
|
|
+++ content/browser/shared_worker/shared_worker_service_impl.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -480,7 +480,8 @@ void SharedWorkerServiceImpl::CreateWorker(
|
|
|
|
FROM_HERE, {BrowserThread::IO},
|
2018-05-16 11:28:49 +02:00
|
|
|
base::BindOnce(
|
|
|
|
&CreateScriptLoaderOnIO,
|
2018-10-02 14:14:11 +02:00
|
|
|
- storage_partition_->url_loader_factory_getter(),
|
|
|
|
+ base::WrapRefCounted(
|
|
|
|
+ storage_partition_->url_loader_factory_getter()),
|
2018-06-08 18:53:10 +02:00
|
|
|
std::move(factory_bundle_for_browser),
|
2018-09-04 11:43:21 +02:00
|
|
|
std::move(subresource_loader_factories), service_worker_context_,
|
2018-07-31 21:21:39 +02:00
|
|
|
appcache_handle_core,
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
|
2018-10-02 14:14:11 +02:00
|
|
|
index 78110a30b23a..f387d99af595 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/storage_partition_impl.h
|
|
|
|
+++ content/browser/storage_partition_impl.h
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -97,7 +97,7 @@ class CONTENT_EXPORT StoragePartitionImpl
|
2018-02-15 01:12:09 +01:00
|
|
|
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;
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -138,14 +138,14 @@ class CONTENT_EXPORT StoragePartitionImpl
|
2018-07-31 21:21:39 +02:00
|
|
|
void FlushNetworkInterfaceForTesting() override;
|
2018-03-20 21:15:08 +01:00
|
|
|
void WaitForDeletionTasksForTesting() override;
|
2018-02-15 01:12:09 +01:00
|
|
|
|
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
|
|
|
- BlobRegistryWrapper* GetBlobRegistry();
|
2018-03-20 21:15:08 +01:00
|
|
|
- PrefetchURLLoaderService* GetPrefetchURLLoaderService();
|
2018-05-21 14:54:08 +02:00
|
|
|
- CookieStoreContext* GetCookieStoreContext();
|
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
|
|
|
+ BlobRegistryWrapper* GetBlobRegistry() override;
|
2018-03-20 21:15:08 +01:00
|
|
|
+ PrefetchURLLoaderService* GetPrefetchURLLoaderService() override;
|
2018-05-21 14:54:08 +02:00
|
|
|
+ CookieStoreContext* GetCookieStoreContext() override;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-06-19 00:08:20 +02:00
|
|
|
// blink::mojom::StoragePartitionService interface.
|
2018-03-20 21:15:08 +01:00
|
|
|
void OpenLocalStorage(const url::Origin& origin,
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -159,18 +159,19 @@ class CONTENT_EXPORT StoragePartitionImpl
|
|
|
|
const std::vector<url::Origin>& origins,
|
|
|
|
OnCanSendReportingReportsCallback callback) 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,
|
2018-06-19 00:08:20 +02:00
|
|
|
- mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request);
|
|
|
|
+ mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request)
|
|
|
|
+ override;
|
2017-10-20 19:45:20 +02:00
|
|
|
|
|
|
|
auto& bindings_for_testing() { return bindings_; }
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -181,10 +182,11 @@ class CONTENT_EXPORT StoragePartitionImpl
|
2018-02-15 01:12:09 +01:00
|
|
|
// 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_;
|
|
|
|
}
|
|
|
|
|
2016-08-24 11:28:52 +02:00
|
|
|
diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
index 9ed67fe1550b..d0c791791c38 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/browser/streams/stream_context.cc
|
|
|
|
+++ content/browser/streams/stream_context.cc
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -23,6 +23,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
|
2018-10-02 14:14:11 +02:00
|
|
|
index 63fe0125ca1c..698378600723 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
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -19,7 +19,6 @@
|
2018-06-01 21:16:26 +02:00
|
|
|
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
|
2018-04-19 17:44:42 +02:00
|
|
|
#include "content/browser/frame_host/render_frame_host_impl.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"
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -27,6 +26,7 @@
|
|
|
|
#include "content/public/browser/browser_task_traits.h"
|
2017-05-31 17:33:30 +02:00
|
|
|
#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"
|
2018-02-15 01:12:09 +01:00
|
|
|
#include "content/public/common/url_constants.h"
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -314,9 +314,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory,
|
2017-12-07 22:44:24 +01:00
|
|
|
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
|
2018-10-02 14:14:11 +02:00
|
|
|
index e26a929290a9..cf6f5b3b41ec 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/public/browser/browser_context.h
|
|
|
|
+++ content/public/browser/browser_context.h
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -238,6 +238,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.
|
2018-10-02 14:14:11 +02:00
|
|
|
@@ -332,6 +334,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
|
2018-07-31 21:21:39 +02:00
|
|
|
index f55e28d79cda..297541d0a99a 100644
|
2016-08-24 11:28:52 +02:00
|
|
|
--- content/public/browser/storage_partition.h
|
|
|
|
+++ content/public/browser/storage_partition.h
|
2018-06-19 00:08:20 +02:00
|
|
|
@@ -14,8 +14,10 @@
|
2018-04-19 17:44:42 +02:00
|
|
|
#include "base/files/file_path.h"
|
2016-08-24 11:28:52 +02:00
|
|
|
#include "base/time/time.h"
|
|
|
|
#include "content/common/content_export.h"
|
|
|
|
+#include "mojo/public/cpp/bindings/binding_set.h"
|
2018-04-19 17:44:42 +02:00
|
|
|
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
2018-05-20 15:51:42 +02:00
|
|
|
#include "services/network/public/mojom/cookie_manager.mojom.h"
|
2018-06-19 00:08:20 +02:00
|
|
|
+#include "third_party/blink/public/mojom/dom_storage/storage_partition_service.mojom.h"
|
|
|
|
|
|
|
|
class GURL;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
2018-07-31 21:21:39 +02:00
|
|
|
@@ -60,12 +62,28 @@ class ServiceWorkerContext;
|
2018-04-19 17:44:42 +02:00
|
|
|
class SharedWorkerService;
|
|
|
|
class WebPackageContext;
|
2016-08-24 11:28:52 +02:00
|
|
|
|
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;
|
2018-05-21 14:54:08 +02:00
|
|
|
+class CookieStoreContext;
|
2018-02-15 01:12:09 +01:00
|
|
|
+class LockManager;
|
2017-01-23 18:36:54 +01:00
|
|
|
+class PaymentAppContextImpl;
|
2018-03-20 21:15:08 +01:00
|
|
|
+class PrefetchURLLoaderService;
|
2017-05-31 17:33:30 +02:00
|
|
|
+class URLLoaderFactoryGetter;
|
2018-04-19 17:44:42 +02:00
|
|
|
+
|
2017-05-31 17:33:30 +02:00
|
|
|
#if !defined(OS_ANDROID)
|
|
|
|
class HostZoomLevelContext;
|
2018-04-19 17:44:42 +02:00
|
|
|
class HostZoomMap;
|
2018-02-15 01:12:09 +01:00
|
|
|
class ZoomLevelDelegate;
|
|
|
|
#endif // !defined(OS_ANDROID)
|
2017-02-14 17:47:27 +01:00
|
|
|
|
|
|
|
+namespace mojom {
|
|
|
|
+class StoragePartitionService;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
// Defines what persistent state a child process can access.
|
|
|
|
//
|
|
|
|
// The StoragePartition defines the view each child process has of the
|
2018-07-31 21:21:39 +02:00
|
|
|
@@ -103,6 +121,7 @@ class CONTENT_EXPORT StoragePartition {
|
2018-02-15 01:12:09 +01:00
|
|
|
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;
|
2018-07-31 21:21:39 +02:00
|
|
|
@@ -229,6 +248,26 @@ class CONTENT_EXPORT StoragePartition {
|
|
|
|
// Wait until all deletions tasks are finished. For test use only.
|
|
|
|
virtual void WaitForDeletionTasksForTesting() = 0;
|
2018-02-15 01:12:09 +01:00
|
|
|
|
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 BlobRegistryWrapper* GetBlobRegistry() = 0;
|
2018-03-20 21:15:08 +01:00
|
|
|
+ virtual PrefetchURLLoaderService* GetPrefetchURLLoaderService() = 0;
|
2018-05-21 14:54:08 +02:00
|
|
|
+ virtual CookieStoreContext* GetCookieStoreContext() = 0;
|
2018-02-15 01:12:09 +01:00
|
|
|
+
|
2017-05-31 17:33:30 +02:00
|
|
|
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
|
|
|
|
+ virtual BrowserContext* browser_context() const = 0;
|
|
|
|
+
|
2017-10-20 19:45:20 +02:00
|
|
|
+ virtual mojo::BindingId Bind(
|
2017-09-06 23:40:58 +02:00
|
|
|
+ int process_id,
|
2018-06-19 00:08:20 +02:00
|
|
|
+ mojo::InterfaceRequest<blink::mojom::StoragePartitionService> request) = 0;
|
2018-02-15 01:12:09 +01:00
|
|
|
+
|
|
|
|
+ virtual void set_site_for_service_worker(
|
|
|
|
+ const GURL& site_for_service_worker) = 0;
|
|
|
|
+ virtual const GURL& site_for_service_worker() const = 0;
|
2016-08-24 11:28:52 +02:00
|
|
|
+
|
|
|
|
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
|
2018-09-04 11:43:21 +02:00
|
|
|
index e18b8180bb5e..f775176238ac 100644
|
2017-10-30 21:52:39 +01:00
|
|
|
--- storage/browser/database/database_tracker.cc
|
|
|
|
+++ storage/browser/database/database_tracker.cc
|
2018-08-09 22:18:24 +02:00
|
|
|
@@ -481,7 +481,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))) &&
|