| 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 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 883 if (task.startTime > endTime) | 883 if (task.startTime > endTime) |
| 884 break; | 884 break; |
| 885 aggregateTimeForRecordWithinWindow(task); | 885 aggregateTimeForRecordWithinWindow(task); |
| 886 } | 886 } |
| 887 | 887 |
| 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 energy = 0; |
| 894 if (Capabilities.canProfilePower) |
| 895 energy = this._viewsForMode(WebInspector.TimelinePanel.Mode.Power).o
verviewView.calculateEnergy(startTime, endTime); |
| 896 |
| 893 var fragment = document.createDocumentFragment(); | 897 var fragment = document.createDocumentFragment(); |
| 894 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre
gatedStats)); | 898 fragment.appendChild(WebInspector.TimelineUIUtils.generatePieChart(aggre
gatedStats, undefined, undefined, energy)); |
| 895 var startOffset = startTime - this._model.minimumRecordTime(); | 899 var startOffset = startTime - this._model.minimumRecordTime(); |
| 896 var endOffset = endTime - this._model.minimumRecordTime(); | 900 var endOffset = endTime - this._model.minimumRecordTime(); |
| 897 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString(
startOffset), Number.millisToString(endOffset)); | 901 var title = WebInspector.UIString("%s \u2013 %s", Number.millisToString(
startOffset), Number.millisToString(endOffset)); |
| 898 this._detailsView.setContent(title, fragment); | 902 this._detailsView.setContent(title, fragment); |
| 899 }, | 903 }, |
| 900 | 904 |
| 901 /** | 905 /** |
| 902 * @param {?WebInspector.TimelineModel.Record} record | 906 * @param {?WebInspector.TimelineModel.Record} record |
| 903 */ | 907 */ |
| 904 selectRecord: function(record) | 908 selectRecord: function(record) |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 * @param {!WebInspector.TimelineModel.Record} record | 1189 * @param {!WebInspector.TimelineModel.Record} record |
| 1186 * @return {boolean} | 1190 * @return {boolean} |
| 1187 */ | 1191 */ |
| 1188 accept: function(record) | 1192 accept: function(record) |
| 1189 { | 1193 { |
| 1190 return !this._hiddenRecords[record.type]; | 1194 return !this._hiddenRecords[record.type]; |
| 1191 }, | 1195 }, |
| 1192 | 1196 |
| 1193 __proto__: WebInspector.TimelineModel.Filter.prototype | 1197 __proto__: WebInspector.TimelineModel.Filter.prototype |
| 1194 } | 1198 } |
| OLD | NEW |