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

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

Issue 517493002: ServiceWorker: Update the install sequence as per the latest spec (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment fix (+rebase) Created 6 years, 4 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
Index: content/browser/service_worker/service_worker_register_job.cc
diff --git a/content/browser/service_worker/service_worker_register_job.cc b/content/browser/service_worker/service_worker_register_job.cc
index 8b3f388b019dc9b024e508865bc5392f48c9249c..5c96d87a364e8bad2f6f9d93aead2672ce7fb7d7 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -339,24 +339,25 @@ void ServiceWorkerRegisterJob::OnStartWorkerFinished(
return;
}
- // "Resolve promise with serviceWorker."
- DCHECK(!registration()->installing_version());
- ResolvePromise(status, registration(), new_version());
InstallAndContinue();
}
-// This function corresponds to the spec's _Install algorithm.
+// This function corresponds to the spec's [[Install]] algorithm.
void ServiceWorkerRegisterJob::InstallAndContinue() {
SetPhase(INSTALL);
- // "3. Set registration.installingWorker to worker."
+ // "2. Set registration.installingWorker to worker."
registration()->SetInstallingVersion(new_version());
+ // "3. Resolve promise with registration."
+ ResolvePromise(SERVICE_WORKER_OK, registration(), new_version());
+
// "4. Run the [[UpdateState]] algorithm passing registration.installingWorker
// and "installing" as the arguments."
new_version()->SetStatus(ServiceWorkerVersion::INSTALLING);
- // TODO(nhiroki,michaeln): "5. Fire a simple event named updatefound..."
+ // "5. Fire a simple event named updatefound..."
+ registration()->NotifyUpdateFound();
// "6. Fire an event named install..."
new_version()->DispatchInstallEvent(

Powered by Google App Engine
This is Rietveld 408576698