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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: ScriptModule interaction refactored to ScriptController Created 4 years 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/ScriptController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
index d6d58c058eb92b026696323618b1204c090df3ac..1b4782d94b4e3ff4bbcf2194c0e16eb48f3e80db 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
@@ -32,6 +32,7 @@
#include "bindings/core/v8/ScriptController.h"
+#include "bindings/core/v8/ScriptModule.h"
#include "bindings/core/v8/ScriptSourceCode.h"
#include "bindings/core/v8/ScriptValue.h"
#include "bindings/core/v8/V8Binding.h"
@@ -452,4 +453,19 @@ void ScriptController::executeScriptInIsolatedWorld(
}
}
+ScriptModule ScriptController::compileModule(const String& script,
+ const String& urlStr) {
+ v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
+ v8::HandleScope handleScope(isolate);
+
+ ScriptState* scriptState = ScriptState::forMainWorld(frame());
+ if (!scriptState) {
+ printf("Failed to get ScriptState forMainWorld\n");
+ return ScriptModule();
+ }
+
+ ScriptState::Scope scope(scriptState);
+ return ScriptModule::compile(isolate, script, urlStr);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698