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

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

Issue 2910953002: Worklet: Enqueue tasks into outsideSetting's event loop (Closed)
Patch Set: fix Created 3 years, 7 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/workers/MainThreadWorklet.cpp
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
index cdec996017a1b9aa6719e9760e4f224861e8a174..2fe55ffc7f28fa1dd826a7a8bd080d7d48acf570 100644
--- a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
@@ -7,7 +7,9 @@
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "bindings/core/v8/ScriptSourceCode.h"
#include "bindings/core/v8/V8BindingForCore.h"
+#include "core/dom/Document.h"
#include "core/frame/LocalFrame.h"
+#include "core/workers/ParentFrameTaskRunners.h"
#include "core/workers/WorkletGlobalScopeProxy.h"
#include "core/workers/WorkletPendingTasks.h"
#include "platform/wtf/WTF.h"
@@ -56,9 +58,11 @@ void MainThreadWorklet::FetchAndInvokeScript(const KURL& module_url_record,
ParseCredentialsOption(options.credentials());
// Step 7: "Let outsideSettings be the relevant settings object of this."
- // TODO(nhiroki): outsideSettings will be used for posting a task to the
- // document's responsible event loop. We could use a task runner for the
+ // outsideSettings will be used for posting a task to the document's
+ // responsible event loop. ParentFrameTaskRunners are available for the
// purpose.
falken 2017/05/30 01:33:23 Would like to make more clear what's in the spec a
nhiroki 2017/05/30 02:14:23 Done.
+ auto task_runners = ParentFrameTaskRunners::Create(
+ ToDocument(GetExecutionContext())->GetFrame());
// Step 8: "Let moduleResponsesMap be worklet's module responses map."
// TODO(nhiroki): Implement moduleResponsesMap (https://crbug.com/627945).
@@ -91,7 +95,7 @@ void MainThreadWorklet::FetchAndInvokeScript(const KURL& module_url_record,
// TODO(nhiroki): Queue a task instead of executing this here.
for (const auto& proxy : proxies_) {
proxy->FetchAndInvokeScript(module_url_record, credentials_mode,
- pending_tasks);
+ task_runners, pending_tasks);
}
}

Powered by Google App Engine
This is Rietveld 408576698