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

Unified Diff: third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp

Issue 2842923002: Support Inline module script (Closed)
Patch Set: Created 3 years, 8 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/loader/modulescript/ModuleTreeLinker.cpp
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
index 7f9213e213e24be7730548294b06b323f6672a0b..f97d8237cc54a0ae2bd2599847860d0b3f3fb400 100644
--- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
@@ -9,6 +9,7 @@
#include "core/dom/ModuleScript.h"
#include "core/loader/modulescript/ModuleScriptFetchRequest.h"
#include "core/loader/modulescript/ModuleTreeLinkerRegistry.h"
+#include "platform/WebTaskRunner.h"
#include "platform/loader/fetch/ResourceLoadingLog.h"
#include "platform/wtf/Vector.h"
@@ -30,6 +31,24 @@ ModuleTreeLinker* ModuleTreeLinker::Fetch(
return fetcher;
}
+ModuleTreeLinker* ModuleTreeLinker::FetchDescendantsForInlineScript(
+ ModuleScript* module_script,
+ Modulator* modulator,
+ ModuleTreeLinkerRegistry* registry,
+ ModuleTreeClient* client) {
+ AncestorList empty_ancestor_list;
+
+ ModuleTreeLinker* fetcher =
+ new ModuleTreeLinker(empty_ancestor_list, modulator, registry, client);
+
+ fetcher->module_script_ = module_script;
+ fetcher->AdvanceState(State::kFetchingSelf);
+ modulator->TaskRunner()->PostTask(
+ BLINK_FROM_HERE,
+ WTF::Bind(&ModuleTreeLinker::FetchDescendants, WrapPersistent(fetcher)));
+ return fetcher;
+}
+
ModuleTreeLinker::ModuleTreeLinker(const AncestorList& ancestor_list_with_url,
Modulator* modulator,
ModuleTreeLinkerRegistry* registry,

Powered by Google App Engine
This is Rietveld 408576698