OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 IDMap<blink::WebServiceWorkerClientsClaimCallbacks, IDMapOwnPointer>; | 173 IDMap<blink::WebServiceWorkerClientsClaimCallbacks, IDMapOwnPointer>; |
174 using ClientCallbacksMap = | 174 using ClientCallbacksMap = |
175 IDMap<blink::WebServiceWorkerClientCallbacks, IDMapOwnPointer>; | 175 IDMap<blink::WebServiceWorkerClientCallbacks, IDMapOwnPointer>; |
176 using SkipWaitingCallbacksMap = | 176 using SkipWaitingCallbacksMap = |
177 IDMap<blink::WebServiceWorkerSkipWaitingCallbacks, IDMapOwnPointer>; | 177 IDMap<blink::WebServiceWorkerSkipWaitingCallbacks, IDMapOwnPointer>; |
178 using SyncEventCallbacksMap = | 178 using SyncEventCallbacksMap = |
179 IDMap<const base::Callback<void(blink::mojom::ServiceWorkerEventStatus)>, | 179 IDMap<const base::Callback<void(blink::mojom::ServiceWorkerEventStatus)>, |
180 IDMapOwnPointer>; | 180 IDMapOwnPointer>; |
181 | 181 |
182 explicit WorkerContextData(ServiceWorkerContextClient* owner) | 182 explicit WorkerContextData(ServiceWorkerContextClient* owner) |
183 : interface_registry(nullptr), | 183 : weak_factory(owner), proxy_weak_factory(owner->proxy_) {} |
184 weak_factory(owner), | |
185 proxy_weak_factory(owner->proxy_) {} | |
186 | 184 |
187 ~WorkerContextData() { | 185 ~WorkerContextData() { |
188 DCHECK(thread_checker.CalledOnValidThread()); | 186 DCHECK(thread_checker.CalledOnValidThread()); |
189 } | 187 } |
190 | 188 |
191 // Pending callbacks for GetClientDocuments(). | 189 // Pending callbacks for GetClientDocuments(). |
192 ClientsCallbacksMap clients_callbacks; | 190 ClientsCallbacksMap clients_callbacks; |
193 | 191 |
194 // Pending callbacks for OpenWindow() and FocusClient(). | 192 // Pending callbacks for OpenWindow() and FocusClient(). |
195 ClientCallbacksMap client_callbacks; | 193 ClientCallbacksMap client_callbacks; |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 } | 1035 } |
1038 | 1036 |
1039 base::WeakPtr<ServiceWorkerContextClient> | 1037 base::WeakPtr<ServiceWorkerContextClient> |
1040 ServiceWorkerContextClient::GetWeakPtr() { | 1038 ServiceWorkerContextClient::GetWeakPtr() { |
1041 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1039 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
1042 DCHECK(context_); | 1040 DCHECK(context_); |
1043 return context_->weak_factory.GetWeakPtr(); | 1041 return context_->weak_factory.GetWeakPtr(); |
1044 } | 1042 } |
1045 | 1043 |
1046 } // namespace content | 1044 } // namespace content |
OLD | NEW |