| 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/download/download_manager_impl.h" | 8 #include "content/browser/download/download_manager_impl.h" |
| 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" | 9 #include "content/browser/fileapi/chrome_blob_storage_context.h" |
| 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" | 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 scoped_ptr<base::hash_set<base::FilePath> > active_paths, | 115 scoped_ptr<base::hash_set<base::FilePath> > active_paths, |
| 116 const base::Closure& done) { | 116 const base::Closure& done) { |
| 117 GetStoragePartitionMap(browser_context)->GarbageCollect( | 117 GetStoragePartitionMap(browser_context)->GarbageCollect( |
| 118 active_paths.Pass(), done); | 118 active_paths.Pass(), done); |
| 119 } | 119 } |
| 120 | 120 |
| 121 DownloadManager* BrowserContext::GetDownloadManager( | 121 DownloadManager* BrowserContext::GetDownloadManager( |
| 122 BrowserContext* context) { | 122 BrowserContext* context) { |
| 123 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 123 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 124 if (!context->GetUserData(kDownloadManagerKeyName)) { | 124 if (!context->GetUserData(kDownloadManagerKeyName)) { |
| 125 ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); | |
| 126 DCHECK(rdh); | |
| 127 DownloadManager* download_manager = | 125 DownloadManager* download_manager = |
| 128 new DownloadManagerImpl( | 126 new DownloadManagerImpl( |
| 129 GetContentClient()->browser()->GetNetLog(), context); | 127 GetContentClient()->browser()->GetNetLog(), context); |
| 130 | 128 |
| 131 SetDownloadManager(context, download_manager); | 129 SetDownloadManager(context, download_manager); |
| 132 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); | 130 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); |
| 133 } | 131 } |
| 134 | 132 |
| 135 return static_cast<DownloadManager*>( | 133 return static_cast<DownloadManager*>( |
| 136 context->GetUserData(kDownloadManagerKeyName)); | 134 context->GetUserData(kDownloadManagerKeyName)); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 #endif // !OS_IOS | 319 #endif // !OS_IOS |
| 322 | 320 |
| 323 BrowserContext::~BrowserContext() { | 321 BrowserContext::~BrowserContext() { |
| 324 #if !defined(OS_IOS) | 322 #if !defined(OS_IOS) |
| 325 if (GetUserData(kDownloadManagerKeyName)) | 323 if (GetUserData(kDownloadManagerKeyName)) |
| 326 GetDownloadManager(this)->Shutdown(); | 324 GetDownloadManager(this)->Shutdown(); |
| 327 #endif | 325 #endif |
| 328 } | 326 } |
| 329 | 327 |
| 330 } // namespace content | 328 } // namespace content |
| OLD | NEW |