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

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

Issue 2704323002: [ES6 modules] Introduce ModuleMap (Closed)
Patch Set: no core expor Created 3 years, 9 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 ScriptModuleResolver_h
6 #define ScriptModuleResolver_h
7
8 #include "bindings/core/v8/ExceptionState.h"
9 #include "platform/heap/Handle.h"
10 #include "wtf/text/WTFString.h"
11
12 namespace blink {
13
14 class ScriptModule;
15 class ModuleScript;
16
17 // The ScriptModuleResolver interface is used from V8 module bindings
18 // when it need the ScriptModule's descendants.
19 //
20 // When a module writes import 'x', the module is called the referrer, 'x' is
21 // the specifier, and the module identified by 'x' is the descendant.
22 // ScriptModuleResolver, given a referrer and specifier, can look up the
23 // descendant.
24 class ScriptModuleResolver : public GarbageCollected<ScriptModuleResolver> {
25 public:
26 DEFINE_INLINE_VIRTUAL_TRACE() {}
27
28 // Notify the ScriptModuleResolver that a ModuleScript exists.
29 // This hook gives a chance for the resolver impl to populate module record
30 // identifier -> ModuleScript mapping entry.
31 virtual void registerModuleScript(ModuleScript*) = 0;
32
33 // Implements "Runtime Semantics: HostResolveImportedModule"
34 // https://tc39.github.io/ecma262/#sec-hostresolveimportedmodule
35 // This returns a null ScriptModule when an exception is thrown.
36 virtual ScriptModule resolve(const String& specifier,
37 const ScriptModule& referrer,
38 ExceptionState&) = 0;
39 };
40
41 } // namespace blink
42
43 #endif // ScriptModuleResolver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleMapTest.cpp ('k') | third_party/WebKit/Source/core/testing/DummyModulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698