| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_script_context.h" | 5 #include "content/renderer/service_worker/service_worker_script_context.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 void ServiceWorkerScriptContext::OnSyncEvent(int request_id) { | 360 void ServiceWorkerScriptContext::OnSyncEvent(int request_id) { |
| 361 TRACE_EVENT0("ServiceWorker", | 361 TRACE_EVENT0("ServiceWorker", |
| 362 "ServiceWorkerScriptContext::OnSyncEvent"); | 362 "ServiceWorkerScriptContext::OnSyncEvent"); |
| 363 proxy_->dispatchSyncEvent(request_id); | 363 proxy_->dispatchSyncEvent(request_id); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void ServiceWorkerScriptContext::OnNotificationClickEvent( | 366 void ServiceWorkerScriptContext::OnNotificationClickEvent( |
| 367 int request_id, | 367 int request_id, |
| 368 const std::string& notification_id, | 368 int64_t persistent_notification_id, |
| 369 const PlatformNotificationData& notification_data) { | 369 const PlatformNotificationData& notification_data) { |
| 370 TRACE_EVENT0("ServiceWorker", | 370 TRACE_EVENT0("ServiceWorker", |
| 371 "ServiceWorkerScriptContext::OnNotificationClickEvent"); | 371 "ServiceWorkerScriptContext::OnNotificationClickEvent"); |
| 372 notification_click_start_timings_[request_id] = base::TimeTicks::Now(); | 372 notification_click_start_timings_[request_id] = base::TimeTicks::Now(); |
| 373 proxy_->dispatchNotificationClickEvent( | 373 proxy_->dispatchNotificationClickEvent( |
| 374 request_id, | 374 request_id, |
| 375 blink::WebString::fromUTF8(notification_id), | 375 persistent_notification_id, |
| 376 ToWebNotificationData(notification_data)); | 376 ToWebNotificationData(notification_data)); |
| 377 } | 377 } |
| 378 | 378 |
| 379 void ServiceWorkerScriptContext::OnPushEvent(int request_id, | 379 void ServiceWorkerScriptContext::OnPushEvent(int request_id, |
| 380 const std::string& data) { | 380 const std::string& data) { |
| 381 TRACE_EVENT0("ServiceWorker", | 381 TRACE_EVENT0("ServiceWorker", |
| 382 "ServiceWorkerScriptContext::OnPushEvent"); | 382 "ServiceWorkerScriptContext::OnPushEvent"); |
| 383 push_start_timings_[request_id] = base::TimeTicks::Now(); | 383 push_start_timings_[request_id] = base::TimeTicks::Now(); |
| 384 proxy_->dispatchPushEvent(request_id, blink::WebString::fromUTF8(data)); | 384 proxy_->dispatchPushEvent(request_id, blink::WebString::fromUTF8(data)); |
| 385 } | 385 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 new blink::WebServiceWorkerError(error_type, message)); | 578 new blink::WebServiceWorkerError(error_type, message)); |
| 579 callbacks->onError(error.release()); | 579 callbacks->onError(error.release()); |
| 580 pending_claim_clients_callbacks_.Remove(request_id); | 580 pending_claim_clients_callbacks_.Remove(request_id); |
| 581 } | 581 } |
| 582 | 582 |
| 583 void ServiceWorkerScriptContext::OnPing() { | 583 void ServiceWorkerScriptContext::OnPing() { |
| 584 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); | 584 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); |
| 585 } | 585 } |
| 586 | 586 |
| 587 } // namespace content | 587 } // namespace content |
| OLD | NEW |