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::didPauseAfterDownload() { | 285 void ServiceWorkerContextClient::didPauseAfterDownload() { |
279 Send(new EmbeddedWorkerHostMsg_DidPauseAfterDownload(embedded_worker_id_)); | 286 Send(new EmbeddedWorkerHostMsg_DidPauseAfterDownload(embedded_worker_id_)); |
280 } | 287 } |
281 | 288 |
282 void ServiceWorkerContextClient::getClients( | 289 void ServiceWorkerContextClient::getClients( |
283 const blink::WebServiceWorkerClientQueryOptions& weboptions, | 290 const blink::WebServiceWorkerClientQueryOptions& weboptions, |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 } | 978 } |
972 | 979 |
973 base::WeakPtr<ServiceWorkerContextClient> | 980 base::WeakPtr<ServiceWorkerContextClient> |
974 ServiceWorkerContextClient::GetWeakPtr() { | 981 ServiceWorkerContextClient::GetWeakPtr() { |
975 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 982 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
976 DCHECK(context_); | 983 DCHECK(context_); |
977 return context_->weak_factory.GetWeakPtr(); | 984 return context_->weak_factory.GetWeakPtr(); |
978 } | 985 } |
979 | 986 |
980 } // namespace content | 987 } // namespace content |
OLD | NEW |