Index: Source/devtools/front_end/timeline/TimelineFlameChart.js |
diff --git a/Source/devtools/front_end/timeline/TimelineFlameChart.js b/Source/devtools/front_end/timeline/TimelineFlameChart.js |
index 2a6572740951905febfcdda1de9cc9648e5e7a92..dd78e3b1b43b9327428b029bed86c500a263d9a9 100644 |
--- a/Source/devtools/front_end/timeline/TimelineFlameChart.js |
+++ b/Source/devtools/front_end/timeline/TimelineFlameChart.js |
@@ -237,12 +237,30 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { |
{ |
return e.endTime || e.startTime + WebInspector.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs; |
} |
+ function isJSInvocationEvent(e) |
+ { |
+ switch (e.name) { |
+ case WebInspector.TracingTimelineModel.RecordType.FunctionCall: |
+ case WebInspector.TracingTimelineModel.RecordType.EvaluateScript: |
+ return true; |
+ } |
+ return false; |
+ } |
var jsFrameEvents = []; |
var stackTraceOpenEvents = []; |
+ var currentJSInvocationEndTime = 0; |
var coalesceThresholdMs = WebInspector.TimelineFlameChartDataProvider.JSFrameCoalsceThresholdMs; |
for (var i = 0; i < events.length; ++i) { |
var e = events[i]; |
- if (!e.stackTrace || !this._isVisible(e)) |
+ if (e.startTime >= currentJSInvocationEndTime) { |
+ stackTraceOpenEvents.length = 0; |
+ currentJSInvocationEndTime = 0; |
+ } |
+ if (isJSInvocationEvent(e)) |
+ currentJSInvocationEndTime = e.endTime; |
yurys
2014/08/01 15:29:17
This doesn't seem to work well in case of nested J
alph
2014/08/01 15:44:45
I plan to address nested invocations in a separate
|
+ if (!currentJSInvocationEndTime) |
+ continue; |
+ if (!e.stackTrace) |
continue; |
while (stackTraceOpenEvents.length && eventEndTime(stackTraceOpenEvents.peekLast()) + coalesceThresholdMs <= e.startTime) |
stackTraceOpenEvents.pop(); |