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

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

Issue 385143002: ServiceWorker: Stop a worker thread on unregistration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: modify unittests Created 6 years, 5 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_job_unittest.cc ('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 64453fdb1ca136c38ed706cdf6305fac60381a26..494b5ba090626fdd06c7c671f2dba1c9a7ae5f38 100644
--- a/content/browser/service_worker/service_worker_version.cc
+++ b/content/browser/service_worker/service_worker_version.cc
@@ -389,9 +389,11 @@ void ServiceWorkerVersion::RemoveControllee(
RemoveProcessFromWorker(provider_host->process_id());
if (HasControllee())
return;
- ScheduleStopWorker();
- if (is_doomed_)
+ if (is_doomed_) {
DoomInternal();
+ return;
+ }
+ ScheduleStopWorker();
}
void ServiceWorkerVersion::AddPotentialControllee(
@@ -667,7 +669,9 @@ void ServiceWorkerVersion::ScheduleStopWorker() {
}
void ServiceWorkerVersion::DoomInternal() {
+ DCHECK(!HasControllee());
SetStatus(REDUNDANT);
+ StopWorker(base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
if (!context_)
return;
std::vector<ServiceWorkerDatabase::ResourceRecord> resources;
« no previous file with comments | « content/browser/service_worker/service_worker_job_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698