OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 var aggregatedTotal = 0; | 888 var aggregatedTotal = 0; |
889 for (var categoryName in aggregatedStats) | 889 for (var categoryName in aggregatedStats) |
890 aggregatedTotal += aggregatedStats[categoryName]; | 890 aggregatedTotal += aggregatedStats[categoryName]; |
891 aggregatedStats["idle"] = Math.max(0, endTime - startTime - aggregatedTo
tal); | 891 aggregatedStats["idle"] = Math.max(0, endTime - startTime - aggregatedTo
tal); |
892 | 892 |
893 var fragment = document.createDocumentFragment(); | 893 var fragment = document.createDocumentFragment(); |
894 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre
gatedStats)); | 894 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre
gatedStats)); |
895 var startOffset = startTime - this._model.minimumRecordTime(); | 895 var startOffset = startTime - this._model.minimumRecordTime(); |
896 var endOffset = endTime - this._model.minimumRecordTime(); | 896 var endOffset = endTime - this._model.minimumRecordTime(); |
897 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString(
startOffset), Number.millisToString(endOffset)); | 897 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString(
startOffset), Number.millisToString(endOffset)); |
| 898 |
| 899 if (Capabilities.canProfilePower) { |
| 900 var powerOverview = /** @type {!WebInspector.TimelinePowerOverview}
*/ (this._viewsForMode(WebInspector.TimelinePanel.Mode.Power).overviewView); |
| 901 energy = powerOverview.calculateEnergy(startTime, endTime); |
| 902 title += WebInspector.UIString(" Energy: %.2f Joules", energy); |
| 903 } |
898 this._detailsView.setContent(title, fragment); | 904 this._detailsView.setContent(title, fragment); |
899 }, | 905 }, |
900 | 906 |
901 /** | 907 /** |
902 * @param {?WebInspector.TimelineModel.Record} record | 908 * @param {?WebInspector.TimelineModel.Record} record |
903 */ | 909 */ |
904 selectRecord: function(record) | 910 selectRecord: function(record) |
905 { | 911 { |
906 this._detailsLinkifier.reset(); | 912 this._detailsLinkifier.reset(); |
907 this._selectedRecord = record; | 913 this._selectedRecord = record; |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 * @param {!WebInspector.TimelineModel.Record} record | 1191 * @param {!WebInspector.TimelineModel.Record} record |
1186 * @return {boolean} | 1192 * @return {boolean} |
1187 */ | 1193 */ |
1188 accept: function(record) | 1194 accept: function(record) |
1189 { | 1195 { |
1190 return !this._hiddenRecords[record.type]; | 1196 return !this._hiddenRecords[record.type]; |
1191 }, | 1197 }, |
1192 | 1198 |
1193 __proto__: WebInspector.TimelineModel.Filter.prototype | 1199 __proto__: WebInspector.TimelineModel.Filter.prototype |
1194 } | 1200 } |
OLD | NEW |