| 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> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/sequenced_task_runner.h" | 14 #include "base/sequenced_task_runner.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "content/browser/browser_main_loop.h" | 17 #include "content/browser/browser_main_loop.h" |
| 18 #include "content/browser/fileapi/browser_file_system_helper.h" | 18 #include "content/browser/fileapi/browser_file_system_helper.h" |
| 19 #include "content/browser/gpu/shader_disk_cache.h" | 19 #include "content/browser/gpu/shader_disk_cache.h" |
| 20 #include "content/browser/host_zoom_map_impl.h" | 20 #include "content/browser/host_zoom_map_impl.h" |
| 21 #include "content/browser/indexed_db/database_factory_impl.h" |
| 21 #include "content/browser/notifications/platform_notification_context_impl.h" | 22 #include "content/browser/notifications/platform_notification_context_impl.h" |
| 22 #include "content/common/dom_storage/dom_storage_types.h" | 23 #include "content/common/dom_storage/dom_storage_types.h" |
| 23 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/dom_storage_context.h" | 26 #include "content/public/browser/dom_storage_context.h" |
| 26 #include "content/public/browser/indexed_db_context.h" | 27 #include "content/public/browser/indexed_db_context.h" |
| 27 #include "content/public/browser/local_storage_usage_info.h" | 28 #include "content/public/browser/local_storage_usage_info.h" |
| 28 #include "content/public/browser/session_storage_usage_info.h" | 29 #include "content/public/browser/session_storage_usage_info.h" |
| 29 #include "net/base/completion_callback.h" | 30 #include "net/base/completion_callback.h" |
| 30 #include "net/base/net_errors.h" | 31 #include "net/base/net_errors.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); | 459 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()); |
| 459 | 460 |
| 460 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = | 461 scoped_refptr<DOMStorageContextWrapper> dom_storage_context = |
| 461 new DOMStorageContextWrapper( | 462 new DOMStorageContextWrapper( |
| 462 BrowserContext::GetShellConnectorFor(context), | 463 BrowserContext::GetShellConnectorFor(context), |
| 463 in_memory ? base::FilePath() : context->GetPath(), | 464 in_memory ? base::FilePath() : context->GetPath(), |
| 464 relative_partition_path, context->GetSpecialStoragePolicy()); | 465 relative_partition_path, context->GetSpecialStoragePolicy()); |
| 465 | 466 |
| 466 // BrowserMainLoop may not be initialized in unit tests. Tests will | 467 // BrowserMainLoop may not be initialized in unit tests. Tests will |
| 467 // need to inject their own task runner into the IndexedDBContext. | 468 // need to inject their own task runner into the IndexedDBContext. |
| 468 base::SequencedTaskRunner* idb_task_runner = | 469 base::SingleThreadTaskRunner* idb_task_runner = |
| 469 BrowserThread::CurrentlyOn(BrowserThread::UI) && | 470 BrowserThread::CurrentlyOn(BrowserThread::UI) && |
| 470 BrowserMainLoop::GetInstance() | 471 BrowserMainLoop::GetInstance() |
| 471 ? BrowserMainLoop::GetInstance() | 472 ? BrowserMainLoop::GetInstance() |
| 472 ->indexed_db_thread() | 473 ->indexed_db_thread() |
| 473 ->task_runner() | 474 ->task_runner() |
| 474 .get() | 475 .get() |
| 475 : NULL; | 476 : NULL; |
| 476 | 477 |
| 477 base::FilePath path = in_memory ? base::FilePath() : partition_path; | 478 base::FilePath path = in_memory ? base::FilePath() : partition_path; |
| 478 scoped_refptr<IndexedDBContextImpl> indexed_db_context = | 479 scoped_refptr<IndexedDBContextImpl> indexed_db_context = |
| 479 new IndexedDBContextImpl(path, | 480 new IndexedDBContextImpl(path, context->GetSpecialStoragePolicy(), |
| 480 context->GetSpecialStoragePolicy(), | 481 quota_manager->proxy(), idb_task_runner); |
| 481 quota_manager->proxy(), | |
| 482 idb_task_runner); | |
| 483 | 482 |
| 484 scoped_refptr<CacheStorageContextImpl> cache_storage_context = | 483 scoped_refptr<CacheStorageContextImpl> cache_storage_context = |
| 485 new CacheStorageContextImpl(context); | 484 new CacheStorageContextImpl(context); |
| 486 cache_storage_context->Init(path, make_scoped_refptr(quota_manager->proxy())); | 485 cache_storage_context->Init(path, make_scoped_refptr(quota_manager->proxy())); |
| 487 | 486 |
| 488 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context = | 487 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context = |
| 489 new ServiceWorkerContextWrapper(context); | 488 new ServiceWorkerContextWrapper(context); |
| 490 service_worker_context->Init(path, quota_manager->proxy(), | 489 service_worker_context->Init(path, quota_manager->proxy(), |
| 491 context->GetSpecialStoragePolicy()); | 490 context->GetSpecialStoragePolicy()); |
| 492 | 491 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 net::URLRequestContextGetter* url_request_context) { | 913 net::URLRequestContextGetter* url_request_context) { |
| 915 url_request_context_ = url_request_context; | 914 url_request_context_ = url_request_context; |
| 916 } | 915 } |
| 917 | 916 |
| 918 void StoragePartitionImpl::SetMediaURLRequestContext( | 917 void StoragePartitionImpl::SetMediaURLRequestContext( |
| 919 net::URLRequestContextGetter* media_url_request_context) { | 918 net::URLRequestContextGetter* media_url_request_context) { |
| 920 media_url_request_context_ = media_url_request_context; | 919 media_url_request_context_ = media_url_request_context; |
| 921 } | 920 } |
| 922 | 921 |
| 923 } // namespace content | 922 } // namespace content |
| OLD | NEW |