| 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, |
| 100 on_gc_required); |
| 101 } |
| 102 |
| 103 // static |
| 104 void BrowserContext::GarbageCollectStoragePartitions( |
| 105 BrowserContext* browser_context, |
| 106 scoped_ptr<base::hash_set<FilePath> > active_paths, |
| 107 const base::Closure& done) { |
| 108 GetStoragePartitionMap(browser_context)->GarbageCollect( |
| 109 active_paths.Pass(), done); |
| 99 } | 110 } |
| 100 | 111 |
| 101 DownloadManager* BrowserContext::GetDownloadManager( | 112 DownloadManager* BrowserContext::GetDownloadManager( |
| 102 BrowserContext* context) { | 113 BrowserContext* context) { |
| 103 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 114 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 104 if (!context->GetUserData(kDownloadManagerKeyName)) { | 115 if (!context->GetUserData(kDownloadManagerKeyName)) { |
| 105 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | 116 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); |
| 106 DCHECK(rdh); | 117 DCHECK(rdh); |
| 107 scoped_refptr<DownloadManager> download_manager = | 118 scoped_refptr<DownloadManager> download_manager = |
| 108 new DownloadManagerImpl( | 119 new DownloadManagerImpl( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 #endif // !OS_IOS | 239 #endif // !OS_IOS |
| 229 | 240 |
| 230 BrowserContext::~BrowserContext() { | 241 BrowserContext::~BrowserContext() { |
| 231 #if !defined(OS_IOS) | 242 #if !defined(OS_IOS) |
| 232 if (GetUserData(kDownloadManagerKeyName)) | 243 if (GetUserData(kDownloadManagerKeyName)) |
| 233 GetDownloadManager(this)->Shutdown(); | 244 GetDownloadManager(this)->Shutdown(); |
| 234 #endif | 245 #endif |
| 235 } | 246 } |
| 236 | 247 |
| 237 } // namespace content | 248 } // namespace content |
| OLD | NEW |