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 #if !defined(OS_IOS) | 7 #if !defined(OS_IOS) |
8 #include "content/browser/appcache/chrome_appcache_service.h" | 8 #include "content/browser/appcache/chrome_appcache_service.h" |
9 #include "content/browser/dom_storage/dom_storage_context_impl.h" | 9 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
10 #include "content/browser/download/download_manager_impl.h" | 10 #include "content/browser/download/download_manager_impl.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 static_cast<StoragePartitionImplMap*>( | 46 static_cast<StoragePartitionImplMap*>( |
47 browser_context->GetUserData(kStorageParitionMapKeyName)); | 47 browser_context->GetUserData(kStorageParitionMapKeyName)); |
48 if (!partition_map) { | 48 if (!partition_map) { |
49 partition_map = new StoragePartitionImplMap(browser_context); | 49 partition_map = new StoragePartitionImplMap(browser_context); |
50 browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); | 50 browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); |
51 } | 51 } |
52 | 52 |
53 if (browser_context->IsOffTheRecord()) | 53 if (browser_context->IsOffTheRecord()) |
54 in_memory = true; | 54 in_memory = true; |
55 | 55 |
56 // TODO(nasko): Webview tags with named partitions will have both | |
57 // partition_domain and partition_name set. In this case, mark them in-memory | |
58 // until the on-disk storage code has landed. http://crbug.com/159464 | |
59 if (!partition_domain.empty() && !partition_name.empty()) | |
60 in_memory = true; | |
61 | |
62 return partition_map->Get(partition_domain, partition_name, in_memory); | 56 return partition_map->Get(partition_domain, partition_name, in_memory); |
63 } | 57 } |
64 | 58 |
65 // Run |callback| on each DOMStorageContextImpl in |browser_context|. | 59 // Run |callback| on each DOMStorageContextImpl in |browser_context|. |
66 void PurgeDOMStorageContextInPartition(StoragePartition* storage_partition) { | 60 void PurgeDOMStorageContextInPartition(StoragePartition* storage_partition) { |
67 static_cast<StoragePartitionImpl*>(storage_partition)-> | 61 static_cast<StoragePartitionImpl*>(storage_partition)-> |
68 GetDOMStorageContext()->PurgeMemory(); | 62 GetDOMStorageContext()->PurgeMemory(); |
69 } | 63 } |
70 | 64 |
71 void SaveSessionStateOnIOThread( | 65 void SaveSessionStateOnIOThread( |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 #endif // !OS_IOS | 213 #endif // !OS_IOS |
220 | 214 |
221 BrowserContext::~BrowserContext() { | 215 BrowserContext::~BrowserContext() { |
222 #if !defined(OS_IOS) | 216 #if !defined(OS_IOS) |
223 if (GetUserData(kDownloadManagerKeyName)) | 217 if (GetUserData(kDownloadManagerKeyName)) |
224 GetDownloadManager(this)->Shutdown(); | 218 GetDownloadManager(this)->Shutdown(); |
225 #endif | 219 #endif |
226 } | 220 } |
227 | 221 |
228 } // namespace content | 222 } // namespace content |
OLD | NEW |