[ui] Fix eslint issues (`ui/eslint-all --fix`)

Change-Id: Idaa87c4d126af606d45c326d1a7d73341a0557c1
diff --git a/ui/src/controller/adb.ts b/ui/src/controller/adb.ts
index 2b592a2..258c9c6 100644
--- a/ui/src/controller/adb.ts
+++ b/ui/src/controller/adb.ts
@@ -185,7 +185,7 @@
   }
 
   findEndpointNumber(
-      endpoints: USBEndpoint[], direction: 'out'|'in', type = 'bulk'): number {
+    endpoints: USBEndpoint[], direction: 'out'|'in', type = 'bulk'): number {
     const ep =
         endpoints.find((ep) => ep.type === type && ep.direction === direction);
 
@@ -196,18 +196,18 @@
 
   receiveDeviceMessages() {
     this.recv()
-        .then((msg) => {
-          this.onMessage(msg);
-          this.receiveDeviceMessages();
-        })
-        .catch((e) => {
-          // Ignore error with "DEVICE_NOT_SET_ERROR" message since it is always
-          // thrown after the device disconnects.
-          if (e.message !== DEVICE_NOT_SET_ERROR) {
-            console.error(`Exception in recv: ${e.name}. error: ${e.message}`);
-          }
-          this.disconnect();
-        });
+      .then((msg) => {
+        this.onMessage(msg);
+        this.receiveDeviceMessages();
+      })
+      .catch((e) => {
+        // Ignore error with "DEVICE_NOT_SET_ERROR" message since it is always
+        // thrown after the device disconnects.
+        if (e.message !== DEVICE_NOT_SET_ERROR) {
+          console.error(`Exception in recv: ${e.name}. error: ${e.message}`);
+        }
+        this.disconnect();
+      });
   }
 
   async onMessage(msg: AdbMsg) {
@@ -217,14 +217,14 @@
       this.handleAuthentication(msg);
     } else if (msg.cmd === 'CNXN') {
       console.assert(
-          [AdbState.AUTH_STEP2, AdbState.AUTH_STEP3].includes(this.state));
+        [AdbState.AUTH_STEP2, AdbState.AUTH_STEP3].includes(this.state));
       this.state = AdbState.CONNECTED;
       this.handleConnectedMessage(msg);
     } else if (this.state === AdbState.CONNECTED && [
-                 'OKAY',
-                 'WRTE',
-                 'CLSE',
-               ].indexOf(msg.cmd) >= 0) {
+      'OKAY',
+      'WRTE',
+      'CLSE',
+    ].indexOf(msg.cmd) >= 0) {
       const stream = this.streams.get(msg.arg1);
       if (!stream) {
         console.warn(`Received message ${msg} for unknown stream ${msg.arg1}`);
@@ -305,7 +305,7 @@
         resolve(stream);
       };
       stream.onClose = () =>
-          reject(new Error(`Failed to openStream svc=${svc}`));
+        reject(new Error(`Failed to openStream svc=${svc}`));
     });
   }
 
@@ -320,9 +320,9 @@
   }
 
   async send(
-      cmd: CmdType, arg0: number, arg1: number, data?: Uint8Array|string) {
+    cmd: CmdType, arg0: number, arg1: number, data?: Uint8Array|string) {
     await this.sendMsg(AdbMsgImpl.create(
-        {cmd, arg0, arg1, data, useChecksum: this.useChecksum}));
+      {cmd, arg0, arg1, data, useChecksum: this.useChecksum}));
   }
 
   //  The header and the message data must be sent consecutively. Using 2 awaits
@@ -362,7 +362,7 @@
     };
 
     const key = await crypto.subtle.generateKey(
-        keySpec, /* extractable=*/ true, ['sign', 'verify']);
+      keySpec, /* extractable=*/ true, ['sign', 'verify']);
     return key;
   }
 
@@ -428,7 +428,7 @@
 
     if (this.writeQueue.length > 0) {
       console.error(`Dropping ${
-          this.writeQueue.length} queued messages due to stream closing.`);
+        this.writeQueue.length} queued messages due to stream closing.`);
       this.writeQueue = [];
     }
 
@@ -483,7 +483,7 @@
       return;
     }
     console.error(
-        `Unexpected stream msg ${msg.toString()} in state ${this.state}`);
+      `Unexpected stream msg ${msg.toString()} in state ${this.state}`);
   }
 }
 
@@ -504,8 +504,8 @@
   useChecksum: boolean;
 
   constructor(
-      cmd: CmdType, arg0: number, arg1: number, dataLen: number,
-      dataChecksum: number, useChecksum = false) {
+    cmd: CmdType, arg0: number, arg1: number, dataLen: number,
+    dataChecksum: number, useChecksum = false) {
     console.assert(cmd.length === 4);
     this.cmd = cmd;
     this.arg0 = arg0;
@@ -655,7 +655,7 @@
 // CL can work:
 // https://android-review.googlesource.com/c/platform/external/perfetto/+/1105354/18
 async function signAdbTokenWithPrivateKey(
-    _privateKey: CryptoKey, token: Uint8Array): Promise<ArrayBuffer> {
+  _privateKey: CryptoKey, token: Uint8Array): Promise<ArrayBuffer> {
   // This function is not implemented.
   return token.buffer;
 }
diff --git a/ui/src/controller/adb_base_controller.ts b/ui/src/controller/adb_base_controller.ts
index e55c11c..3bb0249 100644
--- a/ui/src/controller/adb_base_controller.ts
+++ b/ui/src/controller/adb_base_controller.ts
@@ -78,7 +78,7 @@
           this.state = AdbConnectionState.READY_TO_CONNECT;
           const target = globals.state.recordingTarget;
           throw Error(`Device with serial ${
-              isAdbTarget(target) ? target.serial : 'n/a'} not found.`);
+            isAdbTarget(target) ? target.serial : 'n/a'} not found.`);
         }
 
         this.sendStatus(`Please allow USB debugging on device.
@@ -118,7 +118,7 @@
     if (!traceConfigProto) return;
     const duration = extractDurationFromTraceConfig(traceConfigProto);
     this.sendStatus(`Recording in progress${
-        exists(duration) ? ' for ' + duration.toString() + ' ms' : ''}...`);
+      exists(duration) ? ' for ' + duration.toString() + ' ms' : ''}...`);
   }
 
   abstract invoke(method: string, argsProto: Uint8Array): void;
diff --git a/ui/src/controller/adb_record_controller_jsdomtest.ts b/ui/src/controller/adb_record_controller_jsdomtest.ts
index efa32c5..538bfd0 100644
--- a/ui/src/controller/adb_record_controller_jsdomtest.ts
+++ b/ui/src/controller/adb_record_controller_jsdomtest.ts
@@ -107,20 +107,20 @@
   testArray[0] = 65;
   const generatedCmd = adbController.generateStartTracingCommand(testArray);
   expect(generatedCmd)
-      .toBe(`echo '${btoa('A')}' | base64 -d | perfetto -c - -o DEST`);
+    .toBe(`echo '${btoa('A')}' | base64 -d | perfetto -c - -o DEST`);
 });
 
 test('tracingEndedSuccessfully', () => {
   expect(
-      adbController.tracingEndedSuccessfully(
-          'Connected to the Perfetto traced service, starting tracing for 10000 ms\nWrote 564 bytes into /data/misc/perfetto-traces/trace'))
-      .toBe(true);
+    adbController.tracingEndedSuccessfully(
+      'Connected to the Perfetto traced service, starting tracing for 10000 ms\nWrote 564 bytes into /data/misc/perfetto-traces/trace'))
+    .toBe(true);
   expect(
-      adbController.tracingEndedSuccessfully(
-          'Connected to the Perfetto traced service, starting tracing for 10000 ms'))
-      .toBe(false);
+    adbController.tracingEndedSuccessfully(
+      'Connected to the Perfetto traced service, starting tracing for 10000 ms'))
+    .toBe(false);
   expect(
-      adbController.tracingEndedSuccessfully(
-          'Connected to the Perfetto traced service, starting tracing for 0 ms'))
-      .toBe(false);
+    adbController.tracingEndedSuccessfully(
+      'Connected to the Perfetto traced service, starting tracing for 0 ms'))
+    .toBe(false);
 });
diff --git a/ui/src/controller/adb_shell_controller.ts b/ui/src/controller/adb_shell_controller.ts
index d2fe620..3a95708 100644
--- a/ui/src/controller/adb_shell_controller.ts
+++ b/ui/src/controller/adb_shell_controller.ts
@@ -45,23 +45,23 @@
     console.assert(this.state === AdbConnectionState.CONNECTED);
 
     switch (method) {
-      case 'EnableTracing':
-        this.enableTracing(params);
-        break;
-      case 'ReadBuffers':
-        this.readBuffers();
-        break;
-      case 'DisableTracing':
-        this.disableTracing();
-        break;
-      case 'FreeBuffers':
-        this.freeBuffers();
-        break;
-      case 'GetTraceStats':
-        break;
-      default:
-        this.sendErrorMessage(`Method not recognized: ${method}`);
-        break;
+    case 'EnableTracing':
+      this.enableTracing(params);
+      break;
+    case 'ReadBuffers':
+      this.readBuffers();
+      break;
+    case 'DisableTracing':
+      this.disableTracing();
+      break;
+    case 'FreeBuffers':
+      this.freeBuffers();
+      break;
+    case 'GetTraceStats':
+      break;
+    default:
+      this.sendErrorMessage(`Method not recognized: ${method}`);
+      break;
     }
   }
 
@@ -110,11 +110,11 @@
     const readTraceShell =
         await this.adb.shell(this.generateReadTraceCommand());
     readTraceShell.onData = (raw) =>
-        this.sendMessage(this.generateChunkReadResponse(raw));
+      this.sendMessage(this.generateChunkReadResponse(raw));
 
     readTraceShell.onClose = () => {
       this.sendMessage(
-          this.generateChunkReadResponse(new Uint8Array(), /* last */ true));
+        this.generateChunkReadResponse(new Uint8Array(), /* last */ true));
     };
   }
 
diff --git a/ui/src/controller/adb_socket_controller.ts b/ui/src/controller/adb_socket_controller.ts
index bf74fbc..487a4ba 100644
--- a/ui/src/controller/adb_socket_controller.ts
+++ b/ui/src/controller/adb_socket_controller.ts
@@ -124,7 +124,7 @@
     const frame = new IPCFrame({
       requestId,
       msgInvokeMethod: new IPCFrame.InvokeMethod(
-          {serviceId: this.serviceId, methodId, argsProto}),
+        {serviceId: this.serviceId, methodId, argsProto}),
     });
     this.requestMethods.set(requestId, method);
     this.sendFrame(frame);
@@ -221,9 +221,9 @@
         const bytesToCompleteMessage =
             this.frameToParseLen - this.incomingBufferLen;
         this.appendToIncomingBuffer(
-            newData.subarray(0, bytesToCompleteMessage));
+          newData.subarray(0, bytesToCompleteMessage));
         this.parseMessage(
-            this.incomingBuffer.subarray(0, this.frameToParseLen));
+          this.incomingBuffer.subarray(0, this.frameToParseLen));
         this.incomingBufferLen = 0;
         // Remove the data just parsed.
         newData = newData.subarray(bytesToCompleteMessage);
