| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 context, partition_path, in_memory, quota_manager->proxy()); | 436 context, partition_path, in_memory, quota_manager->proxy()); |
| 437 | 437 |
| 438 scoped_refptr<storage::DatabaseTracker> database_tracker = | 438 scoped_refptr<storage::DatabaseTracker> database_tracker = |
| 439 new storage::DatabaseTracker(partition_path, | 439 new storage::DatabaseTracker(partition_path, |
| 440 in_memory, | 440 in_memory, |
| 441 context->GetSpecialStoragePolicy(), | 441 context->GetSpecialStoragePolicy(), |
| 442 quota_manager->proxy(), | 442 quota_manager->proxy(), |
| 443 BrowserThread::GetMessageLoopProxyForThread( | 443 BrowserThread::GetMessageLoopProxyForThread( |
| 444 BrowserThread::FILE).get()); | 444 BrowserThread::FILE).get()); |
| 445 | 445 |
| 446 base::FilePath path = in_memory ? base::FilePath() : context->GetPath(); | |
| 447 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = | 446 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = |
| 448 new DOMStorageContextWrapper(BrowserContext::GetMojoUserIdFor(context), | 447 new DOMStorageContextWrapper( |
| 449 path, relative_partition_path, | 448 BrowserContext::GetMojoUserIdFor(context), |
| 450 context->GetSpecialStoragePolicy()); | 449 in_memory ? base::FilePath() : context->GetPath(), |
| 450 relative_partition_path, context->GetSpecialStoragePolicy()); |
| 451 | 451 |
| 452 // BrowserMainLoop may not be initialized in unit tests. Tests will | 452 // BrowserMainLoop may not be initialized in unit tests. Tests will |
| 453 // need to inject their own task runner into the IndexedDBContext. | 453 // need to inject their own task runner into the IndexedDBContext. |
| 454 base::SequencedTaskRunner* idb_task_runner = | 454 base::SequencedTaskRunner* idb_task_runner = |
| 455 BrowserThread::CurrentlyOn(BrowserThread::UI) && | 455 BrowserThread::CurrentlyOn(BrowserThread::UI) && |
| 456 BrowserMainLoop::GetInstance() | 456 BrowserMainLoop::GetInstance() |
| 457 ? BrowserMainLoop::GetInstance() | 457 ? BrowserMainLoop::GetInstance() |
| 458 ->indexed_db_thread() | 458 ->indexed_db_thread() |
| 459 ->task_runner() | 459 ->task_runner() |
| 460 .get() | 460 .get() |
| 461 : NULL; | 461 : NULL; |
| 462 |
| 463 base::FilePath path = in_memory ? base::FilePath() : partition_path; |
| 462 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 464 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
| 463 new IndexedDBContextImpl(path, | 465 new IndexedDBContextImpl(path, |
| 464 context->GetSpecialStoragePolicy(), | 466 context->GetSpecialStoragePolicy(), |
| 465 quota_manager->proxy(), | 467 quota_manager->proxy(), |
| 466 idb_task_runner); | 468 idb_task_runner); |
| 467 | 469 |
| 468 scoped_refptr<CacheStorageContextImpl> cache_storage_context = | 470 scoped_refptr<CacheStorageContextImpl> cache_storage_context = |
| 469 new CacheStorageContextImpl(context); | 471 new CacheStorageContextImpl(context); |
| 470 cache_storage_context->Init(path, make_scoped_refptr(quota_manager->proxy())); | 472 cache_storage_context->Init(path, make_scoped_refptr(quota_manager->proxy())); |
| 471 | 473 |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 net::URLRequestContextGetter* url_request_context) { | 911 net::URLRequestContextGetter* url_request_context) { |
| 910 url_request_context_ = url_request_context; | 912 url_request_context_ = url_request_context; |
| 911 } | 913 } |
| 912 | 914 |
| 913 void StoragePartitionImpl::SetMediaURLRequestContext( | 915 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 914 net::URLRequestContextGetter* media_url_request_context) { | 916 net::URLRequestContextGetter* media_url_request_context) { |
| 915 media_url_request_context_ = media_url_request_context; | 917 media_url_request_context_ = media_url_request_context; |
| 916 } | 918 } |
| 917 | 919 |
| 918 } // namespace content | 920 } // namespace content |
| OLD | NEW |