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 3b1a8dfec5b4a353f5ff09d14852ee28ecd8cbee..de92c42b7a4a993b9b2457d1bde1b8ad3d6a8185 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp |
@@ -416,6 +416,7 @@ std::unique_ptr<CompileFn> SelectCompileFunction(V8CacheOptions cache_options, |
} // namespace |
v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
+ ExecutionContext* context, |
const ScriptSourceCode& source, |
v8::Isolate* isolate, |
AccessControlStatus access_control_status, |
@@ -425,13 +426,15 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
return v8::Local<v8::Script>(); |
} |
return CompileScript( |
- V8String(isolate, source.Source()), source.Url(), source.SourceMapUrl(), |
- source.StartPosition(), isolate, source.GetResource(), source.Streamer(), |
+ context, V8String(isolate, source.Source()), source.Url(), |
+ source.SourceMapUrl(), source.StartPosition(), isolate, |
+ source.GetResource(), source.Streamer(), |
source.GetResource() ? source.GetResource()->CacheHandler() : nullptr, |
access_control_status, cache_options); |
} |
v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
+ ExecutionContext* context, |
const String& code, |
const String& file_name, |
const String& source_map_url, |
@@ -444,13 +447,14 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
V8ThrowException::ThrowError(isolate, "Source file too large."); |
return v8::Local<v8::Script>(); |
} |
- return CompileScript(V8String(isolate, code), file_name, source_map_url, |
- text_position, isolate, nullptr, nullptr, |
+ return CompileScript(context, V8String(isolate, code), file_name, |
+ source_map_url, text_position, isolate, nullptr, nullptr, |
cache_metadata_handler, access_control_status, |
v8_cache_options); |
} |
v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
+ ExecutionContext* context, |
v8::Local<v8::String> code, |
const String& file_name, |
const String& source_map_url, |
@@ -465,6 +469,9 @@ v8::MaybeLocal<v8::Script> V8ScriptRunner::CompileScript( |
"v8,devtools.timeline", "v8.compile", "fileName", file_name.Utf8(), |
"data", |
InspectorCompileScriptEvent::Data(file_name, script_start_position)); |
+ probe::V8Compile probe(context, file_name, |
+ script_start_position.line_.ZeroBasedInt(), |
+ script_start_position.column_.ZeroBasedInt()); |
DCHECK(!streamer || resource); |
DCHECK(!resource || resource->CacheHandler() == cache_handler); |
@@ -581,14 +588,16 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::RunCompiledScript( |
} |
v8::MaybeLocal<v8::Value> V8ScriptRunner::CompileAndRunInternalScript( |
+ ExecutionContext* context, |
v8::Local<v8::String> source, |
v8::Isolate* isolate, |
const String& file_name, |
const TextPosition& script_start_position) { |
v8::Local<v8::Script> script; |
- if (!V8ScriptRunner::CompileScript( |
- source, file_name, String(), script_start_position, isolate, nullptr, |
- nullptr, nullptr, kSharableCrossOrigin, kV8CacheOptionsDefault) |
+ if (!V8ScriptRunner::CompileScript(context, source, file_name, String(), |
+ script_start_position, isolate, nullptr, |
+ nullptr, nullptr, kSharableCrossOrigin, |
+ kV8CacheOptionsDefault) |
.ToLocal(&script)) |
return v8::MaybeLocal<v8::Value>(); |