@@ -240,7 +240,7 @@
   }
 
   decodeResponse(
-      requestId: number, responseProto: Uint8Array, hasMore = false) {
+    requestId: number, responseProto: Uint8Array, hasMore = false) {
     const method = this.requestMethods.get(requestId);
     if (!method) {
       console.error(`Unknown request id: ${requestId}`);
@@ -296,7 +296,7 @@
 
   sendReadBufferResponse() {
     this.sendMessage(this.generateChunkReadResponse(
-        this.traceProtoWriter.finish(), /* last */ true));
+      this.traceProtoWriter.finish(), /* last */ true));
     this.traceProtoWriter = protobuf.Writer.create();
   }
 
@@ -332,44 +332,44 @@
   handleIncomingFrame(frame: IPCFrame) {
     const requestId = frame.requestId;
     switch (frame.msg) {
-      case 'msgBindServiceReply': {
-        const msgBindServiceReply = frame.msgBindServiceReply;
-        if (msgBindServiceReply && msgBindServiceReply.methods &&
+    case 'msgBindServiceReply': {
+      const msgBindServiceReply = frame.msgBindServiceReply;
+      if (msgBindServiceReply && msgBindServiceReply.methods &&
             /* eslint-disable @typescript-eslint/strict-boolean-expressions */
             msgBindServiceReply.serviceId) {
-          /* eslint-enable */
-          console.assert(msgBindServiceReply.success);
-          this.availableMethods = msgBindServiceReply.methods;
-          this.serviceId = msgBindServiceReply.serviceId;
-          this.resolveBindingPromise();
-          this.resolveBindingPromise = () => {};
-        }
-        return;
+        /* eslint-enable */
+        console.assert(msgBindServiceReply.success);
+        this.availableMethods = msgBindServiceReply.methods;
+        this.serviceId = msgBindServiceReply.serviceId;
+        this.resolveBindingPromise();
+        this.resolveBindingPromise = () => {};
       }
-      case 'msgInvokeMethodReply': {
-        const msgInvokeMethodReply = frame.msgInvokeMethodReply;
-        if (msgInvokeMethodReply && msgInvokeMethodReply.replyProto) {
-          if (!msgInvokeMethodReply.success) {
-            console.error(
-                'Unsuccessful method invocation: ', msgInvokeMethodReply);
-            return;
-          }
-          this.decodeResponse(
-              requestId,
-              msgInvokeMethodReply.replyProto,
-              msgInvokeMethodReply.hasMore === true);
+      return;
+    }
+    case 'msgInvokeMethodReply': {
+      const msgInvokeMethodReply = frame.msgInvokeMethodReply;
+      if (msgInvokeMethodReply && msgInvokeMethodReply.replyProto) {
+        if (!msgInvokeMethodReply.success) {
+          console.error(
+            'Unsuccessful method invocation: ', msgInvokeMethodReply);
+          return;
         }
-        return;
+        this.decodeResponse(
+          requestId,
+          msgInvokeMethodReply.replyProto,
+          msgInvokeMethodReply.hasMore === true);
       }
-      default:
-        console.error(`not recognized frame message: ${frame.msg}`);
+      return;
+    }
+    default:
+      console.error(`not recognized frame message: ${frame.msg}`);
     }
   }
 }
 
 const decoders = new Map<string, Function>()
-                     .set('EnableTracing', EnableTracingResponse.decode)
-                     .set('FreeBuffers', FreeBuffersResponse.decode)
-                     .set('ReadBuffers', ReadBuffersResponse.decode)
-                     .set('DisableTracing', DisableTracingResponse.decode)
-                     .set('GetTraceStats', GetTraceStatsResponse.decode);
+  .set('EnableTracing', EnableTracingResponse.decode)
+  .set('FreeBuffers', FreeBuffersResponse.decode)
+  .set('ReadBuffers', ReadBuffersResponse.decode)
+  .set('DisableTracing', DisableTracingResponse.decode)
+  .set('GetTraceStats', GetTraceStatsResponse.decode);
diff --git a/ui/src/controller/aggregation/aggregation_controller.ts b/ui/src/controller/aggregation/aggregation_controller.ts
index 137d133..b0c145d 100644
--- a/ui/src/controller/aggregation/aggregation_controller.ts
+++ b/ui/src/controller/aggregation/aggregation_controller.ts
@@ -86,14 +86,14 @@
       this.requestingData = true;
       if (sortingChanged) this.previousSorting = aggregatePreferences.sorting;
       this.getAggregateData(area, hasAreaChanged)
-          .then((data) => publishAggregateData({data, kind: this.args.kind}))
-          .finally(() => {
-            this.requestingData = false;
-            if (this.queuedRequest) {
-              this.queuedRequest = false;
-              this.run();
-            }
-          });
+        .then((data) => publishAggregateData({data, kind: this.args.kind}))
+        .finally(() => {
+          this.requestingData = false;
+          if (this.queuedRequest) {
+            this.queuedRequest = false;
+            this.run();
+          }
+        });
     }
   }
 
