Chromium Code Reviews| 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..53dcde51d84d9c17e8e1c3e496d800ecd1867253 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 |
| - // purpose. |
| + // In the specification, outsideSettings is used for posting a task to the |
| + // document's responsible event loop. In our implementation, |
| + // ParentFrameTaskRunners does this. |
|
kinuko
2017/05/30 02:32:58
Do we want to pass the entire ParentFrameTaskRunne
nhiroki
2017/05/30 04:03:40
We don't need the entire task runners. Changed.
|
| + 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); |
| } |
| } |