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

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

Issue 2826313003: Worklet: Enable module script loading for main thread worklets (Closed)
Patch Set: rebase Created 3 years, 8 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
Index: third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
diff --git a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
index 30c377d4117dc0377a97d072ba1726253bbaa60d..05dbf0c2daeee0c26116ad0cdc70ca343a8dfa3a 100644
--- a/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
+++ b/third_party/WebKit/Source/core/dom/TaskRunnerHelper.cpp
@@ -7,6 +7,7 @@
#include "core/dom/Document.h"
#include "core/dom/ExecutionContext.h"
#include "core/frame/LocalFrame.h"
+#include "core/workers/MainThreadWorkletGlobalScope.h"
#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "core/workers/WorkerThread.h"
#include "platform/WebFrameScheduler.h"
@@ -71,6 +72,10 @@ RefPtr<WebTaskRunner> TaskRunnerHelper::Get(
return Get(type, ToDocument(executionContext));
if (executionContext->IsDocument())
return Get(type, ToDocument(executionContext));
+ if (executionContext->IsMainThreadWorkletGlobalScope()) {
+ return Get(type,
+ ToMainThreadWorkletGlobalScope(executionContext)->GetFrame());
+ }
if (executionContext->IsWorkerOrWorkletGlobalScope())
return Get(type, ToWorkerOrWorkletGlobalScope(executionContext));
executionContext = nullptr;

Powered by Google App Engine
This is Rietveld 408576698