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

Unified Diff: third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.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/MainThreadWorkletGlobalScope.cpp
diff --git a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
index 20ca6dd8fccab2bdda0176d22eb0d178b79b6b77..776998542d71ed8100dd9a35004565698fe5c11a 100644
--- a/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
+++ b/third_party/WebKit/Source/core/workers/MainThreadWorkletGlobalScope.cpp
@@ -8,12 +8,14 @@
#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
#include "core/dom/Document.h"
#include "core/dom/Modulator.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/frame/Deprecation.h"
#include "core/frame/FrameConsole.h"
#include "core/frame/LocalFrame.h"
#include "core/inspector/MainThreadDebugger.h"
#include "core/loader/modulescript/ModuleScriptFetchRequest.h"
#include "core/probe/CoreProbes.h"
+#include "core/workers/WorkletModuleResponsesMap.h"
#include "core/workers/WorkletModuleTreeClient.h"
#include "public/platform/WebURLRequest.h"
@@ -58,10 +60,17 @@ WorkerThread* MainThreadWorkletGlobalScope::GetThread() const {
// https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script
void MainThreadWorkletGlobalScope::FetchAndInvokeScript(
const KURL& module_url_record,
+ WorkletModuleResponsesMap* module_responses_map,
WebURLRequest::FetchCredentialsMode credentials_mode,
RefPtr<WebTaskRunner> outside_settings_task_runner,
WorkletPendingTasks* pending_tasks) {
DCHECK(IsMainThread());
+ if (!module_responses_map_proxy_) {
+ module_responses_map_proxy_ = new WorkletModuleResponsesMapProxy(
+ module_responses_map, outside_settings_task_runner,
+ TaskRunnerHelper::Get(TaskType::kUnspecedLoading, this));
+ }
+
// Step 1: "Let insideSettings be the workletGlobalScope's associated
// environment settings object."
// Step 2: "Let script by the result of fetch a worklet script given
@@ -85,6 +94,12 @@ void MainThreadWorkletGlobalScope::Terminate() {
Dispose();
}
+WorkletModuleResponsesMapProxy*
+MainThreadWorkletGlobalScope::GetModuleResponsesMapProxy() const {
+ DCHECK(module_responses_map_proxy_);
+ return module_responses_map_proxy_;
+}
+
void MainThreadWorkletGlobalScope::AddConsoleMessage(
ConsoleMessage* console_message) {
GetFrame()->Console().AddMessage(console_message);
@@ -99,6 +114,7 @@ CoreProbeSink* MainThreadWorkletGlobalScope::GetProbeSink() {
}
DEFINE_TRACE(MainThreadWorkletGlobalScope) {
+ visitor->Trace(module_responses_map_proxy_);
WorkletGlobalScope::Trace(visitor);
ContextClient::Trace(visitor);
}

Powered by Google App Engine
This is Rietveld 408576698