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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ModuleTreeLinkerTest.fetchTreeInstantiationFailure 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/Modulator.h
diff --git a/third_party/WebKit/Source/core/dom/Modulator.h b/third_party/WebKit/Source/core/dom/Modulator.h
index ef95e0b48bf21f23ff408d924aa9dd71da8f2474..14f181526124b65e51175fa1fdd84d20aba2faa4 100644
--- a/third_party/WebKit/Source/core/dom/Modulator.h
+++ b/third_party/WebKit/Source/core/dom/Modulator.h
@@ -8,6 +8,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/V8PerContextData.h"
#include "core/CoreExport.h"
+#include "core/dom/AncestorList.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/AccessControlStatus.h"
#include "platform/weborigin/KURL.h"
@@ -29,11 +30,18 @@ class WebTaskRunner;
// A SingleModuleClient is notified when single module script node (node as in a
// module tree graph) load is complete and its corresponding entry is created in
// module map.
-class SingleModuleClient : public GarbageCollectedMixin {
+class CORE_EXPORT SingleModuleClient : public GarbageCollectedMixin {
public:
virtual void NotifyModuleLoadFinished(ModuleScript*) = 0;
};
+// A ModuleTreeClient is notified when a module script and its whole descendent
+// tree load is complete.
+class CORE_EXPORT ModuleTreeClient : public GarbageCollectedMixin {
+ public:
+ virtual void NotifyModuleTreeLoadFinished(ModuleScript*) = 0;
+};
+
// spec: "top-level module fetch flag"
// https://html.spec.whatwg.org/multipage/webappapis.html#fetching-scripts-is-top-level
enum class ModuleGraphLevel { kTopLevelModuleFetch, kDependentModuleFetch };
@@ -62,6 +70,23 @@ class CORE_EXPORT Modulator : public GarbageCollectedFinalized<Modulator>,
virtual ReferrerPolicy GetReferrerPolicy() = 0;
virtual SecurityOrigin* GetSecurityOrigin() = 0;
+ // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-module-script-tree
+ virtual void FetchTree(const ModuleScriptFetchRequest&,
+ ModuleTreeClient*) = 0;
+
+ // https://html.spec.whatwg.org/#internal-module-script-graph-fetching-procedure
+ virtual void FetchTreeInternal(const ModuleScriptFetchRequest&,
+ const AncestorList&,
+ ModuleGraphLevel,
+ ModuleTreeClient*) = 0;
+
+ // Asynchronously retrieve a module script from the module map, or fetch it
+ // and put it in the map if it's not there already.
+ // https://html.spec.whatwg.org/#fetch-a-single-module-script
+ virtual void FetchSingle(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ SingleModuleClient*) = 0;
+
// Synchronously retrieves a single module script from existing module map
// entry.
virtual ModuleScript* GetFetchedModuleScript(const KURL&) = 0;
@@ -78,7 +103,7 @@ class CORE_EXPORT Modulator : public GarbageCollectedFinalized<Modulator>,
virtual Vector<String> ModuleRequestsFromScriptModule(ScriptModule) = 0;
- virtual void ExecuteModule(ScriptModule) = 0;
+ virtual void ExecuteModule(const ModuleScript*) = 0;
private:
friend class ModuleMap;

Powered by Google App Engine
This is Rietveld 408576698