OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_worker/service_worker_context_wrapper.h" | 5 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const base::FilePath& user_data_directory, | 121 const base::FilePath& user_data_directory, |
122 storage::QuotaManagerProxy* quota_manager_proxy, | 122 storage::QuotaManagerProxy* quota_manager_proxy, |
123 storage::SpecialStoragePolicy* special_storage_policy) { | 123 storage::SpecialStoragePolicy* special_storage_policy) { |
124 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 124 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
125 | 125 |
126 is_incognito_ = user_data_directory.empty(); | 126 is_incognito_ = user_data_directory.empty(); |
127 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | 127 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); |
128 std::unique_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager( | 128 std::unique_ptr<ServiceWorkerDatabaseTaskManager> database_task_manager( |
129 new ServiceWorkerDatabaseTaskManagerImpl(pool)); | 129 new ServiceWorkerDatabaseTaskManagerImpl(pool)); |
130 scoped_refptr<base::SingleThreadTaskRunner> disk_cache_thread = | 130 scoped_refptr<base::SingleThreadTaskRunner> disk_cache_thread = |
131 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE); | 131 BrowserThread::GetTaskRunnerForThread(BrowserThread::CACHE); |
132 InitInternal(user_data_directory, std::move(database_task_manager), | 132 InitInternal(user_data_directory, std::move(database_task_manager), |
133 disk_cache_thread, quota_manager_proxy, special_storage_policy); | 133 disk_cache_thread, quota_manager_proxy, special_storage_policy); |
134 } | 134 } |
135 | 135 |
136 void ServiceWorkerContextWrapper::Shutdown() { | 136 void ServiceWorkerContextWrapper::Shutdown() { |
137 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 137 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
138 | 138 |
139 storage_partition_ = nullptr; | 139 storage_partition_ = nullptr; |
140 process_manager_->Shutdown(); | 140 process_manager_->Shutdown(); |
141 BrowserThread::PostTask( | 141 BrowserThread::PostTask( |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 observer_list_->Notify(FROM_HERE, | 740 observer_list_->Notify(FROM_HERE, |
741 &ServiceWorkerContextObserver::OnStorageWiped); | 741 &ServiceWorkerContextObserver::OnStorageWiped); |
742 } | 742 } |
743 | 743 |
744 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { | 744 ServiceWorkerContextCore* ServiceWorkerContextWrapper::context() { |
745 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 745 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
746 return context_core_.get(); | 746 return context_core_.get(); |
747 } | 747 } |
748 | 748 |
749 } // namespace content | 749 } // namespace content |
OLD | NEW |