Make audits_worker a worker with module scope

This allows us to properly import the Runtime with an ES import, as well
as resolve the service dispatcher in the appropriate scope. It relies on
the previous patch to be pushed to the appspot server, before it can be
resolved properly.

Bug: 1006759
Change-Id: I2d65c82e00ffaaa6ca2dd39fd4309e44d7a87002
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2030781
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/front_end/audits_worker.js b/front_end/audits_worker.js
index f6813c6..c97fda6 100644
--- a/front_end/audits_worker.js
+++ b/front_end/audits_worker.js
@@ -1,9 +1,9 @@
 // Copyright 2016 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
-self.importScripts('platform/utilities.js');
-// Release build has Runtime.js bundled.
-if (!self.Root || !self.Root.Runtime) {
-  self.importScripts('Runtime.js');
-}
+import './platform/utilities.js';
+import './Runtime.js';
+
+import './worker_service/ServiceDispatcher.js';
+
 Root.Runtime.startWorker('audits_worker');