Chromium Code Reviews| 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 e._blackboxRoot = true; | 330 e._blackboxRoot = true; |
| 331 } | 331 } |
| 332 if (title) { | 332 if (title) { |
| 333 this._appendHeader(title, style, forceExpanded); | 333 this._appendHeader(title, style, forceExpanded); |
| 334 title = ''; | 334 title = ''; |
| 335 } | 335 } |
| 336 | 336 |
| 337 var level = this._currentLevel + openEvents.length; | 337 var level = this._currentLevel + openEvents.length; |
| 338 if (flowEventsEnabled) | 338 if (flowEventsEnabled) |
| 339 this._appendFlowEvent(e, level); | 339 this._appendFlowEvent(e, level); |
| 340 this._appendEvent(e, level); | 340 if (e.phase !== SDK.TracingModel.Phase.FlowEnd) |
| 341 this._appendEvent(e, level); | |
| 341 if (!isExtension && TimelineModel.TimelineModel.isMarkerEvent(e)) | 342 if (!isExtension && TimelineModel.TimelineModel.isMarkerEvent(e)) |
| 342 this._timelineData.entryTotalTimes[this._entryData.length] = undefined; | 343 this._timelineData.entryTotalTimes[this._entryData.length] = undefined; |
| 343 | 344 |
| 344 maxStackDepth = Math.max(maxStackDepth, openEvents.length + 1); | 345 maxStackDepth = Math.max(maxStackDepth, openEvents.length + 1); |
| 345 if (e.endTime) | 346 if (e.endTime) |
| 346 openEvents.push(e); | 347 openEvents.push(e); |
| 347 } | 348 } |
| 348 this._entryTypeByLevel.length = this._currentLevel + maxStackDepth; | 349 this._entryTypeByLevel.length = this._currentLevel + maxStackDepth; |
| 349 this._entryTypeByLevel.fill(entryType, this._currentLevel); | 350 this._entryTypeByLevel.fill(entryType, this._currentLevel); |
| 350 this._currentLevel += maxStackDepth; | 351 this._currentLevel += maxStackDepth; |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 748 timelineData.flowStartTimes.push(event.startTime); | 749 timelineData.flowStartTimes.push(event.startTime); |
| 749 timelineData.flowStartLevels.push(level); | 750 timelineData.flowStartLevels.push(level); |
| 750 return flowIndex; | 751 return flowIndex; |
| 751 } | 752 } |
| 752 | 753 |
| 753 /** | 754 /** |
| 754 * @param {!SDK.TracingModel.Event} event | 755 * @param {!SDK.TracingModel.Event} event |
| 755 * @param {number} flowIndex | 756 * @param {number} flowIndex |
| 756 */ | 757 */ |
| 757 function pushEndFlow(event, flowIndex) { | 758 function pushEndFlow(event, flowIndex) { |
| 759 if (flowIndex < 0) | |
|
caseq
2017/03/14 02:09:43
How can this happen?
pfeldman
2017/03/14 02:29:24
That's a way to filter out things. Filtering in th
| |
| 760 return; | |
| 758 timelineData.flowEndTimes[flowIndex] = event.startTime; | 761 timelineData.flowEndTimes[flowIndex] = event.startTime; |
| 759 timelineData.flowEndLevels[flowIndex] = level; | 762 timelineData.flowEndLevels[flowIndex] = level; |
| 760 } | 763 } |
| 761 | 764 |
| 762 switch (event.phase) { | 765 switch (event.phase) { |
| 763 case SDK.TracingModel.Phase.FlowBegin: | 766 case SDK.TracingModel.Phase.FlowBegin: |
| 764 this._flowEventIndexById.set(event.id, pushStartFlow(event)); | 767 this._flowEventIndexById.set(event.id, pushStartFlow(event)); |
| 765 break; | 768 break; |
| 766 case SDK.TracingModel.Phase.FlowStep: | 769 case SDK.TracingModel.Phase.FlowStep: |
| 767 pushEndFlow(event, this._flowEventIndexById.get(event.id)); | 770 pushEndFlow(event, this._flowEventIndexById.get(event.id)); |
|
caseq
2017/03/14 02:44:47
btw, I think you shouldn't use raw event id for t
| |
| 768 this._flowEventIndexById.set(event.id, pushStartFlow(event)); | 771 this._flowEventIndexById.set(event.id, pushStartFlow(event)); |
| 769 break; | 772 break; |
| 770 case SDK.TracingModel.Phase.FlowEnd: | 773 case SDK.TracingModel.Phase.FlowEnd: |
| 771 pushEndFlow(event, this._flowEventIndexById.get(event.id)); | 774 pushEndFlow(event, this._flowEventIndexById.get(event.id)); |
| 772 this._flowEventIndexById.delete(event.id); | 775 this._flowEventIndexById.delete(event.id); |
| 773 break; | 776 break; |
| 774 } | 777 } |
| 775 } | 778 } |
| 776 | 779 |
| 777 /** | 780 /** |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 868 * @return {boolean} | 871 * @return {boolean} |
| 869 */ | 872 */ |
| 870 _isVisible(event) { | 873 _isVisible(event) { |
| 871 return this._filters.every(function(filter) { | 874 return this._filters.every(function(filter) { |
| 872 return filter.accept(event); | 875 return filter.accept(event); |
| 873 }); | 876 }); |
| 874 } | 877 } |
| 875 }; | 878 }; |
| 876 | 879 |
| 877 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; | 880 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; |
| OLD | NEW |