@@ -115,7 +115,7 @@
     const colIds = defs.map((col) => col.columnId);
     const pref = globals.state.aggregatePreferences[this.kind];
     let sorting = `${this.getDefaultSorting().column} ${
-        this.getDefaultSorting().direction}`;
+      this.getDefaultSorting().direction}`;
     // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
     if (pref && pref.sorting) {
       sorting = `${pref.sorting.column} ${pref.sorting.direction}`;
@@ -171,7 +171,7 @@
   async getSum(def: ColumnDef): Promise<string> {
     if (!def.sum) return '';
     const result = await this.args.engine.query(
-        `select ifnull(sum(${def.columnId}), 0) as s from ${this.kind}`);
+      `select ifnull(sum(${def.columnId}), 0) as s from ${this.kind}`);
     let sum = result.firstRow({s: NUM}).s;
     if (def.kind === 'TIMESTAMP_NS') {
       sum = sum / 1e6;
diff --git a/ui/src/controller/aggregation/thread_aggregation_controller.ts b/ui/src/controller/aggregation/thread_aggregation_controller.ts
index 1473848..9906fab 100644
--- a/ui/src/controller/aggregation/thread_aggregation_controller.ts
+++ b/ui/src/controller/aggregation/thread_aggregation_controller.ts
@@ -77,7 +77,7 @@
     const query = `select state, io_wait as ioWait, sum(dur) as totalDur
       FROM thread JOIN thread_state USING(utid)
       WHERE utid IN (${this.utids}) AND thread_state.ts + thread_state.dur > ${
-        area.start} AND
+  area.start} AND
       thread_state.ts < ${area.end}
       GROUP BY state, io_wait`;
     const result = await engine.query(query);
diff --git a/ui/src/controller/app_controller.ts b/ui/src/controller/app_controller.ts
index b6d9969..256580b 100644
--- a/ui/src/controller/app_controller.ts
+++ b/ui/src/controller/app_controller.ts
@@ -44,7 +44,7 @@
         [Child('permalink', PermalinkController, {})];
     if (!RECORDING_V2_FLAG.get()) {
       childControllers.push(Child(
-          'record', RecordController, {extensionPort: this.extensionPort}));
+        'record', RecordController, {extensionPort: this.extensionPort}));
     }
     if (globals.state.engine !== undefined) {
       const engineCfg = globals.state.engine;
diff --git a/ui/src/controller/args_parser.ts b/ui/src/controller/args_parser.ts
index b36c30b..8ca1b8f 100644
--- a/ui/src/controller/args_parser.ts
+++ b/ui/src/controller/args_parser.ts
@@ -60,7 +60,7 @@
 }
 
 function insert<T>(
-    args: ArgNode<T>[], keys: Key[], path: string, value: T): void {
+  args: ArgNode<T>[], keys: Key[], path: string, value: T): void {
   const currentKey = keys.shift()!;
   let node = args.find((x) => x.key === currentKey);
   if (!node) {
diff --git a/ui/src/controller/args_parser_unittest.ts b/ui/src/controller/args_parser_unittest.ts
index 8586157..e4ea2f7 100644
--- a/ui/src/controller/args_parser_unittest.ts
+++ b/ui/src/controller/args_parser_unittest.ts
@@ -27,70 +27,70 @@
 describe('convertArgsToTree', () => {
   test('converts example arg set', () => {
     expect(convertArgsToTree(args))
-        .toEqual(
-            [
+      .toEqual(
+        [
+          {
+            key: 'simple_key',
+            value: {key: 'simple_key', value: 'simple_value'},
+          },
+          {
+            key: 'thing',
+            children: [
+              {key: 'key', value: {key: 'thing.key', value: 'value'}},
               {
-                key: 'simple_key',
-                value: {key: 'simple_key', value: 'simple_value'},
-              },
-              {
-                key: 'thing',
+                key: 'point',
                 children: [
-                  {key: 'key', value: {key: 'thing.key', value: 'value'}},
                   {
-                    key: 'point',
+                    key: 0,
                     children: [
                       {
-                        key: 0,
-                        children: [
-                          {
-                            key: 'x',
-                            value: {key: 'thing.point[0].x', value: 10},
-                          },
-                          {
-                            key: 'y',
-                            value: {key: 'thing.point[0].y', value: 20},
-                          },
-                        ],
+                        key: 'x',
+                        value: {key: 'thing.point[0].x', value: 10},
                       },
                       {
-                        key: 1,
-                        children: [
-                          {
-                            key: 'x',
-                            value: {key: 'thing.point[1].x', value: 0},
-                          },
-                          {
-                            key: 'y',
-                            value: {key: 'thing.point[1].y', value: -10},
-                          },
-                        ],
+                        key: 'y',
+                        value: {key: 'thing.point[0].y', value: 20},
                       },
                     ],
                   },
-                ],
-              },
-              {
-                key: 'foo',
-                children: [
                   {
-                    key: 'bar',
+                    key: 1,
                     children: [
                       {
-                        key: 'foo',
-                        children: [
-                          {
-                            key: 'bar',
-                            value: {key: 'foo.bar.foo.bar', value: 'baz'},
-                          },
-                        ],
+                        key: 'x',
+                        value: {key: 'thing.point[1].x', value: 0},
+                      },
+                      {
+                        key: 'y',
+                        value: {key: 'thing.point[1].y', value: -10},
                       },
                     ],
                   },
                 ],
               },
             ],
-        );
+          },
+          {
+            key: 'foo',
+            children: [
+              {
+                key: 'bar',
+                children: [
+                  {
+                    key: 'foo',
+                    children: [
+                      {
+                        key: 'bar',
+                        value: {key: 'foo.bar.foo.bar', value: 'baz'},
+                      },
+                    ],
+                  },
+                ],
+              },
+            ],
+          },
+        ],
+      );
   });
 
   test('handles value and children in same node', () => {
diff --git a/ui/src/controller/consumer_port_types.ts b/ui/src/controller/consumer_port_types.ts
index 950c0ed..dcd8a65 100644
--- a/ui/src/controller/consumer_port_types.ts
+++ b/ui/src/controller/consumer_port_types.ts
@@ -27,7 +27,7 @@
 // A type guard that can be used in order to be able to access the property of
 // an object in a checked manner.
 export function hasProperty<T extends object, P extends string>(
-    obj: T, prop: P): obj is T&{[prop in P]: unknown} {
+  obj: T, prop: P): obj is T&{[prop in P]: unknown} {
   return obj.hasOwnProperty(prop);
 }
 
diff --git a/ui/src/controller/controller.ts b/ui/src/controller/controller.ts
index 92d61d0..e4299d5 100644
--- a/ui/src/controller/controller.ts
+++ b/ui/src/controller/controller.ts
@@ -28,9 +28,9 @@
 export type ControllerInitializerAny = ControllerInitializer<any>;
 
 export function Child<ConstructorArgs>(
-    id: string,
-    factory: ControllerFactory<ConstructorArgs>,
-    args: ConstructorArgs): ControllerInitializer<ConstructorArgs> {
+  id: string,
+  factory: ControllerFactory<ConstructorArgs>,
+  args: ConstructorArgs): ControllerInitializer<ConstructorArgs> {
   return {id, factory, args};
 }
 
diff --git a/ui/src/controller/cpu_profile_controller.ts b/ui/src/controller/cpu_profile_controller.ts
index 89f4828..a251442 100644
--- a/ui/src/controller/cpu_profile_controller.ts
+++ b/ui/src/controller/cpu_profile_controller.ts
@@ -54,29 +54,29 @@
     this.lastSelectedSample = this.copyCpuProfileSample(selection);
 
     this.getSampleData(selectedSample.id)
-        .then((sampleData) => {
-          /* eslint-disable @typescript-eslint/strict-boolean-expressions */
-          if (sampleData !== undefined && selectedSample &&
+      .then((sampleData) => {
+        /* eslint-disable @typescript-eslint/strict-boolean-expressions */
+        if (sampleData !== undefined && selectedSample &&
               /* eslint-enable */
               this.lastSelectedSample &&
               this.lastSelectedSample.id === selectedSample.id) {
-            const cpuProfileDetails: CpuProfileDetails = {
-              id: selectedSample.id,
-              ts: selectedSample.ts,
-              utid: selectedSample.utid,
-              stack: sampleData,
-            };
+          const cpuProfileDetails: CpuProfileDetails = {
+            id: selectedSample.id,
+            ts: selectedSample.ts,
+            utid: selectedSample.utid,
+            stack: sampleData,
+          };
 
-            publishCpuProfileDetails(cpuProfileDetails);
-          }
-        })
-        .finally(() => {
-          this.requestingData = false;
-          if (this.queuedRunRequest) {
-            this.queuedRunRequest = false;
-            this.run();
-          }
-        });
+          publishCpuProfileDetails(cpuProfileDetails);
+        }
+      })
+      .finally(() => {
+        this.requestingData = false;
+        if (this.queuedRunRequest) {
+          this.queuedRunRequest = false;
+          this.run();
+        }
+      });
   }
 
   private copyCpuProfileSample(cpuProfileSample: CpuProfileSampleSelection):
diff --git a/ui/src/controller/flamegraph_controller.ts b/ui/src/controller/flamegraph_controller.ts
index 62648df..e856d72 100644
--- a/ui/src/controller/flamegraph_controller.ts
+++ b/ui/src/controller/flamegraph_controller.ts
@@ -53,18 +53,18 @@
 
 function getFlamegraphType(type: ProfileType) {
   switch (type) {
-    case ProfileType.HEAP_PROFILE:
-    case ProfileType.MIXED_HEAP_PROFILE:
-    case ProfileType.NATIVE_HEAP_PROFILE:
-    case ProfileType.JAVA_HEAP_SAMPLES:
-      return 'native';
-    case ProfileType.JAVA_HEAP_GRAPH:
-      return 'graph';
-    case ProfileType.PERF_SAMPLE:
-      return 'perf';
-    default:
-      const exhaustiveCheck: never = type;
-      throw new Error(`Unhandled case: ${exhaustiveCheck}`);
+  case ProfileType.HEAP_PROFILE:
+  case ProfileType.MIXED_HEAP_PROFILE:
+  case ProfileType.NATIVE_HEAP_PROFILE:
+  case ProfileType.JAVA_HEAP_SAMPLES:
+    return 'native';
+  case ProfileType.JAVA_HEAP_GRAPH:
+    return 'graph';
+  case ProfileType.PERF_SAMPLE:
+    return 'perf';
+  default:
+    const exhaustiveCheck: never = type;
+    throw new Error(`Unhandled case: ${exhaustiveCheck}`);
   }
 }
 
@@ -100,7 +100,7 @@
       }
       tableName = `${this.prefix}_${this.tableId++}`;
       await this.engine.query(
-          `create temp table if not exists ${tableName} as ${query}`);
+        `create temp table if not exists ${tableName} as ${query}`);
       this.cache.set(query, tableName);
     }
     return tableName;
@@ -128,7 +128,7 @@
       const upids = [];
       if (!area) {
         this.checkCompletionAndPublishFlamegraph(
-            {...globals.flamegraphDetails, isInAreaSelection: false});
+          {...globals.flamegraphDetails, isInAreaSelection: false});
         return;
       }
       for (const trackId of area.tracks) {
@@ -142,7 +142,7 @@
       }
       if (upids.length === 0) {
         this.checkCompletionAndPublishFlamegraph(
-            {...globals.flamegraphDetails, isInAreaSelection: false});
+          {...globals.flamegraphDetails, isInAreaSelection: false});
         return;
       }
       globals.dispatch(Actions.openFlamegraph({
@@ -167,13 +167,13 @@
   }
 
   private async assembleFlamegraphDetails(
-      selection: FlamegraphState, isInAreaSelection: boolean) {
+    selection: FlamegraphState, isInAreaSelection: boolean) {
     const selectedFlamegraphState = {...selection};
     const flamegraphMetadata = await this.getFlamegraphMetadata(
-        selection.type,
-        selectedFlamegraphState.start,
-        selectedFlamegraphState.end,
-        selectedFlamegraphState.upids);
+      selection.type,
+      selectedFlamegraphState.start,
+      selectedFlamegraphState.end,
+      selectedFlamegraphState.upids);
     if (flamegraphMetadata !== undefined) {
       Object.assign(this.flamegraphDetails, flamegraphMetadata);
     }
@@ -187,28 +187,28 @@
     this.lastSelectedFlamegraphState = {...selection};
 
     const expandedId = selectedFlamegraphState.expandedCallsite ?
-        selectedFlamegraphState.expandedCallsite.id :
-        -1;
+      selectedFlamegraphState.expandedCallsite.id :
+      -1;
     const rootSize = selectedFlamegraphState.expandedCallsite === undefined ?
-        undefined :
-        selectedFlamegraphState.expandedCallsite.totalSize;
+      undefined :
+      selectedFlamegraphState.expandedCallsite.totalSize;
 
     const key = `${selectedFlamegraphState.upids};${
-        selectedFlamegraphState.start};${selectedFlamegraphState.end}`;
+      selectedFlamegraphState.start};${selectedFlamegraphState.end}`;
 
     try {
       const flamegraphData = await this.getFlamegraphData(
-          key,
-          /* eslint-disable @typescript-eslint/strict-boolean-expressions */
-          selectedFlamegraphState.viewingOption ?
-              /* eslint-enable */
-              selectedFlamegraphState.viewingOption :
-              defaultViewingOption(selectedFlamegraphState.type),
-          selection.start,
-          selection.end,
-          selectedFlamegraphState.upids,
-          selectedFlamegraphState.type,
-          selectedFlamegraphState.focusRegex);
+        key,
+        /* eslint-disable @typescript-eslint/strict-boolean-expressions */
+        selectedFlamegraphState.viewingOption ?
+        /* eslint-enable */
+          selectedFlamegraphState.viewingOption :
+          defaultViewingOption(selectedFlamegraphState.type),
+        selection.start,
+        selection.end,
+        selectedFlamegraphState.upids,
+        selectedFlamegraphState.type,
+        selectedFlamegraphState.focusRegex);
       // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
       if (flamegraphData !== undefined && selection &&
           selection.kind === selectedFlamegraphState.kind &&
@@ -217,11 +217,11 @@
         const expandedFlamegraphData =
             expandCallsites(flamegraphData, expandedId);
         this.prepareAndMergeCallsites(
-            expandedFlamegraphData,
-            this.lastSelectedFlamegraphState.viewingOption,
-            isInAreaSelection,
-            rootSize,
-            this.lastSelectedFlamegraphState.expandedCallsite);
+          expandedFlamegraphData,
+          this.lastSelectedFlamegraphState.viewingOption,
+          isInAreaSelection,
+          rootSize,
+          this.lastSelectedFlamegraphState.expandedCallsite);
       }
     } finally {
       this.requestingData = false;
@@ -239,7 +239,7 @@
           this.lastSelectedFlamegraphState.end !== selection.end ||
           this.lastSelectedFlamegraphState.type !== selection.type ||
           !FlamegraphController.areArraysEqual(
-              this.lastSelectedFlamegraphState.upids, selection.upids) ||
+            this.lastSelectedFlamegraphState.upids, selection.upids) ||
           this.lastSelectedFlamegraphState.viewingOption !==
               selection.viewingOption ||
           this.lastSelectedFlamegraphState.focusRegex !==
@@ -249,11 +249,11 @@
   }
 
   private prepareAndMergeCallsites(
-      flamegraphData: CallsiteInfo[],
-      viewingOption: FlamegraphStateViewingOption, isInAreaSelection: boolean,
-      rootSize?: number, expandedCallsite?: CallsiteInfo) {
+    flamegraphData: CallsiteInfo[],
+    viewingOption: FlamegraphStateViewingOption, isInAreaSelection: boolean,
+    rootSize?: number, expandedCallsite?: CallsiteInfo) {
     this.flamegraphDetails.flamegraph = mergeCallsites(
-        flamegraphData, this.getMinSizeDisplayed(flamegraphData, rootSize));
+      flamegraphData, this.getMinSizeDisplayed(flamegraphData, rootSize));
     this.flamegraphDetails.expandedCallsite = expandedCallsite;
     this.flamegraphDetails.viewingOption = viewingOption;
     this.flamegraphDetails.isInAreaSelection = isInAreaSelection;
@@ -265,15 +265,15 @@
     flamegraphDetails.graphIncomplete =
         (await this.args.engine.query(`select value from stats
        where severity = 'error' and name = 'heap_graph_non_finalized_graph'`))
