OLD | NEW |
---|---|
(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 ModulatorImpl_h | |
6 #define ModulatorImpl_h | |
7 | |
8 #include "bindings/core/v8/ScriptModule.h" | |
9 #include "bindings/core/v8/V8PerIsolateData.h" | |
10 #include "core/dom/Modulator.h" | |
11 #include "platform/heap/Handle.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class Document; | |
16 class ModuleMap; | |
17 class ModuleScriptLoaderRegistry; | |
18 class ModuleTreeLinkerRegistry; | |
19 class ResourceFetcher; | |
20 class ScriptState; | |
21 class WebTaskRunner; | |
22 | |
23 class ModulatorImpl final : public GarbageCollectedFinalized<Modulator>, | |
24 public Modulator { | |
25 USING_GARBAGE_COLLECTED_MIXIN(ModulatorImpl); | |
26 | |
27 public: | |
28 static ModulatorImpl* create(RefPtr<ScriptState>, Document&); | |
dominicc (has gone to gerrit)
2017/01/11 03:23:48
Probably fine, but what would the parameter list l
kouhei (in TOK)
2017/01/13 05:41:28
The idea was to eventually have create(State, Work
| |
29 | |
30 virtual ~ModulatorImpl(); | |
31 DECLARE_TRACE(); | |
32 | |
33 private: | |
34 // Implements Modulator | |
35 | |
36 ScriptModuleResolver* scriptModuleResolver() override { | |
37 return m_scriptModuleResolver.get(); | |
38 } | |
39 WebTaskRunner* taskRunner() override { return m_taskRunner.get(); } | |
40 | |
41 void fetchTree(const KURL&, const KURL& baseURL, ModuleTreeClient*) override; | |
42 void fetchSingle( | |
43 const KURL&, | |
44 const KURL& baseURL, | |
45 SingleModuleClient* | |
46 /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, an d a top-level module fetch flag*/) | |
47 override; | |
48 void fetchNewSingleModule( | |
49 const KURL&, | |
50 const KURL& baseURL, | |
51 ModuleScriptLoaderClient* | |
52 /*, a fetch client settings object, a destination, a cryptographic nonce, a parser state, a credentials mode, a module map settings object, a referrer, an d a top-level module fetch flag*/) | |
53 override; | |
54 | |
55 ModuleScript* retrieveFetchedModuleScript(const KURL&) override; | |
56 | |
57 ScriptModule compileModule(const String& script, | |
dominicc (has gone to gerrit)
2017/01/11 03:23:48
I feel like there's a second interface here called
| |
58 const String& urlStr) override; | |
59 bool instantiateModule(ScriptModule) override; | |
60 Vector<String> moduleRequestsFromScriptModule(ScriptModule) override; | |
61 void executeModule(ScriptModule) override; | |
62 | |
63 private: | |
64 ModulatorImpl(RefPtr<ScriptState>, WebTaskRunner*, ResourceFetcher*); | |
65 | |
66 RefPtr<ScriptState> m_scriptState; | |
67 std::unique_ptr<WebTaskRunner> m_taskRunner; | |
68 Member<ResourceFetcher> m_fetcher; | |
69 Member<ModuleMap> m_map; | |
70 Member<ModuleScriptLoaderRegistry> m_loaderRegistry; | |
71 Member<ModuleTreeLinkerRegistry> m_treeLinkerRegistry; | |
72 Member<ScriptModuleResolver> m_scriptModuleResolver; | |
73 }; | |
74 | |
75 } // namespace blink | |
76 | |
77 #endif | |
OLD | NEW |