Skip to content

Commit 5c0078a

Browse files
and-oliDevtools-frontend LUCI CQ
authored andcommitted
[RPP] check for negative entry index before processing initiator data
The check for -1 value is moved early in the processing, to ensure the data is cleared up and not prevented due to early returns. Fixed: 408140272 Change-Id: Icbf4f88403b0e7642e311ff810133bfa34329238 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6429725 Commit-Queue: Andres Olivares <andoli@chromium.org> Auto-Submit: Andres Olivares <andoli@chromium.org> Reviewed-by: Alina Varkki <alinavarkki@chromium.org>
1 parent 3f241ae commit 5c0078a

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

front_end/panels/timeline/TimelineFlameChartDataProvider.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,16 +1249,6 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
12491249
if (!this.timelineDataInternal) {
12501250
return false;
12511251
}
1252-
if (this.lastInitiatorEntry === entryIndex) {
1253-
if (this.lastInitiatorsData) {
1254-
this.timelineDataInternal.initiatorsData = this.lastInitiatorsData;
1255-
}
1256-
return false;
1257-
}
1258-
if (!this.compatibilityTracksAppender) {
1259-
return false;
1260-
}
1261-
12621252
// Remove all previously assigned decorations indicating that the flow event entries are hidden
12631253
const previousInitiatorsDataLength = this.timelineDataInternal.initiatorsData.length;
12641254
// |entryIndex| equals -1 means there is no entry selected, just clear the
@@ -1274,6 +1264,15 @@ export class TimelineFlameChartDataProvider extends Common.ObjectWrapper.ObjectW
12741264
this.timelineDataInternal.resetFlowData();
12751265
return true;
12761266
}
1267+
if (this.lastInitiatorEntry === entryIndex) {
1268+
if (this.lastInitiatorsData) {
1269+
this.timelineDataInternal.initiatorsData = this.lastInitiatorsData;
1270+
}
1271+
return false;
1272+
}
1273+
if (!this.compatibilityTracksAppender) {
1274+
return false;
1275+
}
12771276

12781277
const entryType = this.#entryTypeForIndex(entryIndex);
12791278
if (entryType !== EntryType.TRACK_APPENDER) {

0 commit comments

Comments
 (0)