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

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

Issue 2534803002: Move InspectorTask handling from MainThreadTaskRunner to Document (Closed)
Patch Set: rebase 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
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 33a8c629df28584de2835342404475c2154ca71a..37f2e08f16088c438267b87ece19ea43cb29c7e8 100644
--- a/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/ThreadedWorkletObjectProxy.cpp
@@ -10,6 +10,7 @@
#include "core/dom/ExecutionContext.h"
#include "core/dom/ExecutionContextTask.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/ThreadedWorkletMessagingProxy.h"
#include "wtf/Functional.h"
#include "wtf/PtrUtil.h"
@@ -44,14 +45,14 @@ void ThreadedWorkletObjectProxy::reportConsoleMessage(
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(
- &ThreadedWorkletMessagingProxy::postMessageToPageInspector,
- m_messagingProxyWeakPtr, message));
+ // The TaskType of Inspector tasks need to be Unthrottled because they need to
+ // run even on a suspended page.
+ getParentFrameTaskRunners()
+ ->get(TaskType::Unthrottled)
+ ->postTask(BLINK_FROM_HERE,
+ crossThreadBind(
+ &ThreadedWorkletMessagingProxy::postMessageToPageInspector,
+ m_messagingProxyWeakPtr, message));
}
ParentFrameTaskRunners*

Powered by Google App Engine
This is Rietveld 408576698