| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::OpenWindow( |
| 635 const blink::WebURL& redirect_url, |
| 635 const blink::WebURL& url, | 636 const blink::WebURL& url, |
| 636 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { | 637 std::unique_ptr<blink::WebServiceWorkerClientCallbacks> callbacks) { |
| 637 DCHECK(callbacks); | 638 DCHECK(callbacks); |
| 638 int request_id = context_->client_callbacks.Add(std::move(callbacks)); | 639 int request_id = context_->client_callbacks.Add(std::move(callbacks)); |
| 639 Send(new ServiceWorkerHostMsg_OpenWindow( | 640 Send(new ServiceWorkerHostMsg_OpenWindow(GetRoutingID(), request_id, |
| 640 GetRoutingID(), request_id, url)); | 641 redirect_url, url)); |
| 641 } | 642 } |
| 642 | 643 |
| 643 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url, | 644 void ServiceWorkerContextClient::SetCachedMetadata(const blink::WebURL& url, |
| 644 const char* data, | 645 const char* data, |
| 645 size_t size) { | 646 size_t size) { |
| 646 std::vector<char> copy(data, data + size); | 647 std::vector<char> copy(data, data + size); |
| 647 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy)); | 648 Send(new ServiceWorkerHostMsg_SetCachedMetadata(GetRoutingID(), url, copy)); |
| 648 } | 649 } |
| 649 | 650 |
| 650 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) { | 651 void ServiceWorkerContextClient::ClearCachedMetadata(const blink::WebURL& url) { |
| (...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 } | 1689 } |
| 1689 | 1690 |
| 1690 base::WeakPtr<ServiceWorkerContextClient> | 1691 base::WeakPtr<ServiceWorkerContextClient> |
| 1691 ServiceWorkerContextClient::GetWeakPtr() { | 1692 ServiceWorkerContextClient::GetWeakPtr() { |
| 1692 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence()); | 1693 DCHECK(worker_task_runner_->RunsTasksInCurrentSequence()); |
| 1693 DCHECK(context_); | 1694 DCHECK(context_); |
| 1694 return context_->weak_factory.GetWeakPtr(); | 1695 return context_->weak_factory.GetWeakPtr(); |
| 1695 } | 1696 } |
| 1696 | 1697 |
| 1697 } // namespace content | 1698 } // namespace content |
| OLD | NEW |