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

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

Issue 1928443003: service worker: Update job gets the script url when the job starts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 7 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
« no previous file with comments | « content/browser/service_worker/service_worker_register_job.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <map> 10 #include <map>
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 scope_(registration->pattern()), 298 scope_(registration->pattern()),
299 context_(context), 299 context_(context),
300 script_cache_map_(this, context), 300 script_cache_map_(this, context),
301 ping_controller_(new PingController(this)), 301 ping_controller_(new PingController(this)),
302 should_exclude_from_uma_( 302 should_exclude_from_uma_(
303 ServiceWorkerMetrics::ShouldExcludeURLFromHistogram(scope_)), 303 ServiceWorkerMetrics::ShouldExcludeURLFromHistogram(scope_)),
304 weak_factory_(this) { 304 weak_factory_(this) {
305 DCHECK_NE(kInvalidServiceWorkerVersionId, version_id); 305 DCHECK_NE(kInvalidServiceWorkerVersionId, version_id);
306 DCHECK(context_); 306 DCHECK(context_);
307 DCHECK(registration); 307 DCHECK(registration);
308 DCHECK(script_url_.is_valid());
308 context_->AddLiveVersion(this); 309 context_->AddLiveVersion(this);
309 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker(); 310 embedded_worker_ = context_->embedded_worker_registry()->CreateWorker();
310 embedded_worker_->AddListener(this); 311 embedded_worker_->AddListener(this);
311 } 312 }
312 313
313 ServiceWorkerVersion::~ServiceWorkerVersion() { 314 ServiceWorkerVersion::~ServiceWorkerVersion() {
314 in_dtor_ = true; 315 in_dtor_ = true;
315 316
316 // Record UMA if the worker was trying to start. One way we get here is if the 317 // Record UMA if the worker was trying to start. One way we get here is if the
317 // user closed the tab before the SW could start up. 318 // user closed the tab before the SW could start up.
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1692 void ServiceWorkerVersion::OnBeginEvent() { 1693 void ServiceWorkerVersion::OnBeginEvent() {
1693 if (should_exclude_from_uma_ || running_status() != RUNNING || 1694 if (should_exclude_from_uma_ || running_status() != RUNNING ||
1694 idle_time_.is_null()) { 1695 idle_time_.is_null()) {
1695 return; 1696 return;
1696 } 1697 }
1697 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - 1698 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() -
1698 idle_time_); 1699 idle_time_);
1699 } 1700 }
1700 1701
1701 } // namespace content 1702 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_register_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698