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

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

Issue 2248553002: Add Inspector Agent for WebPerf, add probes in V8ScriptRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove inheritance from InspectorAgent Created 4 years, 4 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/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 f7258b0a58a5c024c2a58b189e65bfc0ef3c2686..2485dc2cc6f7846ab327bec575bf0c1116872a49 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -35,6 +35,7 @@
#include "core/fetch/CachedMetadata.h"
#include "core/fetch/ScriptResource.h"
#include "core/frame/LocalFrame.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "core/inspector/InspectorTraceEvents.h"
#include "core/inspector/ThreadDebugger.h"
#include "platform/Histogram.h"
@@ -411,9 +412,11 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(v8::Isolate* isolate
return v8::MaybeLocal<v8::Value>();
}
v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ InspectorInstrumentation::willExecuteScript(context);
ThreadDebugger::willExecuteScript(isolate, script->GetUnboundScript()->GetId());
result = script->Run(isolate->GetCurrentContext());
ThreadDebugger::didExecuteScript(isolate);
+ InspectorInstrumentation::didExecuteScript(context);
}
crashIfIsolateIsDead(isolate);
@@ -502,15 +505,18 @@ v8::MaybeLocal<v8::Value> V8ScriptRunner::callFunction(v8::Local<v8::Function> f
}
if (!depth)
TRACE_EVENT_BEGIN1("devtools.timeline", "FunctionCall", "data", InspectorFunctionCallEvent::data(context, function));
+
v8::MaybeLocal<v8::Value> result;
{
// Create an extra block so FunctionCall trace event end phase is recorded after
// v8::MicrotasksScope destructor, as the latter is running microtasks.
v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kRunMicrotasks);
+ InspectorInstrumentation::willExecuteScript(context);
ThreadDebugger::willExecuteScript(isolate, function->ScriptId());
result = function->Call(isolate->GetCurrentContext(), receiver, argc, args);
crashIfIsolateIsDead(isolate);
ThreadDebugger::didExecuteScript(isolate);
+ InspectorInstrumentation::didExecuteScript(context);
}
if (!depth)
TRACE_EVENT_END0("devtools.timeline", "FunctionCall");

Powered by Google App Engine
This is Rietveld 408576698