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

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

Issue 2939773005: [POC] Implement "module responses map" concept (Closed)
Patch Set: rebase Created 3 years, 5 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/Worklet.cpp
diff --git a/third_party/WebKit/Source/core/workers/Worklet.cpp b/third_party/WebKit/Source/core/workers/Worklet.cpp
index 634646acb92ad146e1411aeb943aadb950391818..fe9cc7e8032fea56082c269afae907f06f3cc115 100644
--- a/third_party/WebKit/Source/core/workers/Worklet.cpp
+++ b/third_party/WebKit/Source/core/workers/Worklet.cpp
@@ -33,7 +33,8 @@ WebURLRequest::FetchCredentialsMode ParseCredentialsOption(
} // namespace
Worklet::Worklet(LocalFrame* frame)
- : ContextLifecycleObserver(frame->GetDocument()) {
+ : ContextLifecycleObserver(frame->GetDocument()),
+ module_responses_map_(new WorkletModuleResponsesMap) {
DCHECK(IsMainThread());
}
@@ -123,7 +124,7 @@ void Worklet::FetchAndInvokeScript(const KURL& module_url_record,
TaskRunnerHelper::Get(TaskType::kUnspecedLoading, GetExecutionContext());
// Step 8: "Let moduleResponsesMap be worklet's module responses map."
- // TODO(nhiroki): Implement moduleResponsesMap (https://crbug.com/627945).
+ WorkletModuleResponsesMap* module_responses_map = module_responses_map_;
// Step 9: "Let workletGlobalScopeType be worklet's worklet global scope
// type."
@@ -152,13 +153,15 @@ void Worklet::FetchAndInvokeScript(const KURL& module_url_record,
// and promise."
// TODO(nhiroki): Queue a task instead of executing this here.
for (const auto& proxy : proxies_) {
- proxy->FetchAndInvokeScript(module_url_record, credentials_mode,
- outside_settings_task_runner, pending_tasks);
+ proxy->FetchAndInvokeScript(module_url_record, module_responses_map,
+ credentials_mode, outside_settings_task_runner,
+ pending_tasks);
}
}
DEFINE_TRACE(Worklet) {
visitor->Trace(proxies_);
+ visitor->Trace(module_responses_map_);
ContextLifecycleObserver::Trace(visitor);
}
« no previous file with comments | « third_party/WebKit/Source/core/workers/Worklet.h ('k') | third_party/WebKit/Source/core/workers/WorkletGlobalScopeProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698