Chromium Code Reviews| 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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 webRequest.setRequestContext( | 706 webRequest.setRequestContext( |
| 707 GetBlinkRequestContext(request.request_context_type)); | 707 GetBlinkRequestContext(request.request_context_type)); |
| 708 webRequest.setFrameType(GetBlinkFrameType(request.frame_type)); | 708 webRequest.setFrameType(GetBlinkFrameType(request.frame_type)); |
| 709 webRequest.setIsReload(request.is_reload); | 709 webRequest.setIsReload(request.is_reload); |
| 710 proxy_->dispatchFetchEvent(request_id, webRequest); | 710 proxy_->dispatchFetchEvent(request_id, webRequest); |
| 711 } | 711 } |
| 712 | 712 |
| 713 void ServiceWorkerContextClient::OnNotificationClickEvent( | 713 void ServiceWorkerContextClient::OnNotificationClickEvent( |
| 714 int request_id, | 714 int request_id, |
| 715 int64_t persistent_notification_id, | 715 int64_t persistent_notification_id, |
| 716 const PlatformNotificationData& notification_data) { | 716 const PlatformNotificationData& notification_data, |
| 717 int action_index) { | |
| 717 TRACE_EVENT0("ServiceWorker", | 718 TRACE_EVENT0("ServiceWorker", |
| 718 "ServiceWorkerContextClient::OnNotificationClickEvent"); | 719 "ServiceWorkerContextClient::OnNotificationClickEvent"); |
| 719 proxy_->dispatchNotificationClickEvent( | 720 proxy_->dispatchNotificationClickEvent( |
| 720 request_id, | 721 request_id, |
| 721 persistent_notification_id, | 722 persistent_notification_id, |
| 722 ToWebNotificationData(notification_data)); | 723 ToWebNotificationData(notification_data), |
| 724 action_index); | |
|
Peter Beverloo
2015/08/04 21:11:09
Doesn't "git cl format" complain about this? IIRC
johnme
2015/08/05 12:05:36
Nope. Not sure what you mean by "this" either; if
| |
| 723 } | 725 } |
| 724 | 726 |
| 725 void ServiceWorkerContextClient::OnPushEvent(int request_id, | 727 void ServiceWorkerContextClient::OnPushEvent(int request_id, |
| 726 const std::string& data) { | 728 const std::string& data) { |
| 727 TRACE_EVENT0("ServiceWorker", | 729 TRACE_EVENT0("ServiceWorker", |
| 728 "ServiceWorkerContextClient::OnPushEvent"); | 730 "ServiceWorkerContextClient::OnPushEvent"); |
| 729 proxy_->dispatchPushEvent(request_id, blink::WebString::fromUTF8(data)); | 731 proxy_->dispatchPushEvent(request_id, blink::WebString::fromUTF8(data)); |
| 730 } | 732 } |
| 731 | 733 |
| 732 void ServiceWorkerContextClient::OnGeofencingEvent( | 734 void ServiceWorkerContextClient::OnGeofencingEvent( |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 } | 960 } |
| 959 | 961 |
| 960 base::WeakPtr<ServiceWorkerContextClient> | 962 base::WeakPtr<ServiceWorkerContextClient> |
| 961 ServiceWorkerContextClient::GetWeakPtr() { | 963 ServiceWorkerContextClient::GetWeakPtr() { |
| 962 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 964 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 963 DCHECK(context_); | 965 DCHECK(context_); |
| 964 return context_->weak_factory.GetWeakPtr(); | 966 return context_->weak_factory.GetWeakPtr(); |
| 965 } | 967 } |
| 966 | 968 |
| 967 } // namespace content | 969 } // namespace content |
| OLD | NEW |