summaryrefslogtreecommitdiffstats
path: root/content/browser/resource_context_impl.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-15 05:12:34 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-15 05:12:34 +0000
commit55c0ecae62d3e95bf016510d8cb00fdcc6c7271e (patch)
tree7657cef41f5f1487f095437c39c45dfc2b979f0d /content/browser/resource_context_impl.cc
parent7dc57d7e28303ebee22ca59528f4ee22b64b54a9 (diff)
downloadchromium_src-55c0ecae62d3e95bf016510d8cb00fdcc6c7271e.zip
chromium_src-55c0ecae62d3e95bf016510d8cb00fdcc6c7271e.tar.gz
chromium_src-55c0ecae62d3e95bf016510d8cb00fdcc6c7271e.tar.bz2
AppCache and StoragePartition'ing
* Get rid of BrowserContext::GetAppCacheService and ResourceContext::GetAppCacheService as they've been replace by accessors on the StoragePartition and WorkerStoragePartition classes. * Added a BrowsingContext::GetRequestContextForStoragePartition(id) accessor so the constellation of storage context + main request context can initialized properly. Implemented that method in chrome's Profile class in terms of the existing GetRequestContextForIsolatedApp(id) accessor. * Hold references to the ChromeAppCacheService and ChromeBlobStorageContext inside of ResourceMessageFilter and provide accessors to them. These are for use by the ResourceDispatcherHost singleton which would otherwise not have enough context to get needed references to partitioned things. * Widen the ResourceDispatcherHostDelegate::RequestBeginning method to also take an AppCacheService* parameter since that value can no longer be retrieved via the ResourceContext. Chrome's impl of this delegate interface needs that value to construct OfflineResourceThrottles. * Poke at WorkerProcessHost to create ResourceMessageFilters and others to utlize the correct URLRequestContext so the right set of cookies are used in shared workers. TBR=mihaip,sail,thakis BUG=85121 Review URL: https://chromiumcodereview.appspot.com/10916132 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/resource_context_impl.cc')
-rw-r--r--content/browser/resource_context_impl.cc28
1 files changed, 7 insertions, 21 deletions
diff --git a/content/browser/resource_context_impl.cc b/content/browser/resource_context_impl.cc
index 0dd5cea..c4074d3 100644
--- a/content/browser/resource_context_impl.cc
+++ b/content/browser/resource_context_impl.cc
@@ -31,7 +31,6 @@
#include "webkit/fileapi/file_system_url_request_job_factory.h"
// Key names on ResourceContext.
-static const char* kAppCacheServiceKeyName = "content_appcache_service_tracker";
static const char* kBlobStorageContextKeyName = "content_blob_storage_context";
static const char* kHostZoomMapKeyName = "content_host_zoom_map";
@@ -185,11 +184,6 @@ void InitializeRequestContext(
} // namespace
-AppCacheService* ResourceContext::GetAppCacheService(ResourceContext* context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- return UserDataAdapter<ChromeAppCacheService>::Get(
- context, kAppCacheServiceKeyName);
-}
ResourceContext::ResourceContext() {
if (ResourceDispatcherHostImpl::Get())
@@ -204,12 +198,6 @@ ResourceContext::~ResourceContext() {
}
}
-BlobStorageController* GetBlobStorageControllerForResourceContext(
- ResourceContext* resource_context) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- return GetChromeBlobStorageContextForResourceContext(resource_context)->
- controller();
-}
ChromeBlobStorageContext* GetChromeBlobStorageContextForResourceContext(
ResourceContext* resource_context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -228,11 +216,6 @@ void InitializeResourceContext(BrowserContext* browser_context) {
DCHECK(!resource_context->GetUserData(kHostZoomMapKeyName));
resource_context->SetUserData(
- kAppCacheServiceKeyName,
- new UserDataAdapter<ChromeAppCacheService>(
- static_cast<ChromeAppCacheService*>(
- BrowserContext::GetAppCacheService(browser_context))));
- resource_context->SetUserData(
kBlobStorageContextKeyName,
new UserDataAdapter<ChromeBlobStorageContext>(
ChromeBlobStorageContext::GetFor(browser_context)));
@@ -245,6 +228,9 @@ void InitializeResourceContext(BrowserContext* browser_context) {
HostZoomMap::GetForBrowserContext(browser_context)));
resource_context->DetachUserDataThread();
+ StoragePartition* storage_partition =
+ BrowserContext::GetDefaultStoragePartition(browser_context);
+
// Add content's URLRequestContext's hooks.
// Check first to avoid memory leak in unittests.
// TODO(creis): Do equivalent initializations for isolated app and isolated
@@ -264,9 +250,9 @@ void InitializeResourceContext(BrowserContext* browser_context) {
base::Bind(
&InitializeRequestContext,
make_scoped_refptr(browser_context->GetRequestContext()),
- BrowserContext::GetAppCacheService(browser_context),
+ storage_partition->GetAppCacheService(),
make_scoped_refptr(
- BrowserContext::GetFileSystemContext(browser_context)),
+ storage_partition->GetFileSystemContext()),
make_scoped_refptr(
ChromeBlobStorageContext::GetFor(browser_context))));
BrowserThread::PostTask(
@@ -274,9 +260,9 @@ void InitializeResourceContext(BrowserContext* browser_context) {
base::Bind(
&InitializeRequestContext,
make_scoped_refptr(browser_context->GetMediaRequestContext()),
- BrowserContext::GetAppCacheService(browser_context),
+ storage_partition->GetAppCacheService(),
make_scoped_refptr(
- BrowserContext::GetFileSystemContext(browser_context)),
+ storage_partition->GetFileSystemContext()),
make_scoped_refptr(
ChromeBlobStorageContext::GetFor(browser_context))));
}