| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ModulatorImpl_h | 5 #ifndef ModulatorImpl_h |
| 6 #define ModulatorImpl_h | 6 #define ModulatorImpl_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptModule.h" | 8 #include "bindings/core/v8/ScriptModule.h" |
| 9 #include "core/dom/Modulator.h" | 9 #include "core/dom/Modulator.h" |
| 10 #include "platform/bindings/ScriptWrappable.h" | 10 #include "platform/bindings/ScriptWrappable.h" |
| 11 #include "platform/bindings/TraceWrapperMember.h" | 11 #include "platform/bindings/TraceWrapperMember.h" |
| 12 #include "platform/bindings/V8PerIsolateData.h" | 12 #include "platform/bindings/V8PerIsolateData.h" |
| 13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class Document; | |
| 18 class ExecutionContext; | 17 class ExecutionContext; |
| 19 class ModuleMap; | 18 class ModuleMap; |
| 20 class ModuleScriptLoaderRegistry; | 19 class ModuleScriptLoaderRegistry; |
| 21 class ModuleTreeLinkerRegistry; | 20 class ModuleTreeLinkerRegistry; |
| 22 class ResourceFetcher; | 21 class ResourceFetcher; |
| 23 class ScriptState; | 22 class ScriptState; |
| 24 class WebTaskRunner; | 23 class WebTaskRunner; |
| 25 | 24 |
| 26 // ModulatorImpl is the implementation of Modulator interface, which represents | 25 // ModulatorImpl is the implementation of Modulator interface, which represents |
| 27 // "environment settings object" concept for module scripts. | 26 // "environment settings object" concept for module scripts. |
| 28 // ModulatorImpl serves as the backplane for tieing all ES6 module algorithm | 27 // ModulatorImpl serves as the backplane for tieing all ES6 module algorithm |
| 29 // components together. | 28 // components together. |
| 30 class ModulatorImpl final : public Modulator { | 29 class ModulatorImpl final : public Modulator { |
| 31 public: | 30 public: |
| 32 static ModulatorImpl* Create(RefPtr<ScriptState>, Document&); | 31 static ModulatorImpl* Create(RefPtr<ScriptState>, ResourceFetcher*); |
| 33 | 32 |
| 34 virtual ~ModulatorImpl(); | 33 virtual ~ModulatorImpl(); |
| 35 DECLARE_TRACE(); | 34 DECLARE_TRACE(); |
| 36 DECLARE_VIRTUAL_TRACE_WRAPPERS(); | 35 DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
| 37 | 36 |
| 38 private: | 37 private: |
| 39 // Implements Modulator | 38 // Implements Modulator |
| 40 | 39 |
| 41 ScriptModuleResolver* GetScriptModuleResolver() override { | 40 ScriptModuleResolver* GetScriptModuleResolver() override { |
| 42 return script_module_resolver_.Get(); | 41 return script_module_resolver_.Get(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 60 ModuleGraphLevel, | 59 ModuleGraphLevel, |
| 61 ModuleScriptLoaderClient*) override; | 60 ModuleScriptLoaderClient*) override; |
| 62 ScriptModule CompileModule(const String& script, | 61 ScriptModule CompileModule(const String& script, |
| 63 const String& url_str, | 62 const String& url_str, |
| 64 AccessControlStatus) override; | 63 AccessControlStatus) override; |
| 65 ScriptValue InstantiateModule(ScriptModule) override; | 64 ScriptValue InstantiateModule(ScriptModule) override; |
| 66 ScriptValue GetInstantiationError(const ModuleScript*) override; | 65 ScriptValue GetInstantiationError(const ModuleScript*) override; |
| 67 Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override; | 66 Vector<String> ModuleRequestsFromScriptModule(ScriptModule) override; |
| 68 void ExecuteModule(const ModuleScript*) override; | 67 void ExecuteModule(const ModuleScript*) override; |
| 69 | 68 |
| 70 ModulatorImpl(RefPtr<ScriptState>, RefPtr<WebTaskRunner>, ResourceFetcher*); | 69 ModulatorImpl(RefPtr<ScriptState>, ResourceFetcher*); |
| 71 | 70 |
| 72 ExecutionContext* GetExecutionContext() const; | 71 ExecutionContext* GetExecutionContext() const; |
| 73 | 72 |
| 74 RefPtr<ScriptState> script_state_; | 73 RefPtr<ScriptState> script_state_; |
| 75 RefPtr<WebTaskRunner> task_runner_; | 74 RefPtr<WebTaskRunner> task_runner_; |
| 76 Member<ResourceFetcher> fetcher_; | 75 Member<ResourceFetcher> fetcher_; |
| 77 TraceWrapperMember<ModuleMap> map_; | 76 TraceWrapperMember<ModuleMap> map_; |
| 78 Member<ModuleScriptLoaderRegistry> loader_registry_; | 77 Member<ModuleScriptLoaderRegistry> loader_registry_; |
| 79 Member<ModuleTreeLinkerRegistry> tree_linker_registry_; | 78 Member<ModuleTreeLinkerRegistry> tree_linker_registry_; |
| 80 Member<ScriptModuleResolver> script_module_resolver_; | 79 Member<ScriptModuleResolver> script_module_resolver_; |
| 81 }; | 80 }; |
| 82 | 81 |
| 83 } // namespace blink | 82 } // namespace blink |
| 84 | 83 |
| 85 #endif | 84 #endif |
| OLD | NEW |