Skip to content

Commit 8232367

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
RPP: add JSDoc explaining timelineData.markers
I got confused about what we use them for the other day and how we draw LCP/etc markers. Leaving this comment to at least help the next person out. [email protected] Bug: none Change-Id: I0bd0e5926e0e1ac5c33010bfc834d396b1649eeb Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6891412 Commit-Queue: Paul Irish <[email protected]> Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Paul Irish <[email protected]>
1 parent 436c0c0 commit 8232367

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

front_end/panels/timeline/TimingsTrackAppender.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ export class TimingsTrackAppender implements TrackAppender {
115115
* extension markers (the first available level to append more data).
116116
*/
117117
#appendExtensionsAtLevel(currentLevel: number): number {
118-
let markers: Trace.Types.Extensions.SyntheticExtensionMarker[] = [];
119-
markers = markers.concat(this.#extensionMarkers).sort((m1, m2) => m1.ts - m2.ts);
118+
const markers = this.#extensionMarkers.toSorted((m1, m2) => m1.ts - m2.ts);
120119
if (markers.length === 0) {
121120
return currentLevel;
122121
}

front_end/ui/legacy/components/perf_ui/FlameChart.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4194,6 +4194,18 @@ export class FlameChartTimelineData {
41944194
**/
41954195
entryDecorations: FlameChartDecoration[][];
41964196
groups: Group[];
4197+
4198+
/**
4199+
* Markers are events with vertical lines that go down the entire timeline at their start time.
4200+
* These are only used now in the Extensibility API; users can provide a
4201+
* `marker` event
4202+
* (https://developer.chrome.com/docs/devtools/performance/extension#inject_your_data_with_the_user_timings_api)
4203+
* which will render with a vertical line.
4204+
* If you are wondering what we use to draw page events like LCP, those are
4205+
* done via the overlays system. In time, it probably makes sense to use the
4206+
* overlays for e11y marker events too, and then we can remove markers from
4207+
* TimelineData, rather than have two systems to build the same UI...
4208+
*/
41974209
markers: FlameChartMarker[];
41984210

41994211
// These four arrays are used to draw the initiator arrows, and if there are

0 commit comments

Comments
 (0)