| 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<DTLSIdentityStore> dtls_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), |
| 169 dtls_identity_store_(dtls_identity_store.Pass()) { |
| 168 } | 170 } |
| 169 | 171 |
| 170 StoragePartitionImpl::~StoragePartitionImpl() { | 172 StoragePartitionImpl::~StoragePartitionImpl() { |
| 171 // These message loop checks are just to avoid leaks in unittests. | 173 // These message loop checks are just to avoid leaks in unittests. |
| 172 if (GetDatabaseTracker() && | 174 if (GetDatabaseTracker() && |
| 173 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { | 175 BrowserThread::IsMessageLoopValid(BrowserThread::FILE)) { |
| 174 BrowserThread::PostTask( | 176 BrowserThread::PostTask( |
| 175 BrowserThread::FILE, FROM_HERE, | 177 BrowserThread::FILE, FROM_HERE, |
| 176 base::Bind(&webkit_database::DatabaseTracker::Shutdown, | 178 base::Bind(&webkit_database::DatabaseTracker::Shutdown, |
| 177 GetDatabaseTracker())); | 179 GetDatabaseTracker())); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 229 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
| 228 new IndexedDBContextImpl(path, | 230 new IndexedDBContextImpl(path, |
| 229 context->GetSpecialStoragePolicy(), | 231 context->GetSpecialStoragePolicy(), |
| 230 quota_manager->proxy(), | 232 quota_manager->proxy(), |
| 231 BrowserThread::GetMessageLoopProxyForThread( | 233 BrowserThread::GetMessageLoopProxyForThread( |
| 232 BrowserThread::WEBKIT_DEPRECATED).get()); | 234 BrowserThread::WEBKIT_DEPRECATED).get()); |
| 233 | 235 |
| 234 scoped_refptr<ChromeAppCacheService> appcache_service = | 236 scoped_refptr<ChromeAppCacheService> appcache_service = |
| 235 new ChromeAppCacheService(quota_manager->proxy()); | 237 new ChromeAppCacheService(quota_manager->proxy()); |
| 236 | 238 |
| 239 scoped_ptr<DTLSIdentityStore> dtls_identity_store; |
| 240 dtls_identity_store.reset(new DTLSIdentityStore()); |
| 241 |
| 237 return new StoragePartitionImpl(partition_path, | 242 return new StoragePartitionImpl(partition_path, |
| 238 quota_manager.get(), | 243 quota_manager.get(), |
| 239 appcache_service.get(), | 244 appcache_service.get(), |
| 240 filesystem_context.get(), | 245 filesystem_context.get(), |
| 241 database_tracker.get(), | 246 database_tracker.get(), |
| 242 dom_storage_context.get(), | 247 dom_storage_context.get(), |
| 243 indexed_db_context.get()); | 248 indexed_db_context.get(), |
| 249 dtls_identity_store.Pass()); |
| 244 } | 250 } |
| 245 | 251 |
| 246 base::FilePath StoragePartitionImpl::GetPath() { | 252 base::FilePath StoragePartitionImpl::GetPath() { |
| 247 return partition_path_; | 253 return partition_path_; |
| 248 } | 254 } |
| 249 | 255 |
| 250 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { | 256 net::URLRequestContextGetter* StoragePartitionImpl::GetURLRequestContext() { |
| 251 return url_request_context_.get(); | 257 return url_request_context_.get(); |
| 252 } | 258 } |
| 253 | 259 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 DCHECK(storage_mask == kShaderStorage); | 334 DCHECK(storage_mask == kShaderStorage); |
| 329 | 335 |
| 330 if (storage_mask & kShaderStorage) { | 336 if (storage_mask & kShaderStorage) { |
| 331 BrowserThread::PostTask( | 337 BrowserThread::PostTask( |
| 332 BrowserThread::IO, FROM_HERE, | 338 BrowserThread::IO, FROM_HERE, |
| 333 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end, | 339 base::Bind(&ClearShaderCacheOnIOThread, GetPath(), begin, end, |
| 334 callback)); | 340 callback)); |
| 335 } | 341 } |
| 336 } | 342 } |
| 337 | 343 |
| 344 DTLSIdentityStore* StoragePartitionImpl::GetDTLSIdentityStore() { |
| 345 return dtls_identity_store_.get(); |
| 346 } |
| 347 |
| 338 void StoragePartitionImpl::SetURLRequestContext( | 348 void StoragePartitionImpl::SetURLRequestContext( |
| 339 net::URLRequestContextGetter* url_request_context) { | 349 net::URLRequestContextGetter* url_request_context) { |
| 340 url_request_context_ = url_request_context; | 350 url_request_context_ = url_request_context; |
| 341 } | 351 } |
| 342 | 352 |
| 343 void StoragePartitionImpl::SetMediaURLRequestContext( | 353 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 344 net::URLRequestContextGetter* media_url_request_context) { | 354 net::URLRequestContextGetter* media_url_request_context) { |
| 345 media_url_request_context_ = media_url_request_context; | 355 media_url_request_context_ = media_url_request_context; |
| 346 } | 356 } |
| 347 | 357 |
| 348 } // namespace content | 358 } // namespace content |
| OLD | NEW |