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

Unified Diff: third_party/WebKit/Source/core/dom/MessagePort.cpp

Issue 2586093002: Specify TaskType of posted Task explicitly in MessagePort (3) (Closed)
Patch Set: Created 4 years 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: third_party/WebKit/Source/core/dom/MessagePort.cpp
diff --git a/third_party/WebKit/Source/core/dom/MessagePort.cpp b/third_party/WebKit/Source/core/dom/MessagePort.cpp
index fca2b56427bd6fd9cf1479770643a502f63b39b0..655e09e3a11c1f14c056a97c029c6d362a791951 100644
--- a/third_party/WebKit/Source/core/dom/MessagePort.cpp
+++ b/third_party/WebKit/Source/core/dom/MessagePort.cpp
@@ -33,6 +33,7 @@
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "core/dom/ExecutionContextTask.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/events/MessageEvent.h"
#include "core/frame/LocalDOMWindow.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -126,8 +127,10 @@ WebMessagePortChannelUniquePtr MessagePort::disentangle() {
// access mutable variables).
void MessagePort::messageAvailable() {
DCHECK(getExecutionContext());
+ // TODO(tzik): Use ParentThreadTaskRunners instead of ExecutionContext here to
+ // avoid touching foreign thread GCed object.
getExecutionContext()->postTask(
- BLINK_FROM_HERE,
+ TaskType::PostedMessage, BLINK_FROM_HERE,
createCrossThreadTask(&MessagePort::dispatchMessages,
wrapCrossThreadWeakPersistent(this)));
}
« 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