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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 // Pending callbacks for ClaimClients(). | 209 // Pending callbacks for ClaimClients(). |
210 ClaimClientsCallbacksMap claim_clients_callbacks; | 210 ClaimClientsCallbacksMap claim_clients_callbacks; |
211 | 211 |
212 // Pending callbacks for Background Sync Events | 212 // Pending callbacks for Background Sync Events |
213 SyncEventCallbacksMap sync_event_callbacks; | 213 SyncEventCallbacksMap sync_event_callbacks; |
214 | 214 |
215 // Pending callbacks for Fetch Events | 215 // Pending callbacks for Fetch Events |
216 FetchEventCallbacksMap fetch_event_callbacks; | 216 FetchEventCallbacksMap fetch_event_callbacks; |
217 | 217 |
218 shell::InterfaceRegistry interface_registry; | 218 service_manager::InterfaceRegistry interface_registry; |
219 shell::InterfaceProvider remote_interfaces; | 219 service_manager::InterfaceProvider remote_interfaces; |
220 | 220 |
221 base::ThreadChecker thread_checker; | 221 base::ThreadChecker thread_checker; |
222 base::WeakPtrFactory<ServiceWorkerContextClient> weak_factory; | 222 base::WeakPtrFactory<ServiceWorkerContextClient> weak_factory; |
223 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; | 223 base::WeakPtrFactory<blink::WebServiceWorkerContextProxy> proxy_weak_factory; |
224 }; | 224 }; |
225 | 225 |
226 class ServiceWorkerContextClient::FetchEventDispatcherImpl | 226 class ServiceWorkerContextClient::FetchEventDispatcherImpl |
227 : public NON_EXPORTED_BASE(mojom::FetchEventDispatcher) { | 227 : public NON_EXPORTED_BASE(mojom::FetchEventDispatcher) { |
228 public: | 228 public: |
229 static void Create(mojom::FetchEventDispatcherRequest request) { | 229 static void Create(mojom::FetchEventDispatcherRequest request) { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) | 315 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) |
316 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) | 316 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) |
317 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) | 317 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) |
318 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing); | 318 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing); |
319 IPC_MESSAGE_UNHANDLED(handled = false) | 319 IPC_MESSAGE_UNHANDLED(handled = false) |
320 IPC_END_MESSAGE_MAP() | 320 IPC_END_MESSAGE_MAP() |
321 DCHECK(handled); | 321 DCHECK(handled); |
322 } | 322 } |
323 | 323 |
324 void ServiceWorkerContextClient::BindInterfaceProviders( | 324 void ServiceWorkerContextClient::BindInterfaceProviders( |
325 shell::mojom::InterfaceProviderRequest request, | 325 service_manager::mojom::InterfaceProviderRequest request, |
326 shell::mojom::InterfaceProviderPtr remote_interfaces) { | 326 service_manager::mojom::InterfaceProviderPtr remote_interfaces) { |
327 context_->interface_registry.Bind(std::move(request)); | 327 context_->interface_registry.Bind(std::move(request)); |
328 context_->remote_interfaces.Bind(std::move(remote_interfaces)); | 328 context_->remote_interfaces.Bind(std::move(remote_interfaces)); |
329 } | 329 } |
330 | 330 |
331 blink::WebURL ServiceWorkerContextClient::scope() const { | 331 blink::WebURL ServiceWorkerContextClient::scope() const { |
332 return service_worker_scope_; | 332 return service_worker_scope_; |
333 } | 333 } |
334 | 334 |
335 void ServiceWorkerContextClient::getClient( | 335 void ServiceWorkerContextClient::getClient( |
336 const blink::WebString& id, | 336 const blink::WebString& id, |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 } | 1136 } |
1137 | 1137 |
1138 base::WeakPtr<ServiceWorkerContextClient> | 1138 base::WeakPtr<ServiceWorkerContextClient> |
1139 ServiceWorkerContextClient::GetWeakPtr() { | 1139 ServiceWorkerContextClient::GetWeakPtr() { |
1140 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1140 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
1141 DCHECK(context_); | 1141 DCHECK(context_); |
1142 return context_->weak_factory.GetWeakPtr(); | 1142 return context_->weak_factory.GetWeakPtr(); |
1143 } | 1143 } |
1144 | 1144 |
1145 } // namespace content | 1145 } // namespace content |
OLD | NEW |