[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/public/browser/browser_context.h" |
| 6 | |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 7 | #if !defined(OS_IOS) |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 8 | #include "content/browser/download/download_manager_impl.h" |
[email protected] | 393b6cb | 2014-05-15 00:55:12 | [diff] [blame] | 9 | #include "content/browser/fileapi/chrome_blob_storage_context.h" |
[email protected] | c4d28166 | 2013-03-31 00:35:08 | [diff] [blame] | 10 | #include "content/browser/indexed_db/indexed_db_context_impl.h" |
[email protected] | 678c036 | 2012-12-05 08:02:44 | [diff] [blame] | 11 | #include "content/browser/loader/resource_dispatcher_host_impl.h" |
[email protected] | 66e53d028 | 2014-08-07 10:04:35 | [diff] [blame] | 12 | #include "content/browser/push_messaging_router.h" |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 13 | #include "content/browser/storage_partition_impl_map.h" |
[email protected] | d7c7c98a | 2012-07-12 21:27:44 | [diff] [blame] | 14 | #include "content/common/child_process_host_impl.h" |
[email protected] | 393b6cb | 2014-05-15 00:55:12 | [diff] [blame] | 15 | #include "content/public/browser/blob_handle.h" |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 16 | #include "content/public/browser/browser_thread.h" |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 17 | #include "content/public/browser/content_browser_client.h" |
[email protected] | 536fd0b | 2013-03-14 17:41:57 | [diff] [blame] | 18 | #include "content/public/browser/site_instance.h" |
[email protected] | 4d7c4ef | 2012-03-16 01:47:12 | [diff] [blame] | 19 | #include "net/cookies/cookie_monster.h" |
| 20 | #include "net/cookies/cookie_store.h" |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 21 | #include "net/ssl/channel_id_service.h" |
| 22 | #include "net/ssl/channel_id_store.h" |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 23 | #include "net/url_request/url_request_context.h" |
[email protected] | 6939075a | 2012-08-28 08:35:53 | [diff] [blame] | 24 | #include "net/url_request/url_request_context_getter.h" |
[email protected] | 08b1f75f | 2013-05-22 22:02:38 | [diff] [blame] | 25 | #include "webkit/browser/database/database_tracker.h" |
[email protected] | f25e113 | 2013-05-24 13:58:04 | [diff] [blame] | 26 | #include "webkit/browser/fileapi/external_mount_points.h" |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 27 | #endif // !OS_IOS |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 28 | |
[email protected] | 314c3e2 | 2012-02-21 03:57:42 | [diff] [blame] | 29 | using base::UserDataAdapter; |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 30 | |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 31 | namespace content { |
| 32 | |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 33 | // Only ~BrowserContext() is needed on iOS. |
| 34 | #if !defined(OS_IOS) |
[email protected] | 735e20c | 2012-03-20 01:16:59 | [diff] [blame] | 35 | namespace { |
| 36 | |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 37 | // Key names on BrowserContext. |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 38 | const char kDownloadManagerKeyName[] = "download_manager"; |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 39 | const char kStorageParitionMapKeyName[] = "content_storage_partition_map"; |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 40 | |
[email protected] | 9afc14e2 | 2013-09-25 22:34:14 | [diff] [blame] | 41 | #if defined(OS_CHROMEOS) |
| 42 | const char kMountPointsKey[] = "mount_points"; |
| 43 | #endif // defined(OS_CHROMEOS) |
| 44 | |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 45 | StoragePartitionImplMap* GetStoragePartitionMap( |
| 46 | BrowserContext* browser_context) { |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 47 | StoragePartitionImplMap* partition_map = |
| 48 | static_cast<StoragePartitionImplMap*>( |
| 49 | browser_context->GetUserData(kStorageParitionMapKeyName)); |
[email protected] | d7c7c98a | 2012-07-12 21:27:44 | [diff] [blame] | 50 | if (!partition_map) { |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 51 | partition_map = new StoragePartitionImplMap(browser_context); |
[email protected] | d7c7c98a | 2012-07-12 21:27:44 | [diff] [blame] | 52 | browser_context->SetUserData(kStorageParitionMapKeyName, partition_map); |
| 53 | } |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 54 | return partition_map; |
| 55 | } |
| 56 | |
| 57 | StoragePartition* GetStoragePartitionFromConfig( |
| 58 | BrowserContext* browser_context, |
| 59 | const std::string& partition_domain, |
| 60 | const std::string& partition_name, |
| 61 | bool in_memory) { |
| 62 | StoragePartitionImplMap* partition_map = |
| 63 | GetStoragePartitionMap(browser_context); |
[email protected] | d7c7c98a | 2012-07-12 21:27:44 | [diff] [blame] | 64 | |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 65 | if (browser_context->IsOffTheRecord()) |
| 66 | in_memory = true; |
| 67 | |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 68 | return partition_map->Get(partition_domain, partition_name, in_memory); |
[email protected] | d1198fd | 2012-08-13 22:50:19 | [diff] [blame] | 69 | } |
| 70 | |
[email protected] | 6939075a | 2012-08-28 08:35:53 | [diff] [blame] | 71 | void SaveSessionStateOnIOThread( |
| 72 | const scoped_refptr<net::URLRequestContextGetter>& context_getter, |
[email protected] | 98d6d456 | 2014-06-25 20:57:55 | [diff] [blame] | 73 | AppCacheServiceImpl* appcache_service) { |
[email protected] | 6939075a | 2012-08-28 08:35:53 | [diff] [blame] | 74 | net::URLRequestContext* context = context_getter->GetURLRequestContext(); |
| 75 | context->cookie_store()->GetCookieMonster()-> |
[email protected] | bf510ed | 2012-06-05 08:31:43 | [diff] [blame] | 76 | SetForceKeepSessionState(); |
[email protected] | 6b8a3c74 | 2014-07-25 00:25:35 | [diff] [blame] | 77 | context->channel_id_service()->GetChannelIDStore()-> |
[email protected] | 6939075a | 2012-08-28 08:35:53 | [diff] [blame] | 78 | SetForceKeepSessionState(); |
| 79 | appcache_service->set_force_keep_session_state(); |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 80 | } |
| 81 | |
[email protected] | 89acda8 | 2013-06-25 20:52:50 | [diff] [blame] | 82 | void SaveSessionStateOnIndexedDBThread( |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 83 | scoped_refptr<IndexedDBContextImpl> indexed_db_context) { |
[email protected] | bf510ed | 2012-06-05 08:31:43 | [diff] [blame] | 84 | indexed_db_context->SetForceKeepSessionState(); |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 85 | } |
| 86 | |
[email protected] | 735e20c | 2012-03-20 01:16:59 | [diff] [blame] | 87 | } // namespace |
| 88 | |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 89 | // static |
| 90 | void BrowserContext::AsyncObliterateStoragePartition( |
| 91 | BrowserContext* browser_context, |
[email protected] | 399583b | 2012-12-11 09:33:42 | [diff] [blame] | 92 | const GURL& site, |
| 93 | const base::Closure& on_gc_required) { |
| 94 | GetStoragePartitionMap(browser_context)->AsyncObliterate(site, |
| 95 | on_gc_required); |
| 96 | } |
| 97 | |
| 98 | // static |
| 99 | void BrowserContext::GarbageCollectStoragePartitions( |
| 100 | BrowserContext* browser_context, |
[email protected] | 2dec8ec | 2013-02-07 19:20:34 | [diff] [blame] | 101 | scoped_ptr<base::hash_set<base::FilePath> > active_paths, |
[email protected] | 399583b | 2012-12-11 09:33:42 | [diff] [blame] | 102 | const base::Closure& done) { |
| 103 | GetStoragePartitionMap(browser_context)->GarbageCollect( |
| 104 | active_paths.Pass(), done); |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 105 | } |
| 106 | |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 107 | DownloadManager* BrowserContext::GetDownloadManager( |
| 108 | BrowserContext* context) { |
[email protected] | ecd3ad2 | 2012-07-10 20:02:40 | [diff] [blame] | 109 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 110 | if (!context->GetUserData(kDownloadManagerKeyName)) { |
[email protected] | d25fda1 | 2012-06-12 17:05:03 | [diff] [blame] | 111 | ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get(); |
| 112 | DCHECK(rdh); |
[email protected] | eba4a4d | 2013-05-29 02:18:06 | [diff] [blame] | 113 | DownloadManager* download_manager = |
[email protected] | d25fda1 | 2012-06-12 17:05:03 | [diff] [blame] | 114 | new DownloadManagerImpl( |
[email protected] | 1679869 | 2013-04-23 18:08:38 | [diff] [blame] | 115 | GetContentClient()->browser()->GetNetLog(), context); |
[email protected] | d25fda1 | 2012-06-12 17:05:03 | [diff] [blame] | 116 | |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 117 | context->SetUserData( |
| 118 | kDownloadManagerKeyName, |
[email protected] | eba4a4d | 2013-05-29 02:18:06 | [diff] [blame] | 119 | download_manager); |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 120 | download_manager->SetDelegate(context->GetDownloadManagerDelegate()); |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 121 | } |
| 122 | |
[email protected] | eba4a4d | 2013-05-29 02:18:06 | [diff] [blame] | 123 | return static_cast<DownloadManager*>( |
| 124 | context->GetUserData(kDownloadManagerKeyName)); |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 125 | } |
| 126 | |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 127 | // static |
[email protected] | cd501a7 | 2014-08-22 19:58:31 | [diff] [blame^] | 128 | storage::ExternalMountPoints* BrowserContext::GetMountPoints( |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 129 | BrowserContext* context) { |
| 130 | // Ensure that these methods are called on the UI thread, except for |
| 131 | // unittests where a UI thread might not have been created. |
| 132 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
| 133 | !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
| 134 | |
| 135 | #if defined(OS_CHROMEOS) |
| 136 | if (!context->GetUserData(kMountPointsKey)) { |
[email protected] | cd501a7 | 2014-08-22 19:58:31 | [diff] [blame^] | 137 | scoped_refptr<storage::ExternalMountPoints> mount_points = |
| 138 | storage::ExternalMountPoints::CreateRefCounted(); |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 139 | context->SetUserData( |
| 140 | kMountPointsKey, |
[email protected] | cd501a7 | 2014-08-22 19:58:31 | [diff] [blame^] | 141 | new UserDataAdapter<storage::ExternalMountPoints>(mount_points.get())); |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 142 | } |
| 143 | |
[email protected] | cd501a7 | 2014-08-22 19:58:31 | [diff] [blame^] | 144 | return UserDataAdapter<storage::ExternalMountPoints>::Get(context, |
| 145 | kMountPointsKey); |
[email protected] | 6ef0c391 | 2013-01-25 22:46:34 | [diff] [blame] | 146 | #else |
| 147 | return NULL; |
| 148 | #endif |
| 149 | } |
| 150 | |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 151 | StoragePartition* BrowserContext::GetStoragePartition( |
| 152 | BrowserContext* browser_context, |
| 153 | SiteInstance* site_instance) { |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 154 | std::string partition_domain; |
| 155 | std::string partition_name; |
| 156 | bool in_memory = false; |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 157 | |
| 158 | // TODO(ajwong): After GetDefaultStoragePartition() is removed, get rid of |
| 159 | // this conditional and require that |site_instance| is non-NULL. |
| 160 | if (site_instance) { |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 161 | GetContentClient()->browser()->GetStoragePartitionConfigForSite( |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 162 | browser_context, site_instance->GetSiteURL(), true, |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 163 | &partition_domain, &partition_name, &in_memory); |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 164 | } |
| 165 | |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 166 | return GetStoragePartitionFromConfig( |
| 167 | browser_context, partition_domain, partition_name, in_memory); |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 168 | } |
| 169 | |
[email protected] | e94bbcb | 2012-09-07 05:33:57 | [diff] [blame] | 170 | StoragePartition* BrowserContext::GetStoragePartitionForSite( |
| 171 | BrowserContext* browser_context, |
| 172 | const GURL& site) { |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 173 | std::string partition_domain; |
| 174 | std::string partition_name; |
| 175 | bool in_memory; |
[email protected] | e94bbcb | 2012-09-07 05:33:57 | [diff] [blame] | 176 | |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 177 | GetContentClient()->browser()->GetStoragePartitionConfigForSite( |
[email protected] | 14acc64 | 2012-11-17 12:20:10 | [diff] [blame] | 178 | browser_context, site, true, &partition_domain, &partition_name, |
| 179 | &in_memory); |
[email protected] | 1bc2831 | 2012-11-08 08:31:53 | [diff] [blame] | 180 | |
| 181 | return GetStoragePartitionFromConfig( |
| 182 | browser_context, partition_domain, partition_name, in_memory); |
[email protected] | e94bbcb | 2012-09-07 05:33:57 | [diff] [blame] | 183 | } |
| 184 | |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 185 | void BrowserContext::ForEachStoragePartition( |
| 186 | BrowserContext* browser_context, |
| 187 | const StoragePartitionCallback& callback) { |
| 188 | StoragePartitionImplMap* partition_map = |
| 189 | static_cast<StoragePartitionImplMap*>( |
| 190 | browser_context->GetUserData(kStorageParitionMapKeyName)); |
| 191 | if (!partition_map) |
| 192 | return; |
| 193 | |
| 194 | partition_map->ForEach(callback); |
| 195 | } |
| 196 | |
| 197 | StoragePartition* BrowserContext::GetDefaultStoragePartition( |
| 198 | BrowserContext* browser_context) { |
| 199 | return GetStoragePartition(browser_context, NULL); |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 200 | } |
| 201 | |
[email protected] | 393b6cb | 2014-05-15 00:55:12 | [diff] [blame] | 202 | void BrowserContext::CreateMemoryBackedBlob(BrowserContext* browser_context, |
| 203 | const char* data, size_t length, |
| 204 | const BlobCallback& callback) { |
| 205 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 206 | |
| 207 | ChromeBlobStorageContext* blob_context = |
| 208 | ChromeBlobStorageContext::GetFor(browser_context); |
| 209 | BrowserThread::PostTaskAndReplyWithResult( |
| 210 | BrowserThread::IO, FROM_HERE, |
| 211 | base::Bind(&ChromeBlobStorageContext::CreateMemoryBackedBlob, |
| 212 | make_scoped_refptr(blob_context), data, length), |
| 213 | callback); |
| 214 | } |
| 215 | |
[email protected] | 66e53d028 | 2014-08-07 10:04:35 | [diff] [blame] | 216 | // static |
| 217 | void BrowserContext::DeliverPushMessage( |
| 218 | BrowserContext* browser_context, |
| 219 | const GURL& origin, |
| 220 | int64 service_worker_registration_id, |
| 221 | const std::string& data, |
| 222 | const base::Callback<void(PushMessagingStatus)>& callback) { |
| 223 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 224 | PushMessagingRouter::DeliverMessage( |
| 225 | browser_context, origin, service_worker_registration_id, data, callback); |
| 226 | } |
| 227 | |
[email protected] | 314c3e2 | 2012-02-21 03:57:42 | [diff] [blame] | 228 | void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) { |
[email protected] | 7e26ac9 | 2012-02-27 20:15:05 | [diff] [blame] | 229 | // This will be enough to tickle initialization of BrowserContext if |
| 230 | // necessary, which initializes ResourceContext. The reason we don't call |
[email protected] | 4c3a2358 | 2012-08-18 08:54:34 | [diff] [blame] | 231 | // ResourceContext::InitializeResourceContext() directly here is that |
| 232 | // ResourceContext initialization may call back into BrowserContext |
| 233 | // and when that call returns it'll end rewriting its UserData map. It will |
| 234 | // end up rewriting the same value but this still causes a race condition. |
| 235 | // |
| 236 | // See http://crbug.com/115678. |
| 237 | GetDefaultStoragePartition(context); |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 238 | } |
| 239 | |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 240 | void BrowserContext::SaveSessionState(BrowserContext* browser_context) { |
[email protected] | 5c8e67c | 2012-08-29 00:48:52 | [diff] [blame] | 241 | GetDefaultStoragePartition(browser_context)->GetDatabaseTracker()-> |
| 242 | SetForceKeepSessionState(); |
[email protected] | b1b502e | 2012-09-16 07:31:43 | [diff] [blame] | 243 | StoragePartition* storage_partition = |
| 244 | BrowserContext::GetDefaultStoragePartition(browser_context); |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 245 | |
| 246 | if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) { |
| 247 | BrowserThread::PostTask( |
| 248 | BrowserThread::IO, FROM_HERE, |
[email protected] | 6939075a | 2012-08-28 08:35:53 | [diff] [blame] | 249 | base::Bind( |
| 250 | &SaveSessionStateOnIOThread, |
| 251 | make_scoped_refptr(browser_context->GetRequestContext()), |
[email protected] | 98d6d456 | 2014-06-25 20:57:55 | [diff] [blame] | 252 | static_cast<AppCacheServiceImpl*>( |
[email protected] | 63ef8551 | 2014-06-05 14:21:26 | [diff] [blame] | 253 | storage_partition->GetAppCacheService()))); |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 254 | } |
| 255 | |
[email protected] | 5f2aa72 | 2013-08-07 16:59:41 | [diff] [blame] | 256 | DOMStorageContextWrapper* dom_storage_context_proxy = |
| 257 | static_cast<DOMStorageContextWrapper*>( |
[email protected] | b1b502e | 2012-09-16 07:31:43 | [diff] [blame] | 258 | storage_partition->GetDOMStorageContext()); |
[email protected] | 5f2aa72 | 2013-08-07 16:59:41 | [diff] [blame] | 259 | dom_storage_context_proxy->SetForceKeepSessionState(); |
[email protected] | 735e20c | 2012-03-20 01:16:59 | [diff] [blame] | 260 | |
[email protected] | 89acda8 | 2013-06-25 20:52:50 | [diff] [blame] | 261 | IndexedDBContextImpl* indexed_db_context_impl = |
| 262 | static_cast<IndexedDBContextImpl*>( |
[email protected] | b1b502e | 2012-09-16 07:31:43 | [diff] [blame] | 263 | storage_partition->GetIndexedDBContext()); |
[email protected] | 89acda8 | 2013-06-25 20:52:50 | [diff] [blame] | 264 | // No task runner in unit tests. |
| 265 | if (indexed_db_context_impl->TaskRunner()) { |
| 266 | indexed_db_context_impl->TaskRunner()->PostTask( |
| 267 | FROM_HERE, |
| 268 | base::Bind(&SaveSessionStateOnIndexedDBThread, |
| 269 | make_scoped_refptr(indexed_db_context_impl))); |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 270 | } |
| 271 | } |
| 272 | |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 273 | #endif // !OS_IOS |
[email protected] | 6e2d3d2 | 2012-02-24 18:10:36 | [diff] [blame] | 274 | |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 275 | BrowserContext::~BrowserContext() { |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 276 | #if !defined(OS_IOS) |
[email protected] | b441a849 | 2012-06-06 14:55:57 | [diff] [blame] | 277 | if (GetUserData(kDownloadManagerKeyName)) |
| 278 | GetDownloadManager(this)->Shutdown(); |
[email protected] | e0ce8a1e | 2012-09-18 10:26:36 | [diff] [blame] | 279 | #endif |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 280 | } |
| 281 | |
[email protected] | 55eb70e76 | 2012-02-20 17:38:39 | [diff] [blame] | 282 | } // namespace content |