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

Side by Side 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: rebased 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ScriptModuleResolverImpl_h
6 #define ScriptModuleResolverImpl_h
7
8 #include "bindings/core/v8/ScriptModule.h"
9 #include "core/dom/ScriptModuleResolver.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/HashMap.h"
12 #include "wtf/text/WTFString.h"
13
14 namespace blink {
15
16 class Modulator;
17 class ModuleScript;
18 class ScriptModule;
19
20 class ScriptModuleResolverImpl final : public ScriptModuleResolver {
21 public:
22 static ScriptModuleResolverImpl* create(Modulator* modulator) {
23 return new ScriptModuleResolverImpl(modulator);
24 }
25
26 DECLARE_VIRTUAL_TRACE();
27
28 // Implements ScriptModuleResolver:
29
30 void registerModuleScript(ModuleScript*) override;
31 // Implements "Runtime Semantics: HostResolveImportedModule" per HTML spec.
32 // https://html.spec.whatwg.org/#hostresolveimportedmodule(referencingmodule,- specifier)
33 ScriptModule resolve(const String& specifier,
34 const ScriptModule& referrer,
35 ExceptionState&) override;
36
37 private:
38 ScriptModuleResolverImpl(Modulator* modulator) : m_modulator(modulator) {}
39
40 HeapHashMap<ScriptModule, Member<ModuleScript>>
41 m_recordToModuleScriptMap;
42 Member<Modulator> m_modulator;
43 };
44
45 } // namespace blink
46
47 #endif // ScriptModuleResolverImpl_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698