Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js

Issue 2797763003: DevTools: Show the full chain of initiators on the flame chart. (Closed)
Patch Set: Addressing comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 buildFlowForInitiator(entryIndex) { 868 buildFlowForInitiator(entryIndex) {
869 if (this._lastInitiatorEntry === entryIndex) 869 if (this._lastInitiatorEntry === entryIndex)
870 return false; 870 return false;
871 this._lastInitiatorEntry = entryIndex; 871 this._lastInitiatorEntry = entryIndex;
872 var event = this.eventByIndex(entryIndex); 872 var event = this.eventByIndex(entryIndex);
873 var td = this._timelineData; 873 var td = this._timelineData;
874 td.flowStartTimes = []; 874 td.flowStartTimes = [];
875 td.flowStartLevels = []; 875 td.flowStartLevels = [];
876 td.flowEndTimes = []; 876 td.flowEndTimes = [];
877 td.flowEndLevels = []; 877 td.flowEndLevels = [];
878 // Find the closest ancestor with an initiator. 878 while (event) {
879 var initiator; 879 // Find the closest ancestor with an initiator.
880 for (; event; event = this._eventParent(event)) { 880 var initiator;
881 if (!this._isVisible(event)) 881 for (; event; event = this._eventParent(event)) {
882 continue; 882 initiator = TimelineModel.TimelineData.forEvent(event).initiator();
883 initiator = TimelineModel.TimelineData.forEvent(event).initiator(); 883 if (initiator)
884 if (initiator) 884 break;
885 }
886 if (!initiator)
885 break; 887 break;
888 var eventIndex = event[Timeline.TimelineFlameChartDataProvider._indexSymbo l];
889 var initiatorIndex = initiator[Timeline.TimelineFlameChartDataProvider._in dexSymbol];
890 td.flowStartTimes.push(initiator.endTime || initiator.startTime);
891 td.flowStartLevels.push(td.entryLevels[initiatorIndex]);
892 td.flowEndTimes.push(event.startTime);
893 td.flowEndLevels.push(td.entryLevels[eventIndex]);
894 event = initiator;
886 } 895 }
887 if (!initiator || !this._isVisible(initiator))
888 return true;
889 var eventIndex = event[Timeline.TimelineFlameChartDataProvider._indexSymbol] ;
890 var initiatorIndex = initiator[Timeline.TimelineFlameChartDataProvider._inde xSymbol];
891 td.flowStartTimes.push(initiator.endTime || initiator.startTime);
892 td.flowStartLevels.push(td.entryLevels[initiatorIndex]);
893 td.flowEndTimes.push(event.startTime);
894 td.flowEndLevels.push(td.entryLevels[eventIndex]);
895 return true; 896 return true;
896 } 897 }
897 898
898 /** 899 /**
899 * @param {!SDK.TracingModel.Event} event 900 * @param {!SDK.TracingModel.Event} event
900 * @return {?SDK.TracingModel.Event} 901 * @return {?SDK.TracingModel.Event}
901 */ 902 */
902 _eventParent(event) { 903 _eventParent(event) {
903 return this._entryParent[event[Timeline.TimelineFlameChartDataProvider._inde xSymbol]] || null; 904 return this._entryParent[event[Timeline.TimelineFlameChartDataProvider._inde xSymbol]] || null;
904 } 905 }
905 906
906 /** 907 /**
907 * @param {number} entryIndex 908 * @param {number} entryIndex
908 * @return {?SDK.TracingModel.Event} 909 * @return {?SDK.TracingModel.Event}
909 */ 910 */
910 eventByIndex(entryIndex) { 911 eventByIndex(entryIndex) {
911 return this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType. Event ? 912 return this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType. Event ?
912 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) : 913 /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) :
913 null; 914 null;
914 } 915 }
915 }; 916 };
916 917
917 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001; 918 Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001;
918 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index'); 919 Timeline.TimelineFlameChartDataProvider._indexSymbol = Symbol('index');
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698