Bug 1416711 - Stop guarding consumer calls to DebuggerServer.init();r=ochameau
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 13 Nov 2017 21:04:43 +0100
changeset 447632 6e58664da16e453fe051ef33b9b123d47358270e
parent 447631 71cc1ff4febe42ebc14eb757e3842940b117bcdb
child 447633 6075d6f91ae732fea71637802f185c20808d14b0
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1416711
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1416711 - Stop guarding consumer calls to DebuggerServer.init();r=ochameau DebuggerServer.init() already bails out if it was previously initialized so we could avoid guarding the calls to init() with it everywhere. Registering an actor module several times is also a noop as the Server keeps a map of all the already registered modules and will bail out if the module is already known. MozReview-Commit-ID: 4ONLlx9253i
devtools/client/aboutdebugging/initializer.js
devtools/client/canvasdebugger/test/head.js
devtools/client/debugger/new/test/mochitest/browser_dbg-chrome-debugging.js
devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-01.js
devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-02.js
devtools/client/debugger/test/mochitest/browser_dbg_chrome-debugging.js
devtools/client/debugger/test/mochitest/browser_dbg_debugger-statement.js
devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-01.js
devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-02.js
devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-03.js
devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
devtools/client/debugger/test/mochitest/browser_dbg_tabactor-01.js
devtools/client/debugger/test/mochitest/browser_dbg_tabactor-02.js
devtools/client/debugger/test/mochitest/head.js
devtools/client/framework/devtools-browser.js
devtools/client/framework/target-from-url.js
devtools/client/framework/target.js
devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
devtools/client/framework/test/browser_two_tabs.js
devtools/client/framework/test/head.js
devtools/client/framework/toolbox-init.js
devtools/client/responsive.html/manager.js
devtools/client/scratchpad/scratchpad.js
devtools/client/shadereditor/test/head.js
devtools/client/shared/test/test-actor-registry.js
devtools/client/webaudioeditor/test/head.js
devtools/client/webconsole/hudservice.js
devtools/client/webide/modules/runtimes.js
devtools/client/webide/test/test_autoconnect_runtime.html
devtools/client/webide/test/test_autoselect_project.html
devtools/client/webide/test/test_device_preferences.html
devtools/client/webide/test/test_device_runtime.html
devtools/client/webide/test/test_runtime.html
devtools/client/webide/test/test_toolbox.html
devtools/docs/backend/client-api.md
devtools/server/child.js
devtools/server/content-server.jsm
devtools/server/tests/browser/browser_register_actor.js
devtools/server/tests/mochitest/test_connectToChild.html
devtools/server/tests/mochitest/test_connection-manager.html
devtools/server/tests/mochitest/test_device.html
devtools/server/tests/mochitest/test_framerate_01.html
devtools/server/tests/mochitest/test_framerate_02.html
devtools/server/tests/mochitest/test_framerate_03.html
devtools/server/tests/mochitest/test_getProcess.html
devtools/server/tests/mochitest/test_setupInParentChild.html
devtools/server/tests/unit/head_dbg.js
devtools/shared/security/tests/chrome/test_websocket-transport.html
devtools/shared/webconsole/test/common.js
mobile/android/chrome/content/RemoteDebugger.js
mobile/android/modules/geckoview/GeckoViewRemoteDebugger.jsm
--- a/devtools/client/aboutdebugging/initializer.js
+++ b/devtools/client/aboutdebugging/initializer.js
@@ -34,19 +34,17 @@ const AboutDebuggingApp = createFactory(
 var AboutDebugging = {
   init() {
     if (!Services.prefs.getBoolPref("devtools.enabled", true)) {
       // If DevTools are disabled, navigate to about:devtools.
       window.location = "about:devtools?reason=AboutDebugging";
       return;
     }
 
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-    }
+    DebuggerServer.init();
     DebuggerServer.allowChromeProcess = true;
     // We want a full featured server for about:debugging. Especially the
     // "browser actors" like addons.
     DebuggerServer.registerActors({ root: true, browser: true, tab: true });
 
     this.client = new DebuggerClient(DebuggerServer.connectPipe());
 
     this.client.connect().then(() => {
--- a/devtools/client/canvasdebugger/test/head.js
+++ b/devtools/client/canvasdebugger/test/head.js
@@ -186,20 +186,18 @@ function navigate(aTarget, aUrl, aWaitFo
 }
 
 function reload(aTarget, aWaitForTargetEvent = "navigate") {
   executeSoon(() => aTarget.activeTab.reload());
   return once(aTarget, aWaitForTargetEvent);
 }
 
 function initServer() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 }
 
 function initCallWatcherBackend(aUrl) {
   info("Initializing a call watcher front.");
   initServer();
 
   return Task.spawn(function* () {
     let tab = yield addTab(aUrl);
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-chrome-debugging.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-chrome-debugging.js
@@ -13,20 +13,18 @@ var gNewChromeSource = promise.defer();
 
 var { DevToolsLoader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 var customLoader = new DevToolsLoader();
 customLoader.invisibleToDebugger = true;
 var { DebuggerServer } = customLoader.require("devtools/server/main");
 var { DebuggerClient } = require("devtools/shared/client/debugger-client");
 
 function initDebuggerClient() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   DebuggerServer.allowChromeProcess = true;
 
   let transport = DebuggerServer.connectPipe();
   return new DebuggerClient(transport);
 }
 
 function attachThread(client, actor) {
   return new Promise(resolve => {
--- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-01.js
@@ -7,20 +7,18 @@
  * Tests that the break-on-dom-events request works.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-01.html";
 
 var gClient, gThreadClient, gInput, gButton;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_break-on-dom-event-02.js
@@ -8,20 +8,18 @@
  * listeners and handler objects with 'handleEvent' methods.
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-03.html";
 
 var gClient, gThreadClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_chrome-debugging.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_chrome-debugging.js
@@ -15,20 +15,18 @@ var gNewGlobal = promise.defer();
 var gNewChromeSource = promise.defer();
 
 var { DevToolsLoader } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 var customLoader = new DevToolsLoader();
 customLoader.invisibleToDebugger = true;
 var { DebuggerServer } = customLoader.require("devtools/server/main");
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   DebuggerServer.allowChromeProcess = true;
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_debugger-statement.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_debugger-statement.js
@@ -8,20 +8,18 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
 
 var gClient;
 var gTab;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-01.js
@@ -8,20 +8,18 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-01.html";
 
 var gClient;
 var gTab;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-02.js
@@ -9,20 +9,18 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_event-listeners-03.html";
 
 var gClient;
 var gTab;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_event-listeners-03.js
@@ -9,20 +9,18 @@
  */
 
 const TAB_URL = EXAMPLE_URL + "doc_native-event-handler.html";
 
 var gClient;
 var gTab;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
@@ -7,20 +7,18 @@
  * Check extension-added global actor API.
  */
 
 const ACTORS_URL = CHROME_URL + "testactors.js";
 
 function test() {
   let gClient;
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   DebuggerServer.addActors(ACTORS_URL);
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
@@ -9,20 +9,18 @@
 const ADDON1_ID = "jid1-oBAwBoE5rSecNg@jetpack";
 const ADDON1_PATH = "addon1.xpi";
 const ADDON2_ID = "jid1-qjtzNGV8xw5h2A@jetpack";
 const ADDON2_PATH = "addon2.xpi";
 
 var gAddon1, gAddon1Actor, gAddon2, gAddon2Actor, gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     promise.resolve(null)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
@@ -8,20 +8,18 @@
  */
 
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
 
 var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     promise.resolve(null)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
@@ -20,20 +20,18 @@ var gNewWindow;
 
 // Stock onListChanged handler.
 var onListChangedCount = 0;
 function onListChangedHandler() {
   onListChangedCount++;
 }
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   gTabList = new BrowserTabList("fake DebuggerServerConnection");
   gTabList._testing = true;
   gTabList.onListChanged = onListChangedHandler;
 
   checkSingleTab()
     .then(addTabA)
     .then(testTabA)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
@@ -7,20 +7,18 @@
  * Make sure the listTabs request works as specified.
  */
 
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
 var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(Task.async(function* ([aType, aTraits]) {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
     let tab = yield addTab(TAB1_URL);
 
--- a/devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
@@ -10,20 +10,18 @@
 
 const TAB1_URL = EXAMPLE_URL + "doc_script-switching-01.html";
 const TAB2_URL = EXAMPLE_URL + "doc_script-switching-02.html";
 
 var gNewTab, gNewWindow;
 var gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     promise.resolve(null)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
@@ -8,20 +8,18 @@
  */
 
 const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
 
 var gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
 
     addTab(TAB1_URL)
--- a/devtools/client/debugger/test/mochitest/browser_dbg_tabactor-01.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_tabactor-01.js
@@ -8,20 +8,18 @@
  */
 
 const ACTORS_URL = CHROME_URL + "testactors.js";
 const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
 var gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   DebuggerServer.addActors(ACTORS_URL);
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
--- a/devtools/client/debugger/test/mochitest/browser_dbg_tabactor-02.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_tabactor-02.js
@@ -8,20 +8,18 @@
  */
 
 const ACTORS_URL = CHROME_URL + "testactors.js";
 const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
 
 var gClient;
 
 function test() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   DebuggerServer.addActors(ACTORS_URL);
 
   let transport = DebuggerServer.connectPipe();
   gClient = new DebuggerClient(transport);
   gClient.connect().then(([aType, aTraits]) => {
     is(aType, "browser",
       "Root actor should identify itself as a browser.");
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -622,20 +622,18 @@ function AddonDebugger() {
   this._onConsoleAPICall = this._onConsoleAPICall.bind(this);
   EventEmitter.decorate(this);
 }
 
 AddonDebugger.prototype = {
   init: Task.async(function* (aAddonId) {
     info("Initializing an addon debugger panel.");
 
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     DebuggerServer.allowChromeProcess = true;
 
     this.frame = document.createElement("iframe");
     this.frame.setAttribute("height", 400);
     document.documentElement.appendChild(this.frame);
     window.addEventListener("message", this._onMessage);
 
     let transport = DebuggerServer.connectPipe();
@@ -1319,20 +1317,18 @@ function waitForDispatch(panel, type, ev
       yield _afterDispatchDone(controller, actionType);
       count++;
       info(type + " dispatched " + count + " time(s)");
     }
   });
 }
 
 function* initWorkerDebugger(TAB_URL, WORKER_URL) {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   yield connect(client);
 
   let tab = yield addTab(TAB_URL);
   let { tabs } = yield listTabs(client);
   let [, tabClient] = yield attachTab(client, findTab(tabs, TAB_URL));
 
--- a/devtools/client/framework/devtools-browser.js
+++ b/devtools/client/framework/devtools-browser.js
@@ -323,20 +323,18 @@ var gDevToolsBrowser = exports.gDevTools
       win.focus();
     } else {
       Services.ww.openWindow(null, "chrome://webide/content/", "webide", "chrome,centerscreen,resizable", null);
     }
   },
 
   _getContentProcessTarget(processId) {
     // Create a DebuggerServer in order to connect locally to it
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     DebuggerServer.allowChromeProcess = true;
 
     let transport = DebuggerServer.connectPipe();
     let client = new DebuggerClient(transport);
 
     let deferred = defer();
     client.connect().then(() => {
       client.getProcess(processId)
--- a/devtools/client/framework/target-from-url.js
+++ b/devtools/client/framework/target-from-url.js
@@ -127,16 +127,14 @@ function* createClient(params) {
   let port = params.get("port");
   let webSocket = !!params.get("ws");
 
   let transport;
   if (port) {
     transport = yield DebuggerClient.socketConnect({ host, port, webSocket });
   } else {
     // Setup a server if we don't have one already running
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     transport = DebuggerServer.connectPipe();
   }
   return new DebuggerClient(transport);
 }
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -399,19 +399,18 @@ TabTarget.prototype = {
       return this._remote.promise;
     }
 
     this._remote = defer();
 
     if (this.isLocalTab) {
       // Since a remote protocol connection will be made, let's start the
       // DebuggerServer here, once and for all tools.
-      if (!DebuggerServer.initialized) {
-        DebuggerServer.init();
-      }
+      DebuggerServer.init();
+
       // When connecting to a local tab, we only need the root actor.
       // Then we are going to call DebuggerServer.connectToChild and talk
       // directly with actors living in the child process.
       // We also need browser actors for actor registry which enabled addons
       // to register custom actors.
       DebuggerServer.registerActors({ root: true, browser: true, tab: false });
 
       this._client = new DebuggerClient(DebuggerServer.connectPipe());
--- a/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
+++ b/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
@@ -58,20 +58,18 @@ function runTools(target) {
 
     yield toolbox.destroy();
   });
 }
 
 function getClient() {
   let deferred = defer();
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let transport = DebuggerServer.connectPipe();
   let client = new DebuggerClient(transport);
 
   return client.connect().then(() => client);
 }
 
 function getTarget(client) {
--- a/devtools/client/framework/test/browser_two_tabs.js
+++ b/devtools/client/framework/test/browser_two_tabs.js
@@ -15,20 +15,18 @@ const TAB_URL_2 = "data:text/html;charse
 
 var gClient;
 var gTab1, gTab2;
 var gTabActor1, gTabActor2;
 
 function test() {
   waitForExplicitFinish();
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   openTabs();
 }
 
 function openTabs() {
   // Open two tabs, select the second
   addTab(TAB_URL_1).then(tab1 => {
     gTab1 = tab1;
--- a/devtools/client/framework/test/head.js
+++ b/devtools/client/framework/test/head.js
@@ -23,20 +23,18 @@ function toggleAllTools(state) {
   }
 }
 
 function getChromeActors(callback)
 {
   let { DebuggerServer } = require("devtools/server/main");
   let { DebuggerClient } = require("devtools/shared/client/debugger-client");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   DebuggerServer.allowChromeProcess = true;
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect()
     .then(() => client.getProcess())
     .then(response => {
       callback(client, response.form);
     });
--- a/devtools/client/framework/toolbox-init.js
+++ b/devtools/client/framework/toolbox-init.js
@@ -65,20 +65,18 @@ if (url.search.length > 1) {
       // Need to use a xray to have attributes and behavior expected by
       // devtools codebase
       iframe = XPCNativeWrapper(iframe);
 
       // Fake a xul:tab object as we don't have one.
       // linkedBrowser is the only one attribute being queried by client.getTab
       let tab = { linkedBrowser: iframe };
 
-      if (!DebuggerServer.initialized) {
-        DebuggerServer.init();
-        DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-      }
+      DebuggerServer.init();
+      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
       let client = new DebuggerClient(DebuggerServer.connectPipe());
 
       yield client.connect();
       // Creates a target for a given browser iframe.
       let response = yield client.getTab({ tab });
       let form = response.tab;
       target = yield TargetFactory.forRemoteTab({client, form, chrome: false});
     } else {
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -425,20 +425,18 @@ ResponsiveUI.prototype = {
     }
 
     this.destroyed = true;
 
     return true;
   }),
 
   connectToServer: Task.async(function* () {
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     this.client = new DebuggerClient(DebuggerServer.connectPipe());
     yield this.client.connect();
     let { tab } = yield this.client.getTab();
     this.emulationFront = EmulationFront(this.client, tab);
   }),
 
   handleEvent(event) {
     let { browserWindow, tab } = this;
--- a/devtools/client/scratchpad/scratchpad.js
+++ b/devtools/client/scratchpad/scratchpad.js
@@ -2181,20 +2181,18 @@ ScratchpadWindow.prototype = Heritage.ex
   /**
    * Attach to this window.
    *
    * @return Promise
    *         The promise for the target for this window.
    */
   _attach: function SW__attach()
   {
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     DebuggerServer.allowChromeProcess = true;
 
     let client = new DebuggerClient(DebuggerServer.connectPipe());
     return client.connect()
       .then(() => client.getProcess())
       .then(aResponse => {
         return { form: aResponse.form, client: client };
       });
--- a/devtools/client/shadereditor/test/head.js
+++ b/devtools/client/shadereditor/test/head.js
@@ -221,20 +221,18 @@ function navigate(aTarget, aUrl, aWaitFo
 function reload(aTarget, aWaitForTargetEvent = "navigate") {
   executeSoon(() => aTarget.activeTab.reload());
   return once(aTarget, aWaitForTargetEvent);
 }
 
 function initBackend(aUrl) {
   info("Initializing a shader editor front.");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   return Task.spawn(function* () {
     let tab = yield addTab(aUrl);
     let target = TargetFactory.forTab(tab);
 
     yield target.makeRemote();
 
     let front = new WebGLFront(target.client, target.form);
--- a/devtools/client/shared/test/test-actor-registry.js
+++ b/devtools/client/shared/test/test-actor-registry.js
@@ -61,20 +61,18 @@
   // Sometimes, we need the test actor before opening or without a toolbox then just
   // create a front for the given `tab`
   exports.getTestActorWithoutToolbox = Task.async(function* (tab) {
     let { DebuggerServer } = require("devtools/server/main");
     let { DebuggerClient } = require("devtools/shared/client/debugger-client");
 
     // We need to spawn a client instance,
     // but for that we have to first ensure a server is running
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     let client = new DebuggerClient(DebuggerServer.connectPipe());
 
     yield client.connect();
 
     // We also need to make sure the test actor is registered on the server.
     yield exports.registerTestActor(client);
 
     return getTestActor(client, tab);
--- a/devtools/client/webaudioeditor/test/head.js
+++ b/devtools/client/webaudioeditor/test/head.js
@@ -156,20 +156,18 @@ function loadFrameScripts() {
 
 /**
  * Adds a new tab, and instantiate a WebAudiFront object.
  * This requires calling removeTab before the test ends.
  */
 function initBackend(aUrl) {
   info("Initializing a web audio editor front.");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   return Task.spawn(function* () {
     let tab = yield addTab(aUrl);
     let target = TargetFactory.forTab(tab);
 
     yield target.makeRemote();
 
     let front = new WebAudioFront(target.client, target.form);
--- a/devtools/client/webconsole/hudservice.js
+++ b/devtools/client/webconsole/hudservice.js
@@ -183,23 +183,20 @@ HUD_SERVICE.prototype =
     }
 
     this._browserConsoleDefer = defer();
 
     function connect()
     {
       let deferred = defer();
 
-      if (!DebuggerServer.initialized) {
-        DebuggerServer.init();
-      }
-
       // Ensure that the root actor and the tab actors have been registered on the DebuggerServer,
       // so that the Browser Console can retrieve the console actors.
       // (See Bug 1416105 for rationale).
+      DebuggerServer.init();
       DebuggerServer.registerActors({ root: true, browser: false, tab: true });
 
       DebuggerServer.allowChromeProcess = true;
 
       let client = new DebuggerClient(DebuggerServer.connectPipe());
       return client.connect()
         .then(() => client.getProcess())
         .then(aResponse => {
--- a/devtools/client/webide/modules/runtimes.js
+++ b/devtools/client/webide/modules/runtimes.js
@@ -432,20 +432,18 @@ WiFiRuntime.prototype = {
 };
 
 // For testing use only
 exports._WiFiRuntime = WiFiRuntime;
 
 var gLocalRuntime = {
   type: RuntimeTypes.LOCAL,
   connect: function (connection) {
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     DebuggerServer.allowChromeProcess = true;
     connection.host = null; // Force Pipe transport
     connection.port = null;
     connection.connect();
     return promise.resolve();
   },
   get id() {
     return "local";
--- a/devtools/client/webide/test/test_autoconnect_runtime.html
+++ b/devtools/client/webide/test/test_autoconnect_runtime.html
@@ -14,20 +14,18 @@
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         Task.spawn(function*() {
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           let win = yield openWebIDE();
           let docRuntime = getRuntimeDocument(win);
 
           let fakeRuntime = {
             type: "USB",
             connect: function(connection) {
               is(connection, win.AppManager.connection, "connection is valid");
--- a/devtools/client/webide/test/test_autoselect_project.html
+++ b/devtools/client/webide/test/test_autoselect_project.html
@@ -14,20 +14,18 @@
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         Task.spawn(function* () {
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           let win = yield openWebIDE();
           let docRuntime = getRuntimeDocument(win);
           let docProject = getProjectDocument(win);
 
           let panelNode = docRuntime.querySelector("#runtime-panel");
           let items = panelNode.querySelectorAll(".runtime-panel-item-other");
           is(items.length, 2, "Found 2 runtime buttons");
--- a/devtools/client/webide/test/test_device_preferences.html
+++ b/devtools/client/webide/test/test_device_preferences.html
@@ -14,20 +14,18 @@
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         Task.spawn(function* () {
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           let win = yield openWebIDE();
 
           let prefIframe = win.document.querySelector("#deck-panel-devicepreferences");
           let docRuntime = getRuntimeDocument(win);
 
           win.AppManager.update("runtime-list");
 
--- a/devtools/client/webide/test/test_device_runtime.html
+++ b/devtools/client/webide/test/test_device_runtime.html
@@ -14,20 +14,18 @@
 
   <body>
 
     <script type="application/javascript">
       window.onload = function() {
         SimpleTest.waitForExplicitFinish();
 
         Task.spawn(function* () {
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           let win = yield openWebIDE();
 
           let detailsIframe = win.document.querySelector("#deck-panel-runtimedetails");
 
           yield connectToLocalRuntime(win);
 
           let details = win.document.querySelector("#cmd_showRuntimeDetails");
--- a/devtools/client/webide/test/test_runtime.html
+++ b/devtools/client/webide/test/test_runtime.html
@@ -34,20 +34,18 @@
           function isPlayActive() {
             return !win.document.querySelector("#cmd_play").hasAttribute("disabled");
           }
 
           function isStopActive() {
             return !win.document.querySelector("#cmd_stop").hasAttribute("disabled");
           }
 
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           win = yield openWebIDE();
           let docRuntime = getRuntimeDocument(win);
           let docProject = getProjectDocument(win);
           let winProject = getProjectWindow(win);
 
           let packagedAppLocation = getTestFilePath("app");
 
--- a/devtools/client/webide/test/test_toolbox.html
+++ b/devtools/client/webide/test/test_toolbox.html
@@ -26,20 +26,18 @@
               yield closeWebIDE(win);
             }
             DebuggerServer.destroy();
             yield removeAllProjects();
           });
         });
 
         Task.spawn(function*() {
-          if (!DebuggerServer.initialized) {
-            DebuggerServer.init();
-            DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-          }
+          DebuggerServer.init();
+          DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
           win = yield openWebIDE();
           let docRuntime = getRuntimeDocument(win);
           let docProject = getProjectDocument(win);
 
           win.AppManager.update("runtime-list");
 
           let deferred = new Promise(resolve => {
--- a/devtools/docs/backend/client-api.md
+++ b/devtools/docs/backend/client-api.md
@@ -7,20 +7,18 @@ DevTools has a client module that allows
 In order to communicate, a client and a server instance must be created and a protocol connection must be established. The connection can be either over a TCP socket or an nsIPipe. The `start` function displayed below establishes an nsIPipe-backed connection:
 
 ```javascript
 Components.utils.import("resource://gre/modules/devtools/dbg-server.jsm");
 Components.utils.import("resource://gre/modules/devtools/dbg-client.jsm");
 
 function start() {
   // Start the server.
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   // Listen to an nsIPipe
   let transport = DebuggerServer.connectPipe();
 
   // Start the client.
   client = new DebuggerClient(transport);
 
   // Attach listeners for client events.
@@ -36,20 +34,18 @@ function start() {
 If a TCP socket is required, the function should be split in two parts, a server-side and a client-side, like this:
 
 ```javascript
 Components.utils.import("resource://gre/modules/devtools/dbg-server.jsm");
 Components.utils.import("resource://gre/modules/devtools/dbg-client.jsm");
 
 function startServer() {
   // Start the server.
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   // For an nsIServerSocket we do this:
   DebuggerServer.openListener(2929); // A connection on port 2929.
 }
 
 async function startClient() {
   let transport = await DebuggerClient.socketConnect({ host: "localhost", port: 2929 });
 
@@ -161,20 +157,18 @@ Here is the source code for a complete d
 Components.utils.import("resource://gre/modules/devtools/dbg-server.jsm");
 Components.utils.import("resource://gre/modules/devtools/dbg-client.jsm");
 
 let client;
 let threadClient;
 
 function startDebugger() {
   // Start the server.
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   // Listen to an nsIPipe
   let transport = DebuggerServer.connectPipe();
   // For an nsIServerSocket we do this:
   // DebuggerServer.openListener(port);
   // ...and this at the client:
   // let transport = debuggerSocketConnect(host, port);
 
   // Start the client.
--- a/devtools/server/child.js
+++ b/devtools/server/child.js
@@ -13,19 +13,17 @@ try {
   (function () {
     const Cu = Components.utils;
     const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 
     const DevToolsUtils = require("devtools/shared/DevToolsUtils");
     const { dumpn } = DevToolsUtils;
     const { DebuggerServer, ActorPool } = require("devtools/server/main");
 
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-    }
+    DebuggerServer.init();
     // We want a special server without any root actor and only tab actors.
     // We are going to spawn a ContentActor instance in the next few lines,
     // it is going to act like a root actor without being one.
     DebuggerServer.registerActors({ root: false, browser: false, tab: true });
 
     let connections = new Map();
 
     let onConnect = DevToolsUtils.makeInfallible(function (msg) {
--- a/devtools/server/content-server.jsm
+++ b/devtools/server/content-server.jsm
@@ -24,19 +24,17 @@ function setupServer(mm) {
 
   // Init a custom, invisible DebuggerServer, in order to not pollute the
   // debugger with all devtools modules, nor break the debugger itself with
   // using it in the same process.
   gLoader = new DevToolsLoader();
   gLoader.invisibleToDebugger = true;
   let { DebuggerServer } = gLoader.require("devtools/server/main");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-  }
+  DebuggerServer.init();
   // For browser content toolbox, we do need a regular root actor and all tab
   // actors, but don't need all the "browser actors" that are only useful when
   // debugging the parent process via the browser toolbox.
   DebuggerServer.registerActors({ browser: false, root: true, tab: true });
 
   // Clean up things when the client disconnects
   mm.addMessageListener("debug:content-process-destroy", function onDestroy() {
     mm.removeMessageListener("debug:content-process-destroy", onDestroy);
--- a/devtools/server/tests/browser/browser_register_actor.js
+++ b/devtools/server/tests/browser/browser_register_actor.js
@@ -2,20 +2,18 @@
 
 var gClient;
 
 function test() {
   waitForExplicitFinish();
   let {ActorRegistryFront} = require("devtools/shared/fronts/actor-registry");
   let actorURL = "chrome://mochitests/content/chrome/devtools/server/tests/mochitest/hello-actor.js";
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   gClient = new DebuggerClient(DebuggerServer.connectPipe());
   gClient.connect()
     .then(() => gClient.listTabs())
     .then(response => {
       let options = {
         prefix: "helloActor",
         constructor: "HelloActor",
--- a/devtools/server/tests/mochitest/test_connectToChild.html
+++ b/devtools/server/tests/mochitest/test_connectToChild.html
@@ -44,19 +44,17 @@ function runTests() {
   // Register a test actor in the child process so that we can know if and when
   // this fake actor is destroyed.
   mm.loadFrameScript("data:text/javascript,new " + function FrameScriptScope() {
     /* eslint-disable no-shadow */
     const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
     const { DebuggerServer } = require("devtools/server/main");
     /* eslint-enable no-shadow */
 
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-    }
+    DebuggerServer.init();
 
     function TestActor() {
       dump("instanciate test actor\n");
     }
     TestActor.prototype = {
       actorPrefix: "test",
 
       destroy: function () {
@@ -68,19 +66,17 @@ function runTests() {
     };
     TestActor.prototype.requestTypes = {
       "hello": TestActor.prototype.hello
     };
     DebuggerServer.addTabActor(TestActor, "testActor");
   }, false);
 
   // Instantiate a minimal server
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-  }
+  DebuggerServer.init();
   if (!DebuggerServer.createRootActor) {
     DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   }
 
   function firstClient() {
     // Fake a first connection to an iframe
     let transport = DebuggerServer.connectPipe();
     let conn = transport._serverConnection;
--- a/devtools/server/tests/mochitest/test_connection-manager.html
+++ b/devtools/server/tests/mochitest/test_connection-manager.html
@@ -18,20 +18,18 @@ window.onload = function () {
   SimpleTest.waitForExplicitFinish();
 
   const Cu = Components.utils;
 
   const {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
   const {DebuggerServer} = require("devtools/server/main");
   const Services = require("Services");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   const {
     ConnectionManager,
     Connection
   } = require("devtools/shared/client/connection-manager");
 
   let orgCount = ConnectionManager.connections.length;
 
--- a/devtools/server/tests/mochitest/test_device.html
+++ b/devtools/server/tests/mochitest/test_device.html
@@ -22,20 +22,18 @@ window.onload = function () {
   const {DebuggerClient} = require("devtools/shared/client/debugger-client");
   const {DebuggerServer} = require("devtools/server/main");
   const Services = require("Services");
 
   SimpleTest.waitForExplicitFinish();
 
   const {getDeviceFront} = require("devtools/shared/fronts/device");
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect().then(function onConnect() {
     client.listTabs(function onListTabs(response) {
       let d = getDeviceFront(client, response);
 
       let desc;
       let appInfo = Services.appinfo;
--- a/devtools/server/tests/mochitest/test_framerate_01.html
+++ b/devtools/server/tests/mochitest/test_framerate_01.html
@@ -62,20 +62,18 @@ window.onload = function () {
 
       frameCount = 0;
       prevTime = currTime;
     }
 
     return timeline;
   }
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect().then(function onConnect() {
     client.listTabs(function onListTabs(response) {
       let form = response.tabs[response.selected];
       let front = FramerateFront(client, form);
 
       window.setTimeout(() => {
--- a/devtools/server/tests/mochitest/test_framerate_02.html
+++ b/devtools/server/tests/mochitest/test_framerate_02.html
@@ -62,20 +62,18 @@ window.onload = function () {
 
       frameCount = 0;
       prevTime = currTime;
     }
 
     return timeline;
   }
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect().then(function onConnect() {
     client.listTabs(function onListTabs(response) {
       let form = response.tabs[response.selected];
       let front = FramerateFront(client, form);
 
       front.stopRecording().then(rawData => {
--- a/devtools/server/tests/mochitest/test_framerate_03.html
+++ b/devtools/server/tests/mochitest/test_framerate_03.html
@@ -30,20 +30,18 @@ window.onload = function () {
 
   SimpleTest.waitForExplicitFinish();
 
   const {FramerateFront} = require("devtools/shared/fronts/framerate");
   const START_TICK = 2000;
   const STOP_TICK = 3000;
   const TOTAL_TIME = 5000;
 
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect().then(function onConnect() {
     client.listTabs(function onListTabs(response) {
       let form = response.tabs[response.selected];
       let front = FramerateFront(client, form);
 
       front.startRecording().then(() => {
--- a/devtools/server/tests/mochitest/test_getProcess.html
+++ b/devtools/server/tests/mochitest/test_getProcess.html
@@ -33,19 +33,17 @@ window.onload = function () {
       // Allows creating a branch new process when creation the iframe
       ["dom.ipc.processCount", 10],
     ]
   }, runTests);
 };
 
 function runTests() {
   // Instantiate a minimal server
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-  }
+  DebuggerServer.init();
   DebuggerServer.allowChromeProcess = true;
   if (!DebuggerServer.createRootActor) {
     DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   }
 
   let client, iframe, processCount;
 
   function connect() {
--- a/devtools/server/tests/mochitest/test_setupInParentChild.html
+++ b/devtools/server/tests/mochitest/test_setupInParentChild.html
@@ -37,19 +37,17 @@ window.onload = function () {
 
 function runTests() {
   // Create a minimal iframe with a message manager
   let iframe = document.createElement("iframe");
   iframe.mozbrowser = true;
   document.body.appendChild(iframe);
 
   // Instantiate a minimal server
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-  }
+  DebuggerServer.init();
   if (!DebuggerServer.createRootActor) {
     DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   }
 
   // Fake a connection to an iframe
   let transport = DebuggerServer.connectPipe();
   let conn = transport._serverConnection;
   let client = new DebuggerClient(transport);
--- a/devtools/server/tests/unit/head_dbg.js
+++ b/devtools/server/tests/unit/head_dbg.js
@@ -433,20 +433,18 @@ function finishClient(client) {
     DebuggerServer.destroy();
     do_test_finished();
   });
 }
 
 // Create a server, connect to it and fetch tab actors for the parent process;
 // pass |callback| the debugger client and tab actor form with all actor IDs.
 function get_chrome_actors(callback) {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   DebuggerServer.allowChromeProcess = true;
 
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   client.connect()
     .then(() => client.getProcess())
     .then(response => {
       callback(client, response.form);
     });
--- a/devtools/shared/security/tests/chrome/test_websocket-transport.html
+++ b/devtools/shared/security/tests/chrome/test_websocket-transport.html
@@ -21,20 +21,18 @@ window.onload = function () {
   Services.prefs.setBoolPref("devtools.debugger.prompt-connection", false);
 
   SimpleTest.registerCleanupFunction(() => {
     Services.prefs.clearUserPref("devtools.debugger.remote-enabled");
     Services.prefs.clearUserPref("devtools.debugger.prompt-connection");
   });
 
   add_task(function* () {
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
 
     is(DebuggerServer.listeningSockets, 0, "0 listening sockets");
 
     let listener = DebuggerServer.createListener();
     ok(listener, "Socket listener created");
     listener.portOrPath = -1;
     listener.webSocket = true;
     yield listener.open();
--- a/devtools/shared/webconsole/test/common.js
+++ b/devtools/shared/webconsole/test/common.js
@@ -20,20 +20,18 @@ const {DebuggerClient} = require("devtoo
 const ObjectClient = require("devtools/shared/client/object-client");
 const Services = require("Services");
 
 function initCommon() {
   // Services.prefs.setBoolPref("devtools.debugger.log", true);
 }
 
 function initDebuggerServer() {
-  if (!DebuggerServer.initialized) {
-    DebuggerServer.init();
-    DebuggerServer.registerActors({ browser: true, root: true, tab: true });
-  }
+  DebuggerServer.init();
+  DebuggerServer.registerActors({ browser: true, root: true, tab: true });
   DebuggerServer.allowChromeProcess = true;
 }
 
 function connectToDebugger() {
   initCommon();
   initDebuggerServer();
 
   let transport = DebuggerServer.connectPipe();
--- a/mobile/android/chrome/content/RemoteDebugger.js
+++ b/mobile/android/chrome/content/RemoteDebugger.js
@@ -171,20 +171,16 @@ var RemoteDebugger = {
     });
 
     this._receivingOOB.then(() => this._receivingOOB = null);
 
     return this._receivingOOB;
   },
 
   initServer: function() {
-    if (DebuggerServer.initialized) {
-      return;
-    }
-
     DebuggerServer.init();
 
     // Add browser and Fennec specific actors
     DebuggerServer.registerActors({ browser: true, root: true, tab: true });
     DebuggerServer.registerModule("resource://gre/modules/dbg-browser-actors.js");
 
     // Allow debugging of chrome for any process
     DebuggerServer.allowChromeProcess = true;
--- a/mobile/android/modules/geckoview/GeckoViewRemoteDebugger.jsm
+++ b/mobile/android/modules/geckoview/GeckoViewRemoteDebugger.jsm
@@ -38,25 +38,21 @@ class GeckoViewRemoteDebugger extends Ge
     if (enabled && !this._isEnabled) {
       this.register();
     } else if (!enabled) {
       this.unregister();
     }
   }
 
   register() {
-    if (!DebuggerServer.initialized) {
-      DebuggerServer.init();
-
-      let windowType = "navigator:geckoview";
-      DebuggerServer.registerActors({ browser: true, root: true, tab: true, windowType });
-      DebuggerServer.registerModule(
-        "resource://gre/modules/dbg-browser-actors.js");
-      DebuggerServer.allowChromeProcess = true;
-    }
+    DebuggerServer.init();
+    DebuggerServer.registerActors({ browser: true, root: true, tab: true,
+      windowType: "navigator:geckoview" });
+    DebuggerServer.registerModule("resource://gre/modules/dbg-browser-actors.js");
+    DebuggerServer.allowChromeProcess = true;
 
     let windowId = this.window.QueryInterface(Ci.nsIInterfaceRequestor)
                               .getInterface(Ci.nsIDOMWindowUtils)
                               .outerWindowID;
     let env = Cc["@mozilla.org/process/environment;1"]
               .getService(Ci.nsIEnvironment);
     let dataDir = env.get("MOZ_ANDROID_DATA_DIR");