perfetto-ui: Make TrackState generic

Previously track specific config (cpu number, upid, utid etc) was
directly part of TrackState. This was unfortunate as it meant
editing TrackState (and reducer.ts and actions.ts) anytime we
added a new track or edited the config of an existing track.

This CL introduces a 'config' field on TrackState which
each track type can fill with its own custom data. To support this
both Track and TrackController now take an optional type parameter:
Config which determines the type of this field.

Also removes AddChromeTrack and makes AddTrack generic.

Change-Id: Ideabf3496c796579bda0fbc0eabb18fb08fa6ec3
diff --git a/ui/src/frontend/track.ts b/ui/src/frontend/track.ts
index 724041f..64dc3b3 100644
--- a/ui/src/frontend/track.ts
+++ b/ui/src/frontend/track.ts
@@ -32,15 +32,22 @@
 /**
  * The abstract class that needs to be implemented by all tracks.
  */
-export abstract class Track {
+export abstract class Track<Config = {}> {
   /**
    * Receive data published by the TrackController of this track.
    */
   constructor(protected trackState: TrackState) {}
   abstract renderCanvas(ctx: CanvasRenderingContext2D): void;
+
+  get config(): Config {
+    return this.trackState.config as Config;
+  }
+
   getHeight(): number {
     return 40;
   }
+
   onMouseMove(_position: {x: number, y: number}) {}
+
   onMouseOut() {}
 }