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

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

Issue 2910953002: Worklet: Enqueue tasks into outsideSetting's event loop (Closed)
Patch Set: fix header inclusion 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..a022207d9df0fffa4b02c7f197c3aaeaab2b0000 100644
--- a/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorklet.cpp
@@ -10,6 +10,7 @@
#include "core/frame/LocalFrame.h"
#include "core/workers/WorkletGlobalScopeProxy.h"
#include "core/workers/WorkletPendingTasks.h"
+#include "platform/WebTaskRunner.h"
#include "platform/wtf/WTF.h"
#include "public/platform/WebURLRequest.h"
@@ -56,9 +57,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
- // purpose.
+ // In the specification, outsideSettings is used for posting a task to the
+ // document's responsible event loop. In our implementation, WebTaskRunner
+ // does this.
kinuko 2017/05/30 04:38:52 Now the last part of this comment reads a bit weir
nhiroki 2017/05/30 05:25:30 Done.
+ RefPtr<WebTaskRunner> parent_frame_task_runner =
+ TaskRunnerHelper::Get(TaskType::kUnspecedLoading, GetExecutionContext());
// Step 8: "Let moduleResponsesMap be worklet's module responses map."
// TODO(nhiroki): Implement moduleResponsesMap (https://crbug.com/627945).
@@ -91,7 +94,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);
+ parent_frame_task_runner, pending_tasks);
}
}

Powered by Google App Engine
This is Rietveld 408576698