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

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

Issue 985663002: Implement ServiceWorkerRegistration related DevTools events [2/2 chromium] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override 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 | « content/browser/service_worker/service_worker_version.h ('k') | 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 7b2a5a285dd21690b647924769b76bac6551df47..53f05f35587fccc65f3b26b5fb4fadef4e6cd0c0 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -365,12 +365,8 @@ void ServiceWorkerVersion::RegisterStatusChangeCallback(
ServiceWorkerVersionInfo ServiceWorkerVersion::GetInfo() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
return ServiceWorkerVersionInfo(
- running_status(),
- status(),
- script_url(),
- version_id(),
- embedded_worker()->process_id(),
- embedded_worker()->thread_id(),
+ running_status(), status(), script_url(), registration_id(), version_id(),
+ embedded_worker()->process_id(), embedded_worker()->thread_id(),
embedded_worker()->worker_devtools_agent_route_id());
}
@@ -812,6 +808,10 @@ void ServiceWorkerVersion::OnScriptLoaded() {
ping_state_ = PINGING;
}
+void ServiceWorkerVersion::OnStarting() {
+ FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this));
+}
+
void ServiceWorkerVersion::OnStarted() {
DCHECK_EQ(RUNNING, running_status());
DCHECK(cache_listener_.get());
@@ -820,7 +820,11 @@ void ServiceWorkerVersion::OnStarted() {
// Fire all start callbacks.
scoped_refptr<ServiceWorkerVersion> protect(this);
RunCallbacks(this, &start_callbacks_, SERVICE_WORKER_OK);
- FOR_EACH_OBSERVER(Listener, listeners_, OnWorkerStarted(this));
+ FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this));
+}
+
+void ServiceWorkerVersion::OnStopping() {
+ FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this));
}
void ServiceWorkerVersion::OnStopped(
@@ -869,7 +873,7 @@ void ServiceWorkerVersion::OnStopped(
streaming_url_request_jobs_.clear();
- FOR_EACH_OBSERVER(Listener, listeners_, OnWorkerStopped(this));
+ FOR_EACH_OBSERVER(Listener, listeners_, OnRunningStateChanged(this));
// There should be no more communication from/to a stopped worker. Deleting
// the listener prevents any pending completion callbacks from causing
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698