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

Side by Side Diff: content/browser/storage_partition_impl_map.cc

Issue 11147026: Initial refactor to get profiles to propagate storage partition details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing Android's BrowserContext. Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/storage_partition_impl_map.h" 5 #include "content/browser/storage_partition_impl_map.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // There was no previous partition, so let's make a new one. 207 // There was no previous partition, so let's make a new one.
208 StoragePartitionImpl* partition = 208 StoragePartitionImpl* partition =
209 StoragePartitionImpl::Create(browser_context_, partition_id, 209 StoragePartitionImpl::Create(browser_context_, partition_id,
210 browser_context_->GetPath()); 210 browser_context_->GetPath());
211 partitions_[partition_id] = partition; 211 partitions_[partition_id] = partition;
212 212
213 // These calls must happen after StoragePartitionImpl::Create(). 213 // These calls must happen after StoragePartitionImpl::Create().
214 partition->SetURLRequestContext( 214 partition->SetURLRequestContext(
215 partition_id.empty() ? 215 partition_id.empty() ?
216 browser_context_->GetRequestContext() : 216 browser_context_->GetRequestContext() :
217 browser_context_->GetRequestContextForStoragePartition(partition_id)); 217 browser_context_->GetRequestContextForStoragePartition(
218 partition->GetPath(), false));
218 partition->SetMediaURLRequestContext( 219 partition->SetMediaURLRequestContext(
219 partition_id.empty() ? 220 partition_id.empty() ?
220 browser_context_->GetMediaRequestContext() : 221 browser_context_->GetMediaRequestContext() :
221 browser_context_->GetMediaRequestContextForStoragePartition( 222 browser_context_->GetMediaRequestContextForStoragePartition(
222 partition_id)); 223 partition->GetPath(), false));
223 224
224 PostCreateInitialization(partition); 225 PostCreateInitialization(partition);
225 226
226 // TODO(ajwong): ResourceContexts no longer have any storage related state. 227 // TODO(ajwong): ResourceContexts no longer have any storage related state.
227 // We should move this into a place where it is called once per 228 // We should move this into a place where it is called once per
228 // BrowserContext creation rather than piggybacking off the default context 229 // BrowserContext creation rather than piggybacking off the default context
229 // creation. 230 // creation.
230 if (partition_id.empty()) { 231 if (partition_id.empty()) {
231 InitializeResourceContext(browser_context_); 232 InitializeResourceContext(browser_context_);
232 } 233 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 273
273 // We do not call InitializeURLRequestContext() for media contexts because, 274 // We do not call InitializeURLRequestContext() for media contexts because,
274 // other than the HTTP cache, the media contexts share the same backing 275 // other than the HTTP cache, the media contexts share the same backing
275 // objects as their associated "normal" request context. Thus, the previous 276 // objects as their associated "normal" request context. Thus, the previous
276 // call serves to initialize the media request context for this storage 277 // call serves to initialize the media request context for this storage
277 // partition as well. 278 // partition as well.
278 } 279 }
279 } 280 }
280 281
281 } // namespace content 282 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698