-            .firstRow({value: NUM})
-            .value > 0;
+          .firstRow({value: NUM})
+          .value > 0;
     publishFlamegraphDetails(flamegraphDetails);
   }
 
   async getFlamegraphData(
-      baseKey: string, viewingOption: FlamegraphStateViewingOption, start: time,
-      end: time, upids: number[], type: ProfileType,
-      focusRegex: string): Promise<CallsiteInfo[]> {
+    baseKey: string, viewingOption: FlamegraphStateViewingOption, start: time,
+    end: time, upids: number[], type: ProfileType,
+    focusRegex: string): Promise<CallsiteInfo[]> {
     let currentData: CallsiteInfo[];
     const key = `${baseKey}-${viewingOption}`;
     if (this.flamegraphDatasets.has(key)) {
@@ -287,15 +287,15 @@
       const tableName =
           await this.prepareViewsAndTables(start, end, upids, type, focusRegex);
       currentData = await this.getFlamegraphDataFromTables(
-          tableName, viewingOption, focusRegex);
+        tableName, viewingOption, focusRegex);
       this.flamegraphDatasets.set(key, currentData);
     }
     return currentData;
   }
 
   async getFlamegraphDataFromTables(
-      tableName: string, viewingOption: FlamegraphStateViewingOption,
-      focusRegex: string) {
+    tableName: string, viewingOption: FlamegraphStateViewingOption,
+    focusRegex: string) {
     let orderBy = '';
     let totalColumnName: 'cumulativeSize'|'cumulativeAllocSize'|
         'cumulativeCount'|'cumulativeAllocCount' = 'cumulativeSize';
@@ -304,39 +304,39 @@
     // Alternatively consider collapsing frames of the same label.
     const maxDepth = 100;
     switch (viewingOption) {
-      case FlamegraphStateViewingOption.ALLOC_SPACE_MEMORY_ALLOCATED_KEY:
-        orderBy = `where cumulative_alloc_size > 0 and depth < ${
-            maxDepth} order by depth, parent_id,
+    case FlamegraphStateViewingOption.ALLOC_SPACE_MEMORY_ALLOCATED_KEY:
+      orderBy = `where cumulative_alloc_size > 0 and depth < ${
+        maxDepth} order by depth, parent_id,
             cumulative_alloc_size desc, name`;
-        totalColumnName = 'cumulativeAllocSize';
-        selfColumnName = 'size';
-        break;
-      case FlamegraphStateViewingOption.OBJECTS_ALLOCATED_NOT_FREED_KEY:
-        orderBy = `where cumulative_count > 0 and depth < ${
-            maxDepth} order by depth, parent_id,
+      totalColumnName = 'cumulativeAllocSize';
+      selfColumnName = 'size';
+      break;
+    case FlamegraphStateViewingOption.OBJECTS_ALLOCATED_NOT_FREED_KEY:
+      orderBy = `where cumulative_count > 0 and depth < ${
+        maxDepth} order by depth, parent_id,
             cumulative_count desc, name`;
-        totalColumnName = 'cumulativeCount';
-        selfColumnName = 'count';
-        break;
-      case FlamegraphStateViewingOption.OBJECTS_ALLOCATED_KEY:
-        orderBy = `where cumulative_alloc_count > 0 and depth < ${
-            maxDepth} order by depth, parent_id,
+      totalColumnName = 'cumulativeCount';
+      selfColumnName = 'count';
+      break;
+    case FlamegraphStateViewingOption.OBJECTS_ALLOCATED_KEY:
+      orderBy = `where cumulative_alloc_count > 0 and depth < ${
+        maxDepth} order by depth, parent_id,
             cumulative_alloc_count desc, name`;
-        totalColumnName = 'cumulativeAllocCount';
-        selfColumnName = 'count';
-        break;
-      case FlamegraphStateViewingOption.PERF_SAMPLES_KEY:
-      case FlamegraphStateViewingOption.SPACE_MEMORY_ALLOCATED_NOT_FREED_KEY:
-        orderBy = `where cumulative_size > 0 and depth < ${
-            maxDepth} order by depth, parent_id,
+      totalColumnName = 'cumulativeAllocCount';
+      selfColumnName = 'count';
+      break;
+    case FlamegraphStateViewingOption.PERF_SAMPLES_KEY:
+    case FlamegraphStateViewingOption.SPACE_MEMORY_ALLOCATED_NOT_FREED_KEY:
+      orderBy = `where cumulative_size > 0 and depth < ${
+        maxDepth} order by depth, parent_id,
             cumulative_size desc, name`;
-        totalColumnName = 'cumulativeSize';
-        selfColumnName = 'size';
-        break;
-      default:
-        const exhaustiveCheck: never = viewingOption;
-        throw new Error(`Unhandled case: ${exhaustiveCheck}`);
-        break;
+      totalColumnName = 'cumulativeSize';
+      selfColumnName = 'size';
+      break;
+    default:
+      const exhaustiveCheck: never = viewingOption;
+      throw new Error(`Unhandled case: ${exhaustiveCheck}`);
+      break;
     }
 
     const callsites = await this.args.engine.query(`
@@ -419,8 +419,8 @@
   }
 
   private async prepareViewsAndTables(
-      start: time, end: time, upids: number[], type: ProfileType,
-      focusRegex: string): Promise<string> {
+    start: time, end: time, upids: number[], type: ProfileType,
+    focusRegex: string): Promise<string> {
     const flamegraphType = getFlamegraphType(type);
     if (type === ProfileType.PERF_SAMPLE) {
       let upid: string;
@@ -433,7 +433,7 @@
         upidGroup = `NULL`;
       }
       return this.cache.getTableName(
-          `select id, name, map_name, parent_id, depth, cumulative_size,
+        `select id, name, map_name, parent_id, depth, cumulative_size,
           cumulative_alloc_size, cumulative_count, cumulative_alloc_count,
           size, alloc_size, count, alloc_count, source_file, line_number
           from experimental_flamegraph(
@@ -446,7 +446,7 @@
           )`);
     }
     return this.cache.getTableName(
-        `select id, name, map_name, parent_id, depth, cumulative_size,
+      `select id, name, map_name, parent_id, depth, cumulative_size,
           cumulative_alloc_size, cumulative_count, cumulative_alloc_count,
           size, alloc_size, count, alloc_count, source_file, line_number
           from experimental_flamegraph(
@@ -474,14 +474,14 @@
   }
 
   async getFlamegraphMetadata(
-      type: ProfileType, start: time, end: time,
-      upids: number[]): Promise<FlamegraphDetails|undefined> {
+    type: ProfileType, start: time, end: time,
+    upids: number[]): Promise<FlamegraphDetails|undefined> {
     // Don't do anything if selection of the marker stayed the same.
     if ((this.lastSelectedFlamegraphState !== undefined &&
          ((this.lastSelectedFlamegraphState.start === start &&
            this.lastSelectedFlamegraphState.end === end &&
            FlamegraphController.areArraysEqual(
-               this.lastSelectedFlamegraphState.upids, upids))))) {
+             this.lastSelectedFlamegraphState.upids, upids))))) {
       return undefined;
     }
 
