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

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

Issue 304543002: Show the unregistered workers in chrome://serviceworker-internals and chrome://inspect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass live_registrations to chrome://inspect. Created 6 years, 6 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "content/browser/service_worker/embedded_worker_instance.h" 10 #include "content/browser/service_worker/embedded_worker_instance.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this)); 132 FOR_EACH_OBSERVER(Listener, listeners_, OnVersionStateChanged(this));
133 } 133 }
134 134
135 void ServiceWorkerVersion::RegisterStatusChangeCallback( 135 void ServiceWorkerVersion::RegisterStatusChangeCallback(
136 const base::Closure& callback) { 136 const base::Closure& callback) {
137 status_change_callbacks_.push_back(callback); 137 status_change_callbacks_.push_back(callback);
138 } 138 }
139 139
140 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() { 140 ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() {
141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
142 return ServiceWorkerVersionInfo(running_status(), 142 return ServiceWorkerVersionInfo(
143 status(), 143 running_status(),
144 version_id(), 144 status(),
145 embedded_worker()->process_id(), 145 version_id(),
146 embedded_worker()->thread_id()); 146 embedded_worker()->process_id(),
147 embedded_worker()->thread_id(),
148 embedded_worker()->worker_devtools_agent_route_id());
147 } 149 }
148 150
149 void ServiceWorkerVersion::StartWorker(const StatusCallback& callback) { 151 void ServiceWorkerVersion::StartWorker(const StatusCallback& callback) {
150 StartWorkerWithCandidateProcesses(std::vector<int>(), callback); 152 StartWorkerWithCandidateProcesses(std::vector<int>(), callback);
151 } 153 }
152 154
153 void ServiceWorkerVersion::StartWorkerWithCandidateProcesses( 155 void ServiceWorkerVersion::StartWorkerWithCandidateProcesses(
154 const std::vector<int>& possible_process_ids, 156 const std::vector<int>& possible_process_ids,
155 const StatusCallback& callback) { 157 const StatusCallback& callback) {
156 switch (running_status()) { 158 switch (running_status()) {
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 return; 581 return;
580 } 582 }
581 stop_worker_timer_.Start( 583 stop_worker_timer_.Start(
582 FROM_HERE, base::TimeDelta::FromSeconds(kStopWorkerDelay), 584 FROM_HERE, base::TimeDelta::FromSeconds(kStopWorkerDelay),
583 base::Bind(&ServiceWorkerVersion::StopWorker, 585 base::Bind(&ServiceWorkerVersion::StopWorker,
584 weak_factory_.GetWeakPtr(), 586 weak_factory_.GetWeakPtr(),
585 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback))); 587 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)));
586 } 588 }
587 589
588 } // namespace content 590 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698