OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 currentJSInvocationEndTime = e.endTime; | 260 currentJSInvocationEndTime = e.endTime; |
261 if (!currentJSInvocationEndTime) | 261 if (!currentJSInvocationEndTime) |
262 continue; | 262 continue; |
263 if (!e.stackTrace) | 263 if (!e.stackTrace) |
264 continue; | 264 continue; |
265 while (stackTraceOpenEvents.length && eventEndTime(stackTraceOpenEve
nts.peekLast()) + coalesceThresholdMs <= e.startTime) | 265 while (stackTraceOpenEvents.length && eventEndTime(stackTraceOpenEve
nts.peekLast()) + coalesceThresholdMs <= e.startTime) |
266 stackTraceOpenEvents.pop(); | 266 stackTraceOpenEvents.pop(); |
267 var numFrames = e.stackTrace.length; | 267 var numFrames = e.stackTrace.length; |
268 for (var j = 0; j < numFrames && j < stackTraceOpenEvents.length; ++
j) { | 268 for (var j = 0; j < numFrames && j < stackTraceOpenEvents.length; ++
j) { |
269 var frame = e.stackTrace[numFrames - 1 - j]; | 269 var frame = e.stackTrace[numFrames - 1 - j]; |
270 if (!equalFrames(frame, stackTraceOpenEvents[j].args.data)) | 270 if (!equalFrames(frame, stackTraceOpenEvents[j].args["data"])) |
271 break; | 271 break; |
272 stackTraceOpenEvents[j].endTime = Math.max(stackTraceOpenEvents[
j].endTime, eventEndTime(e)); | 272 stackTraceOpenEvents[j].endTime = Math.max(stackTraceOpenEvents[
j].endTime, eventEndTime(e)); |
273 stackTraceOpenEvents[j].duration = stackTraceOpenEvents[j].endTi
me - stackTraceOpenEvents[j].startTime; | 273 stackTraceOpenEvents[j].duration = stackTraceOpenEvents[j].endTi
me - stackTraceOpenEvents[j].startTime; |
274 } | 274 } |
275 stackTraceOpenEvents.length = j; | 275 stackTraceOpenEvents.length = j; |
276 var timestampUs = e.startTime * 1000; | 276 var timestampUs = e.startTime * 1000; |
277 var durationUs = (e.duration || WebInspector.TimelineFlameChartDataP
rovider.InstantEventVisibleDurationMs) * 1000; | 277 var durationUs = (e.duration || WebInspector.TimelineFlameChartDataP
rovider.InstantEventVisibleDurationMs) * 1000; |
278 for (; j < numFrames; ++j) { | 278 for (; j < numFrames; ++j) { |
279 var frame = e.stackTrace[numFrames - 1 - j]; | 279 var frame = e.stackTrace[numFrames - 1 - j]; |
280 var payload = /** @type {!WebInspector.TracingModel.EventPayload
} */ ({ | 280 var payload = /** @type {!WebInspector.TracingModel.EventPayload
} */ ({ |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 /** | 357 /** |
358 * @param {number} entryIndex | 358 * @param {number} entryIndex |
359 * @return {string} | 359 * @return {string} |
360 */ | 360 */ |
361 entryColor: function(entryIndex) | 361 entryColor: function(entryIndex) |
362 { | 362 { |
363 var event = this._entryEvents[entryIndex]; | 363 var event = this._entryEvents[entryIndex]; |
364 if (!event) | 364 if (!event) |
365 return this._entryIndexToFrame[entryIndex] ? "white" : "#555"; | 365 return this._entryIndexToFrame[entryIndex] ? "white" : "#555"; |
366 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFrame) | 366 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFrame) |
367 return WebInspector.TimelineFlameChartDataProvider.jsFrameColorGener
ator().colorForID(event.args.data["functionName"]); | 367 return WebInspector.TimelineFlameChartDataProvider.jsFrameColorGener
ator().colorForID(event.args["data"]["functionName"]); |
368 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(event
.name); | 368 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(event
.name); |
369 return style.category.fillColorStop1; | 369 return style.category.fillColorStop1; |
370 }, | 370 }, |
371 | 371 |
372 /** | 372 /** |
373 * @param {number} entryIndex | 373 * @param {number} entryIndex |
374 * @param {!CanvasRenderingContext2D} context | 374 * @param {!CanvasRenderingContext2D} context |
375 * @param {?string} text | 375 * @param {?string} text |
376 * @param {number} barX | 376 * @param {number} barX |
377 * @param {number} barY | 377 * @param {number} barY |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 /** | 777 /** |
778 * @constructor | 778 * @constructor |
779 * @param {!WebInspector.TimelineSelection} selection | 779 * @param {!WebInspector.TimelineSelection} selection |
780 * @param {number} entryIndex | 780 * @param {number} entryIndex |
781 */ | 781 */ |
782 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex) | 782 WebInspector.TimelineFlameChart.Selection = function(selection, entryIndex) |
783 { | 783 { |
784 this.timelineSelection = selection; | 784 this.timelineSelection = selection; |
785 this.entryIndex = entryIndex; | 785 this.entryIndex = entryIndex; |
786 } | 786 } |
OLD | NEW |