@@ -490,7 +490,7 @@
     const upidGroup = FlamegraphController.serializeUpidGroup(upids);
 
     const result = await this.args.engine.query(
-        `select pid from process where upid in (${upidGroup})`);
+      `select pid from process where upid in (${upidGroup})`);
     const it = result.iter({pid: NUM});
     const pids = [];
     for (let i = 0; it.valid(); ++i, it.next()) {
diff --git a/ui/src/controller/flow_events_controller.ts b/ui/src/controller/flow_events_controller.ts
index c6515b3..202a626 100644
--- a/ui/src/controller/flow_events_controller.ts
+++ b/ui/src/controller/flow_events_controller.ts
@@ -314,12 +314,12 @@
     this.lastSelectedKind = 'CHROME_SLICE';
 
     const connectedFlows = SHOW_INDIRECT_PRECEDING_FLOWS_FLAG.get() ?
-        `(
+      `(
            select * from directly_connected_flow(${sliceId})
            union
            select * from preceding_flow(${sliceId})
          )` :
-        `directly_connected_flow(${sliceId})`;
+      `directly_connected_flow(${sliceId})`;
 
     const query = `
     select
@@ -358,7 +358,7 @@
     left join process process_in on process_in.upid = thread_in.upid
     `;
     this.queryFlowEvents(
-        query, (flows: Flow[]) => publishConnectedFlows(flows));
+      query, (flows: Flow[]) => publishConnectedFlows(flows));
   }
 
   areaSelected(areaId: string) {
diff --git a/ui/src/controller/ftrace_controller.ts b/ui/src/controller/ftrace_controller.ts
index e4f13cc..664d754 100644
--- a/ui/src/controller/ftrace_controller.ts
+++ b/ui/src/controller/ftrace_controller.ts
@@ -129,15 +129,15 @@
       limit ${count} offset ${offset};`);
     const events: FtraceEvent[] = [];
     const it = queryRes.iter(
-        {
-          id: NUM,
-          ts: LONG,
-          name: STR,
-          cpu: NUM,
-          thread: STR_NULL,
-          process: STR_NULL,
-          args: STR,
-        },
+      {
+        id: NUM,
+        ts: LONG,
+        name: STR,
+        cpu: NUM,
+        thread: STR_NULL,
+        process: STR_NULL,
+        args: STR,
+      },
     );
     for (let row = 0; it.valid(); it.next(), row++) {
       events.push({
diff --git a/ui/src/controller/logs_controller.ts b/ui/src/controller/logs_controller.ts
index 987a7fb..aa6b505 100644
--- a/ui/src/controller/logs_controller.ts
+++ b/ui/src/controller/logs_controller.ts
@@ -36,7 +36,7 @@
 import {Controller} from './controller';
 
 async function updateLogBounds(
-    engine: Engine, span: Span<time, duration>): Promise<LogBounds> {
+  engine: Engine, span: Span<time, duration>): Promise<LogBounds> {
   const vizStartNs = span.start;
   const vizEndNs = span.end;
 
@@ -73,7 +73,7 @@
 }
 
 async function updateLogEntries(
-    engine: Engine, span: Span<time, duration>, pagination: Pagination):
+  engine: Engine, span: Span<time, duration>, pagination: Pagination):
     Promise<LogEntries> {
   const vizStartNs = span.start;
   const vizEndNs = span.end;
@@ -116,7 +116,7 @@
     tags.push(it.tag);
     messages.push(it.msg);
     isHighlighted.push(
-        it.isMsgHighlighted === 1 || it.isProcessHighlighted === 1);
+      it.isMsgHighlighted === 1 || it.isProcessHighlighted === 1);
     processName.push(it.processName);
   }
 
@@ -253,8 +253,8 @@
       await this.engine.query('drop view if exists filtered_logs');
 
       const globMatch = LogsController.composeGlobMatch(
-          this.logFilteringCriteria.hideNonMatching,
-          this.logFilteringCriteria.textEntry);
+        this.logFilteringCriteria.hideNonMatching,
+        this.logFilteringCriteria.textEntry);
       let selectedRows = `select prio, ts, tag, msg,
           process.name as process_name, ${globMatch}
           from android_logs
@@ -263,7 +263,7 @@
           where prio >= ${this.logFilteringCriteria.minimumLevel}`;
       if (this.logFilteringCriteria.tags.length) {
         selectedRows += ` and tag in (${
-            LogsController.serializeTags(this.logFilteringCriteria.tags)})`;
+          LogsController.serializeTags(this.logFilteringCriteria.tags)})`;
       }
 
       // We extract only the rows which will be visible.
@@ -301,7 +301,7 @@
       // If the entries are collapsed, we won't highlight any lines.
       return `msg glob ${escapeGlob(textEntry)} as is_msg_chosen,
         (process.name is not null and process.name glob ${
-          escapeGlob(textEntry)}) as is_process_chosen,
+  escapeGlob(textEntry)}) as is_process_chosen,
         0 as is_msg_highlighted,
         0 as is_process_highlighted`;
     } else if (!textEntry) {
@@ -316,7 +316,7 @@
         1 as is_process_chosen,
         msg glob ${escapeGlob(textEntry)} as is_msg_highlighted,
         (process.name is not null and process.name glob ${
-          escapeGlob(textEntry)}) as is_process_highlighted`;
+  escapeGlob(textEntry)}) as is_process_highlighted`;
     }
   }
 }
diff --git a/ui/src/controller/permalink_controller.ts b/ui/src/controller/permalink_controller.ts
index c49673a..a309be3 100644
--- a/ui/src/controller/permalink_controller.ts
+++ b/ui/src/controller/permalink_controller.ts
@@ -77,34 +77,34 @@
       });
 
       PermalinkController.createPermalink(isRecordingConfig)
-          .then((hash) => {
-            globals.dispatch(Actions.setPermalink({requestId, hash}));
-          })
-          .finally(() => {
-            publishConversionJobStatusUpdate({
-              jobName,
-              jobStatus: ConversionJobStatus.NotRunning,
-            });
+        .then((hash) => {
+          globals.dispatch(Actions.setPermalink({requestId, hash}));
+        })
+        .finally(() => {
+          publishConversionJobStatusUpdate({
+            jobName,
+            jobStatus: ConversionJobStatus.NotRunning,
           });
+        });
       return;
     }
 
     // Otherwise, this is a request to load the permalink.
     PermalinkController.loadState(globals.state.permalink.hash)
-        .then((stateOrConfig) => {
-          if (PermalinkController.isRecordConfig(stateOrConfig)) {
-            // This permalink state only contains a RecordConfig. Show the
-            // recording page with the config, but keep other state as-is.
-            const validConfig =
+      .then((stateOrConfig) => {
+        if (PermalinkController.isRecordConfig(stateOrConfig)) {
+          // This permalink state only contains a RecordConfig. Show the
+          // recording page with the config, but keep other state as-is.
+          const validConfig =
                 runValidator(recordConfigValidator, stateOrConfig as unknown)
-                    .result;
-            globals.dispatch(Actions.setRecordConfig({config: validConfig}));
-            Router.navigate('#!/record');
-            return;
-          }
-          globals.dispatch(Actions.setState({newState: stateOrConfig}));
-          this.lastRequestId = stateOrConfig.permalink.requestId;
-        });
+                  .result;
+          globals.dispatch(Actions.setRecordConfig({config: validConfig}));
+          Router.navigate('#!/record');
+          return;
+        }
+        globals.dispatch(Actions.setState({newState: stateOrConfig}));
+        this.lastRequestId = stateOrConfig.permalink.requestId;
+      });
   }
 
   private static upgradeState(state: State): State {
@@ -170,22 +170,22 @@
         PermalinkController.updateStatus(`Uploading ${traceName}`);
         const uploader = new TraceGcsUploader(dataToUpload, () => {
           switch (uploader.state) {
-            case 'UPLOADING':
-              const statusTxt = `Uploading ${uploader.getEtaString()}`;
-              PermalinkController.updateStatus(statusTxt);
-              break;
-            case 'UPLOADED':
-              // Convert state to use URLs and remove permalink.
-              const url = uploader.uploadedUrl;
-              uploadState = produce(globals.state, (draft) => {
-                assertExists(draft.engine).source = {type: 'URL', url};
-                draft.permalink = {};
-              });
-              break;
-            case 'ERROR':
-              PermalinkController.updateStatus(
-                  `Upload failed ${uploader.error}`);
-              break;
+          case 'UPLOADING':
+            const statusTxt = `Uploading ${uploader.getEtaString()}`;
+            PermalinkController.updateStatus(statusTxt);
+            break;
+          case 'UPLOADED':
+            // Convert state to use URLs and remove permalink.
+            const url = uploader.uploadedUrl;
+            uploadState = produce(globals.state, (draft) => {
+              assertExists(draft.engine).source = {type: 'URL', url};
+              draft.permalink = {};
+            });
+            break;
+          case 'ERROR':
+            PermalinkController.updateStatus(
+              `Upload failed ${uploader.error}`);
+            break;
           }  // switch (state)
         });  // onProgress
         await uploader.waitForCompletion();
@@ -204,7 +204,7 @@
     const response = await fetch(url);
     if (!response.ok) {
       throw new Error(
-          `Could not fetch permalink.\n` +
+        `Could not fetch permalink.\n` +
           `Are you sure the id (${id}) is correct?\n` +
           `URL: ${url}`);
     }
diff --git a/ui/src/controller/pivot_table_controller.ts b/ui/src/controller/pivot_table_controller.ts
index 4954544..230a151 100644
--- a/ui/src/controller/pivot_table_controller.ts
+++ b/ui/src/controller/pivot_table_controller.ts
@@ -103,9 +103,9 @@
     const treeCount =
         countIndex >= 0 ? expectNumber(tree.aggregates[countIndex]) : 0;
     const rowCount = countIndex >= 0 ?
-        expectNumber(
-            row[aggregationIndex(this.pivotColumnsCount, countIndex)]) :
-        0;
+      expectNumber(
+        row[aggregationIndex(this.pivotColumnsCount, countIndex)]) :
+      0;
 
     for (let i = 0; i < this.aggregateColumns.length; i++) {
       const agg = this.aggregateColumns[i];
@@ -114,22 +114,22 @@
       const childAgg = row[aggregationIndex(this.pivotColumnsCount, i)];
       if (typeof currAgg === 'number' && typeof childAgg === 'number') {
         switch (agg.aggregationFunction) {
-          case 'SUM':
-          case 'COUNT':
-            tree.aggregates[i] = currAgg + childAgg;
-            break;
-          case 'MAX':
-            tree.aggregates[i] = Math.max(currAgg, childAgg);
-            break;
-          case 'MIN':
-            tree.aggregates[i] = Math.min(currAgg, childAgg);
-            break;
-          case 'AVG': {
-            const currSum = currAgg * treeCount;
-            const addSum = childAgg * rowCount;
-            tree.aggregates[i] = (currSum + addSum) / (treeCount + rowCount);
-            break;
-          }
+        case 'SUM':
+        case 'COUNT':
+          tree.aggregates[i] = currAgg + childAgg;
+          break;
+        case 'MAX':
+          tree.aggregates[i] = Math.max(currAgg, childAgg);
+          break;
+        case 'MIN':
+          tree.aggregates[i] = Math.min(currAgg, childAgg);
+          break;
+        case 'AVG': {
+          const currSum = currAgg * treeCount;
+          const addSum = childAgg * rowCount;
+          tree.aggregates[i] = (currSum + addSum) / (treeCount + rowCount);
+          break;
+        }
         }
       }
     }
@@ -153,7 +153,7 @@
       aggregates.push(row[aggregationIndex(this.pivotColumnsCount, j)]);
     }
     aggregates.push(row[aggregationIndex(
-        this.pivotColumnsCount, this.aggregateColumns.length)]);
+      this.pivotColumnsCount, this.aggregateColumns.length)]);
 
     return {
       isCollapsed: false,
@@ -246,7 +246,7 @@
       // Iterator is invalid after creation; means that there are no rows
       // satisfying filtering criteria. Return an empty tree.
       globals.dispatch(Actions.setPivotStateQueryResult(
-          {queryResult: createEmptyQueryResult(query.metadata)}));
+        {queryResult: createEmptyQueryResult(query.metadata)}));
       return;
     }
 
@@ -256,7 +256,7 @@
     }
 
     globals.dispatch(Actions.setPivotStateQueryResult(
-        {queryResult: {tree: treeBuilder.build(), metadata: query.metadata}}));
+      {queryResult: {tree: treeBuilder.build(), metadata: query.metadata}}));
     globals.dispatch(Actions.setCurrentTab({tab: 'pivot_table'}));
   }
 
@@ -293,7 +293,7 @@
         (selection !== null && selection.kind === 'AREA' &&
          this.shouldRerun(pivotTableState, selection))) {
       globals.dispatch(
-          Actions.setPivotTableQueryRequested({queryRequested: false}));
+        Actions.setPivotTableQueryRequested({queryRequested: false}));
       // Need to re-run the existing query, clear the current result.
       globals.dispatch(Actions.setPivotStateQueryResult({queryResult: null}));
       this.processQuery(generateQueryFromState(pivotTableState));
diff --git a/ui/src/controller/pivot_table_tree_builder_unittest.ts b/ui/src/controller/pivot_table_tree_builder_unittest.ts
index 5ab93f9..8d3d696 100644
--- a/ui/src/controller/pivot_table_tree_builder_unittest.ts
+++ b/ui/src/controller/pivot_table_tree_builder_unittest.ts
@@ -19,18 +19,18 @@
 describe('Pivot Table tree builder', () => {
   test('aggregates averages correctly', () => {
     const builder = new PivotTableTreeBuilder(
-        {
-          pivotColumns: [
-            {kind: 'regular', table: 'slice', column: 'category'},
-            {kind: 'regular', table: 'slice', column: 'name'},
-          ],
-          aggregationColumns: [{
-            aggregationFunction: 'AVG',
-            column: {kind: 'regular', table: 'slice', column: 'dur'},
-          }],
-          countIndex: 1,
-        },
-        ['cat1', 'name1', 80.0, 2]);
+      {
+        pivotColumns: [
+          {kind: 'regular', table: 'slice', column: 'category'},
+          {kind: 'regular', table: 'slice', column: 'name'},
+        ],
+        aggregationColumns: [{
+          aggregationFunction: 'AVG',
+          column: {kind: 'regular', table: 'slice', column: 'dur'},
+        }],
+        countIndex: 1,
+      },
+      ['cat1', 'name1', 80.0, 2]);
 
     builder.ingestRow(['cat1', 'name2', 20.0, 1]);
     builder.ingestRow(['cat2', 'name3', 20.0, 1]);
diff --git a/ui/src/controller/record_config_types.ts b/ui/src/controller/record_config_types.ts
index 78f6478..06e4ec8 100644
--- a/ui/src/controller/record_config_types.ts
+++ b/ui/src/controller/record_config_types.ts
@@ -115,7 +115,7 @@
   targetCmdLine: arrayOf(str()),
 });
 export const namedRecordConfigValidator = record(
-    {title: requiredStr, key: requiredStr, config: recordConfigValidator});
+  {title: requiredStr, key: requiredStr, config: recordConfigValidator});
 export type NamedRecordConfig =
     ValidatedType<typeof namedRecordConfigValidator>;
 export type RecordConfig = ValidatedType<typeof recordConfigValidator>;
diff --git a/ui/src/controller/record_controller.ts b/ui/src/controller/record_controller.ts
index f5d8d61..8ce241d 100644
--- a/ui/src/controller/record_controller.ts
+++ b/ui/src/controller/record_controller.ts
@@ -53,7 +53,7 @@
 type RPCImplMethod = (Method|rpc.ServiceMethod<Message<{}>, Message<{}>>);
 
 export function genConfigProto(
-    uiCfg: RecordConfig, target: RecordingTarget): Uint8Array {
+  uiCfg: RecordConfig, target: RecordingTarget): Uint8Array {
   return TraceConfig.encode(convertToRecordingV2Input(uiCfg, target)).finish();
 }
 
@@ -62,38 +62,38 @@
 // diverge.
 // TODO(octaviant) delete this once we switch to RecordingV2.
 function convertToRecordingV2Input(
-    uiCfg: RecordConfig, target: RecordingTarget): TraceConfig {
+  uiCfg: RecordConfig, target: RecordingTarget): TraceConfig {
   let targetType: 'ANDROID'|'CHROME'|'CHROME_OS'|'LINUX';
   let androidApiLevel!: number;
   switch (target.os) {
-    case 'L':
-      targetType = 'LINUX';
-      break;
-    case 'C':
-      targetType = 'CHROME';
-      break;
-    case 'CrOS':
-      targetType = 'CHROME_OS';
-      break;
-    case 'S':
-      androidApiLevel = 31;
-      targetType = 'ANDROID';
-      break;
-    case 'R':
-      androidApiLevel = 30;
-      targetType = 'ANDROID';
-      break;
-    case 'Q':
-      androidApiLevel = 29;
-      targetType = 'ANDROID';
-      break;
-    case 'P':
-      androidApiLevel = 28;
-      targetType = 'ANDROID';
-      break;
-    default:
-      androidApiLevel = 26;
-      targetType = 'ANDROID';
+  case 'L':
+    targetType = 'LINUX';
+    break;
+  case 'C':
+    targetType = 'CHROME';
+    break;
+  case 'CrOS':
+    targetType = 'CHROME_OS';
+    break;
+  case 'S':
+    androidApiLevel = 31;
+    targetType = 'ANDROID';
+    break;
+  case 'R':
+    androidApiLevel = 30;
+    targetType = 'ANDROID';
+    break;
+  case 'Q':
+    androidApiLevel = 29;
+    targetType = 'ANDROID';
+    break;
+  case 'P':
+    androidApiLevel = 28;
+    targetType = 'ANDROID';
+    break;
+  default:
+    androidApiLevel = 26;
+    targetType = 'ANDROID';
   }
 
   let targetInfo: TargetInfo;
@@ -170,7 +170,7 @@
           yield ' '.repeat(indent) + '}';
         } else {
           throw new Error(`Record proto entry "${entry}" with unexpected type ${
-              typeof entry}`);
+            typeof entry}`);
         }
         yield '\n';
       }
