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

Unified Diff: third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp

Issue 2535653002: Worker: Deprecate PostTaskToMainExecutionContext (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 | « third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h ('k') | 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/workers/ThreadedWorkletObjectProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
index 394bea66fdf4902bf1532d2b9f635816c826ed1d..f8fc183a13648a5b9d3bb91d3c9df58aea68b991 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
@@ -23,34 +23,31 @@ std::unique_ptr<ThreadedWorkletObjectProxy> ThreadedWorkletObjectProxy::create(
return wrapUnique(new ThreadedWorkletObjectProxy(messagingProxy));
}
-void ThreadedWorkletObjectProxy::postTaskToMainExecutionContext(
- std::unique_ptr<ExecutionContextTask> task) {
- getExecutionContext()->postTask(BLINK_FROM_HERE, std::move(task));
-}
-
void ThreadedWorkletObjectProxy::reportConsoleMessage(
MessageSource source,
MessageLevel level,
const String& message,
SourceLocation* location) {
+ // TODO(nhiroki): Replace this with getParentFrameTaskRunners().
+ // (https://crbug.com/667310)
getExecutionContext()->postTask(
- BLINK_FROM_HERE,
- createCrossThreadTask(
- &::blink::ThreadedWorkletMessagingProxy::reportConsoleMessage,
- crossThreadUnretained(m_messagingProxy), source, level, message,
- passed(location->clone())));
+ BLINK_FROM_HERE, createCrossThreadTask(
+ &ThreadedWorkletMessagingProxy::reportConsoleMessage,
+ crossThreadUnretained(m_messagingProxy), source,
+ level, message, passed(location->clone())));
}
void ThreadedWorkletObjectProxy::postMessageToPageInspector(
const String& message) {
DCHECK(getExecutionContext()->isDocument());
+ // TODO(nhiroki): Replace this with getParentFrameTaskRunners().
+ // (https://crbug.com/667310)
toDocument(getExecutionContext())
->postInspectorTask(
BLINK_FROM_HERE,
- createCrossThreadTask(&::blink::ThreadedWorkletMessagingProxy::
- postMessageToPageInspector,
- crossThreadUnretained(m_messagingProxy),
- message));
+ createCrossThreadTask(
+ &ThreadedWorkletMessagingProxy::postMessageToPageInspector,
+ crossThreadUnretained(m_messagingProxy), message));
}
ParentFrameTaskRunners*
@@ -60,15 +57,18 @@ ThreadedWorkletObjectProxy::getParentFrameTaskRunners() {
}
void ThreadedWorkletObjectProxy::didCloseWorkerGlobalScope() {
+ // TODO(nhiroki): Replace this with getParentFrameTaskRunners().
+ // (https://crbug.com/667310)
getExecutionContext()->postTask(
- BLINK_FROM_HERE,
- createCrossThreadTask(
- &::blink::ThreadedWorkletMessagingProxy::terminateGlobalScope,
- crossThreadUnretained(m_messagingProxy)));
+ BLINK_FROM_HERE, createCrossThreadTask(
+ &ThreadedWorkletMessagingProxy::terminateGlobalScope,
+ crossThreadUnretained(m_messagingProxy)));
}
void ThreadedWorkletObjectProxy::didTerminateWorkerThread() {
// This will terminate the MessagingProxy.
+ // TODO(nhiroki): Replace this with getParentFrameTaskRunners().
+ // (https://crbug.com/667310)
getExecutionContext()->postTask(
BLINK_FROM_HERE,
createCrossThreadTask(
« no previous file with comments | « third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698