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_impl.h" | 9 #include "content/browser/dom_storage/dom_storage_context_impl.h" |
10 #include "content/browser/download/download_manager_impl.h" | 10 #include "content/browser/download/download_manager_impl.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // unittests where a UI thread might not have been created. | 138 // unittests where a UI thread might not have been created. |
139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
140 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); | 140 !BrowserThread::IsMessageLoopValid(BrowserThread::UI)); |
141 | 141 |
142 #if defined(OS_CHROMEOS) | 142 #if defined(OS_CHROMEOS) |
143 if (!context->GetUserData(kMountPointsKey)) { | 143 if (!context->GetUserData(kMountPointsKey)) { |
144 scoped_refptr<fileapi::ExternalMountPoints> mount_points = | 144 scoped_refptr<fileapi::ExternalMountPoints> mount_points = |
145 fileapi::ExternalMountPoints::CreateRefCounted(); | 145 fileapi::ExternalMountPoints::CreateRefCounted(); |
146 context->SetUserData( | 146 context->SetUserData( |
147 kMountPointsKey, | 147 kMountPointsKey, |
148 new UserDataAdapter<fileapi::ExternalMountPoints>( | 148 new UserDataAdapter<fileapi::ExternalMountPoints>(mount_points.get())); |
149 mount_points)); | |
150 } | 149 } |
151 | 150 |
152 return UserDataAdapter<fileapi::ExternalMountPoints>::Get( | 151 return UserDataAdapter<fileapi::ExternalMountPoints>::Get( |
153 context, kMountPointsKey); | 152 context, kMountPointsKey); |
154 #else | 153 #else |
155 return NULL; | 154 return NULL; |
156 #endif | 155 #endif |
157 } | 156 } |
158 | 157 |
159 StoragePartition* BrowserContext::GetStoragePartition( | 158 StoragePartition* BrowserContext::GetStoragePartition( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 #endif // !OS_IOS | 265 #endif // !OS_IOS |
267 | 266 |
268 BrowserContext::~BrowserContext() { | 267 BrowserContext::~BrowserContext() { |
269 #if !defined(OS_IOS) | 268 #if !defined(OS_IOS) |
270 if (GetUserData(kDownloadManagerKeyName)) | 269 if (GetUserData(kDownloadManagerKeyName)) |
271 GetDownloadManager(this)->Shutdown(); | 270 GetDownloadManager(this)->Shutdown(); |
272 #endif | 271 #endif |
273 } | 272 } |
274 | 273 |
275 } // namespace content | 274 } // namespace content |
OLD | NEW |