OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/service_worker/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 ServiceWorkerVersion::PendingRequest<CallbackType>::PendingRequest( | 1151 ServiceWorkerVersion::PendingRequest<CallbackType>::PendingRequest( |
1152 const CallbackType& callback, | 1152 const CallbackType& callback, |
1153 const base::TimeTicks& time) | 1153 const base::TimeTicks& time) |
1154 : callback(callback), start_time(time) { | 1154 : callback(callback), start_time(time) { |
1155 } | 1155 } |
1156 | 1156 |
1157 template <typename CallbackType> | 1157 template <typename CallbackType> |
1158 ServiceWorkerVersion::PendingRequest<CallbackType>::~PendingRequest() { | 1158 ServiceWorkerVersion::PendingRequest<CallbackType>::~PendingRequest() { |
1159 } | 1159 } |
1160 | 1160 |
1161 void ServiceWorkerVersion::OnScriptLoaded() { | 1161 void ServiceWorkerVersion::OnThreadStarted() { |
1162 if (running_status() == STOPPING) | 1162 if (running_status() == STOPPING) |
1163 return; | 1163 return; |
1164 DCHECK_EQ(STARTING, running_status()); | 1164 DCHECK_EQ(STARTING, running_status()); |
1165 // Activate ping/pong now that JavaScript execution will start. | 1165 // Activate ping/pong now that JavaScript execution will start. |
1166 ping_controller_->Activate(); | 1166 ping_controller_->Activate(); |
1167 } | 1167 } |
1168 | 1168 |
1169 void ServiceWorkerVersion::OnStarting() { | 1169 void ServiceWorkerVersion::OnStarting() { |
1170 FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this)); | 1170 FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this)); |
1171 } | 1171 } |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 void ServiceWorkerVersion::OnBeginEvent() { | 2354 void ServiceWorkerVersion::OnBeginEvent() { |
2355 if (should_exclude_from_uma_ || running_status() != RUNNING || | 2355 if (should_exclude_from_uma_ || running_status() != RUNNING || |
2356 idle_time_.is_null()) { | 2356 idle_time_.is_null()) { |
2357 return; | 2357 return; |
2358 } | 2358 } |
2359 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - | 2359 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - |
2360 idle_time_); | 2360 idle_time_); |
2361 } | 2361 } |
2362 | 2362 |
2363 } // namespace content | 2363 } // namespace content |
OLD | NEW |