| 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 657 } |
| 658 | 658 |
| 659 void ServiceWorkerContextClient::claim( | 659 void ServiceWorkerContextClient::claim( |
| 660 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { | 660 blink::WebServiceWorkerClientsClaimCallbacks* callbacks) { |
| 661 DCHECK(callbacks); | 661 DCHECK(callbacks); |
| 662 int request_id = context_->claim_clients_callbacks.Add(callbacks); | 662 int request_id = context_->claim_clients_callbacks.Add(callbacks); |
| 663 Send(new ServiceWorkerHostMsg_ClaimClients(GetRoutingID(), request_id)); | 663 Send(new ServiceWorkerHostMsg_ClaimClients(GetRoutingID(), request_id)); |
| 664 } | 664 } |
| 665 | 665 |
| 666 void ServiceWorkerContextClient::registerForeignFetchScopes( | 666 void ServiceWorkerContextClient::registerForeignFetchScopes( |
| 667 const blink::WebVector<blink::WebURL>& sub_scopes) { | 667 const blink::WebVector<blink::WebURL>& sub_scopes, |
| 668 const blink::WebVector<blink::WebURL>& origins) { |
| 668 Send(new ServiceWorkerHostMsg_RegisterForeignFetchScopes( | 669 Send(new ServiceWorkerHostMsg_RegisterForeignFetchScopes( |
| 669 GetRoutingID(), std::vector<GURL>(sub_scopes.begin(), sub_scopes.end()))); | 670 GetRoutingID(), std::vector<GURL>(sub_scopes.begin(), sub_scopes.end()), |
| 671 std::vector<GURL>(origins.begin(), origins.end()))); |
| 670 } | 672 } |
| 671 | 673 |
| 672 void ServiceWorkerContextClient::DispatchSyncEvent( | 674 void ServiceWorkerContextClient::DispatchSyncEvent( |
| 673 const blink::WebSyncRegistration& registration, | 675 const blink::WebSyncRegistration& registration, |
| 674 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance, | 676 blink::WebServiceWorkerContextProxy::LastChanceOption last_chance, |
| 675 const SyncCallback& callback) { | 677 const SyncCallback& callback) { |
| 676 TRACE_EVENT0("ServiceWorker", | 678 TRACE_EVENT0("ServiceWorker", |
| 677 "ServiceWorkerContextClient::DispatchSyncEvent"); | 679 "ServiceWorkerContextClient::DispatchSyncEvent"); |
| 678 int request_id = | 680 int request_id = |
| 679 context_->sync_event_callbacks.Add(new SyncCallback(callback)); | 681 context_->sync_event_callbacks.Add(new SyncCallback(callback)); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 } | 1019 } |
| 1018 | 1020 |
| 1019 base::WeakPtr<ServiceWorkerContextClient> | 1021 base::WeakPtr<ServiceWorkerContextClient> |
| 1020 ServiceWorkerContextClient::GetWeakPtr() { | 1022 ServiceWorkerContextClient::GetWeakPtr() { |
| 1021 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1023 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1022 DCHECK(context_); | 1024 DCHECK(context_); |
| 1023 return context_->weak_factory.GetWeakPtr(); | 1025 return context_->weak_factory.GetWeakPtr(); |
| 1024 } | 1026 } |
| 1025 | 1027 |
| 1026 } // namespace content | 1028 } // namespace content |
| OLD | NEW |