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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 | 87 |
88 void PurgeMemoryOnIOThread(appcache::AppCacheService* appcache_service) { | 88 void PurgeMemoryOnIOThread(appcache::AppCacheService* appcache_service) { |
89 appcache_service->PurgeMemory(); | 89 appcache_service->PurgeMemory(); |
90 } | 90 } |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 // static | 94 // static |
95 void BrowserContext::AsyncObliterateStoragePartition( | 95 void BrowserContext::AsyncObliterateStoragePartition( |
96 BrowserContext* browser_context, | 96 BrowserContext* browser_context, |
97 const GURL& site) { | 97 const GURL& site, |
98 GetStoragePartitionMap(browser_context)->AsyncObliterate(site); | 98 const base::Closure& on_gc_required) { |
99 GetStoragePartitionMap(browser_context)->AsyncObliterate(site, on_gc_required) ; | |
Charlie Reis
2012/12/05 02:25:40
Long line.
| |
100 } | |
101 | |
102 // static | |
103 void BrowserContext::GarbageCollectStoragePartitions( | |
104 BrowserContext* browser_context, | |
105 base::hash_set<FilePath>* active_paths, | |
106 const base::Closure& done) { | |
107 scoped_ptr<base::hash_set<FilePath> > scoped_active_paths( | |
108 new base::hash_set<FilePath>()); | |
109 scoped_active_paths->swap(*active_paths); | |
110 GetStoragePartitionMap(browser_context)->GarbageCollect( | |
111 scoped_active_paths.Pass(), done); | |
99 } | 112 } |
100 | 113 |
101 DownloadManager* BrowserContext::GetDownloadManager( | 114 DownloadManager* BrowserContext::GetDownloadManager( |
102 BrowserContext* context) { | 115 BrowserContext* context) { |
103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
104 if (!context->GetUserData(kDownloadManagerKeyName)) { | 117 if (!context->GetUserData(kDownloadManagerKeyName)) { |
105 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | 118 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); |
106 DCHECK(rdh); | 119 DCHECK(rdh); |
107 scoped_refptr<DownloadManager> download_manager = | 120 scoped_refptr<DownloadManager> download_manager = |
108 new DownloadManagerImpl( | 121 new DownloadManagerImpl( |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
228 #endif // !OS_IOS | 241 #endif // !OS_IOS |
229 | 242 |
230 BrowserContext::~BrowserContext() { | 243 BrowserContext::~BrowserContext() { |
231 #if !defined(OS_IOS) | 244 #if !defined(OS_IOS) |
232 if (GetUserData(kDownloadManagerKeyName)) | 245 if (GetUserData(kDownloadManagerKeyName)) |
233 GetDownloadManager(this)->Shutdown(); | 246 GetDownloadManager(this)->Shutdown(); |
234 #endif | 247 #endif |
235 } | 248 } |
236 | 249 |
237 } // namespace content | 250 } // namespace content |
OLD | NEW |