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

Unified Diff: third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.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/InProcessWorkerObjectProxy.cpp
diff --git a/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
index 615bb9ad614aa9eaade96313d7ef2692251c313e..bc60b0f65ac2f6e26394438d260062fe31c32ea5 100644
--- a/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
+++ b/third_party/WebKit/Source/core/workers/InProcessWorkerObjectProxy.cpp
@@ -140,16 +140,15 @@ void InProcessWorkerObjectProxy::reportConsoleMessage(
void InProcessWorkerObjectProxy::postMessageToPageInspector(
const String& message) {
- ExecutionContext* context = getExecutionContext();
- if (context->isDocument()) {
- // TODO(hiroshige): consider using getParentFrameTaskRunners() here
- // too.
- toDocument(context)->postInspectorTask(
- BLINK_FROM_HERE,
- createCrossThreadTask(
- &InProcessWorkerMessagingProxy::postMessageToPageInspector,
- m_messagingProxyWeakPtr, message));
- }
+ DCHECK(getExecutionContext()->isDocument());
+ // 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(
+ &InProcessWorkerMessagingProxy::postMessageToPageInspector,
+ m_messagingProxyWeakPtr, message));
}
ParentFrameTaskRunners*

Powered by Google App Engine
This is Rietveld 408576698