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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 OnFocusClientResponse) | 264 OnFocusClientResponse) |
265 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) | 265 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidSkipWaiting, OnDidSkipWaiting) |
266 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) | 266 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_DidClaimClients, OnDidClaimClients) |
267 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) | 267 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_ClaimClientsError, OnClaimClientsError) |
268 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing); | 268 IPC_MESSAGE_HANDLER(ServiceWorkerMsg_Ping, OnPing); |
269 IPC_MESSAGE_UNHANDLED(handled = false) | 269 IPC_MESSAGE_UNHANDLED(handled = false) |
270 IPC_END_MESSAGE_MAP() | 270 IPC_END_MESSAGE_MAP() |
271 DCHECK(handled); | 271 DCHECK(handled); |
272 } | 272 } |
273 | 273 |
| 274 void ServiceWorkerContextClient::BindServiceRegistry( |
| 275 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 276 mojo::ServiceProviderPtr exposed_services) { |
| 277 service_registry_.Bind(services.Pass()); |
| 278 service_registry_.BindRemoteServiceProvider(exposed_services.Pass()); |
| 279 } |
| 280 |
274 blink::WebURL ServiceWorkerContextClient::scope() const { | 281 blink::WebURL ServiceWorkerContextClient::scope() const { |
275 return service_worker_scope_; | 282 return service_worker_scope_; |
276 } | 283 } |
277 | 284 |
278 void ServiceWorkerContextClient::getClients( | 285 void ServiceWorkerContextClient::getClients( |
279 const blink::WebServiceWorkerClientQueryOptions& weboptions, | 286 const blink::WebServiceWorkerClientQueryOptions& weboptions, |
280 blink::WebServiceWorkerClientsCallbacks* callbacks) { | 287 blink::WebServiceWorkerClientsCallbacks* callbacks) { |
281 DCHECK(callbacks); | 288 DCHECK(callbacks); |
282 int request_id = context_->clients_callbacks.Add(callbacks); | 289 int request_id = context_->clients_callbacks.Add(callbacks); |
283 ServiceWorkerClientQueryOptions options; | 290 ServiceWorkerClientQueryOptions options; |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 } | 935 } |
929 | 936 |
930 base::WeakPtr<ServiceWorkerContextClient> | 937 base::WeakPtr<ServiceWorkerContextClient> |
931 ServiceWorkerContextClient::GetWeakPtr() { | 938 ServiceWorkerContextClient::GetWeakPtr() { |
932 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 939 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
933 DCHECK(context_); | 940 DCHECK(context_); |
934 return context_->weak_factory.GetWeakPtr(); | 941 return context_->weak_factory.GetWeakPtr(); |
935 } | 942 } |
936 | 943 |
937 } // namespace content | 944 } // namespace content |
OLD | NEW |