OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 */ | 1039 */ |
1040 static _filterForStats() { | 1040 static _filterForStats() { |
1041 var visibleEventsFilter = Timeline.TimelineUIUtils.visibleEventsFilter(); | 1041 var visibleEventsFilter = Timeline.TimelineUIUtils.visibleEventsFilter(); |
1042 return event => visibleEventsFilter.accept(event) || SDK.TracingModel.isTopL
evelEvent(event); | 1042 return event => visibleEventsFilter.accept(event) || SDK.TracingModel.isTopL
evelEvent(event); |
1043 } | 1043 } |
1044 /** | 1044 /** |
1045 * @param {!TimelineModel.TimelineModel} model | 1045 * @param {!TimelineModel.TimelineModel} model |
1046 */ | 1046 */ |
1047 static _buildRangeStatsCacheIfNeeded(model) { | 1047 static _buildRangeStatsCacheIfNeeded(model) { |
1048 var tasks = model.mainThreadTasks(); | 1048 var tasks = model.mainThreadTasks(); |
1049 if (tasks.length && tasks[0][Timeline.TimelineUIUtils._categoryBreakdownCach
eSymbol]) | 1049 var filter = Timeline.TimelineUIUtils._filterForStats(); |
| 1050 var firstTask = tasks.find(filter); |
| 1051 if (!firstTask || firstTask[Timeline.TimelineUIUtils._categoryBreakdownCache
Symbol]) |
1050 return; | 1052 return; |
1051 var aggregatedStats = {}; | 1053 var aggregatedStats = {}; |
1052 var ownTimes = []; | 1054 var ownTimes = []; |
1053 TimelineModel.TimelineModel.forEachEvent( | 1055 TimelineModel.TimelineModel.forEachEvent( |
1054 model.mainThreadEvents(), onStartEvent, onEndEvent, undefined, undefined
, undefined, | 1056 model.mainThreadEvents(), onStartEvent, onEndEvent, undefined, undefined
, undefined, filter); |
1055 Timeline.TimelineUIUtils._filterForStats()); | |
1056 | 1057 |
1057 /** | 1058 /** |
1058 * @param {!SDK.TracingModel.Event} e | 1059 * @param {!SDK.TracingModel.Event} e |
1059 */ | 1060 */ |
1060 function onStartEvent(e) { | 1061 function onStartEvent(e) { |
1061 if (ownTimes.length) | 1062 if (ownTimes.length) |
1062 ownTimes[ownTimes.length - 1] -= e.duration; | 1063 ownTimes[ownTimes.length - 1] -= e.duration; |
1063 ownTimes.push(e.duration); | 1064 ownTimes.push(e.duration); |
1064 } | 1065 } |
1065 | 1066 |
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 * @param {string=} warningType | 2311 * @param {string=} warningType |
2311 */ | 2312 */ |
2312 appendWarningRow(event, warningType) { | 2313 appendWarningRow(event, warningType) { |
2313 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); | 2314 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); |
2314 if (warning) | 2315 if (warning) |
2315 this.appendElementRow(Common.UIString('Warning'), warning, true); | 2316 this.appendElementRow(Common.UIString('Warning'), warning, true); |
2316 } | 2317 } |
2317 }; | 2318 }; |
2318 | 2319 |
2319 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); | 2320 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo
wnCache'); |
OLD | NEW |