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/public/browser/browser_context.h" | 5 #include "content/public/browser/browser_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 #endif | 232 #endif |
233 } | 233 } |
234 | 234 |
235 StoragePartition* BrowserContext::GetStoragePartition( | 235 StoragePartition* BrowserContext::GetStoragePartition( |
236 BrowserContext* browser_context, | 236 BrowserContext* browser_context, |
237 SiteInstance* site_instance) { | 237 SiteInstance* site_instance) { |
238 std::string partition_domain; | 238 std::string partition_domain; |
239 std::string partition_name; | 239 std::string partition_name; |
240 bool in_memory = false; | 240 bool in_memory = false; |
241 | 241 |
242 // TODO(ajwong): After GetDefaultStoragePartition() is removed, get rid of | |
243 // this conditional and require that |site_instance| is non-NULL. | |
244 if (site_instance) { | 242 if (site_instance) { |
245 GetContentClient()->browser()->GetStoragePartitionConfigForSite( | 243 GetContentClient()->browser()->GetStoragePartitionConfigForSite( |
246 browser_context, site_instance->GetSiteURL(), true, | 244 browser_context, site_instance->GetSiteURL(), true, |
247 &partition_domain, &partition_name, &in_memory); | 245 &partition_domain, &partition_name, &in_memory); |
248 } | 246 } |
249 | 247 |
250 return GetStoragePartitionFromConfig( | 248 return GetStoragePartitionFromConfig( |
251 browser_context, partition_domain, partition_name, in_memory); | 249 browser_context, partition_domain, partition_name, in_memory); |
252 } | 250 } |
253 | 251 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 if (GetUserData(kDownloadManagerKeyName)) | 526 if (GetUserData(kDownloadManagerKeyName)) |
529 GetDownloadManager(this)->Shutdown(); | 527 GetDownloadManager(this)->Shutdown(); |
530 } | 528 } |
531 | 529 |
532 void BrowserContext::ShutdownStoragePartitions() { | 530 void BrowserContext::ShutdownStoragePartitions() { |
533 if (GetUserData(kStoragePartitionMapKeyName)) | 531 if (GetUserData(kStoragePartitionMapKeyName)) |
534 RemoveUserData(kStoragePartitionMapKeyName); | 532 RemoveUserData(kStoragePartitionMapKeyName); |
535 } | 533 } |
536 | 534 |
537 } // namespace content | 535 } // namespace content |
OLD | NEW |