@@ -307,7 +307,7 @@
     globals.dispatch(Actions.setRecordingStatus({status: undefined}));
     if (globals.state.recordingCancelled) {
       globals.dispatch(
-          Actions.setLastRecordingError({error: 'Recording cancelled.'}));
+        Actions.setLastRecordingError({error: 'Recording cancelled.'}));
       this.traceBuffer = [];
       return;
     }
@@ -349,7 +349,7 @@
     // TODO(octaviant): b/204998302
     console.error('Error in record controller: ', message);
     globals.dispatch(
-        Actions.setLastRecordingError({error: message.substr(0, 150)}));
+      Actions.setLastRecordingError({error: message.substr(0, 150)}));
     globals.dispatch(Actions.stopRecording({}));
   }
 
@@ -387,8 +387,8 @@
             const socketAccess = await this.hasSocketAccess(target);
 
             controller = socketAccess ?
-                new AdbSocketConsumerPort(this.adb, this) :
-                new AdbConsumerPort(this.adb, this);
+              new AdbSocketConsumerPort(this.adb, this) :
+              new AdbConsumerPort(this.adb, this);
           } else {
             throw Error(`No device connected`);
           }
@@ -416,8 +416,8 @@
   }
 
   private async rpcImpl(
-      method: RPCImplMethod, requestData: Uint8Array,
-      _callback: RPCImplCallback) {
+    method: RPCImplMethod, requestData: Uint8Array,
+    _callback: RPCImplCallback) {
     try {
       const state = globals.state;
       // TODO(hjd): This is a bit weird. We implicitly send each RPC message to
diff --git a/ui/src/controller/search_controller.ts b/ui/src/controller/search_controller.ts
index 8474274..937a4d4 100644
--- a/ui/src/controller/search_controller.ts
+++ b/ui/src/controller/search_controller.ts
@@ -117,26 +117,26 @@
     this.updateInProgress = true;
     const computeSummary =
         this.update(search, newSpan.start, newSpan.end, newResolution)
-            .then((summary) => {
-              publishSearch(summary);
-            });
+          .then((summary) => {
+            publishSearch(summary);
+          });
 
     const computeResults = this.specificSearch(search).then((searchResults) => {
       publishSearchResult(searchResults);
     });
 
     Promise.all([computeSummary, computeResults])
-        .finally(() => {
-          this.updateInProgress = false;
-          this.run();
-        });
+      .finally(() => {
+        this.updateInProgress = false;
+        this.run();
+      });
   }
 
   onDestroy() {}
 
   private async update(
-      search: string, start: time, end: time,
-      resolution: duration): Promise<SearchSummary> {
+    search: string, start: time, end: time,
+    resolution: duration): Promise<SearchSummary> {
     const searchLiteral = escapeSearchQuery(search);
 
     const quantum = resolution * 10n;
@@ -273,7 +273,7 @@
     };
 
     const it = queryRes.iter(
-        {sliceId: NUM, ts: LONG, source: STR, sourceId: NUM, utid: NUM});
+      {sliceId: NUM, ts: LONG, source: STR, sourceId: NUM, utid: NUM});
     for (; it.valid(); it.next()) {
       let trackId = undefined;
       if (it.source === 'cpu') {
diff --git a/ui/src/controller/selection_controller.ts b/ui/src/controller/selection_controller.ts
index 52245a8..09753b2 100644
--- a/ui/src/controller/selection_controller.ts
+++ b/ui/src/controller/selection_controller.ts
@@ -89,12 +89,12 @@
 
     if (selection.kind === 'COUNTER') {
       this.counterDetails(selection.leftTs, selection.rightTs, selection.id)
-          .then((results) => {
-            if (results !== undefined && selection.kind === selectedKind &&
+        .then((results) => {
+          if (results !== undefined && selection.kind === selectedKind &&
                 selection.id === selectedId) {
-              publishCounterDetails(results);
-            }
-          });
+            publishCounterDetails(results);
+          }
+        });
     } else if (selection.kind === 'SLICE') {
       this.sliceDetails(selectedId as number);
     } else if (selection.kind === 'THREAD_STATE') {
@@ -138,7 +138,7 @@
 
     const promisedDetails = this.args.engine.query(`
       SELECT *, ABS_TIME_STR(ts) as absTime FROM ${leafTable} WHERE id = ${
-        selectedId};
+  selectedId};
     `);
 
     const [details, args] = await Promise.all([promisedDetails, promisedArgs]);
@@ -179,37 +179,37 @@
     for (const k of details.columns()) {
       const v = rowIter.get(k);
       switch (k) {
-        case 'id':
-          break;
-        case 'ts':
-          ts = timeFromSql(v);
-          break;
-        case 'thread_ts':
-          threadTs = timeFromSql(v);
-          break;
-        case 'absTime':
-          /* eslint-disable @typescript-eslint/strict-boolean-expressions */
-          if (v) absTime = `${v}`;
-          /* eslint-enable */
-          break;
-        case 'name':
-          name = `${v}`;
-          break;
-        case 'dur':
-          dur = durationFromSql(v);
-          break;
-        case 'thread_dur':
-          threadDur = durationFromSql(v);
-          break;
-        case 'category':
-        case 'cat':
-          category = `${v}`;
-          break;
-        case 'track_id':
-          trackId = Number(v);
-          break;
-        default:
-          if (!ignoredColumns.includes(k)) args.set(k, `${v}`);
+      case 'id':
+        break;
+      case 'ts':
+        ts = timeFromSql(v);
+        break;
+      case 'thread_ts':
+        threadTs = timeFromSql(v);
+        break;
+      case 'absTime':
+        /* eslint-disable @typescript-eslint/strict-boolean-expressions */
+        if (v) absTime = `${v}`;
+        /* eslint-enable */
+        break;
+      case 'name':
+        name = `${v}`;
+        break;
+      case 'dur':
+        dur = durationFromSql(v);
+        break;
+      case 'thread_dur':
+        threadDur = durationFromSql(v);
+        break;
+      case 'category':
+      case 'cat':
+        category = `${v}`;
+        break;
+      case 'track_id':
+        trackId = Number(v);
+        break;
+      default:
+        if (!ignoredColumns.includes(k)) args.set(k, `${v}`);
       }
     }
 
@@ -248,8 +248,8 @@
             FROM ${columnInfo.leafTrackTable}
             WHERE id = ${trackId};
         `)).firstRow({
-             utid: NUM,
-           }).utid;
+          utid: NUM,
+        }).utid;
         Object.assign(selected, await this.computeThreadDetails(utid));
       } else if (hasUpid) {
         const upid = (await this.args.engine.query(`
@@ -257,8 +257,8 @@
             FROM ${columnInfo.leafTrackTable}
             WHERE id = ${trackId};
         `)).firstRow({
-             upid: NUM,
-           }).upid;
+          upid: NUM,
+        }).upid;
         Object.assign(selected, await this.computeProcessDetails(upid));
       }
     }
@@ -394,19 +394,19 @@
       Object.assign(selected, await this.computeThreadDetails(utid));
 
       this.schedulingDetails(ts, utid)
-          .then((wakeResult) => {
-            Object.assign(selected, wakeResult);
-          })
-          .finally(() => {
-            publishSliceDetails(selected);
-          });
+        .then((wakeResult) => {
+          Object.assign(selected, wakeResult);
+        })
+        .finally(() => {
+          publishSliceDetails(selected);
+        });
     }
   }
 
   async counterDetails(ts: time, rightTs: time, id: number):
       Promise<CounterDetails> {
     const counter = await this.args.engine.query(
-        `SELECT value, track_id as trackId FROM counter WHERE id = ${id}`);
+      `SELECT value, track_id as trackId FROM counter WHERE id = ${id}`);
     const row = counter.iter({
       value: NUM,
       trackId: NUM,
@@ -496,7 +496,7 @@
     // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
     if (threadInfo.upid) {
       return Object.assign(
-          {}, threadDetails, await this.computeProcessDetails(threadInfo.upid));
+        {}, threadDetails, await this.computeProcessDetails(threadInfo.upid));
     }
     return threadDetails;
   }
diff --git a/ui/src/controller/trace_controller.ts b/ui/src/controller/trace_controller.ts
index aaf4820..f752427 100644
--- a/ui/src/controller/trace_controller.ts
+++ b/ui/src/controller/trace_controller.ts
@@ -258,101 +258,101 @@
   run() {
     const engineCfg = assertExists(globals.state.engine);
     switch (this.state) {
-      case 'init':
-        this.loadTrace()
-            .then((mode) => {
-              globals.dispatch(Actions.setEngineReady({
-                engineId: this.engineId,
-                ready: true,
-                mode,
-              }));
-            })
-            .catch((err) => {
-              this.updateStatus(`${err}`);
-              throw err;
-            });
-        this.updateStatus('Opening trace');
-        this.setState('loading_trace');
-        break;
+    case 'init':
+      this.loadTrace()
+        .then((mode) => {
+          globals.dispatch(Actions.setEngineReady({
+            engineId: this.engineId,
+            ready: true,
+            mode,
+          }));
+        })
+        .catch((err) => {
+          this.updateStatus(`${err}`);
+          throw err;
+        });
+      this.updateStatus('Opening trace');
+      this.setState('loading_trace');
+      break;
 
-      case 'loading_trace':
-        // Stay in this state until loadTrace() returns and marks the engine as
-        // ready.
-        if (this.engine === undefined || !engineCfg.ready) return;
-        this.setState('ready');
-        break;
+    case 'loading_trace':
+      // Stay in this state until loadTrace() returns and marks the engine as
+      // ready.
+      if (this.engine === undefined || !engineCfg.ready) return;
+      this.setState('ready');
+      break;
 
-      case 'ready':
-        // At this point we are ready to serve queries and handle tracks.
-        const engine = assertExists(this.engine);
-        const childControllers: Children = [];
+    case 'ready':
+      // At this point we are ready to serve queries and handle tracks.
+      const engine = assertExists(this.engine);
+      const childControllers: Children = [];
 
-        const selectionArgs: SelectionControllerArgs = {engine};
-        childControllers.push(
-          Child('selection', SelectionController, selectionArgs));
+      const selectionArgs: SelectionControllerArgs = {engine};
+      childControllers.push(
+        Child('selection', SelectionController, selectionArgs));
 
-        const flowEventsArgs: FlowEventsControllerArgs = {engine};
-        childControllers.push(
-          Child('flowEvents', FlowEventsController, flowEventsArgs));
+      const flowEventsArgs: FlowEventsControllerArgs = {engine};
+      childControllers.push(
+        Child('flowEvents', FlowEventsController, flowEventsArgs));
 
-        const cpuProfileArgs: CpuProfileControllerArgs = {engine};
-        childControllers.push(
-          Child('cpuProfile', CpuProfileController, cpuProfileArgs));
+      const cpuProfileArgs: CpuProfileControllerArgs = {engine};
+      childControllers.push(
+        Child('cpuProfile', CpuProfileController, cpuProfileArgs));
 
-        const flamegraphArgs: FlamegraphControllerArgs = {engine};
-        childControllers.push(
-          Child('flamegraph', FlamegraphController, flamegraphArgs));
+      const flamegraphArgs: FlamegraphControllerArgs = {engine};
+      childControllers.push(
+        Child('flamegraph', FlamegraphController, flamegraphArgs));
+      childControllers.push(Child(
+        'cpu_aggregation',
+        CpuAggregationController,
+        {engine, kind: 'cpu_aggregation'}));
+      childControllers.push(Child(
+        'thread_aggregation',
+        ThreadAggregationController,
+        {engine, kind: 'thread_state_aggregation'}));
+      childControllers.push(Child(
+        'cpu_process_aggregation',
+        CpuByProcessAggregationController,
+        {engine, kind: 'cpu_by_process_aggregation'}));
+      if (!PIVOT_TABLE_REDUX_FLAG.get()) {
+        // Pivot table is supposed to handle the use cases the slice
+        // aggregation panel is used right now. When a flag to use pivot
+        // tables is enabled, do not add slice aggregation controller.
         childControllers.push(Child(
-          'cpu_aggregation',
-          CpuAggregationController,
-          {engine, kind: 'cpu_aggregation'}));
-        childControllers.push(Child(
-          'thread_aggregation',
-          ThreadAggregationController,
-          {engine, kind: 'thread_state_aggregation'}));
-        childControllers.push(Child(
-          'cpu_process_aggregation',
-          CpuByProcessAggregationController,
-          {engine, kind: 'cpu_by_process_aggregation'}));
-        if (!PIVOT_TABLE_REDUX_FLAG.get()) {
-          // Pivot table is supposed to handle the use cases the slice
-          // aggregation panel is used right now. When a flag to use pivot
-          // tables is enabled, do not add slice aggregation controller.
-          childControllers.push(Child(
-            'slice_aggregation',
-            SliceAggregationController,
-            {engine, kind: 'slice_aggregation'}));
-        }
-        childControllers.push(Child(
-          'counter_aggregation',
-          CounterAggregationController,
-          {engine, kind: 'counter_aggregation'}));
-        childControllers.push(Child(
-          'frame_aggregation',
-          FrameAggregationController,
-          {engine, kind: 'frame_aggregation'}));
-        childControllers.push(Child('search', SearchController, {
-          engine,
-          app: globals,
-        }));
-        childControllers.push(
-            Child('pivot_table', PivotTableController, {engine}));
+          'slice_aggregation',
+          SliceAggregationController,
+          {engine, kind: 'slice_aggregation'}));
+      }
+      childControllers.push(Child(
+        'counter_aggregation',
+        CounterAggregationController,
+        {engine, kind: 'counter_aggregation'}));
+      childControllers.push(Child(
+        'frame_aggregation',
+        FrameAggregationController,
+        {engine, kind: 'frame_aggregation'}));
+      childControllers.push(Child('search', SearchController, {
+        engine,
+        app: globals,
+      }));
+      childControllers.push(
+        Child('pivot_table', PivotTableController, {engine}));
 
-        childControllers.push(Child('logs', LogsController, {
-          engine,
-          app: globals,
-        }));
+      childControllers.push(Child('logs', LogsController, {
+        engine,
+        app: globals,
+      }));
 
-        childControllers.push(
-            Child('ftrace', FtraceController, {engine, app: globals}));
+      childControllers.push(
+        Child('ftrace', FtraceController, {engine, app: globals}));
 
-        childControllers.push(
-            Child('traceError', TraceErrorController, {engine}));
+      childControllers.push(
+        Child('traceError', TraceErrorController, {engine}));
 
-        return childControllers;
+      return childControllers;
 
-      default:
-        throw new Error(`unknown state ${this.state}`);
+    default:
+      throw new Error(`unknown state ${this.state}`);
     }
     return;
   }
@@ -378,7 +378,7 @@
       engine = new HttpRpcEngine(this.engineId, LoadingManager.getInstance);
       engine.errorHandler = (err) => {
         globals.dispatch(
-            Actions.setEngineFailed({mode: 'HTTP_RPC', failure: `${err}`}));
+          Actions.setEngineFailed({mode: 'HTTP_RPC', failure: `${err}`}));
         throw err;
       };
     } else {
@@ -492,7 +492,7 @@
     ];
 
     const visibleTimeSpan = await computeVisibleTime(
-        traceTime.start, traceTime.end, isJsonTrace, this.engine);
+      traceTime.start, traceTime.end, isJsonTrace, this.engine);
     // We don't know the resolution at this point. However this will be
     // replaced in 50ms so a guess is fine.
     const resolution = visibleTimeSpan.duration.divide(1000).toTime();
@@ -600,13 +600,13 @@
 
       // Find the previous closest midnight from the trace start time.
       const utcOffset = Time.getLatestMidnight(
-          globals.state.traceTime.start,
-          realtimeOffset,
+        globals.state.traceTime.start,
+        realtimeOffset,
       );
 
       const traceTzOffset = Time.getLatestMidnight(
-          globals.state.traceTime.start,
-          Time.sub(realtimeOffset, Time.fromSeconds(tzOffMin * 60)));
+        globals.state.traceTime.start,
+        Time.sub(realtimeOffset, Time.fromSeconds(tzOffMin * 60)));
 
       publishRealtimeOffset(realtimeOffset, utcOffset, traceTzOffset);
     }
@@ -626,7 +626,7 @@
       if (pendingDeeplink.visStart !== undefined &&
           pendingDeeplink.visEnd !== undefined) {
         this.zoomPendingDeeplink(
-            pendingDeeplink.visStart, pendingDeeplink.visEnd);
+          pendingDeeplink.visStart, pendingDeeplink.visEnd);
       }
       if (pendingDeeplink.query !== undefined) {
         globals.openQuery(pendingDeeplink.query, 'Deeplink Query');
@@ -671,7 +671,7 @@
     const leftTs = globals.state.traceTime.start;
     const rightTs = globals.state.traceTime.end;
     globals.dispatch(Actions.selectPerfSamples(
-        {id: 0, upid, leftTs, rightTs, type: ProfileType.PERF_SAMPLE}));
+      {id: 0, upid, leftTs, rightTs, type: ProfileType.PERF_SAMPLE}));
   }
 
   private async selectFirstHeapProfile() {
@@ -798,11 +798,11 @@
     if (hasSchedOverview) {
       const stepPromises = [];
       for (let start = trace.start; start < trace.end;
-           start = Time.add(start, stepSize)) {
+        start = Time.add(start, stepSize)) {
         const progress = start - trace.start;
         const ratio = Number(progress) / Number(trace.duration);
         this.updateStatus(
-            'Loading overview ' +
+          'Loading overview ' +
             `${Math.round(ratio * 100)}%`);
         const end = Time.add(start, stepSize);
         // The (async() => {})() queues all the 100 async promises in one batch.
@@ -811,8 +811,8 @@
         // between each step, slowing down significantly the overall process.
         stepPromises.push((async () => {
           const schedResult = await engine.query(
-              `select cast(sum(dur) as float)/${
-                  stepSize} as load, cpu from sched ` +
+            `select cast(sum(dur) as float)/${
+              stepSize} as load, cpu from sched ` +
               `where ts >= ${start} and ts < ${end} and utid != 0 ` +
               'group by cpu order by cpu');
           const schedData: {[key: string]: QuantizedLoad} = {};
@@ -838,7 +838,7 @@
          inner join (
            select
              ifnull(cast((ts - ${trace.start})/${
-        stepSize} as int), 0) as bucket,
+  stepSize} as int), 0) as bucket,
              sum(dur) as utid_sum,
              utid
            from slice
@@ -1113,7 +1113,7 @@
 }
 
 async function computeVisibleTime(
-    traceStart: time, traceEnd: time, isJsonTrace: boolean, engine: Engine):
+  traceStart: time, traceEnd: time, isJsonTrace: boolean, engine: Engine):
     Promise<Span<HighPrecisionTime>> {
   // if we have non-default visible state, update the visible time to it
   const previousVisibleState = globals.stateVisibleTime();
@@ -1124,7 +1124,7 @@
       (previousVisibleState.start >= traceStart &&
        previousVisibleState.end <= traceEnd)) {
     return HighPrecisionTimeSpan.fromTime(
-        previousVisibleState.start, previousVisibleState.end);
+      previousVisibleState.start, previousVisibleState.end);
   }
 
   // initialise visible time to the trace time bounds
diff --git a/ui/src/controller/trace_error_controller.ts b/ui/src/controller/trace_error_controller.ts
index 005ed14..c0da8e5 100644
--- a/ui/src/controller/trace_error_controller.ts
+++ b/ui/src/controller/trace_error_controller.ts
@@ -35,11 +35,11 @@
     this.hasRun = true;
     const engine = this.args.engine;
     engine
-        .query(
-            `SELECT sum(value) as sumValue FROM stats WHERE severity != 'info'`)
-        .then((result) => {
-          const errors = result.firstRow({sumValue: NUM}).sumValue;
-          publishTraceErrors(errors);
-        });
+      .query(
+        `SELECT sum(value) as sumValue FROM stats WHERE severity != 'info'`)
+      .then((result) => {
+        const errors = result.firstRow({sumValue: NUM}).sumValue;
+        publishTraceErrors(errors);
+      });
   }
 }
diff --git a/ui/src/controller/track_decider.ts b/ui/src/controller/track_decider.ts
index fee96cf..4ef5258 100644
--- a/ui/src/controller/track_decider.ts
+++ b/ui/src/controller/track_decider.ts
@@ -821,7 +821,7 @@
         name,
         trackSortKey: PrimaryTrackSortKey.COUNTER_TRACK,
         trackGroup: upid === 0 ? SCROLLING_TRACK_GROUP :
-                                 this.upidToUuid.get(upid),
+          this.upidToUuid.get(upid),
       });
     }
   }
@@ -1334,8 +1334,8 @@
           trackSortKey: {
             utid,
             priority: isDefaultTrackForScope ?
-                InThreadTrackSortKey.DEFAULT_TRACK :
-                InThreadTrackSortKey.ORDINARY,
+              InThreadTrackSortKey.DEFAULT_TRACK :
+              InThreadTrackSortKey.ORDINARY,
           },
         });
       }
@@ -1348,8 +1348,8 @@
           trackSortKey: {
             utid,
             priority: isDefaultTrackForScope ?
-                InThreadTrackSortKey.DEFAULT_TRACK :
-                InThreadTrackSortKey.ORDINARY,
+              InThreadTrackSortKey.DEFAULT_TRACK :
+              InThreadTrackSortKey.ORDINARY,
           },
         });
       }
@@ -1382,12 +1382,12 @@
       const processName = it.processName;
       const uuid = this.getUuid(0, upid);
       const name = getTrackName(
-          {name: trackName, upid, pid, kind: COUNTER_TRACK_KIND, processName});
+        {name: trackName, upid, pid, kind: COUNTER_TRACK_KIND, processName});
       this.tracksToAdd.push({
         uri: `perfetto.Counter#process${trackId}`,
         name,
         trackSortKey: await this.resolveTrackSortKeyForProcessCounterTrack(
-            upid, trackName || undefined),
+          upid, trackName || undefined),
         trackGroup: uuid,
       });
     }
