Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: content/browser/service_worker/service_worker_version.cc

Issue 1342733002: ServiceWorker: log when the script's loaded separately from thread start (chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/common/service_worker/embedded_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698