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

Unified Diff: Source/web/WebEmbeddedWorkerImpl.cpp

Issue 684223004: ServiceWorker: Fix data race in shutdown sequence (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebEmbeddedWorkerImpl.cpp
diff --git a/Source/web/WebEmbeddedWorkerImpl.cpp b/Source/web/WebEmbeddedWorkerImpl.cpp
index f9cdbfde727cf76e5b46101e44ee129882f6fdd9..8dc72fbc5e0e1a35535053f97157ce227a1cfde7 100644
--- a/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -51,6 +51,7 @@
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebURLRequest.h"
+#include "public/platform/WebWaitableEvent.h"
#include "public/web/WebDevToolsAgent.h"
#include "public/web/WebServiceWorkerContextClient.h"
#include "public/web/WebServiceWorkerNetworkProvider.h"
@@ -171,6 +172,11 @@ WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(
WebEmbeddedWorkerImpl::~WebEmbeddedWorkerImpl()
{
+ if (m_workerThread) {
+ ASSERT(m_workerThread->terminated());
+ m_workerThread->terminationEvent()->wait();
+ }
+
ASSERT(runningWorkerInstances().contains(this));
runningWorkerInstances().remove(this);
ASSERT(m_webView);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698