| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 } | 648 } |
| 649 | 649 |
| 650 void ServiceWorkerContextClient::claim( | 650 void ServiceWorkerContextClient::claim( |
| 651 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { | 651 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { |
| 652 DCHECK(callbacks); | 652 DCHECK(callbacks); |
| 653 int request_id = context_->claim_clients_callbacks.Add(callbacks); | 653 int request_id = context_->claim_clients_callbacks.Add(callbacks); |
| 654 Send(new ServiceWorkerHostMsg_ClaimClients(GetRoutingID(), request_id)); | 654 Send(new ServiceWorkerHostMsg_ClaimClients(GetRoutingID(), request_id)); |
| 655 } | 655 } |
| 656 | 656 |
| 657 void ServiceWorkerContextClient::registerForeignFetchScopes( | 657 void ServiceWorkerContextClient::registerForeignFetchScopes( |
| 658 const blink::WebVector<blink::WebURL>& sub_scopes) { | 658 const blink::WebVector<blink::WebURL>& sub_scopes, |
| 659 const blink::WebVector<blink::WebURL>& origins) { |
| 659 Send(new ServiceWorkerHostMsg_RegisterForeignFetchScopes( | 660 Send(new ServiceWorkerHostMsg_RegisterForeignFetchScopes( |
| 660 GetRoutingID(), std::vector<GURL>(sub_scopes.begin(), sub_scopes.end()))); | 661 GetRoutingID(), std::vector<GURL>(sub_scopes.begin(), sub_scopes.end()), |
| 662 std::vector<GURL>(origins.begin(), origins.end()))); |
| 661 } | 663 } |
| 662 | 664 |
| 663 void ServiceWorkerContextClient::DispatchSyncEvent( | 665 void ServiceWorkerContextClient::DispatchSyncEvent( |
| 664 const blink::WebSyncRegistration& registration, | 666 const blink::WebSyncRegistration& registration, |
| 665 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance, | 667 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance, |
| 666 const SyncCallback& callback) { | 668 const SyncCallback& callback) { |
| 667 TRACE_EVENT0("ServiceWorker", | 669 TRACE_EVENT0("ServiceWorker", |
| 668 "ServiceWorkerContextClient::DispatchSyncEvent"); | 670 "ServiceWorkerContextClient::DispatchSyncEvent"); |
| 669 int request_id = | 671 int request_id = |
| 670 context_->sync_event_callbacks.Add(new SyncCallback(callback)); | 672 context_->sync_event_callbacks.Add(new SyncCallback(callback)); |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 995 } | 997 } |
| 996 | 998 |
| 997 base::WeakPtr<ServiceWorkerContextClient> | 999 base::WeakPtr<ServiceWorkerContextClient> |
| 998 ServiceWorkerContextClient::GetWeakPtr() { | 1000 ServiceWorkerContextClient::GetWeakPtr() { |
| 999 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1001 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1000 DCHECK(context_); | 1002 DCHECK(context_); |
| 1001 return context_->weak_factory.GetWeakPtr(); | 1003 return context_->weak_factory.GetWeakPtr(); |
| 1002 } | 1004 } |
| 1003 | 1005 |
| 1004 } // namespace content | 1006 } // namespace content |
| OLD | NEW |