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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.h

Issue 2790473002: [ES6 modules] Introduce ScriptModuleResolverImpl (Closed)
Patch Set: error impl / unit test 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/CoreExport.h"
10 #include "core/dom/ScriptModuleResolver.h"
11 #include "platform/heap/Handle.h"
12 #include "wtf/HashMap.h"
13 #include "wtf/text/WTFString.h"
14
15 namespace blink {
16
17 class Modulator;
18 class ModuleScript;
19 class ScriptModule;
20
21 class CORE_EXPORT ScriptModuleResolverImpl final : public ScriptModuleResolver {
haraken 2017/04/05 11:48:29 Add a class-level comment.
kouhei (in TOK) 2017/04/06 05:34:18 Done.
22 public:
23 static ScriptModuleResolverImpl* create(Modulator* modulator) {
24 return new ScriptModuleResolverImpl(modulator);
25 }
26
27 DECLARE_VIRTUAL_TRACE();
28
29 // Implements ScriptModuleResolver:
30
31 void registerModuleScript(ModuleScript*) override;
32 // Implements "Runtime Semantics: HostResolveImportedModule" per HTML spec.
33 // https://html.spec.whatwg.org/#hostresolveimportedmodule(referencingmodule,- specifier)
34 ScriptModule resolve(const String& specifier,
35 const ScriptModule& referrer,
36 ExceptionState&) override;
37
38 private:
39 ScriptModuleResolverImpl(Modulator* modulator) : m_modulator(modulator) {}
haraken 2017/04/05 11:48:29 Add explicit.
kouhei (in TOK) 2017/04/06 05:34:18 Done.
40
41 HeapHashMap<ScriptModule, Member<ModuleScript>> 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