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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 kDownloadManagerKeyName, | 118 kDownloadManagerKeyName, |
119 download_manager); | 119 download_manager); |
120 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); | 120 download_manager->SetDelegate(context->GetDownloadManagerDelegate()); |
121 } | 121 } |
122 | 122 |
123 return static_cast<DownloadManager*>( | 123 return static_cast<DownloadManager*>( |
124 context->GetUserData(kDownloadManagerKeyName)); | 124 context->GetUserData(kDownloadManagerKeyName)); |
125 } | 125 } |
126 | 126 |
127 // static | 127 // static |
128 fileapi::ExternalMountPoints* BrowserContext::GetMountPoints( | 128 storage::ExternalMountPoints* BrowserContext::GetMountPoints( |
129 BrowserContext* context) { | 129 BrowserContext* context) { |
130 // Ensure that these methods are called on the UI thread, except for | 130 // Ensure that these methods are called on the UI thread, except for |
131 // unittests where a UI thread might not have been created. | 131 // unittests where a UI thread might not have been created. |
132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 132 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
133 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 133 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
134 | 134 |
135 #if defined(OS_CHROMEOS) | 135 #if defined(OS_CHROMEOS) |
136 if (!context->GetUserData(kMountPointsKey)) { | 136 if (!context->GetUserData(kMountPointsKey)) { |
137 scoped_refptr<fileapi::ExternalMountPoints> mount_points = | 137 scoped_refptr<storage::ExternalMountPoints> mount_points = |
138 fileapi::ExternalMountPoints::CreateRefCounted(); | 138 storage::ExternalMountPoints::CreateRefCounted(); |
139 context->SetUserData( | 139 context->SetUserData( |
140 kMountPointsKey, | 140 kMountPointsKey, |
141 new UserDataAdapter<fileapi::ExternalMountPoints>(mount_points.get())); | 141 new UserDataAdapter<storage::ExternalMountPoints>(mount_points.get())); |
142 } | 142 } |
143 | 143 |
144 return UserDataAdapter<fileapi::ExternalMountPoints>::Get( | 144 return UserDataAdapter<storage::ExternalMountPoints>::Get(context, |
145 context, kMountPointsKey); | 145 kMountPointsKey); |
146 #else | 146 #else |
147 return NULL; | 147 return NULL; |
148 #endif | 148 #endif |
149 } | 149 } |
150 | 150 |
151 StoragePartition* BrowserContext::GetStoragePartition( | 151 StoragePartition* BrowserContext::GetStoragePartition( |
152 BrowserContext* browser_context, | 152 BrowserContext* browser_context, |
153 SiteInstance* site_instance) { | 153 SiteInstance* site_instance) { |
154 std::string partition_domain; | 154 std::string partition_domain; |
155 std::string partition_name; | 155 std::string partition_name; |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 #endif // !OS_IOS | 273 #endif // !OS_IOS |
274 | 274 |
275 BrowserContext::~BrowserContext() { | 275 BrowserContext::~BrowserContext() { |
276 #if !defined(OS_IOS) | 276 #if !defined(OS_IOS) |
277 if (GetUserData(kDownloadManagerKeyName)) | 277 if (GetUserData(kDownloadManagerKeyName)) |
278 GetDownloadManager(this)->Shutdown(); | 278 GetDownloadManager(this)->Shutdown(); |
279 #endif | 279 #endif |
280 } | 280 } |
281 | 281 |
282 } // namespace content | 282 } // namespace content |
OLD | NEW |