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

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,12 @@
StoragePartitionImpl::Create(browser_context_, partition_path);
partitions_[partition_id] = storage_partition;
- PostCreateInitialization(storage_partition, partition_path);
+ net::URLRequestContextGetter* request_context = partition_id.empty() ?
+ browser_context_->GetRequestContext() :
+ browser_context_->GetRequestContextForStoragePartition(partition_id);
+ 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 +78,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 +88,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