OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/shell/shell_browser_context.h" | 5 #include "content/shell/shell_browser_context.h" |
6 | 6 |
| 7 #include "base/bind.h" |
7 #include "base/file_util.h" | 8 #include "base/file_util.h" |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/path_service.h" | 10 #include "base/path_service.h" |
10 #include "content/browser/appcache/chrome_appcache_service.h" | 11 #include "content/browser/appcache/chrome_appcache_service.h" |
11 #include "content/browser/chrome_blob_storage_context.h" | 12 #include "content/browser/chrome_blob_storage_context.h" |
12 #include "content/browser/download/download_id_factory.h" | 13 #include "content/browser/download/download_id_factory.h" |
13 #include "content/browser/download/download_manager.h" | 14 #include "content/browser/download/download_manager.h" |
14 #include "content/browser/download/download_status_updater.h" | 15 #include "content/browser/download/download_status_updater.h" |
15 #include "content/browser/file_system/browser_file_system_helper.h" | 16 #include "content/browser/file_system/browser_file_system_helper.h" |
16 #include "content/browser/geolocation/geolocation_permission_context.h" | 17 #include "content/browser/geolocation/geolocation_permission_context.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 webkit_database::DatabaseTracker* ShellBrowserContext::GetDatabaseTracker() { | 205 webkit_database::DatabaseTracker* ShellBrowserContext::GetDatabaseTracker() { |
205 CreateQuotaManagerAndClients(); | 206 CreateQuotaManagerAndClients(); |
206 return db_tracker_; | 207 return db_tracker_; |
207 } | 208 } |
208 | 209 |
209 ChromeBlobStorageContext* ShellBrowserContext::GetBlobStorageContext() { | 210 ChromeBlobStorageContext* ShellBrowserContext::GetBlobStorageContext() { |
210 if (!blob_storage_context_) { | 211 if (!blob_storage_context_) { |
211 blob_storage_context_ = new ChromeBlobStorageContext(); | 212 blob_storage_context_ = new ChromeBlobStorageContext(); |
212 BrowserThread::PostTask( | 213 BrowserThread::PostTask( |
213 BrowserThread::IO, FROM_HERE, | 214 BrowserThread::IO, FROM_HERE, |
214 NewRunnableMethod( | 215 base::Bind( |
215 blob_storage_context_.get(), | 216 &ChromeBlobStorageContext::InitializeOnIOThread, |
216 &ChromeBlobStorageContext::InitializeOnIOThread)); | 217 blob_storage_context_.get())); |
217 } | 218 } |
218 return blob_storage_context_; | 219 return blob_storage_context_; |
219 } | 220 } |
220 | 221 |
221 ChromeAppCacheService* ShellBrowserContext::GetAppCacheService() { | 222 ChromeAppCacheService* ShellBrowserContext::GetAppCacheService() { |
222 CreateQuotaManagerAndClients(); | 223 CreateQuotaManagerAndClients(); |
223 return appcache_service_; | 224 return appcache_service_; |
224 } | 225 } |
225 | 226 |
226 fileapi::FileSystemContext* ShellBrowserContext::GetFileSystemContext() { | 227 fileapi::FileSystemContext* ShellBrowserContext::GetFileSystemContext() { |
(...skipping 16 matching lines...) Expand all Loading... |
243 db_tracker_ = new webkit_database::DatabaseTracker( | 244 db_tracker_ = new webkit_database::DatabaseTracker( |
244 GetPath(), IsOffTheRecord(), false, NULL, quota_manager_->proxy(), | 245 GetPath(), IsOffTheRecord(), false, NULL, quota_manager_->proxy(), |
245 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); | 246 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)); |
246 webkit_context_ = new WebKitContext( | 247 webkit_context_ = new WebKitContext( |
247 IsOffTheRecord(), GetPath(), NULL, false, quota_manager_->proxy(), | 248 IsOffTheRecord(), GetPath(), NULL, false, quota_manager_->proxy(), |
248 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); | 249 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::WEBKIT)); |
249 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); | 250 appcache_service_ = new ChromeAppCacheService(quota_manager_->proxy()); |
250 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; | 251 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy; |
251 BrowserThread::PostTask( | 252 BrowserThread::PostTask( |
252 BrowserThread::IO, FROM_HERE, | 253 BrowserThread::IO, FROM_HERE, |
253 NewRunnableMethod( | 254 base::Bind( |
| 255 &ChromeAppCacheService::InitializeOnIOThread, |
254 appcache_service_.get(), | 256 appcache_service_.get(), |
255 &ChromeAppCacheService::InitializeOnIOThread, | |
256 IsOffTheRecord() | 257 IsOffTheRecord() |
257 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")), | 258 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")), |
258 &GetResourceContext(), | 259 &GetResourceContext(), |
259 special_storage_policy)); | 260 special_storage_policy)); |
260 } | 261 } |
261 | 262 |
262 } // namespace content | 263 } // namespace content |
OLD | NEW |