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 <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 std::unique_ptr<blink::WebServiceWorkerClientsCallbacks> callbacks) { | 624 std::unique_ptr<blink::WebServiceWorkerClientsCallbacks> callbacks) { |
625 DCHECK(callbacks); | 625 DCHECK(callbacks); |
626 int request_id = context_->clients_callbacks.Add(std::move(callbacks)); | 626 int request_id = context_->clients_callbacks.Add(std::move(callbacks)); |
627 ServiceWorkerClientQueryOptions options; | 627 ServiceWorkerClientQueryOptions options; |
628 options.client_type = weboptions.client_type; | 628 options.client_type = weboptions.client_type; |
629 options.include_uncontrolled = weboptions.include_uncontrolled; | 629 options.include_uncontrolled = weboptions.include_uncontrolled; |
630 Send(new ServiceWorkerHostMsg_GetClients( | 630 Send(new ServiceWorkerHostMsg_GetClients( |
631 GetRoutingID(), request_id, options)); | 631 GetRoutingID(), request_id, options)); |
632 } | 632 } |
633 | 633 |
634 void ServiceWorkerContextClient::OpenWindow( | 634 void ServiceWorkerContextClient::OpenWindowForClients( |
635 const blink::WebURL& url, | 635 const blink::WebURL& url, |
636 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { | 636 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { |
637 DCHECK(callbacks); | 637 DCHECK(callbacks); |
638 int request_id = context_->client_callbacks.Add(std::move(callbacks)); | 638 int request_id = context_->client_callbacks.Add(std::move(callbacks)); |
639 Send(new ServiceWorkerHostMsg_OpenWindow( | 639 Send(new ServiceWorkerHostMsg_OpenNewTab(GetRoutingID(), request_id, url)); |
640 GetRoutingID(), request_id, url)); | 640 } |
| 641 |
| 642 void ServiceWorkerContextClient::OpenWindowForPaymentHandler( |
| 643 const blink::WebURL& url, |
| 644 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { |
| 645 DCHECK(callbacks); |
| 646 int request_id = context_->client_callbacks.Add(std::move(callbacks)); |
| 647 Send(new ServiceWorkerHostMsg_OpenNewPopup(GetRoutingID(), request_id, url)); |
641 } | 648 } |
642 | 649 |
643 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url, | 650 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url, |
644 const char* data, | 651 const char* data, |
645 size_t size) { | 652 size_t size) { |
646 std::vector<char> copy(data, data + size); | 653 std::vector<char> copy(data, data + size); |
647 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy)); | 654 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy)); |
648 } | 655 } |
649 | 656 |
650 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) { | 657 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) { |
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1689 } | 1696 } |
1690 | 1697 |
1691 base::WeakPtr<ServiceWorkerContextClient> | 1698 base::WeakPtr<ServiceWorkerContextClient> |
1692 ServiceWorkerContextClient::GetWeakPtr() { | 1699 ServiceWorkerContextClient::GetWeakPtr() { |
1693 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence()); | 1700 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence()); |
1694 DCHECK(context_); | 1701 DCHECK(context_); |
1695 return context_->weak_factory.GetWeakPtr(); | 1702 return context_->weak_factory.GetWeakPtr(); |
1696 } | 1703 } |
1697 | 1704 |
1698 } // namespace content | 1705 } // namespace content |
OLD | NEW |