Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 2893823004: [Payments] Implement openWindow for service worker based payment handler (Closed)
Patch Set: address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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_OpenWindowForClients(GetRoutingID(), request_id,
640 GetRoutingID(), request_id, url)); 640 url));
641 }
642
643 void ServiceWorkerContextClient::OpenWindowForPaymentHandler(
644 const blink::WebURL& url,
645 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) {
646 DCHECK(callbacks);
647 int request_id = context_->client_callbacks.Add(std::move(callbacks));
648 Send(new ServiceWorkerHostMsg_OpenWindowForPaymentHandler(GetRoutingID(),
649 request_id, url));
641 } 650 }
642 651
643 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url, 652 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url,
644 const char* data, 653 const char* data,
645 size_t size) { 654 size_t size) {
646 std::vector<char> copy(data, data + size); 655 std::vector<char> copy(data, data + size);
647 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy)); 656 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy));
648 } 657 }
649 658
650 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) { 659 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) {
(...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 } 1698 }
1690 1699
1691 base::WeakPtr<ServiceWorkerContextClient> 1700 base::WeakPtr<ServiceWorkerContextClient>
1692 ServiceWorkerContextClient::GetWeakPtr() { 1701 ServiceWorkerContextClient::GetWeakPtr() {
1693 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence()); 1702 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence());
1694 DCHECK(context_); 1703 DCHECK(context_);
1695 return context_->weak_factory.GetWeakPtr(); 1704 return context_->weak_factory.GetWeakPtr();
1696 } 1705 }
1697 1706
1698 } // namespace content 1707 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698