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

Unified Diff: Source/bindings/v8/ScriptController.cpp

Issue 271883002: Add more FunctionCall trace events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | « no previous file | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptController.cpp
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index f685c9f48d4effa74569b2f56a446ea77a3b6922..af477ed285ccff207513cea5dedcd8d2b9b660a8 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -144,29 +144,18 @@ v8::Local<v8::Value> ScriptController::callFunction(v8::Handle<v8::Function> fun
return ScriptController::callFunction(m_frame->document(), function, receiver, argc, info, m_isolate);
}
-static bool resourceInfo(const v8::Handle<v8::Function> function, String& resourceName, int& lineNumber)
-{
- v8::ScriptOrigin origin = function->GetScriptOrigin();
- if (origin.ResourceName().IsEmpty()) {
- resourceName = "undefined";
- lineNumber = 1;
- } else {
- TOSTRING_DEFAULT(V8StringResource<>, stringResourceName, origin.ResourceName(), false);
- resourceName = stringResourceName;
- lineNumber = function->GetScriptLineNumber() + 1;
- }
- return true;
-}
-
v8::Local<v8::Value> ScriptController::callFunction(ExecutionContext* context, v8::Handle<v8::Function> function, v8::Handle<v8::Value> receiver, int argc, v8::Handle<v8::Value> info[], v8::Isolate* isolate)
{
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall", "data", devToolsTraceEventData(context, function, isolate));
+ TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
+ // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
InspectorInstrumentationCookie cookie;
if (InspectorInstrumentation::timelineAgentEnabled(context)) {
+ int scriptId = 0;
String resourceName;
- int lineNumber;
- if (!resourceInfo(getBoundFunction(function), resourceName, lineNumber))
- return v8::Local<v8::Value>();
- cookie = InspectorInstrumentation::willCallFunction(context, function->ScriptId(), resourceName, lineNumber);
+ int lineNumber = 1;
+ GetDevToolsFunctionInfo(function, isolate, scriptId, resourceName, lineNumber);
+ cookie = InspectorInstrumentation::willCallFunction(context, scriptId, resourceName, lineNumber);
}
v8::Local<v8::Value> result = V8ScriptRunner::callFunction(function, context, receiver, argc, info, isolate);
« no previous file with comments | « no previous file | Source/bindings/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698