Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 // There was no previous partition, so let's make a new one. | 204 // There was no previous partition, so let's make a new one. |
| 205 StoragePartitionImpl* partition = | 205 StoragePartitionImpl* partition = |
| 206 StoragePartitionImpl::Create(browser_context_, partition_id, | 206 StoragePartitionImpl::Create(browser_context_, partition_id, |
| 207 browser_context_->GetPath()); | 207 browser_context_->GetPath()); |
| 208 partitions_[partition_id] = partition; | 208 partitions_[partition_id] = partition; |
| 209 | 209 |
| 210 // These calls must happen after StoragePartitionImpl::Create(). | 210 // These calls must happen after StoragePartitionImpl::Create(). |
| 211 partition->SetURLRequestContext( | 211 partition->SetURLRequestContext( |
| 212 partition_id.empty() ? | 212 partition_id.empty() ? |
| 213 browser_context_->GetRequestContext() : | 213 browser_context_->GetRequestContext() : |
| 214 browser_context_->GetRequestContextForStoragePartition(partition_id)); | 214 browser_context_->GetRequestContextForStoragePartition( |
| 215 partition->GetPath(), partition->InMemory())); | |
|
awong
2012/10/19 21:20:24
This is the only usage of InMemory() I think. Can
nasko
2012/10/19 22:09:00
Done.
| |
| 215 partition->SetMediaURLRequestContext( | 216 partition->SetMediaURLRequestContext( |
| 216 partition_id.empty() ? | 217 partition_id.empty() ? |
| 217 browser_context_->GetMediaRequestContext() : | 218 browser_context_->GetMediaRequestContext() : |
| 218 browser_context_->GetMediaRequestContextForStoragePartition( | 219 browser_context_->GetMediaRequestContextForStoragePartition( |
| 219 partition_id)); | 220 partition->GetPath(), partition->InMemory())); |
| 220 | 221 |
| 221 PostCreateInitialization(partition); | 222 PostCreateInitialization(partition); |
| 222 | 223 |
| 223 // TODO(ajwong): ResourceContexts no longer have any storage related state. | 224 // TODO(ajwong): ResourceContexts no longer have any storage related state. |
| 224 // We should move this into a place where it is called once per | 225 // We should move this into a place where it is called once per |
| 225 // BrowserContext creation rather than piggybacking off the default context | 226 // BrowserContext creation rather than piggybacking off the default context |
| 226 // creation. | 227 // creation. |
| 227 if (partition_id.empty()) { | 228 if (partition_id.empty()) { |
| 228 InitializeResourceContext(browser_context_); | 229 InitializeResourceContext(browser_context_); |
| 229 } | 230 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 | 270 |
| 270 // We do not call InitializeURLRequestContext() for media contexts because, | 271 // We do not call InitializeURLRequestContext() for media contexts because, |
| 271 // other than the HTTP cache, the media contexts share the same backing | 272 // other than the HTTP cache, the media contexts share the same backing |
| 272 // objects as their associated "normal" request context. Thus, the previous | 273 // objects as their associated "normal" request context. Thus, the previous |
| 273 // call serves to initialize the media request context for this storage | 274 // call serves to initialize the media request context for this storage |
| 274 // partition as well. | 275 // partition as well. |
| 275 } | 276 } |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace content | 279 } // namespace content |
| OLD | NEW |