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

Unified Diff: content/renderer/service_worker/embedded_worker_instance_client_impl.cc

Issue 2498573002: Add a return when StopWorker is called after service worker is stopped (Closed)
Patch Set: Created 4 years, 1 month 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/renderer/service_worker/embedded_worker_instance_client_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/service_worker/embedded_worker_instance_client_impl.cc
diff --git a/content/renderer/service_worker/embedded_worker_instance_client_impl.cc b/content/renderer/service_worker/embedded_worker_instance_client_impl.cc
index 8bea7d38ed6d24fc45cc24fa3cb41febd92f4e94..6ef334bb81e52f7781cd00dbe77d92a3857d94a6 100644
--- a/content/renderer/service_worker/embedded_worker_instance_client_impl.cc
+++ b/content/renderer/service_worker/embedded_worker_instance_client_impl.cc
@@ -44,6 +44,7 @@ void EmbeddedWorkerInstanceClientImpl::StopWorkerCompleted() {
TRACE_EVENT0("ServiceWorker",
"EmbeddedWorkerInstanceClientImpl::StopWorkerCompleted");
stop_callback_.Reset();
+ wrapper_ = nullptr;
}
void EmbeddedWorkerInstanceClientImpl::StartWorker(
@@ -73,7 +74,7 @@ void EmbeddedWorkerInstanceClientImpl::StopWorker(
DCHECK(ChildThreadImpl::current());
DCHECK(embedded_worker_id_);
// StopWorker is possible to be called twice.
- if (stop_callback_) {
+ if (stop_callback_ || !wrapper_) {
LOG(WARNING) << "Got StopWorker for stopping worker";
return;
}
« no previous file with comments | « content/renderer/service_worker/embedded_worker_instance_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698