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/indexed_db/indexed_db_context_impl.h" | 10 #include "content/browser/indexed_db/indexed_db_context_impl.h" |
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 11 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
11 #include "content/browser/storage_partition_impl_map.h" | 12 #include "content/browser/storage_partition_impl_map.h" |
12 #include "content/common/child_process_host_impl.h" | 13 #include "content/common/child_process_host_impl.h" |
13 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
14 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
15 #include "content/public/browser/site_instance.h" | 16 #include "content/public/browser/site_instance.h" |
16 #include "net/cookies/cookie_monster.h" | 17 #include "net/cookies/cookie_monster.h" |
17 #include "net/cookies/cookie_store.h" | 18 #include "net/cookies/cookie_store.h" |
18 #include "net/ssl/server_bound_cert_service.h" | 19 #include "net/ssl/server_bound_cert_service.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 return; | 190 return; |
190 | 191 |
191 partition_map->ForEach(callback); | 192 partition_map->ForEach(callback); |
192 } | 193 } |
193 | 194 |
194 StoragePartition* BrowserContext::GetDefaultStoragePartition( | 195 StoragePartition* BrowserContext::GetDefaultStoragePartition( |
195 BrowserContext* browser_context) { | 196 BrowserContext* browser_context) { |
196 return GetStoragePartition(browser_context, NULL); | 197 return GetStoragePartition(browser_context, NULL); |
197 } | 198 } |
198 | 199 |
| 200 BlobContext* BrowserContext::GetBlobContext(BrowserContext* context) { |
| 201 return ChromeBlobStorageContext::GetFor(context); |
| 202 } |
| 203 |
199 void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { | 204 void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { |
200 // This will be enough to tickle initialization of BrowserContext if | 205 // This will be enough to tickle initialization of BrowserContext if |
201 // necessary, which initializes ResourceContext. The reason we don't call | 206 // necessary, which initializes ResourceContext. The reason we don't call |
202 // ResourceContext::InitializeResourceContext() directly here is that | 207 // ResourceContext::InitializeResourceContext() directly here is that |
203 // ResourceContext initialization may call back into BrowserContext | 208 // ResourceContext initialization may call back into BrowserContext |
204 // and when that call returns it'll end rewriting its UserData map. It will | 209 // and when that call returns it'll end rewriting its UserData map. It will |
205 // end up rewriting the same value but this still causes a race condition. | 210 // end up rewriting the same value but this still causes a race condition. |
206 // | 211 // |
207 // See http://crbug.com/115678. | 212 // See http://crbug.com/115678. |
208 GetDefaultStoragePartition(context); | 213 GetDefaultStoragePartition(context); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 #endif // !OS_IOS | 248 #endif // !OS_IOS |
244 | 249 |
245 BrowserContext::~BrowserContext() { | 250 BrowserContext::~BrowserContext() { |
246 #if !defined(OS_IOS) | 251 #if !defined(OS_IOS) |
247 if (GetUserData(kDownloadManagerKeyName)) | 252 if (GetUserData(kDownloadManagerKeyName)) |
248 GetDownloadManager(this)->Shutdown(); | 253 GetDownloadManager(this)->Shutdown(); |
249 #endif | 254 #endif |
250 } | 255 } |
251 | 256 |
252 } // namespace content | 257 } // namespace content |
OLD | NEW |