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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: address haraken/yhirano comments Created 3 years, 11 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/ScriptModuleResolverImpl.h
diff --git a/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.h b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..a91ee6bba59e7ddd9e6e13f73f08ce1aa86e7ccf
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.h
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ScriptModuleResolverImpl_h
+#define ScriptModuleResolverImpl_h
+
+#include "bindings/core/v8/ScriptModule.h"
+#include "bindings/core/v8/ScriptModuleResolver.h"
+#include "platform/heap/Handle.h"
+#include "wtf/HashMap.h"
+#include "wtf/text/WTFString.h"
+
+namespace blink {
+
+class Modulator;
+class ModuleScript;
+class ScriptModule;
+
+class ScriptModuleResolverImpl final : public ScriptModuleResolver {
+ public:
+ static ScriptModuleResolverImpl* create(Modulator* modulator) {
+ return new ScriptModuleResolverImpl(modulator);
+ }
+
+ DECLARE_VIRTUAL_TRACE();
+
+ // Implements ScriptModuleResolver:
+ void registerModuleScript(ModuleScript*) override;
+ ScriptModule resolve(const String& specifier,
+ ScriptModuleIdentifier referrer) override;
+
+ private:
+ ScriptModuleResolverImpl(Modulator* modulator) : m_modulator(modulator) {}
+
+ HeapHashMap<ScriptModuleIdentifier, Member<ModuleScript>>
+ m_recordToModuleScriptMap;
+ Member<Modulator> m_modulator;
+};
+
+} // namespace blink
+
+#endif // ScriptModuleResolverImpl_h

Powered by Google App Engine
This is Rietveld 408576698