Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1546)

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 10916132: AppCache and StoragePartition'ing (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/storage_partition_impl_map.cc
===================================================================
--- content/browser/storage_partition_impl_map.cc (revision 156155)
+++ content/browser/storage_partition_impl_map.cc (working copy)
@@ -15,6 +15,7 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_constants.h"
+#include "net/url_request/url_request_context_getter.h"
namespace content {
@@ -49,8 +50,18 @@
StoragePartitionImpl::Create(browser_context_, partition_path);
partitions_[partition_id] = storage_partition;
- PostCreateInitialization(storage_partition, partition_path);
+ net::URLRequestContextGetter* request_context;
+ if (partition_id.empty()) {
+ request_context = browser_context_->GetRequestContext();
+ } else {
+ // TODO(michaeln/awong): Provide the request context that corresponds to
+ // to this partition. For now, the appcache is initialized into a disabled
+ // state by providing the NULL input. http://crbug.com/85121
michaeln 2012/09/13 00:21:20 NOTE!!!
awong 2012/09/13 00:45:50 Ah hah...yes. This is a problem. A solution would
michaeln 2012/09/13 01:37:20 Should i be worried about "guest-<appid>" being us
+ request_context = NULL;
+ }
+ PostCreateInitialization(storage_partition, partition_path, request_context);
+
// TODO(ajwong): We need to remove this conditional by making
// InitializeResourceContext() understand having different partition data
// based on the renderer_id.
@@ -73,7 +84,8 @@
void StoragePartitionImplMap::PostCreateInitialization(
StoragePartitionImpl* partition,
- const FilePath& partition_path) {
+ const FilePath& partition_path,
+ net::URLRequestContextGetter* request_context_getter) {
// Check first to avoid memory leak in unittests.
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
BrowserThread::PostTask(
@@ -82,11 +94,8 @@
partition->GetAppCacheService(),
browser_context_->IsOffTheRecord() ? FilePath() :
partition_path.Append(kAppCacheDirname),
- // TODO(michaeln): This is not right, appcache will be
- // using the cookies and cache of a the default
- // partition when populating the cache.
- // http://crbug.com/85121
- browser_context_->GetResourceContext(),
+ browser_context_->GetResourceContext(),
+ make_scoped_refptr(request_context_getter),
make_scoped_refptr(
browser_context_->GetSpecialStoragePolicy())));
}

Powered by Google App Engine
This is Rietveld 408576698