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

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

Issue 2077843002: Service worker: Remove unneeded early stop in FinishRequest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a callsiet Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1eda60bb6658272c61db5630d21370dbd42cf231..e61f9e8a516d1b164bc606eaff5817ee85162039 100644
--- a/content/browser/service_worker/service_worker_register_job.cc
+++ b/content/browser/service_worker/service_worker_register_job.cc
@@ -492,8 +492,13 @@ void ServiceWorkerRegisterJob::OnStoreRegistrationComplete(
// "9. If registration.waitingWorker is not null, then:..."
if (registration()->waiting_version()) {
- // "1. Run the [[UpdateState]] algorithm passing registration.waitingWorker
- // and "redundant" as the arguments."
+ // 1. Set redundantWorker to registration’s waiting worker.
+ // 2. Terminate redundantWorker.
+ registration()->waiting_version()->StopWorker(
+ base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
+ // TODO(falken): Move this further down. The spec says to set status to
+ // 'redundant' after promoting the new version to .waiting attribute and
+ // 'installed' status.
registration()->waiting_version()->SetStatus(
ServiceWorkerVersion::REDUNDANT);
}
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698