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 ModuleController_h |
| 6 #define ModuleController_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptModule.h" |
| 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/CoreExport.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 #include "wtf/text/WTFString.h" |
| 13 #include <memory> |
| 14 |
| 15 namespace blink { |
| 16 |
| 17 // ModuleController is responsible for setting up V8 state for various |
| 18 // ScriptModule operations. |
| 19 // ModuleController is analogus to ScriptController. |
| 20 class CORE_EXPORT ModuleController final |
| 21 : public GarbageCollectedFinalized<ModuleController> { |
| 22 public: |
| 23 static ModuleController* create(RefPtr<ScriptState> scriptState) { |
| 24 return new ModuleController(std::move(scriptState)); |
| 25 } |
| 26 ~ModuleController(); |
| 27 DEFINE_INLINE_TRACE() {} |
| 28 |
| 29 // TODO(kouhei): script should be a ScriptSourceCode. |
| 30 ScriptModule compileModule(const String& script, const String& urlStr); |
| 31 bool instantiateModule(ScriptModule); |
| 32 Vector<String> moduleRequestsFromScriptModule(ScriptModule); |
| 33 // TODO(kouhei): move this to V8ScriptRunner. |
| 34 void executeModule(ScriptModule); |
| 35 |
| 36 private: |
| 37 explicit ModuleController(RefPtr<ScriptState>); |
| 38 |
| 39 RefPtr<ScriptState> m_scriptState; |
| 40 }; |
| 41 |
| 42 } // namespace blink |
| 43 |
| 44 #endif // ModuleController_h |
OLD | NEW |