| 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_wrapper.h" | 9 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 10 #include "content/browser/download/download_manager_impl.h" | 10 #include "content/browser/download/download_manager_impl.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 using base::UserDataAdapter; | 29 using base::UserDataAdapter; |
| 30 | 30 |
| 31 namespace content { | 31 namespace content { |
| 32 | 32 |
| 33 // Only ~BrowserContext() is needed on iOS. | 33 // Only ~BrowserContext() is needed on iOS. |
| 34 #if !defined(OS_IOS) | 34 #if !defined(OS_IOS) |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 // Key names on BrowserContext. | 37 // Key names on BrowserContext. |
| 38 const char kDownloadManagerKeyName[] = "download_manager"; | 38 const char kDownloadManagerKeyName[] = "download_manager"; |
| 39 const char kStorageParitionMapKeyName[] = "content_storage_partition_map"; |
| 40 |
| 41 #if defined(OS_CHROMEOS) |
| 39 const char kMountPointsKey[] = "mount_points"; | 42 const char kMountPointsKey[] = "mount_points"; |
| 40 const char kStorageParitionMapKeyName[] = "content_storage_partition_map"; | 43 #endif // defined(OS_CHROMEOS) |
| 41 | 44 |
| 42 StoragePartitionImplMap* GetStoragePartitionMap( | 45 StoragePartitionImplMap* GetStoragePartitionMap( |
| 43 BrowserContext* browser_context) { | 46 BrowserContext* browser_context) { |
| 44 StoragePartitionImplMap* partition_map = | 47 StoragePartitionImplMap* partition_map = |
| 45 static_cast<StoragePartitionImplMap*>( | 48 static_cast<StoragePartitionImplMap*>( |
| 46 browser_context->GetUserData(kStorageParitionMapKeyName)); | 49 browser_context->GetUserData(kStorageParitionMapKeyName)); |
| 47 if (!partition_map) { | 50 if (!partition_map) { |
| 48 partition_map = new StoragePartitionImplMap(browser_context); | 51 partition_map = new StoragePartitionImplMap(browser_context); |
| 49 browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); | 52 browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); |
| 50 } | 53 } |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 #endif // !OS_IOS | 270 #endif // !OS_IOS |
| 268 | 271 |
| 269 BrowserContext::~BrowserContext() { | 272 BrowserContext::~BrowserContext() { |
| 270 #if !defined(OS_IOS) | 273 #if !defined(OS_IOS) |
| 271 if (GetUserData(kDownloadManagerKeyName)) | 274 if (GetUserData(kDownloadManagerKeyName)) |
| 272 GetDownloadManager(this)->Shutdown(); | 275 GetDownloadManager(this)->Shutdown(); |
| 273 #endif | 276 #endif |
| 274 } | 277 } |
| 275 | 278 |
| 276 } // namespace content | 279 } // namespace content |
| OLD | NEW |