| 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/browser/storage_partition_impl.h" | 5 #include "content/browser/storage_partition_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "content/browser/fileapi/browser_file_system_helper.h" | 8 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 9 #include "content/browser/gpu/shader_disk_cache.h" | 9 #include "content/browser/gpu/shader_disk_cache.h" |
| 10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 | 152 |
| 153 StoragePartitionImpl::StoragePartitionImpl( | 153 StoragePartitionImpl::StoragePartitionImpl( |
| 154 const base::FilePath& partition_path, | 154 const base::FilePath& partition_path, |
| 155 quota::QuotaManager* quota_manager, | 155 quota::QuotaManager* quota_manager, |
| 156 ChromeAppCacheService* appcache_service, | 156 ChromeAppCacheService* appcache_service, |
| 157 fileapi::FileSystemContext* filesystem_context, | 157 fileapi::FileSystemContext* filesystem_context, |
| 158 webkit_database::DatabaseTracker* database_tracker, | 158 webkit_database::DatabaseTracker* database_tracker, |
| 159 DOMStorageContextImpl* dom_storage_context, | 159 DOMStorageContextImpl* dom_storage_context, |
| 160 IndexedDBContextImpl* indexed_db_context) | 160 IndexedDBContextImpl* indexed_db_context, |
| 161 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store) |
| 161 : partition_path_(partition_path), | 162 : partition_path_(partition_path), |
| 162 quota_manager_(quota_manager), | 163 quota_manager_(quota_manager), |
| 163 appcache_service_(appcache_service), | 164 appcache_service_(appcache_service), |
| 164 filesystem_context_(filesystem_context), | 165 filesystem_context_(filesystem_context), |
| 165 database_tracker_(database_tracker), | 166 database_tracker_(database_tracker), |
| 166 dom_storage_context_(dom_storage_context), | 167 dom_storage_context_(dom_storage_context), |
| 167 indexed_db_context_(indexed_db_context) { | 168 indexed_db_context_(indexed_db_context), |
| 168 } | 169 webrtc_identity_store_(webrtc_identity_store.Pass()) {} |
| 169 | 170 |
| 170 StoragePartitionImpl::~StoragePartitionImpl() { | 171 StoragePartitionImpl::~StoragePartitionImpl() { |
| 171 // These message loop checks are just to avoid leaks in unittests. | 172 // These message loop checks are just to avoid leaks in unittests. |
| 172 if (GetDatabaseTracker() && | 173 if (GetDatabaseTracker() && |
| 173 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 174 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
| 174 BrowserThread::PostTask( | 175 BrowserThread::PostTask( |
| 175 BrowserThread::FILE, FROM_HERE, | 176 BrowserThread::FILE, FROM_HERE, |
| 176 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 177 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
| 177 GetDatabaseTracker())); | 178 GetDatabaseTracker())); |
| 178 } | 179 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 228 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
| 228 new IndexedDBContextImpl(path, | 229 new IndexedDBContextImpl(path, |
| 229 context->GetSpecialStoragePolicy(), | 230 context->GetSpecialStoragePolicy(), |
| 230 quota_manager->proxy(), | 231 quota_manager->proxy(), |
| 231 BrowserThread::GetMessageLoopProxyForThread( | 232 BrowserThread::GetMessageLoopProxyForThread( |
| 232 BrowserThread::WEBKIT_DEPRECATED).get()); | 233 BrowserThread::WEBKIT_DEPRECATED).get()); |
| 233 | 234 |
| 234 scoped_refptr<ChromeAppCacheService> appcache_service = | 235 scoped_refptr<ChromeAppCacheService> appcache_service = |
| 235 new ChromeAppCacheService(quota_manager->proxy()); | 236 new ChromeAppCacheService(quota_manager->proxy()); |
| 236 | 237 |
| 238 scoped_ptr<WebRTCIdentityStore> webrtc_identity_store; |
| 239 webrtc_identity_store.reset(new WebRTCIdentityStore()); |
| 240 |
| 237 return new StoragePartitionImpl(partition_path, | 241 return new StoragePartitionImpl(partition_path, |
| 238 quota_manager.get(), | 242 quota_manager.get(), |
| 239 appcache_service.get(), | 243 appcache_service.get(), |
| 240 filesystem_context.get(), | 244 filesystem_context.get(), |
| 241 database_tracker.get(), | 245 database_tracker.get(), |
| 242 dom_storage_context.get(), | 246 dom_storage_context.get(), |
| 243 indexed_db_context.get()); | 247 indexed_db_context.get(), |
| 248 webrtc_identity_store.Pass()); |
| 244 } | 249 } |
| 245 | 250 |
| 246 base::FilePath StoragePartitionImpl::GetPath() { | 251 base::FilePath StoragePartitionImpl::GetPath() { |
| 247 return partition_path_; | 252 return partition_path_; |
| 248 } | 253 } |
| 249 | 254 |
| 250 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 255 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
| 251 return url_request_context_.get(); | 256 return url_request_context_.get(); |
| 252 } | 257 } |
| 253 | 258 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 DCHECK(storage_mask == kShaderStorage); | 333 DCHECK(storage_mask == kShaderStorage); |
| 329 | 334 |
| 330 if (storage_mask & kShaderStorage) { | 335 if (storage_mask & kShaderStorage) { |
| 331 BrowserThread::PostTask( | 336 BrowserThread::PostTask( |
| 332 BrowserThread::IO, FROM_HERE, | 337 BrowserThread::IO, FROM_HERE, |
| 333 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end, | 338 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end, |
| 334 callback)); | 339 callback)); |
| 335 } | 340 } |
| 336 } | 341 } |
| 337 | 342 |
| 343 WebRTCIdentityStore* StoragePartitionImpl::GetWebRTCIdentityStore() { |
| 344 return webrtc_identity_store_.get(); |
| 345 } |
| 346 |
| 338 void StoragePartitionImpl::SetURLRequestContext( | 347 void StoragePartitionImpl::SetURLRequestContext( |
| 339 net::URLRequestContextGetter* url_request_context) { | 348 net::URLRequestContextGetter* url_request_context) { |
| 340 url_request_context_ = url_request_context; | 349 url_request_context_ = url_request_context; |
| 341 } | 350 } |
| 342 | 351 |
| 343 void StoragePartitionImpl::SetMediaURLRequestContext( | 352 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 344 net::URLRequestContextGetter* media_url_request_context) { | 353 net::URLRequestContextGetter* media_url_request_context) { |
| 345 media_url_request_context_ = media_url_request_context; | 354 media_url_request_context_ = media_url_request_context; |
| 346 } | 355 } |
| 347 | 356 |
| 348 } // namespace content | 357 } // namespace content |
| OLD | NEW |