| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 UMA_HISTOGRAM_MEDIUM_TIMES( | 211 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 212 "ServiceWorker.PushEvent.Time", | 212 "ServiceWorker.PushEvent.Time", |
| 213 base::TimeTicks::Now() - push_start_timings_[request_id]); | 213 base::TimeTicks::Now() - push_start_timings_[request_id]); |
| 214 } | 214 } |
| 215 push_start_timings_.erase(request_id); | 215 push_start_timings_.erase(request_id); |
| 216 | 216 |
| 217 Send(new ServiceWorkerHostMsg_PushEventFinished( | 217 Send(new ServiceWorkerHostMsg_PushEventFinished( |
| 218 GetRoutingID(), request_id, result)); | 218 GetRoutingID(), request_id, result)); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void ServiceWorkerScriptContext::DidHandleSyncEvent(int request_id) { | 221 void ServiceWorkerScriptContext::DidHandleSyncEvent( |
| 222 Send(new ServiceWorkerHostMsg_SyncEventFinished( | 222 int request_id, |
| 223 GetRoutingID(), request_id)); | 223 blink::WebServiceWorkerEventResult result) { |
| 224 Send(new ServiceWorkerHostMsg_SyncEventFinished(GetRoutingID(), request_id, |
| 225 result)); |
| 224 } | 226 } |
| 225 | 227 |
| 226 void ServiceWorkerScriptContext::DidHandleCrossOriginConnectEvent( | 228 void ServiceWorkerScriptContext::DidHandleCrossOriginConnectEvent( |
| 227 int request_id, | 229 int request_id, |
| 228 bool accept_connection) { | 230 bool accept_connection) { |
| 229 Send(new ServiceWorkerHostMsg_CrossOriginConnectEventFinished( | 231 Send(new ServiceWorkerHostMsg_CrossOriginConnectEventFinished( |
| 230 GetRoutingID(), request_id, accept_connection)); | 232 GetRoutingID(), request_id, accept_connection)); |
| 231 } | 233 } |
| 232 | 234 |
| 233 void ServiceWorkerScriptContext::GetClients( | 235 void ServiceWorkerScriptContext::GetClients( |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 new blink::WebServiceWorkerError(error_type, message)); | 622 new blink::WebServiceWorkerError(error_type, message)); |
| 621 callbacks->onError(error.release()); | 623 callbacks->onError(error.release()); |
| 622 pending_claim_clients_callbacks_.Remove(request_id); | 624 pending_claim_clients_callbacks_.Remove(request_id); |
| 623 } | 625 } |
| 624 | 626 |
| 625 void ServiceWorkerScriptContext::OnPing() { | 627 void ServiceWorkerScriptContext::OnPing() { |
| 626 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); | 628 Send(new ServiceWorkerHostMsg_Pong(GetRoutingID())); |
| 627 } | 629 } |
| 628 | 630 |
| 629 } // namespace content | 631 } // namespace content |
| OLD | NEW |