Bug 1499333 - Rename all "worker client" to "worker target front". r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 18 Oct 2018 07:21:02 +0000
changeset 497674 d893e01e4d37783a8f24c2081b6e85905f3501b1
parent 497673 075201afc029437db5a51b94bd0fde25cb74c202
child 497675 7cf3a024e668a21da95252827dca09e193e6f3e7
push id10002
push userarchaeopteryx@coole-files.de
push dateFri, 19 Oct 2018 23:09:29 +0000
treeherdermozilla-beta@01378c910610 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1499333
milestone64.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 1499333 - Rename all "worker client" to "worker target front". r=jdescottes MozReview-Commit-ID: 30eOjbkYyvg Differential Revision: https://phabricator.services.mozilla.com/D9006
devtools/client/debugger/debugger-controller.js
devtools/client/debugger/new/panel.js
devtools/client/debugger/new/src/client/firefox/events.js
devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
devtools/client/debugger/test/mochitest/head.js
devtools/client/framework/devtools-browser.js
devtools/client/framework/target.js
devtools/client/shared/test/browser_dbg_WorkerTargetActor.attach.js
devtools/client/shared/test/browser_dbg_worker-console-01.js
devtools/client/shared/test/browser_dbg_worker-console-02.js
devtools/client/shared/test/browser_dbg_worker-console-03.js
devtools/client/shared/test/browser_dbg_worker-console-04.js
devtools/client/shared/test/helper_workers.js
devtools/shared/client/thread-client.js
devtools/shared/webconsole/test/common.js
--- a/devtools/client/debugger/debugger-controller.js
+++ b/devtools/client/debugger/debugger-controller.js
@@ -474,18 +474,18 @@ Workers.prototype = {
 
   connect: function () {
     if (!Prefs.workersEnabled) {
       return;
     }
 
     this._updateWorkerList();
 
-    // `_targetFront` can be BrowsingContextTargetFront (protocol.js front) or
-    // WorkerClient/DebuggerClient (old fashion client)
+    // `_targetFront` can be BrowsingContextTargetFront/WorkerTargetFront (protocol.js
+    // front) or DebuggerClient (old fashion client)
     if (typeof(this._targetFront.on) == "function") {
       this._targetFront.on("workerListChanged", this._onWorkerListChanged);
     } else {
       this._targetFront.addListener("workerListChanged", this._onWorkerListChanged);
     }
   },
 
   disconnect: function () {
@@ -524,18 +524,18 @@ Workers.prototype = {
     });
   },
 
   _onWorkerListChanged: function () {
     this._updateWorkerList();
   },
 
   _onWorkerSelect: function (workerForm) {
-    DebuggerController.client.attachWorker(workerForm.actor).then(([response, workerClient]) => {
-      let toolbox = gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
+    DebuggerController.client.attachWorker(workerForm.actor).then(([response, workerTargetFront]) => {
+      let toolbox = gDevTools.showToolbox(TargetFactory.forWorker(workerTargetFront),
                                           "jsdebugger", Toolbox.HostType.WINDOW);
       window.emit(EVENTS.WORKER_SELECTED, toolbox);
     });
   }
 };
 
 /**
  * ThreadState keeps the UI up to date with the state of the
--- a/devtools/client/debugger/new/panel.js
+++ b/devtools/client/debugger/new/panel.js
@@ -59,21 +59,21 @@ DebuggerPanel.prototype = {
     return this._store.getState();
   },
 
   openLink: function(url) {
     openContentLink(url);
   },
 
   openWorkerToolbox: async function(worker) {
-    const [response, workerClient] =
+    const [response, workerTargetFront] =
       await this.toolbox.target.client.attachWorker(worker.actor);
-    const workerTarget = TargetFactory.forWorker(workerClient);
+    const workerTarget = TargetFactory.forWorker(workerTargetFront);
     const toolbox = await gDevTools.showToolbox(workerTarget, "jsdebugger", Toolbox.HostType.WINDOW);
-    toolbox.once("destroy", () => workerClient.detach());
+    toolbox.once("destroy", () => workerTargetFront.detach());
   },
 
   getFrames: function() {
     let frames = this._selectors.getFrames(this._getState());
 
     // Frames is null when the debugger is not paused.
     if (!frames) {
       return {
--- a/devtools/client/debugger/new/src/client/firefox/events.js
+++ b/devtools/client/debugger/new/src/client/firefox/events.js
@@ -36,18 +36,18 @@ function setupEvents(dependencies) {
   });
 
   if (threadClient) {
     Object.keys(clientEvents).forEach(eventName => {
       threadClient.addListener(eventName, clientEvents[eventName]);
     });
 
     if (threadClient._parent) {
-      // Parent may be BrowsingContextTargetFront and be protocol.js.
-      // Or DebuggerClient/WorkerClient and still be old fashion actor.
+      // Parent may be BrowsingContextTargetFront/WorkerTargetFront and be protocol.js.
+      // Or DebuggerClient and still be old fashion actor.
       if (threadClient._parent.on) {
         threadClient._parent.on("workerListChanged", workerListChanged);
       } else {
         threadClient._parent.addListener("workerListChanged", workerListChanged);
       }
     }
   }
 }
--- a/devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_worker-window.js
@@ -23,20 +23,20 @@ add_task(async function() {
   let tab = await addTab(TAB_URL);
   let { tabs } = await listTabs(client);
   let [, targetFront] = await attachTarget(client, findTab(tabs, TAB_URL));
 
   await listWorkers(targetFront);
   await createWorkerInTab(tab, WORKER_URL);
 
   let { workers } = await listWorkers(targetFront);
-  let [, workerClient] = await attachWorker(targetFront,
+  let [, workerTargetFront] = await attachWorker(targetFront,
                                              findWorker(workers, WORKER_URL));
 
-  let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
+  let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerTargetFront),
                                             "jsdebugger",
                                             Toolbox.HostType.WINDOW);
 
   is(toolbox.hostType, "window", "correct host");
 
   await new Promise(done => {
     toolbox.win.parent.addEventListener("message", function onmessage(event) {
       if (event.data.name == "set-host-title") {
@@ -50,13 +50,13 @@ add_task(async function() {
 
   let toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");
   let activeTools = [...toolTabs].map(tab=>tab.getAttribute("data-id"));
 
   is(activeTools.join(","), "webconsole,jsdebugger,scratchpad",
     "Correct set of tools supported by worker");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  await waitForWorkerClose(workerClient);
+  await waitForWorkerClose(workerTargetFront);
   await close(client);
 
   await toolbox.destroy();
 });
--- a/devtools/client/debugger/test/mochitest/head.js
+++ b/devtools/client/debugger/test/mochitest/head.js
@@ -1109,24 +1109,24 @@ function attachWorker(targetFront, worke
   return targetFront.attachWorker(worker.actor);
 }
 
 function waitForWorkerListChanged(targetFront) {
   info("Waiting for worker list to change.");
   return targetFront.once("workerListChanged");
 }
 
-function attachThread(workerClient, options) {
+function attachThread(workerTargetFront, options) {
   info("Attaching to thread.");
-  return workerClient.attachThread(options);
+  return workerTargetFront.attachThread(options);
 }
 
-async function waitForWorkerClose(workerClient) {
+async function waitForWorkerClose(workerTargetFront) {
   info("Waiting for worker to close.");
-  await workerClient.once("close");
+  await workerTargetFront.once("close");
   info("Worker did close.");
 }
 
 function resume(threadClient) {
   info("Resuming thread.");
   return threadClient.resume();
 }
 
@@ -1283,20 +1283,20 @@ async function initWorkerDebugger(TAB_UR
 
   let tab = await addTab(TAB_URL);
   let { tabs } = await listTabs(client);
   let [, targetFront] = await attachTarget(client, findTab(tabs, TAB_URL));
 
   await createWorkerInTab(tab, WORKER_URL);
 
   let { workers } = await listWorkers(targetFront);
-  let [, workerClient] = await attachWorker(targetFront,
+  let [, workerTargetFront] = await attachWorker(targetFront,
                                              findWorker(workers, WORKER_URL));
 
-  let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
+  let toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerTargetFront),
                                             "jsdebugger",
                                             Toolbox.HostType.WINDOW);
 
   let debuggerPanel = toolbox.getCurrentPanel();
   let gDebugger = debuggerPanel.panelWin;
 
-  return {client, tab, targetFront, workerClient, toolbox, gDebugger};
+  return {client, tab, targetFront, workerTargetFront, toolbox, gDebugger};
 }
--- a/devtools/client/framework/devtools-browser.js
+++ b/devtools/client/framework/devtools-browser.js
@@ -370,20 +370,20 @@ var gDevToolsBrowser = exports.gDevTools
    * Open a window-hosted toolbox to debug the worker associated to the provided
    * worker actor.
    *
    * @param  {DebuggerClient} client
    * @param  {Object} workerTargetActor
    *         worker actor form to debug
    */
   async openWorkerToolbox(client, workerTargetActor) {
-    const [, workerClient] = await client.attachWorker(workerTargetActor);
-    const workerTarget = TargetFactory.forWorker(workerClient);
+    const [, workerTargetFront] = await client.attachWorker(workerTargetActor);
+    const workerTarget = TargetFactory.forWorker(workerTargetFront);
     const toolbox = await gDevTools.showToolbox(workerTarget, null, Toolbox.HostType.WINDOW);
-    toolbox.once("destroy", () => workerClient.detach());
+    toolbox.once("destroy", () => workerTargetFront.detach());
   },
 
   /**
    * Install WebIDE widget
    */
   // Used by itself
   installWebIDEWidget() {
     if (this.isWebIDEWidgetInstalled()) {
--- a/devtools/client/framework/target.js
+++ b/devtools/client/framework/target.js
@@ -115,21 +115,21 @@ const TargetFactory = exports.TargetFact
     if (targetPromise == null) {
       const target = new TabTarget(options);
       targetPromise = target.attach().then(() => target);
       promiseTargets.set(options, targetPromise);
     }
     return targetPromise;
   },
 
-  forWorker: function(workerClient) {
-    let target = targets.get(workerClient);
+  forWorker: function(workerTargetFront) {
+    let target = targets.get(workerTargetFront);
     if (target == null) {
-      target = new WorkerTarget(workerClient);
-      targets.set(workerClient, target);
+      target = new WorkerTarget(workerTargetFront);
+      targets.set(workerTargetFront, target);
     }
     return target;
   },
 
   /**
    * Creating a target for a tab that is being closed is a problem because it
    * allows a leak as a result of coming after the close event which normally
    * clears things up. This function allows us to ask if there is a known
@@ -843,29 +843,29 @@ TabTarget.prototype = {
   logWarningInPage: function(text, category) {
     if (this.activeTab && this.activeTab.traits.logInPage) {
       const warningFlag = 1;
       this.activeTab.logInPage({ text, category, flags: warningFlag });
     }
   },
 };
 
-function WorkerTarget(workerClient) {
+function WorkerTarget(workerTargetFront) {
   EventEmitter.decorate(this);
-  this._workerClient = workerClient;
+  this._workerTargetFront = workerTargetFront;
 }
 
 /**
  * A WorkerTarget represents a worker. Unlike TabTarget, which can represent
  * either a local or remote tab, WorkerTarget always represents a remote worker.
  * Moreover, unlike TabTarget, which is constructed with a placeholder object
  * for remote tabs (from which a TargetFront can then be lazily obtained),
- * WorkerTarget is constructed with a WorkerClient directly.
+ * WorkerTarget is constructed with a WorkerTargetFront directly.
  *
- * WorkerClient is designed to mimic the interface of TargetFront as closely as
+ * WorkerTargetFront is designed to mimic the interface of TargetFront as closely as
  * possible. This allows us to debug workers as if they were ordinary tabs,
  * requiring only minimal changes to the rest of the frontend.
  */
 WorkerTarget.prototype = {
   get isRemote() {
     return true;
   },
 
@@ -873,47 +873,47 @@ WorkerTarget.prototype = {
     return true;
   },
 
   get name() {
     return "Worker";
   },
 
   get url() {
-    return this._workerClient.url;
+    return this._workerTargetFront.url;
   },
 
   get isWorkerTarget() {
     return true;
   },
 
   get form() {
     return {
-      consoleActor: this._workerClient.consoleActor
+      consoleActor: this._workerTargetFront.consoleActor
     };
   },
 
   get activeTab() {
-    return this._workerClient;
+    return this._workerTargetFront;
   },
 
   get activeConsole() {
     return this.client._clients.get(this.form.consoleActor);
   },
 
   get client() {
-    return this._workerClient.client;
+    return this._workerTargetFront.client;
   },
 
   get canRewind() {
     return false;
   },
 
   destroy: function() {
-    this._workerClient.detach();
+    this._workerTargetFront.detach();
   },
 
   hasActor: function(name) {
     // console is the only one actor implemented by WorkerTargetActor
     if (name == "console") {
       return true;
     }
     return false;
--- a/devtools/client/shared/test/browser_dbg_WorkerTargetActor.attach.js
+++ b/devtools/client/shared/test/browser_dbg_WorkerTargetActor.attach.js
@@ -39,40 +39,40 @@ function test() {
 
     // If a page still has pending network requests, it will not be moved into
     // the bfcache. Consequently, we cannot use waitForWorkerListChanged here,
     // because the worker is not guaranteed to have finished loading when it is
     // registered. Instead, we have to wait for the promise returned by
     // createWorker in the tab to be resolved.
     yield createWorkerInTab(tab, WORKER1_URL);
     let { workers } = yield listWorkers(targetFront);
-    let [, workerClient1] = yield attachWorker(targetFront,
+    let [, workerTargetFront1] = yield attachWorker(targetFront,
                                                findWorker(workers, WORKER1_URL));
-    is(workerClient1.isClosed, false, "worker in tab 1 should not be closed");
+    is(workerTargetFront1.isClosed, false, "worker in tab 1 should not be closed");
 
     executeSoon(() => {
       BrowserTestUtils.loadURI(tab.linkedBrowser, TAB2_URL);
     });
-    yield waitForWorkerClose(workerClient1);
-    is(workerClient1.isClosed, true, "worker in tab 1 should be closed");
+    yield waitForWorkerClose(workerTargetFront1);
+    is(workerTargetFront1.isClosed, true, "worker in tab 1 should be closed");
 
     yield createWorkerInTab(tab, WORKER2_URL);
     ({ workers } = yield listWorkers(targetFront));
-    const [, workerClient2] = yield attachWorker(targetFront,
+    const [, workerTargetFront2] = yield attachWorker(targetFront,
                                                findWorker(workers, WORKER2_URL));
-    is(workerClient2.isClosed, false, "worker in tab 2 should not be closed");
+    is(workerTargetFront2.isClosed, false, "worker in tab 2 should not be closed");
 
     executeSoon(() => {
       tab.linkedBrowser.goBack();
     });
-    yield waitForWorkerClose(workerClient2);
-    is(workerClient2.isClosed, true, "worker in tab 2 should be closed");
+    yield waitForWorkerClose(workerTargetFront2);
+    is(workerTargetFront2.isClosed, true, "worker in tab 2 should be closed");
 
     ({ workers } = yield listWorkers(targetFront));
-    [, workerClient1] = yield attachWorker(targetFront,
+    [, workerTargetFront1] = yield attachWorker(targetFront,
                                            findWorker(workers, WORKER1_URL));
-    is(workerClient1.isClosed, false, "worker in tab 1 should not be closed");
+    is(workerTargetFront1.isClosed, false, "worker in tab 1 should not be closed");
 
     yield close(client);
     SpecialPowers.setIntPref(MAX_TOTAL_VIEWERS, oldMaxTotalViewers);
     finish();
   });
 }
--- a/devtools/client/shared/test/browser_dbg_worker-console-01.js
+++ b/devtools/client/shared/test/browser_dbg_worker-console-01.js
@@ -13,22 +13,22 @@
 Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
   this);
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
 
 add_task(async function testNormalExecution() {
-  const {client, tab, workerClient, toolbox} =
+  const {client, tab, workerTargetFront, toolbox} =
     await initWorkerDebugger(TAB_URL, WORKER_URL);
 
   const jsterm = await getSplitConsole(toolbox);
   const executed = await jsterm.execute("this.location.toString()");
   ok(executed.textContent.includes(WORKER_URL),
       "Evaluating the global's location works");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  await waitForWorkerClose(workerClient);
-  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await waitForWorkerClose(workerTargetFront);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerTargetFront));
   await close(client);
   await removeTab(tab);
 });
--- a/devtools/client/shared/test/browser_dbg_worker-console-02.js
+++ b/devtools/client/shared/test/browser_dbg_worker-console-02.js
@@ -14,17 +14,17 @@ Services.scriptloader.loadSubScript(
   "chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
   this);
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
 
 add_task(async function testWhilePaused() {
   const dbg = await initWorkerDebugger(TAB_URL, WORKER_URL);
-  const {client, tab, workerClient, toolbox} = dbg;
+  const {client, tab, workerTargetFront, toolbox} = dbg;
 
   // Execute some basic math to make sure evaluations are working.
   const jsterm = await getSplitConsole(toolbox);
   let executed = await jsterm.execute("10000+1");
   ok(executed.textContent.includes("10001"), "Text for message appeared correct");
 
   await clickElement(dbg, "pause");
   once(dbg.client, "willInterrupt").then(() => {
@@ -50,13 +50,13 @@ add_task(async function testWhilePaused(
   info("Trying to get the result of command3");
   executed = await command3;
   ok(executed.textContent.includes("ReferenceError: foobar is not defined"),
      "command3 executed successfully");
 
   await resume(dbg);
 
   terminateWorkerInTab(tab, WORKER_URL);
-  await waitForWorkerClose(workerClient);
-  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await waitForWorkerClose(workerTargetFront);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerTargetFront));
   await close(client);
   await removeTab(tab);
 });
--- a/devtools/client/shared/test/browser_dbg_worker-console-03.js
+++ b/devtools/client/shared/test/browser_dbg_worker-console-03.js
@@ -15,17 +15,17 @@ Services.scriptloader.loadSubScript(
   this);
 
 var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
 var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
 
 // Test to see if creating the pause from the console works.
 add_task(async function testPausedByConsole() {
   const dbg = await initWorkerDebugger(TAB_URL, WORKER_URL);
-  const {client, tab, workerClient, toolbox} = dbg;
+  const {client, tab, workerTargetFront, toolbox} = dbg;
 
   const jsterm = await getSplitConsole(toolbox);
   let executed = await jsterm.execute("10000+1");
   ok(executed.textContent.includes("10001"),
       "Text for message appeared correct");
 
   await clickElement(dbg, "pause");
 
@@ -41,13 +41,13 @@ add_task(async function testPausedByCons
   info("Waiting for a resume");
   await clickElement(dbg, "resume");
 
   executed = await pausedExecution;
   ok(executed.textContent.includes("10002"),
       "Text for message appeared correct");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  await waitForWorkerClose(workerClient);
-  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await waitForWorkerClose(workerTargetFront);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerTargetFront));
   await close(client);
   await removeTab(tab);
 });
--- a/devtools/client/shared/test/browser_dbg_worker-console-04.js
+++ b/devtools/client/shared/test/browser_dbg_worker-console-04.js
@@ -22,28 +22,28 @@ Services.scriptloader.loadSubScript(
 // See bug 1018184 for resolving these issues.
 const { PromiseTestUtils } = scopedCuImport("resource://testing-common/PromiseTestUtils.jsm");
 PromiseTestUtils.whitelistRejectionsGlobally(/connection just closed/);
 
 const TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
 const WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
 
 add_task(async function testPausedByConsole() {
-  const {client, tab, workerClient, toolbox} =
+  const {client, tab, workerTargetFront, toolbox} =
     await initWorkerDebugger(TAB_URL, WORKER_URL);
 
   info("Check Date objects can be used in the console");
   const jsterm = await getSplitConsole(toolbox);
   let executed = await jsterm.execute("new Date(0)");
   ok(executed.textContent.includes("1970-01-01T00:00:00.000Z"),
       "Text for message appeared correct");
 
   info("Check RegExp objects can be used in the console");
   executed = await jsterm.execute("new RegExp('.*')");
   ok(executed.textContent.includes("/.*/"),
       "Text for message appeared correct");
 
   terminateWorkerInTab(tab, WORKER_URL);
-  await waitForWorkerClose(workerClient);
-  await gDevTools.closeToolbox(TargetFactory.forWorker(workerClient));
+  await waitForWorkerClose(workerTargetFront);
+  await gDevTools.closeToolbox(TargetFactory.forWorker(workerTargetFront));
   await close(client);
   await removeTab(tab);
 });
--- a/devtools/client/shared/test/helper_workers.js
+++ b/devtools/client/shared/test/helper_workers.js
@@ -113,24 +113,24 @@ function findWorker(workers, url) {
   return null;
 }
 
 function attachWorker(targetFront, worker) {
   info("Attaching to worker with url '" + worker.url + "'.");
   return targetFront.attachWorker(worker.actor);
 }
 
-function attachThread(workerClient, options) {
+function attachThread(workerTargetFront, options) {
   info("Attaching to thread.");
-  return workerClient.attachThread(options);
+  return workerTargetFront.attachThread(options);
 }
 
-async function waitForWorkerClose(workerClient) {
+async function waitForWorkerClose(workerTargetFront) {
   info("Waiting for worker to close.");
-  await workerClient.once("close");
+  await workerTargetFront.once("close");
   info("Worker did close.");
 }
 
 // Return a promise with a reference to jsterm, opening the split
 // console if necessary.  This cleans up the split console pref so
 // it won't pollute other tests.
 function getSplitConsole(toolbox, win) {
   if (!win) {
@@ -159,30 +159,30 @@ async function initWorkerDebugger(TAB_UR
 
   const tab = await addTab(TAB_URL);
   const { tabs } = await listTabs(client);
   const [, targetFront] = await attachTarget(client, findTab(tabs, TAB_URL));
 
   await createWorkerInTab(tab, WORKER_URL);
 
   const { workers } = await listWorkers(targetFront);
-  const [, workerClient] = await attachWorker(targetFront,
+  const [, workerTargetFront] = await attachWorker(targetFront,
                                              findWorker(workers, WORKER_URL));
 
-  const toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
+  const toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerTargetFront),
                                             "jsdebugger",
                                             Toolbox.HostType.WINDOW);
 
   const debuggerPanel = toolbox.getCurrentPanel();
 
   const gDebugger = debuggerPanel.panelWin;
 
   const context = createDebuggerContext(toolbox);
 
-  return { ...context, client, tab, targetFront, workerClient, toolbox, gDebugger};
+  return { ...context, client, tab, targetFront, workerTargetFront, toolbox, gDebugger};
 }
 
 // Override addTab/removeTab as defined by shared-head, since these have
 // an extra window parameter and add a frame script
 this.addTab = function addTab(url, win) {
   info("Adding tab: " + url);
 
   const deferred = getDeferredPromise().defer();
--- a/devtools/shared/client/thread-client.js
+++ b/devtools/shared/client/thread-client.js
@@ -20,17 +20,17 @@ loader.lazyRequireGetter(this, "SourceCl
 
 const noop = () => {};
 
 /**
  * Creates a thread client for the remote debugging protocol server. This client
  * is a front to the thread actor created in the server side, hiding the
  * protocol details in a traditional JavaScript API.
  *
- * @param client DebuggerClient, WorkerClient or BrowsingContextFront
+ * @param client DebuggerClient, WorkerTargetFront or BrowsingContextFront
  *        The parent of the thread (tab for target-scoped debuggers,
  *        DebuggerClient for chrome debuggers).
  * @param actor string
  *        The actor ID for this thread.
  */
 function ThreadClient(client, actor) {
   this._parent = client;
   this.client = client instanceof DebuggerClient ? client : client.client;
--- a/devtools/shared/webconsole/test/common.js
+++ b/devtools/shared/webconsole/test/common.js
@@ -106,26 +106,26 @@ var _attachConsole = async function(
 
     const { workers } = await targetFront.listWorkers();
     const workerTargetActor = workers.filter(w => w.url == workerName)[0].actor;
     if (!workerTargetActor) {
       console.error("listWorkers failed. Unable to find the " +
                     "worker actor\n");
       return;
     }
-    const [workerResponse, workerClient] =
+    const [workerResponse, workerTargetFront] =
       await targetFront.attachWorker(workerTargetActor);
-    if (!workerClient || workerResponse.error) {
-      console.error("attachWorker failed. No worker client or " +
+    if (!workerTargetFront || workerResponse.error) {
+      console.error("attachWorker failed. No worker target front or " +
                     " error: " + workerResponse.error);
       return;
     }
-    await workerClient.attachThread({});
-    state.actor = workerClient.consoleActor;
-    state.dbgClient.attachConsole(workerClient.consoleActor, listeners)
+    await workerTargetFront.attachThread({});
+    state.actor = workerTargetFront.consoleActor;
+    state.dbgClient.attachConsole(workerTargetFront.consoleActor, listeners)
       .then(_onAttachConsole.bind(null, state), _onAttachError.bind(null, state));
   } else {
     state.actor = tab.consoleActor;
     state.dbgClient.attachConsole(tab.consoleActor, listeners)
       .then(_onAttachConsole.bind(null, state), _onAttachError.bind(null, state));
   }
 };