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

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

Issue 2566513002: Create bare-bones ScriptModule class (Closed)
Patch Set: Update copyrights 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index 9e618c7a37217167e1865bea84daea19b51ef9d7..288b523313dfd3e1df36db324a69ca512f7e41bd 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -493,6 +493,18 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::compileScript(
return (*compileFn)(isolate, code, origin);
}
+v8::MaybeLocal<v8::Module> V8ScriptRunner::compileModule(
+ v8::Isolate* isolate,
+ const String& source,
+ const String& fileName) {
+ TRACE_EVENT1("v8", "v8.compileModule", "fileName", fileName.utf8());
+ // TODO(adamk): Add Inspector integration?
+ // TODO(adamk): Pass more info into ScriptOrigin.
+ v8::ScriptOrigin origin(v8String(isolate, fileName));
+ v8::ScriptCompiler::Source scriptSource(v8String(isolate, source), origin);
+ return v8::ScriptCompiler::CompileModule(isolate, &scriptSource);
+}
+
v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(
v8::Isolate* isolate,
v8::Local<v8::Script> script,
@@ -660,6 +672,16 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callInternalFunction(
return result;
}
+v8::MaybeLocal<v8::Value> V8ScriptRunner::evaluateModule(
+ v8::Local<v8::Module> module,
+ v8::Local<v8::Context> context,
+ v8::Isolate* isolate) {
+ TRACE_EVENT0("v8", "v8.evaluateModule");
+ v8::MicrotasksScope microtasksScope(isolate,
+ v8::MicrotasksScope::kRunMicrotasks);
+ return module->Evaluate(context);
+}
+
v8::MaybeLocal<v8::Object> V8ScriptRunner::instantiateObject(
v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> objectTemplate) {
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698