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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.h

Issue 2781713003: Enable module scripts in ScriptLoader (Closed)
Patch Set: Update TestExpectations 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/dom/ScriptLoader.h
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h
index 1188afd7d45a8c9c35bf05cd3523aa04c6a372ca..862d0a57c468332b168569181b59c05d62b6bbad 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -39,6 +39,9 @@ class Script;
class ResourceFetcher;
class ScriptResource;
+class Modulator;
+class ModulePendingScriptTreeClient;
+
class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
public PendingScriptClient {
USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader);
@@ -75,7 +78,7 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
String ScriptContent() const;
// Creates a PendingScript for external script whose fetch is started in
- // FetchClassicScript().
+ // FetchClassicScript()/FetchModuleScriptTree().
PendingScript* CreatePendingScript();
// Returns false if and only if execution was blocked.
@@ -150,6 +153,12 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
CrossOriginAttributeValue,
SecurityOrigin*,
const String& encoding);
+ // https://html.spec.whatwg.org/#fetch-a-module-script-tree
+ void FetchModuleScriptTree(const KURL&,
+ Modulator*,
+ const String& nonce,
+ ParserDisposition,
+ WebURLRequest::FetchCredentialsMode);
bool DoExecuteScript(const Script*);
@@ -184,9 +193,6 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
// https://html.spec.whatwg.org/#concept-script-type
// "It is determined when the script is prepared"
- // TODO(hiroshige): Currently |script_type_| is set but ignored, and
- // thus is handled as if it is a classic script even if type is "module"
- // and module scripts is enabled.
ScriptType script_type_ = ScriptType::kClassic;
// https://html.spec.whatwg.org/#concept-script-external
@@ -219,6 +225,7 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
DocumentWriteIntervention document_write_intervention_;
Member<PendingScript> pending_script_;
+ Member<ModulePendingScriptTreeClient> module_tree_client_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698