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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ModuleController.h

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ModuleScriptLoaderTest Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698