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( |