| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 proxy_->dispatchForeignFetchEvent(response_id, event_finish_id, webRequest); | 907 proxy_->dispatchForeignFetchEvent(response_id, event_finish_id, webRequest); |
| 908 } else { | 908 } else { |
| 909 proxy_->dispatchFetchEvent(response_id, event_finish_id, webRequest); | 909 proxy_->dispatchFetchEvent(response_id, event_finish_id, webRequest); |
| 910 } | 910 } |
| 911 } | 911 } |
| 912 | 912 |
| 913 void ServiceWorkerContextClient::OnNotificationClickEvent( | 913 void ServiceWorkerContextClient::OnNotificationClickEvent( |
| 914 int request_id, | 914 int request_id, |
| 915 const std::string& notification_id, | 915 const std::string& notification_id, |
| 916 const PlatformNotificationData& notification_data, | 916 const PlatformNotificationData& notification_data, |
| 917 int action_index) { | 917 int action_index, |
| 918 const base::NullableString16& reply) { |
| 918 TRACE_EVENT0("ServiceWorker", | 919 TRACE_EVENT0("ServiceWorker", |
| 919 "ServiceWorkerContextClient::OnNotificationClickEvent"); | 920 "ServiceWorkerContextClient::OnNotificationClickEvent"); |
| 920 proxy_->dispatchNotificationClickEvent( | 921 proxy_->dispatchNotificationClickEvent( |
| 921 request_id, blink::WebString::fromUTF8(notification_id), | 922 request_id, blink::WebString::fromUTF8(notification_id), |
| 922 ToWebNotificationData(notification_data), action_index); | 923 ToWebNotificationData(notification_data), action_index, |
| 924 blink::WebString(reply)); |
| 923 } | 925 } |
| 924 | 926 |
| 925 void ServiceWorkerContextClient::OnNotificationCloseEvent( | 927 void ServiceWorkerContextClient::OnNotificationCloseEvent( |
| 926 int request_id, | 928 int request_id, |
| 927 const std::string& notification_id, | 929 const std::string& notification_id, |
| 928 const PlatformNotificationData& notification_data) { | 930 const PlatformNotificationData& notification_data) { |
| 929 TRACE_EVENT0("ServiceWorker", | 931 TRACE_EVENT0("ServiceWorker", |
| 930 "ServiceWorkerContextClient::OnNotificationCloseEvent"); | 932 "ServiceWorkerContextClient::OnNotificationCloseEvent"); |
| 931 proxy_->dispatchNotificationCloseEvent( | 933 proxy_->dispatchNotificationCloseEvent( |
| 932 request_id, blink::WebString::fromUTF8(notification_id), | 934 request_id, blink::WebString::fromUTF8(notification_id), |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 } | 1134 } |
| 1133 | 1135 |
| 1134 base::WeakPtr<ServiceWorkerContextClient> | 1136 base::WeakPtr<ServiceWorkerContextClient> |
| 1135 ServiceWorkerContextClient::GetWeakPtr() { | 1137 ServiceWorkerContextClient::GetWeakPtr() { |
| 1136 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1138 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1137 DCHECK(context_); | 1139 DCHECK(context_); |
| 1138 return context_->weak_factory.GetWeakPtr(); | 1140 return context_->weak_factory.GetWeakPtr(); |
| 1139 } | 1141 } |
| 1140 | 1142 |
| 1141 } // namespace content | 1143 } // namespace content |
| OLD | NEW |