Chromium Code Reviews| 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 2276cf87089ee5a4bf10e858f0ae89754e971166..24839d162cb9095998129d36ad9e3832d24d1da3 100644 |
| --- a/content/browser/service_worker/service_worker_register_job.cc |
| +++ b/content/browser/service_worker/service_worker_register_job.cc |
| @@ -338,24 +338,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); |
|
nhiroki
2014/08/29 09:22:49
fyi: I'm wondering if we should set the worker to
|
| - // 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( |