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

Unified Diff: Source/core/workers/WorkerMessagingProxy.cpp

Issue 1305453003: Fix data race in blink::WorkerMessagingProxy::reportException (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | Source/core/workers/WorkerThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerMessagingProxy.cpp
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index e3619d6033acebe5781a0abc24435e0242e03dd5..940daffc482898255ad84265e6826a41b95751ad 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -56,6 +56,12 @@ namespace blink {
namespace {
+void processExceptionOnWorkerGlobalScope(int exceptionId, bool isHandled, ExecutionContext* scriptContext)
+{
+ WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext);
+ globalScope->exceptionHandled(exceptionId, isHandled);
+}
+
void processMessageOnWorkerGlobalScope(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels, WorkerObjectProxy* workerObjectProxy, ExecutionContext* scriptContext)
{
WorkerGlobalScope* globalScope = toWorkerGlobalScope(scriptContext);
@@ -166,8 +172,7 @@ void WorkerMessagingProxy::reportException(const String& errorMessage, int lineN
RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, nullptr);
bool errorHandled = !m_workerObject->dispatchEvent(event);
-
- postTaskToWorkerGlobalScope(createCrossThreadTask(&WorkerGlobalScope::exceptionHandled, m_workerThread->workerGlobalScope(), exceptionId, errorHandled));
+ postTaskToWorkerGlobalScope(createCrossThreadTask(&processExceptionOnWorkerGlobalScope, exceptionId, errorHandled));
}
void WorkerMessagingProxy::reportConsoleMessage(MessageSource source, MessageLevel level, const String& message, int lineNumber, const String& sourceURL)
« no previous file with comments | « no previous file | Source/core/workers/WorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698