| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 return this._entryTypeByLevel[this._timelineData.entryLevels[entryIndex]
]; | 632 return this._entryTypeByLevel[this._timelineData.entryLevels[entryIndex]
]; |
| 633 }, | 633 }, |
| 634 | 634 |
| 635 /** | 635 /** |
| 636 * @override | 636 * @override |
| 637 * @param {number} entryIndex | 637 * @param {number} entryIndex |
| 638 * @return {?Array.<!{title: string, value: (string|!Element)}>} | 638 * @return {?Array.<!{title: string, value: (string|!Element)}>} |
| 639 */ | 639 */ |
| 640 prepareHighlightedEntryInfo: function(entryIndex) | 640 prepareHighlightedEntryInfo: function(entryIndex) |
| 641 { | 641 { |
| 642 var time; | 642 var time = ""; |
| 643 var title; | 643 var title; |
| 644 var warning; | 644 var warning; |
| 645 var type = this._entryType(entryIndex); | 645 var type = this._entryType(entryIndex); |
| 646 if (type === WebInspector.TimelineFlameChartEntryType.Event) { | 646 if (type === WebInspector.TimelineFlameChartEntryType.Event) { |
| 647 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._e
ntryData[entryIndex]); | 647 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._e
ntryData[entryIndex]); |
| 648 var totalTime = event.duration; | 648 var totalTime = event.duration; |
| 649 var selfTime = event.selfTime; | 649 var selfTime = event.selfTime; |
| 650 var /** @const */ eps = 1e-6; | 650 var /** @const */ eps = 1e-6; |
| 651 time = typeof totalTime === "number" && Math.abs(totalTime - selfTim
e) > eps && selfTime > eps ? | 651 if (typeof totalTime === "number") { |
| 652 WebInspector.UIString("%s (self %s)", Number.millisToString(tota
lTime, true), Number.millisToString(selfTime, true)) : | 652 time = Math.abs(totalTime - selfTime) > eps && selfTime > eps ? |
| 653 Number.millisToString(totalTime, true); | 653 WebInspector.UIString("%s (self %s)", Number.millisToString(
totalTime, true), Number.millisToString(selfTime, true)) : |
| 654 Number.millisToString(totalTime, true); |
| 655 } |
| 654 title = this.entryTitle(entryIndex); | 656 title = this.entryTitle(entryIndex); |
| 655 warning = WebInspector.TimelineUIUtils.eventWarning(event); | 657 warning = WebInspector.TimelineUIUtils.eventWarning(event); |
| 656 } else if (type === WebInspector.TimelineFlameChartEntryType.Frame) { | 658 } else if (type === WebInspector.TimelineFlameChartEntryType.Frame) { |
| 657 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._entryD
ata[entryIndex]); | 659 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._entryD
ata[entryIndex]); |
| 658 time = WebInspector.UIString("%s ~ %.0f\u2009fps", Number.preciseMil
lisToString(frame.duration, 1), (1000 / frame.duration)); | 660 time = WebInspector.UIString("%s ~ %.0f\u2009fps", Number.preciseMil
lisToString(frame.duration, 1), (1000 / frame.duration)); |
| 659 title = frame.idle ? WebInspector.UIString("Idle Frame") : WebInspec
tor.UIString("Frame"); | 661 title = frame.idle ? WebInspector.UIString("Idle Frame") : WebInspec
tor.UIString("Frame"); |
| 660 if (frame.hasWarnings()) { | 662 if (frame.hasWarnings()) { |
| 661 warning = createElement("span"); | 663 warning = createElement("span"); |
| 662 warning.textContent = WebInspector.UIString("Long frame"); | 664 warning.textContent = WebInspector.UIString("Long frame"); |
| 663 } | 665 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 | 821 |
| 820 /** | 822 /** |
| 821 * @param {!WebInspector.TracingModel.Event} event | 823 * @param {!WebInspector.TracingModel.Event} event |
| 822 * @param {number} level | 824 * @param {number} level |
| 823 */ | 825 */ |
| 824 _appendEvent: function(event, level) | 826 _appendEvent: function(event, level) |
| 825 { | 827 { |
| 826 var index = this._entryData.length; | 828 var index = this._entryData.length; |
| 827 this._entryData.push(event); | 829 this._entryData.push(event); |
| 828 this._timelineData.entryLevels[index] = level; | 830 this._timelineData.entryLevels[index] = level; |
| 829 this._timelineData.entryTotalTimes[index] = event.duration || WebInspect
or.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs; | 831 var duration; |
| 832 if (WebInspector.TimelineModel.isMarkerEvent(event)) |
| 833 duration = undefined; |
| 834 else |
| 835 duration = event.duration || WebInspector.TimelineFlameChartDataProv
ider.InstantEventVisibleDurationMs; |
| 836 this._timelineData.entryTotalTimes[index] = duration; |
| 830 this._timelineData.entryStartTimes[index] = event.startTime; | 837 this._timelineData.entryStartTimes[index] = event.startTime; |
| 831 }, | 838 }, |
| 832 | 839 |
| 833 /** | 840 /** |
| 834 * @param {!WebInspector.TracingModel.Event} event | 841 * @param {!WebInspector.TracingModel.Event} event |
| 835 * @param {number} level | 842 * @param {number} level |
| 836 */ | 843 */ |
| 837 _appendFlowEvent: function(event, level) | 844 _appendFlowEvent: function(event, level) |
| 838 { | 845 { |
| 839 var timelineData = this._timelineData; | 846 var timelineData = this._timelineData; |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 /** | 1516 /** |
| 1510 * @constructor | 1517 * @constructor |
| 1511 * @param {!WebInspector.TimelineSelection} selection | 1518 * @param {!WebInspector.TimelineSelection} selection |
| 1512 * @param {number} entryIndex | 1519 * @param {number} entryIndex |
| 1513 */ | 1520 */ |
| 1514 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) | 1521 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) |
| 1515 { | 1522 { |
| 1516 this.timelineSelection = selection; | 1523 this.timelineSelection = selection; |
| 1517 this.entryIndex = entryIndex; | 1524 this.entryIndex = entryIndex; |
| 1518 } | 1525 } |
| OLD | NEW |