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

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

Issue 2704323002: [ES6 modules] Introduce ModuleMap (Closed)
Patch Set: Created 3 years, 10 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 6f923196ec8333e0e90fe4fddcd3d2ff2b5dd196..541cfe1269b138d029b54b5c2ffd0a357e9c3fa4 100644
--- a/third_party/WebKit/Source/core/dom/Modulator.h
+++ b/third_party/WebKit/Source/core/dom/Modulator.h
@@ -12,6 +12,22 @@
namespace blink {
class LocalFrame;
+class ModuleScript;
+class ModuleScriptFetchRequest;
+class ModuleScriptLoaderClient;
+class ScriptModuleResolver;
+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 {
+ public:
+ virtual void notifyModuleLoadFinished(ModuleScript*) = 0;
+};
+
+// spec: "top-level module fetch flag"
hiroshige 2017/02/22 01:21:30 +link?
kouhei (in TOK) 2017/02/22 07:08:04 Done.
+enum class ModuleGraphLevel { TopLevelModuleFetch, DependentModuleFetch };
// A Modulator is an interface for "environment settings object" concept for
// module scripts.
@@ -22,9 +38,22 @@ class CORE_EXPORT Modulator : public GarbageCollectedMixin {
public:
static Modulator* from(LocalFrame*);
+ virtual ScriptModuleResolver* scriptModuleResolver() = 0;
+ virtual WebTaskRunner* taskRunner() = 0;
+
// https://html.spec.whatwg.org/#resolve-a-module-specifier
static KURL resolveModuleSpecifier(const String& moduleRequest,
const KURL& baseURL);
+
+ private:
+ friend class ModuleMap;
+
+ // Asynchronously fetches a single module script.
hiroshige 2017/02/22 01:21:29 If ModuleScriptLoader::fetch() can notify ModuleSc
kouhei (in TOK) 2017/02/22 07:08:04 Done.
+ // This is triggered from fetchSingle() implementation (which is ModuleMap) if
hiroshige 2017/02/22 01:21:29 nit: s/which is/which is in/?
kouhei (in TOK) 2017/02/22 07:08:04 Done.
+ // the cached entry doesn't exist.
+ virtual void fetchNewSingleModule(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ ModuleScriptLoaderClient*) = 0;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698