| Index: third_party/WebKit/Source/bindings/core/v8/ModuleController.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ModuleController.h b/third_party/WebKit/Source/bindings/core/v8/ModuleController.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a6aa985e9e6fc75e1f6b86bcfb96c26531884b5e
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ModuleController.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef ModuleController_h
|
| +#define ModuleController_h
|
| +
|
| +#include "bindings/core/v8/ScriptModule.h"
|
| +#include "bindings/core/v8/ScriptState.h"
|
| +#include "core/CoreExport.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "wtf/text/WTFString.h"
|
| +#include <memory>
|
| +
|
| +namespace blink {
|
| +
|
| +// ModuleController is responsible for setting up V8 state for various
|
| +// ScriptModule operations.
|
| +// ModuleController is analogus to ScriptController.
|
| +class CORE_EXPORT ModuleController final
|
| + : public GarbageCollectedFinalized<ModuleController> {
|
| + public:
|
| + static ModuleController* create(RefPtr<ScriptState> scriptState) {
|
| + return new ModuleController(std::move(scriptState));
|
| + }
|
| + ~ModuleController();
|
| + DEFINE_INLINE_TRACE() {}
|
| +
|
| + // TODO(kouhei): script should be a ScriptSourceCode.
|
| + ScriptModule compileModule(const String& script, const String& urlStr);
|
| + bool instantiateModule(ScriptModule);
|
| + Vector<String> moduleRequestsFromScriptModule(ScriptModule);
|
| + // TODO(kouhei): move this to V8ScriptRunner.
|
| + void executeModule(ScriptModule);
|
| +
|
| + private:
|
| + explicit ModuleController(RefPtr<ScriptState>);
|
| +
|
| + RefPtr<ScriptState> m_scriptState;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // ModuleController_h
|
|
|