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 <utility> |
9 | 10 |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 | 12 |
12 #if !defined(OS_IOS) | 13 #if !defined(OS_IOS) |
13 #include "content/browser/download/download_manager_impl.h" | 14 #include "content/browser/download/download_manager_impl.h" |
14 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 15 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
15 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 16 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
16 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 17 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
17 #include "content/browser/push_messaging/push_messaging_router.h" | 18 #include "content/browser/push_messaging/push_messaging_router.h" |
18 #include "content/browser/storage_partition_impl_map.h" | 19 #include "content/browser/storage_partition_impl_map.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const base::Closure& on_gc_required) { | 113 const base::Closure& on_gc_required) { |
113 GetStoragePartitionMap(browser_context)->AsyncObliterate(site, | 114 GetStoragePartitionMap(browser_context)->AsyncObliterate(site, |
114 on_gc_required); | 115 on_gc_required); |
115 } | 116 } |
116 | 117 |
117 // static | 118 // static |
118 void BrowserContext::GarbageCollectStoragePartitions( | 119 void BrowserContext::GarbageCollectStoragePartitions( |
119 BrowserContext* browser_context, | 120 BrowserContext* browser_context, |
120 scoped_ptr<base::hash_set<base::FilePath> > active_paths, | 121 scoped_ptr<base::hash_set<base::FilePath> > active_paths, |
121 const base::Closure& done) { | 122 const base::Closure& done) { |
122 GetStoragePartitionMap(browser_context)->GarbageCollect( | 123 GetStoragePartitionMap(browser_context) |
123 active_paths.Pass(), done); | 124 ->GarbageCollect(std::move(active_paths), done); |
124 } | 125 } |
125 | 126 |
126 DownloadManager* BrowserContext::GetDownloadManager( | 127 DownloadManager* BrowserContext::GetDownloadManager( |
127 BrowserContext* context) { | 128 BrowserContext* context) { |
128 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 129 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
129 if (!context->GetUserData(kDownloadManagerKeyName)) { | 130 if (!context->GetUserData(kDownloadManagerKeyName)) { |
130 DownloadManager* download_manager = | 131 DownloadManager* download_manager = |
131 new DownloadManagerImpl( | 132 new DownloadManagerImpl( |
132 GetContentClient()->browser()->GetNetLog(), context); | 133 GetContentClient()->browser()->GetNetLog(), context); |
133 | 134 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 #endif // !OS_IOS | 325 #endif // !OS_IOS |
325 | 326 |
326 BrowserContext::~BrowserContext() { | 327 BrowserContext::~BrowserContext() { |
327 #if !defined(OS_IOS) | 328 #if !defined(OS_IOS) |
328 if (GetUserData(kDownloadManagerKeyName)) | 329 if (GetUserData(kDownloadManagerKeyName)) |
329 GetDownloadManager(this)->Shutdown(); | 330 GetDownloadManager(this)->Shutdown(); |
330 #endif | 331 #endif |
331 } | 332 } |
332 | 333 |
333 } // namespace content | 334 } // namespace content |
OLD | NEW |