@@ -1432,7 +1432,7 @@
 
   getUuidUnchecked(utid: number, upid: number|null) {
     return upid === null ? this.utidToUuid.get(utid) :
-                           this.upidToUuid.get(upid);
+      this.upidToUuid.get(upid);
   }
 
   getUuid(utid: number, upid: number|null) {
@@ -1678,8 +1678,8 @@
           uri,
           key: summaryTrackKey,
           trackSortKey: hasSched ?
-              PrimaryTrackSortKey.PROCESS_SCHEDULING_TRACK :
-              PrimaryTrackSortKey.PROCESS_SUMMARY_TRACK,
+            PrimaryTrackSortKey.PROCESS_SCHEDULING_TRACK :
+            PrimaryTrackSortKey.PROCESS_SUMMARY_TRACK,
           name: `${upid === null ? tid : pid} summary`,
           labels: it.chromeProcessLabels.split(','),
         });
@@ -1763,31 +1763,31 @@
     await this.addScrollJankPluginTracks();
     await this.addCpuSchedulingTracks();
     await this.addFtraceTrack(
-        this.engine.getProxy('TrackDecider::addFtraceTrack'));
+      this.engine.getProxy('TrackDecider::addFtraceTrack'));
     await this.addCpuFreqTracks(
-        this.engine.getProxy('TrackDecider::addCpuFreqTracks'));
+      this.engine.getProxy('TrackDecider::addCpuFreqTracks'));
     await this.addGlobalAsyncTracks(
-        this.engine.getProxy('TrackDecider::addGlobalAsyncTracks'));
+      this.engine.getProxy('TrackDecider::addGlobalAsyncTracks'));
     await this.addGpuFreqTracks(
-        this.engine.getProxy('TrackDecider::addGpuFreqTracks'));
+      this.engine.getProxy('TrackDecider::addGpuFreqTracks'));
     await this.addCpuFreqLimitCounterTracks(
-          this.engine.getProxy('TrackDecider::addCpuFreqLimitCounterTracks'));
+      this.engine.getProxy('TrackDecider::addCpuFreqLimitCounterTracks'));
     await this.addCpuPerfCounterTracks(
-        this.engine.getProxy('TrackDecider::addCpuPerfCounterTracks'));
+      this.engine.getProxy('TrackDecider::addCpuPerfCounterTracks'));
     this.addPluginTracks();
     await this.addAnnotationTracks(
-        this.engine.getProxy('TrackDecider::addAnnotationTracks'));
+      this.engine.getProxy('TrackDecider::addAnnotationTracks'));
     await this.groupGlobalIonTracks();
     await this.groupGlobalIostatTracks(F2FS_IOSTAT_TAG, F2FS_IOSTAT_GROUP_NAME);
     await this.groupGlobalIostatTracks(
-        F2FS_IOSTAT_LAT_TAG, F2FS_IOSTAT_LAT_GROUP_NAME);
+      F2FS_IOSTAT_LAT_TAG, F2FS_IOSTAT_LAT_GROUP_NAME);
     await this.groupGlobalIostatTracks(DISK_IOSTAT_TAG, DISK_IOSTAT_GROUP_NAME);
     await this.groupGlobalUfsCmdTagTracks(UFS_CMD_TAG, UFS_CMD_TAG_GROUP_NAME);
     await this.groupGlobalBuddyInfoTracks();
     await this.groupTracksByRegex(KERNEL_WAKELOCK_REGEX, KERNEL_WAKELOCK_GROUP);
     await this.groupTracksByRegex(NETWORK_TRACK_REGEX, NETWORK_TRACK_GROUP);
     await this.groupTracksByRegex(
-        ENTITY_RESIDENCY_REGEX, ENTITY_RESIDENCY_GROUP);
+      ENTITY_RESIDENCY_REGEX, ENTITY_RESIDENCY_GROUP);
     await this.groupTracksByRegex(UCLAMP_REGEX, UCLAMP_GROUP);
     await this.groupFrequencyTracks(FREQUENCY_GROUP);
     await this.groupTracksByRegex(POWER_RAILS_REGEX, POWER_RAILS_GROUP);
