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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: snapshot 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 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 ScriptModuleIdentifier;
16 class ModuleScript;
17
18 // The ScriptModuleResolver interface is used from V8 module bindings
19 // when it need the ScriptModule's descendants.
20 //
21 // When a module writes import 'x', the module is called the referrer, 'x' is
22 // the specifier, and the module identified by 'x' is the descendant.
23 // ScriptModuleResolver, given a referrer and specifier, can look up the
24 // descendant.
25 class ScriptModuleResolver : public GarbageCollected<ScriptModuleResolver> {
26 public:
27 DEFINE_INLINE_VIRTUAL_TRACE() {}
28
29 // Notify the ScriptModuleResolver that a ModuleScript exists.
30 // This hook gives a chance for the resolver impl to populate module record
31 // identifier -> ModuleScript mapping entry.
32 virtual void registerModuleScript(ModuleScript*) = 0;
33
34 // Implements "Runtime Semantics: HostResolveImportedModule"
35 // https://tc39.github.io/ecma262/#sec-hostresolveimportedmodule
36 // This returns a null ScriptModule when an exception is thrown.
37 virtual ScriptModule resolve(const String& specifier,
38 ScriptModuleIdentifier referrer,
39 ExceptionState&) = 0;
40 };
41
42 } // namespace blink
43
44 #endif // ScriptModuleResolver_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698