[ui] Port "cpu_slice" tracks to plugin tracks.
These tracks are a bit more complex than the ftrace tracks.
- `CpuSliceTrackController` relies on `onSetup()` - I added an
`onCreate()` hook to the `TrackLike` interface and call it from
`TrackPanel` just after the track is created.
- `CpuSliceTrack` track calls `drawTrackHoverTooltip()`, which wasn't
implemented in `TrackAdapter`. Rather than duplicate it I pulled the
functionality out into a helper function as it's fairly standalone
anyway, and also removed it from `Track`. A few other tracks also
needed to be updated slightly.
- `CpuSliceTrack` needs to know it's track ID for making single
selections, so I updated `TrackPanel` to pass this ID down to the
track factory, and modified `TrackWithControllerAdapter` to accept and
store this ID, passing it to the underlying track implementation.
- `CpuSliceTrackController` needs to know it's ID for creating unique
table names. However due to the implementation of the TrackController
constructor, I was unable to pass down the ID to the controller
without changing the implementation of all `TrackController`'s
constructors. So, instead,`TrackControllerAdapter` just creates a
uuid when the object is constructed which is used for a unique table
name that.
- `CpuSliceTrackController` requires the use of `calcCachedBucketSize()`
which is actually fairly standalone so I moved this out of the
`TrackController` base class into a separate helper function.
- CPU aggregation controllers previously worked out which CPUs to
aggregate for by looking at the current area selection and seeing how
many `CPU_SLICE_TRACK_KIND` tracks it covered, resolving the track
configs to find the CPU numbers. This no longer worked after porting,
as all plugin tracks have the special `PLUGIN_TRACK_KIND`. Thus, I
added the ability for plugins to define tags for tracks, and the
aggregation controllers now use those tags to work out which cpus to
aggregate.
Change-Id: Ie0e12f7154f83196fff5ff9badc0520724c75aba
diff --git a/ui/src/common/basic_async_track.ts b/ui/src/common/basic_async_track.ts
index a7f4212..24e3f28 100644
--- a/ui/src/common/basic_async_track.ts
+++ b/ui/src/common/basic_async_track.ts
@@ -46,6 +46,8 @@
private currentState?: TrackData;
protected data?: Data;
+ onCreate(): void {}
+
onDestroy(): void {
this.queuedRequest = false;
this.currentState = undefined;