@@ -1800,7 +1800,7 @@
     // be listed with their user/package name only, and they will be grouped
     // under on their original shared track names. E.g. "GPU Work Period"
     await this.addUserAsyncSliceTracks(
-        this.engine.getProxy('TrackDecider::addUserAsyncSliceTracks'));
+      this.engine.getProxy('TrackDecider::addUserAsyncSliceTracks'));
 
     // Pre-group all kernel "threads" (actually processes) if this is a linux
     // system trace. Below, addProcessTrackGroups will skip them due to an
@@ -1809,37 +1809,37 @@
     // TrackKindPriority.MAIN_THREAD, any process-level tracks will end up
     // pushed to the bottom of the group in the UI.
     await this.addKernelThreadGrouping(
-        this.engine.getProxy('TrackDecider::addKernelThreadGrouping'));
+      this.engine.getProxy('TrackDecider::addKernelThreadGrouping'));
 
     // Create the per-process track groups. Note that this won't necessarily
     // create a track per process. If a process has been completely idle and has
     // no sched events, no track group will be emitted.
     // Will populate this.addTrackGroupActions
     await this.addProcessTrackGroups(
-        this.engine.getProxy('TrackDecider::addProcessTrackGroups'));
+      this.engine.getProxy('TrackDecider::addProcessTrackGroups'));
 
     await this.addProcessHeapProfileTracks(
-        this.engine.getProxy('TrackDecider::addProcessHeapProfileTracks'));
+      this.engine.getProxy('TrackDecider::addProcessHeapProfileTracks'));
     if (PERF_SAMPLE_FLAG.get()) {
       await this.addProcessPerfSamplesTracks(
-          this.engine.getProxy('TrackDecider::addProcessPerfSamplesTracks'));
+        this.engine.getProxy('TrackDecider::addProcessPerfSamplesTracks'));
     }
     await this.addProcessCounterTracks(
-        this.engine.getProxy('TrackDecider::addProcessCounterTracks'));
+      this.engine.getProxy('TrackDecider::addProcessCounterTracks'));
     await this.addProcessAsyncSliceTracks(
-        this.engine.getProxy('TrackDecider::addProcessAsyncSliceTracks'));
+      this.engine.getProxy('TrackDecider::addProcessAsyncSliceTracks'));
     await this.addActualFramesTracks(
-        this.engine.getProxy('TrackDecider::addActualFramesTracks'));
+      this.engine.getProxy('TrackDecider::addActualFramesTracks'));
     await this.addExpectedFramesTracks(
-        this.engine.getProxy('TrackDecider::addExpectedFramesTracks'));
+      this.engine.getProxy('TrackDecider::addExpectedFramesTracks'));
     await this.addThreadCounterTracks(
-        this.engine.getProxy('TrackDecider::addThreadCounterTracks'));
+      this.engine.getProxy('TrackDecider::addThreadCounterTracks'));
     await this.addThreadStateTracks(
-        this.engine.getProxy('TrackDecider::addThreadStateTracks'));
+      this.engine.getProxy('TrackDecider::addThreadStateTracks'));
     await this.addThreadSliceTracks(
-        this.engine.getProxy('TrackDecider::addThreadSliceTracks'));
+      this.engine.getProxy('TrackDecider::addThreadSliceTracks'));
     await this.addThreadCpuSampleTracks(
-        this.engine.getProxy('TrackDecider::addThreadCpuSampleTracks'));
+      this.engine.getProxy('TrackDecider::addThreadCpuSampleTracks'));
     await this.addLogsTrack(this.engine.getProxy('TrackDecider::addLogsTrack'));
 
     // TODO(hjd): Move into plugin API.
@@ -1854,11 +1854,11 @@
     }
 
     this.addTrackGroupActions.push(
-        Actions.addTracks({tracks: this.tracksToAdd}));
+      Actions.addTracks({tracks: this.tracksToAdd}));
 
     const threadOrderingMetadata = await this.computeThreadOrderingMetadata();
     this.addTrackGroupActions.push(
-        Actions.setUtidToTrackSortKey({threadOrderingMetadata}));
+      Actions.setUtidToTrackSortKey({threadOrderingMetadata}));
 
     return this.addTrackGroupActions;
   }
@@ -1866,7 +1866,7 @@
   // Some process counter tracks are tied to specific threads based on their
   // name.
   private async resolveTrackSortKeyForProcessCounterTrack(
-      upid: number, threadName?: string): Promise<TrackSortKey> {
+    upid: number, threadName?: string): Promise<TrackSortKey> {
     if (threadName !== 'GPU completion') {
       return PrimaryTrackSortKey.COUNTER_TRACK;
     }
@@ -1889,8 +1889,8 @@
   }
 
   private static getThreadSortKey(
-      threadName?: string|null, tid?: number|null,
-      pid?: number|null): PrimaryTrackSortKey {
+    threadName?: string|null, tid?: number|null,
+    pid?: number|null): PrimaryTrackSortKey {
     if (pid !== undefined && pid !== null && pid === tid) {
       return PrimaryTrackSortKey.MAIN_THREAD;
     }
@@ -1917,12 +1917,12 @@
     }
 
     switch (true) {
-      case /.*RenderThread.*/.test(threadName):
-        return PrimaryTrackSortKey.RENDER_THREAD;
-      case /.*GPU completion.*/.test(threadName):
-        return PrimaryTrackSortKey.GPU_COMPLETION_THREAD;
-      default:
-        return PrimaryTrackSortKey.ORDINARY_THREAD;
+    case /.*RenderThread.*/.test(threadName):
+      return PrimaryTrackSortKey.RENDER_THREAD;
+    case /.*GPU completion.*/.test(threadName):
+      return PrimaryTrackSortKey.GPU_COMPLETION_THREAD;
+    default:
+      return PrimaryTrackSortKey.ORDINARY_THREAD;
     }
   }
 }