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

Unified Diff: content/browser/service_worker/service_worker_version.cc

Issue 995713002: Service Worker: Don't record StartWorker metrics for a doomed worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@coalesce_more
Patch Set: format Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.cc
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc
index 51eb072ff933c4a2b34dc3f24aaed5d8c7fdee91..e2f13126ac1bc1c24fb039c410e5122693b58c53 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -1540,14 +1540,21 @@ bool ServiceWorkerVersion::HasInflightRequests() const {
void ServiceWorkerVersion::RecordStartWorkerResult(
ServiceWorkerStatusCode status) {
+ base::TimeTicks start_time = start_time_;
+ ClearTick(&start_time_);
+
+ // Failing to start a doomed worker isn't interesting and very common when
+ // update dooms because the script is byte-to-byte identical.
+ if (is_doomed_)
+ return;
+
UMA_HISTOGRAM_ENUMERATION("ServiceWorker.StartWorker.Status", status,
SERVICE_WORKER_ERROR_MAX_VALUE);
- if (status == SERVICE_WORKER_OK && !start_time_.is_null()) {
+ if (status == SERVICE_WORKER_OK && !start_time.is_null()) {
UMA_HISTOGRAM_MEDIUM_TIMES("ServiceWorker.StartWorker.Time",
- GetTickDuration(start_time_));
+ GetTickDuration(start_time));
}
- ClearTick(&start_time_);
if (status != SERVICE_WORKER_ERROR_TIMEOUT)
return;
EmbeddedWorkerInstance::StartingPhase phase =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698