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()))); |
} |