| 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 "content/browser/appcache/chrome_appcache_service.h" | 7 #include "content/browser/appcache/chrome_appcache_service.h" |
| 8 #include "webkit/database/database_tracker.h" | 8 #include "webkit/database/database_tracker.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_file_manager.h" | 10 #include "content/browser/download/download_file_manager.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 context, kDownloadManagerKeyName); | 103 context, kDownloadManagerKeyName); |
| 104 } | 104 } |
| 105 | 105 |
| 106 IndexedDBContext* BrowserContext::GetIndexedDBContext( | 106 IndexedDBContext* BrowserContext::GetIndexedDBContext( |
| 107 BrowserContext* browser_context) { | 107 BrowserContext* browser_context) { |
| 108 // TODO(ajwong): Change this API to require a SiteInstance instead of | 108 // TODO(ajwong): Change this API to require a SiteInstance instead of |
| 109 // using GetDefaultStoragePartition(). | 109 // using GetDefaultStoragePartition(). |
| 110 return GetDefaultStoragePartition(browser_context)->GetIndexedDBContext(); | 110 return GetDefaultStoragePartition(browser_context)->GetIndexedDBContext(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 fileapi::FileSystemContext* BrowserContext::GetFileSystemContext( | |
| 114 BrowserContext* browser_context) { | |
| 115 // TODO(ajwong): Change this API to require a SiteInstance instead of | |
| 116 // using GetDefaultStoragePartition(). | |
| 117 return GetDefaultStoragePartition(browser_context)->GetFileSystemContext(); | |
| 118 } | |
| 119 | |
| 120 StoragePartition* BrowserContext::GetStoragePartition( | 113 StoragePartition* BrowserContext::GetStoragePartition( |
| 121 BrowserContext* browser_context, | 114 BrowserContext* browser_context, |
| 122 SiteInstance* site_instance) { | 115 SiteInstance* site_instance) { |
| 123 std::string partition_id; // Default to "" for NULL |site_instance|. | 116 std::string partition_id; // Default to "" for NULL |site_instance|. |
| 124 | 117 |
| 125 // TODO(ajwong): After GetDefaultStoragePartition() is removed, get rid of | 118 // TODO(ajwong): After GetDefaultStoragePartition() is removed, get rid of |
| 126 // this conditional and require that |site_instance| is non-NULL. | 119 // this conditional and require that |site_instance| is non-NULL. |
| 127 if (site_instance) { | 120 if (site_instance) { |
| 128 partition_id = GetContentClient()->browser()-> | 121 partition_id = GetContentClient()->browser()-> |
| 129 GetStoragePartitionIdForSite(browser_context, site_instance->GetSite()); | 122 GetStoragePartitionIdForSite(browser_context, site_instance->GetSite()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 ForEachStoragePartition(browser_context, | 205 ForEachStoragePartition(browser_context, |
| 213 base::Bind(&PurgeDOMStorageContextInPartition)); | 206 base::Bind(&PurgeDOMStorageContextInPartition)); |
| 214 } | 207 } |
| 215 | 208 |
| 216 BrowserContext::~BrowserContext() { | 209 BrowserContext::~BrowserContext() { |
| 217 if (GetUserData(kDownloadManagerKeyName)) | 210 if (GetUserData(kDownloadManagerKeyName)) |
| 218 GetDownloadManager(this)->Shutdown(); | 211 GetDownloadManager(this)->Shutdown(); |
| 219 } | 212 } |
| 220 | 213 |
| 221 } // namespace content | 214 } // namespace content |
| OLD | NEW |