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

Unified Diff: Source/bindings/v8/V8WorkerGlobalScopeEventListener.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 | « Source/bindings/v8/V8Binding.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp
diff --git a/Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp b/Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp
index 6e3f4f0b461b8db3ad99b8ee0e4aae1dd813e9bc..daffe5e823f86c5cc0c10d283dca367e27ed8667 100644
--- a/Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp
+++ b/Source/bindings/v8/V8WorkerGlobalScopeEventListener.cpp
@@ -79,28 +79,6 @@ void V8WorkerGlobalScopeEventListener::handleEvent(ExecutionContext* context, Ev
invokeEventHandler(context, event, v8::Local<v8::Value>::New(isolate, jsEvent));
}
-static void devtoolsFunctionInfo(v8::Handle<v8::Function> handlerFunction, v8::Isolate* isolate, int& scriptId, String& resourceName, int& lineNumber)
-{
- lineNumber = 1;
- v8::Handle<v8::Function> originalFunction = getBoundFunction(handlerFunction);
- v8::ScriptOrigin origin = originalFunction->GetScriptOrigin();
- if (!origin.ResourceName().IsEmpty()) {
- resourceName = NativeValueTraits<String>::nativeValue(origin.ResourceName(), isolate);
- lineNumber = originalFunction->GetScriptLineNumber() + 1;
- }
- if (resourceName.isEmpty())
- resourceName = "undefined";
-}
-
-static PassRefPtr<TraceEvent::ConvertableToTraceFormat> devtoolsTraceEventData(ExecutionContext* context, v8::Handle<v8::Function> handlerFunction, v8::Isolate* isolate)
-{
- int scriptId = 0;
- String resourceName;
- int lineNumber = 1;
- devtoolsFunctionInfo(handlerFunction, isolate, scriptId, resourceName, lineNumber);
- return InspectorFunctionCallEvent::data(context, scriptId, resourceName, lineNumber);
-}
-
v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::callListenerFunction(ExecutionContext* context, v8::Handle<v8::Value> jsEvent, Event* event)
{
v8::Local<v8::Function> handlerFunction = getListenerFunction(context);
@@ -109,14 +87,15 @@ v8::Local<v8::Value> V8WorkerGlobalScopeEventListener::callListenerFunction(Exec
return v8::Local<v8::Value>();
v8::Isolate* isolate = toIsolate(context);
- TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall", "data", devtoolsTraceEventData(context, handlerFunction, isolate));
+ TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "FunctionCall", "data", devToolsTraceEventData(context, handlerFunction, 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 = 1;
- devtoolsFunctionInfo(handlerFunction, isolate, scriptId, resourceName, lineNumber);
+ GetDevToolsFunctionInfo(handlerFunction, isolate, scriptId, resourceName, lineNumber);
cookie = InspectorInstrumentation::willCallFunction(context, scriptId, resourceName, lineNumber);
}
« no previous file with comments | « Source/bindings/v8/V8Binding.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698