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 <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/location.h" | |
11 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
12 #include "base/single_thread_task_runner.h" | |
13 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
14 #include "content/browser/browser_main_loop.h" | 12 #include "content/browser/browser_main_loop.h" |
15 #include "content/browser/fileapi/browser_file_system_helper.h" | 13 #include "content/browser/fileapi/browser_file_system_helper.h" |
16 #include "content/browser/geofencing/geofencing_manager.h" | 14 #include "content/browser/geofencing/geofencing_manager.h" |
17 #include "content/browser/gpu/shader_disk_cache.h" | 15 #include "content/browser/gpu/shader_disk_cache.h" |
18 #include "content/browser/host_zoom_map_impl.h" | 16 #include "content/browser/host_zoom_map_impl.h" |
19 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" | 17 #include "content/browser/navigator_connect/navigator_connect_context_impl.h" |
20 #include "content/browser/navigator_connect/navigator_connect_service_worker_ser
vice_factory.h" | 18 #include "content/browser/navigator_connect/navigator_connect_service_worker_ser
vice_factory.h" |
21 #include "content/browser/notifications/platform_notification_context_impl.h" | 19 #include "content/browser/notifications/platform_notification_context_impl.h" |
22 #include "content/common/dom_storage/dom_storage_types.h" | 20 #include "content/common/dom_storage/dom_storage_types.h" |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 477 |
480 base::FilePath path = in_memory ? base::FilePath() : partition_path; | 478 base::FilePath path = in_memory ? base::FilePath() : partition_path; |
481 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = | 479 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = |
482 new DOMStorageContextWrapper(path, context->GetSpecialStoragePolicy()); | 480 new DOMStorageContextWrapper(path, context->GetSpecialStoragePolicy()); |
483 | 481 |
484 // BrowserMainLoop may not be initialized in unit tests. Tests will | 482 // BrowserMainLoop may not be initialized in unit tests. Tests will |
485 // need to inject their own task runner into the IndexedDBContext. | 483 // need to inject their own task runner into the IndexedDBContext. |
486 base::SequencedTaskRunner* idb_task_runner = | 484 base::SequencedTaskRunner* idb_task_runner = |
487 BrowserThread::CurrentlyOn(BrowserThread::UI) && | 485 BrowserThread::CurrentlyOn(BrowserThread::UI) && |
488 BrowserMainLoop::GetInstance() | 486 BrowserMainLoop::GetInstance() |
489 ? BrowserMainLoop::GetInstance() | 487 ? BrowserMainLoop::GetInstance()->indexed_db_thread() |
490 ->indexed_db_thread() | 488 ->message_loop_proxy().get() |
491 ->task_runner() | |
492 .get() | |
493 : NULL; | 489 : NULL; |
494 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 490 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
495 new IndexedDBContextImpl(path, | 491 new IndexedDBContextImpl(path, |
496 context->GetSpecialStoragePolicy(), | 492 context->GetSpecialStoragePolicy(), |
497 quota_manager->proxy(), | 493 quota_manager->proxy(), |
498 idb_task_runner); | 494 idb_task_runner); |
499 | 495 |
500 scoped_refptr<CacheStorageContextImpl> cache_storage_context = | 496 scoped_refptr<CacheStorageContextImpl> cache_storage_context = |
501 new CacheStorageContextImpl(context); | 497 new CacheStorageContextImpl(context); |
502 cache_storage_context->Init(path, quota_manager->proxy(), | 498 cache_storage_context->Init(path, quota_manager->proxy(), |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 net::URLRequestContextGetter* url_request_context) { | 948 net::URLRequestContextGetter* url_request_context) { |
953 url_request_context_ = url_request_context; | 949 url_request_context_ = url_request_context; |
954 } | 950 } |
955 | 951 |
956 void StoragePartitionImpl::SetMediaURLRequestContext( | 952 void StoragePartitionImpl::SetMediaURLRequestContext( |
957 net::URLRequestContextGetter* media_url_request_context) { | 953 net::URLRequestContextGetter* media_url_request_context) { |
958 media_url_request_context_ = media_url_request_context; | 954 media_url_request_context_ = media_url_request_context; |
959 } | 955 } |
960 | 956 |
961 } // namespace content | 957 } // namespace content |
OLD | NEW |