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

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

Issue 1893313007: DevTools: Attach all Service Workers except for old redundant ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated pfeldman's comment Created 4 years, 8 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/embedded_worker_instance.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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 DidSkipWaiting(request_id); 341 DidSkipWaiting(request_id);
342 pending_skip_waiting_requests_.clear(); 342 pending_skip_waiting_requests_.clear();
343 } 343 }
344 344
345 std::vector<base::Closure> callbacks; 345 std::vector<base::Closure> callbacks;
346 callbacks.swap(status_change_callbacks_); 346 callbacks.swap(status_change_callbacks_);
347 for (const auto& callback : callbacks) 347 for (const auto& callback : callbacks)
348 callback.Run(); 348 callback.Run();
349 349
350 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this)); 350 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this));
351
352 if (status == INSTALLED)
353 embedded_worker_->OnWorkerVersionInstalled();
354 else if (status == REDUNDANT)
355 embedded_worker_->OnWorkerVersionDoomed();
351 } 356 }
352 357
353 void ServiceWorkerVersion::RegisterStatusChangeCallback( 358 void ServiceWorkerVersion::RegisterStatusChangeCallback(
354 const base::Closure& callback) { 359 const base::Closure& callback) {
355 status_change_callbacks_.push_back(callback); 360 status_change_callbacks_.push_back(callback);
356 } 361 }
357 362
358 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { 363 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() {
359 DCHECK_CURRENTLY_ON(BrowserThread::IO); 364 DCHECK_CURRENTLY_ON(BrowserThread::IO);
360 ServiceWorkerVersionInfo info( 365 ServiceWorkerVersionInfo info(
(...skipping 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1687 void ServiceWorkerVersion::OnBeginEvent() { 1692 void ServiceWorkerVersion::OnBeginEvent() {
1688 if (should_exclude_from_uma_ || running_status() != RUNNING || 1693 if (should_exclude_from_uma_ || running_status() != RUNNING ||
1689 idle_time_.is_null()) { 1694 idle_time_.is_null()) {
1690 return; 1695 return;
1691 } 1696 }
1692 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() - 1697 ServiceWorkerMetrics::RecordTimeBetweenEvents(base::TimeTicks::Now() -
1693 idle_time_); 1698 idle_time_);
1694 } 1699 }
1695 1700
1696 } // namespace content 1701 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/embedded_worker_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698