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 <vector> | 10 #include <vector> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 if (!handler || !handler->context()) | 66 if (!handler || !handler->context()) |
67 return nullptr; | 67 return nullptr; |
68 return handler->context()->wrapper_; | 68 return handler->context()->wrapper_; |
69 } | 69 } |
70 | 70 |
71 ServiceWorkerContextWrapper::ServiceWorkerContextWrapper( | 71 ServiceWorkerContextWrapper::ServiceWorkerContextWrapper( |
72 BrowserContext* browser_context) | 72 BrowserContext* browser_context) |
73 : observer_list_( | 73 : observer_list_( |
74 new ObserverListThreadSafe<ServiceWorkerContextObserver>()), | 74 new ObserverListThreadSafe<ServiceWorkerContextObserver>()), |
75 process_manager_(new ServiceWorkerProcessManager(browser_context)), | 75 process_manager_(new ServiceWorkerProcessManager(browser_context)), |
76 is_incognito_(false) { | 76 is_incognito_(false), |
| 77 browser_context_(browser_context) { |
77 } | 78 } |
78 | 79 |
79 ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() { | 80 ServiceWorkerContextWrapper::~ServiceWorkerContextWrapper() { |
80 } | 81 } |
81 | 82 |
82 void ServiceWorkerContextWrapper::Init( | 83 void ServiceWorkerContextWrapper::Init( |
83 const base::FilePath& user_data_directory, | 84 const base::FilePath& user_data_directory, |
84 storage::QuotaManagerProxy* quota_manager_proxy, | 85 storage::QuotaManagerProxy* quota_manager_proxy, |
85 storage::SpecialStoragePolicy* special_storage_policy) { | 86 storage::SpecialStoragePolicy* special_storage_policy) { |
86 is_incognito_ = user_data_directory.empty(); | 87 is_incognito_ = user_data_directory.empty(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 context_core_.reset(); | 360 context_core_.reset(); |
360 return; | 361 return; |
361 } | 362 } |
362 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); | 363 context_core_.reset(new ServiceWorkerContextCore(context_core_.get(), this)); |
363 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; | 364 DVLOG(1) << "Restarted ServiceWorkerContextCore successfully."; |
364 | 365 |
365 observer_list_->Notify(&ServiceWorkerContextObserver::OnStorageWiped); | 366 observer_list_->Notify(&ServiceWorkerContextObserver::OnStorageWiped); |
366 } | 367 } |
367 | 368 |
368 } // namespace content | 369 } // namespace content |
OLD | NEW |