Bug 1544694 - move and rename SourceClient to SourceFront; r=ochameau,jdescottes
authoryulia <ystartsev@mozilla.com>
Fri, 26 Apr 2019 13:50:47 +0000
changeset 471480 96682cfce65c88f4075349abf2aec0d766601dde
parent 471479 27e6d1a417e2e5b67996c0625868a147b051b7ab
child 471481 31e2f80bc00d283bb65c16d3938f7bdb087018e2
push id35920
push useraiakab@mozilla.com
push dateFri, 26 Apr 2019 22:02:33 +0000
treeherdermozilla-central@b13f2b24ae62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, jdescottes
bugs1544694
milestone68.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 1544694 - move and rename SourceClient to SourceFront; r=ochameau,jdescottes Differential Revision: https://phabricator.services.mozilla.com/D27709
devtools/client/debugger/src/client/firefox/commands.js
devtools/server/tests/unit/head_dbg.js
devtools/server/tests/unit/test_blackboxing-02.js
devtools/server/tests/unit/test_blackboxing-03.js
devtools/server/tests/unit/test_blackboxing-04.js
devtools/server/tests/unit/test_blackboxing-05.js
devtools/server/tests/unit/test_blackboxing-08.js
devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-offsets.js
devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-statements.js
devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets.js
devtools/server/tests/unit/test_setBreakpoint-on-line.js
devtools/server/tests/unit/test_source-01.js
devtools/server/tests/unit/test_source-02.js
devtools/server/tests/unit/test_wasm_source-01.js
devtools/shared/client/moz.build
devtools/shared/client/source-client.js
devtools/shared/client/thread-client.js
devtools/shared/fronts/moz.build
devtools/shared/fronts/source.js
devtools/shared/specs/index.js
--- a/devtools/client/debugger/src/client/firefox/commands.js
+++ b/devtools/client/debugger/src/client/firefox/commands.js
@@ -176,18 +176,18 @@ function breakOnNext(thread: string): Pr
   return lookupThreadClient(thread).breakOnNext();
 }
 
 async function sourceContents({
   actor,
   thread
 }: SourceActor): Promise<{| source: any, contentType: ?string |}> {
   const sourceThreadClient = lookupThreadClient(thread);
-  const sourceClient = sourceThreadClient.source({ actor });
-  const { source, contentType } = await sourceClient.source();
+  const sourceFront = sourceThreadClient.source({ actor });
+  const { source, contentType } = await sourceFront.source();
   return { source, contentType };
 }
 
 function setXHRBreakpoint(path: string, method: string) {
   return threadClient.setXHRBreakpoint(path, method);
 }
 
 function removeXHRBreakpoint(path: string, method: string) {
@@ -360,21 +360,21 @@ async function pauseOnExceptions(
   );
 }
 
 async function blackBox(
   sourceActor: SourceActor,
   isBlackBoxed: boolean,
   range?: Range
 ): Promise<*> {
-  const sourceClient = threadClient.source({ actor: sourceActor.actor });
+  const sourceFront = threadClient.source({ actor: sourceActor.actor });
   if (isBlackBoxed) {
-    await sourceClient.unblackBox(range);
+    await sourceFront.unblackBox(range);
   } else {
-    await sourceClient.blackBox(range);
+    await sourceFront.blackBox(range);
   }
 }
 
 async function setSkipPausing(shouldSkip: boolean) {
   await threadClient.skipBreakpoints(shouldSkip);
   await forEachWorkerThread(thread => thread.skipBreakpoints(shouldSkip));
 }
 
@@ -459,18 +459,18 @@ function getMainThread() {
 async function getBreakpointPositions(
   actors: Array<SourceActor>,
   range: ?Range
 ): Promise<{ [string]: number[] }> {
   const sourcePositions = {};
 
   for (const { thread, actor } of actors) {
     const sourceThreadClient = lookupThreadClient(thread);
-    const sourceClient = sourceThreadClient.source({ actor });
-    const positions = await sourceClient.getBreakpointPositionsCompressed(
+    const sourceFront = sourceThreadClient.source({ actor });
+    const positions = await sourceFront.getBreakpointPositionsCompressed(
       range
     );
 
     for (const line of Object.keys(positions)) {
       let columns = positions[line];
       const existing = sourcePositions[line];
       if (existing) {
         columns = [...new Set([...existing, ...columns])];
--- a/devtools/server/tests/unit/head_dbg.js
+++ b/devtools/server/tests/unit/head_dbg.js
@@ -736,56 +736,56 @@ function stepOut(client, threadClient) {
 function getFrames(threadClient, first, count) {
   dumpn("Getting frames.");
   return threadClient.getFrames(first, count);
 }
 
 /**
  * Black box the specified source.
  *
- * @param SourceClient sourceClient
+ * @param SourceFront sourceFront
  * @returns Promise
  */
-async function blackBox(sourceClient, range = null) {
-  dumpn("Black boxing source: " + sourceClient.actor);
-  const pausedInSource = await sourceClient.blackBox(range);
+async function blackBox(sourceFront, range = null) {
+  dumpn("Black boxing source: " + sourceFront.actor);
+  const pausedInSource = await sourceFront.blackBox(range);
   ok(true, "blackBox didn't throw");
   return pausedInSource;
 }
 
 /**
  * Stop black boxing the specified source.
  *
- * @param SourceClient sourceClient
+ * @param SourceFront sourceFront
  * @returns Promise
  */
-async function unBlackBox(sourceClient, range = null) {
-  dumpn("Un-black boxing source: " + sourceClient.actor);
-  await sourceClient.unblackBox(range);
+async function unBlackBox(sourceFront, range = null) {
+  dumpn("Un-black boxing source: " + sourceFront.actor);
+  await sourceFront.unblackBox(range);
   ok(true, "unblackBox didn't throw");
 }
 
 /**
- * Perform a "source" RDP request with the given SourceClient to get the source
+ * Perform a "source" RDP request with the given SourceFront to get the source
  * content and content type.
  *
- * @param SourceClient sourceClient
+ * @param SourceFront sourceFront
  * @returns Promise
  */
-function getSourceContent(sourceClient) {
-  dumpn("Getting source content for " + sourceClient.actor);
-  return sourceClient.source();
+function getSourceContent(sourceFront) {
+  dumpn("Getting source content for " + sourceFront.actor);
+  return sourceFront.source();
 }
 
 /**
  * Get a source at the specified url.
  *
  * @param ThreadClient threadClient
  * @param string url
- * @returns Promise<SourceClient>
+ * @returns Promise<SourceFront>
  */
 async function getSource(threadClient, url) {
   const source = await getSourceForm(threadClient, url);
   if (source) {
     return threadClient.source(source);
   }
 
   throw new Error("source not found");
@@ -867,18 +867,18 @@ async function setupTestFromUrl(url) {
   const [, threadClient] = await attachThread(targetFront);
   await resume(threadClient);
 
   const sourceUrl = getFileUrl(url);
   const promise = waitForNewSource(threadClient, sourceUrl);
   loadSubScript(sourceUrl, global);
   const { source } = await promise;
 
-  const sourceClient = threadClient.source(source);
-  return { global, debuggerClient, threadClient, sourceClient };
+  const sourceFront = threadClient.source(source);
+  return { global, debuggerClient, threadClient, sourceFront };
 }
 
 /**
  * Run the given test function twice, one with a regular DebuggerServer,
  * testing against a fake tab. And another one against a WorkerDebuggerServer,
  * testing the worker codepath.
  *
  * @param Function test
--- a/devtools/server/tests/unit/test_blackboxing-02.js
+++ b/devtools/server/tests/unit/test_blackboxing-02.js
@@ -65,34 +65,34 @@ function test_black_box() {
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
 function test_black_box_breakpoint() {
   gThreadClient.getSources(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
-    const sourceClient = gThreadClient.source(
+    const sourceFront = gThreadClient.source(
       sources.filter(s => s.url == BLACK_BOXED_URL)[0]
     );
 
-    await blackBox(sourceClient);
+    await blackBox(sourceFront);
 
     gClient.addOneTimeListener("paused", function(event, packet) {
       Assert.equal(
         packet.why.type, "debuggerStatement",
         "We should pass over the breakpoint since the source is black boxed.");
-      gThreadClient.resume(test_unblack_box_breakpoint.bind(null, sourceClient));
+      gThreadClient.resume(test_unblack_box_breakpoint.bind(null, sourceFront));
     });
     gDebuggee.runTest();
   });
 }
 
-async function test_unblack_box_breakpoint(sourceClient) {
-  await unBlackBox(sourceClient);
+async function test_unblack_box_breakpoint(sourceFront) {
+  await unBlackBox(sourceFront);
   gClient.addOneTimeListener("paused", function(event, packet) {
     Assert.equal(packet.why.type, "breakpoint",
                  "We should hit the breakpoint again");
 
     // We will hit the debugger statement on resume, so do this
     // nastiness to skip over it.
     gClient.addOneTimeListener(
       "paused",
--- a/devtools/server/tests/unit/test_blackboxing-03.js
+++ b/devtools/server/tests/unit/test_blackboxing-03.js
@@ -64,36 +64,36 @@ function test_black_box() {
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
 function test_black_box_dbg_statement() {
   gThreadClient.getSources(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
-    const sourceClient = await getSource(gThreadClient, BLACK_BOXED_URL);
+    const sourceFront = await getSource(gThreadClient, BLACK_BOXED_URL);
 
-    await blackBox(sourceClient);
+    await blackBox(sourceFront);
 
     gThreadClient.addOneTimeListener("paused", async function(event, packet) {
       Assert.equal(packet.why.type, "breakpoint",
                    "We should pass over the debugger statement.");
 
       const source = await getSourceById(gThreadClient, packet.frame.where.actor);
       gThreadClient.removeBreakpoint({ sourceUrl: source.url, line: 4 }, {});
 
       await gThreadClient.resume();
-      await test_unblack_box_dbg_statement(sourceClient);
+      await test_unblack_box_dbg_statement(sourceFront);
     });
     gDebuggee.runTest();
   });
 }
 
-async function test_unblack_box_dbg_statement(sourceClient) {
-  await unBlackBox(sourceClient);
+async function test_unblack_box_dbg_statement(sourceFront) {
+  await unBlackBox(sourceFront);
 
   gClient.addOneTimeListener("paused", function(event, packet) {
     Assert.equal(packet.why.type, "debuggerStatement",
                  "We should stop at the debugger statement again");
     finishClient(gClient);
   });
   gDebuggee.runTest();
 }
--- a/devtools/server/tests/unit/test_blackboxing-04.js
+++ b/devtools/server/tests/unit/test_blackboxing-04.js
@@ -62,18 +62,18 @@ function test_black_box() {
     1
   );
   /* eslint-enable no-multi-spaces, no-undef */
 }
 
 function test_black_box_paused() {
   gThreadClient.getSources(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
-    const sourceClient = gThreadClient.source(
+    const sourceFront = gThreadClient.source(
       sources.filter(s => s.url == BLACK_BOXED_URL)[0]
     );
 
-    const pausedInSource = await blackBox(sourceClient);
+    const pausedInSource = await blackBox(sourceFront);
     Assert.ok(pausedInSource,
       "We should be notified that we are currently paused in this source");
     finishClient(gClient);
   });
 }
--- a/devtools/server/tests/unit/test_blackboxing-05.js
+++ b/devtools/server/tests/unit/test_blackboxing-05.js
@@ -66,18 +66,18 @@ function test_black_box() {
     1
   );
   /* eslint-enable no-multi-spaces, no-unreachable, no-undef */
 }
 
 function test_black_box_exception() {
   gThreadClient.getSources(async function({error, sources}) {
     Assert.ok(!error, "Should not get an error: " + error);
-    const sourceClient = await getSource(gThreadClient, BLACK_BOXED_URL);
-    await blackBox(sourceClient);
+    const sourceFront = await getSource(gThreadClient, BLACK_BOXED_URL);
+    await blackBox(sourceFront);
     gThreadClient.pauseOnExceptions(true, false);
 
     gClient.addOneTimeListener("paused", async function(event, packet) {
       const source = await getSourceById(gThreadClient, packet.frame.where.actor);
 
       Assert.equal(source.url, SOURCE_URL,
                    "We shouldn't pause while in the black boxed source.");
       finishClient(gClient);
--- a/devtools/server/tests/unit/test_blackboxing-08.js
+++ b/devtools/server/tests/unit/test_blackboxing-08.js
@@ -24,31 +24,31 @@ async function invokeAndPause({global, d
 function run_test() {
   return (async function() {
     const dbg = await setupTestFromUrl("stepping.js");
     const { threadClient } = dbg;
 
     await invokeAndPause(dbg, `chaining()`);
 
     const { sources } = await getSources(threadClient);
-    const sourceClient = threadClient.source(sources[0]);
+    const sourceFront = threadClient.source(sources[0]);
 
-    await setBreakpoint(threadClient, { sourceUrl: sourceClient.url, line: 7 });
-    await setBreakpoint(threadClient, { sourceUrl: sourceClient.url, line: 11 });
+    await setBreakpoint(threadClient, { sourceUrl: sourceFront.url, line: 7 });
+    await setBreakpoint(threadClient, { sourceUrl: sourceFront.url, line: 11 });
 
     // 1. lets blackbox function a, and assert that we pause in b
     const range = {start: { line: 6, column: 0 }, end: { line: 8, colum: 1 }};
-    blackBox(sourceClient, range);
+    blackBox(sourceFront, range);
     resume(threadClient);
     const paused = await waitForPause(threadClient);
     equal(paused.frame.where.line, 11, "paused inside of b");
     await resume(threadClient);
 
     // 2. lets unblackbox function a, and assert that we pause in a
-    unBlackBox(sourceClient, range);
+    unBlackBox(sourceFront, range);
     await invokeAndPause(dbg, `chaining()`);
     resume(threadClient);
     const paused2 = await waitForPause(threadClient);
     equal(paused2.frame.where.line, 7, "paused inside of a");
 
     await testFinish(dbg);
   })();
 }
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-offsets.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-offsets.js
@@ -1,36 +1,36 @@
 "use strict";
 
 const SOURCE_URL = getFileUrl("setBreakpoint-on-line-with-multiple-offsets.js");
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client }) => {
   const promise = waitForNewSource(threadClient, SOURCE_URL);
   loadSubScript(SOURCE_URL, debuggee);
   const { source } = await promise;
-  const sourceClient = threadClient.source(source);
+  const sourceFront = threadClient.source(source);
 
-  const location = { sourceUrl: sourceClient.url, line: 4 };
+  const location = { sourceUrl: sourceFront.url, line: 4 };
   setBreakpoint(threadClient, location);
 
   let packet = await executeOnNextTickAndWaitForPause(function() {
     Cu.evalInSandbox("f()", debuggee);
   }, client);
   Assert.equal(packet.type, "paused");
   let why = packet.why;
   Assert.equal(why.type, "breakpoint");
   Assert.equal(why.actors.length, 1);
   let frame = packet.frame;
   let where = frame.where;
   Assert.equal(where.actor, source.actor);
   Assert.equal(where.line, location.line);
   let variables = frame.environment.bindings.variables;
   Assert.equal(variables.i.value.type, "undefined");
 
-  const location2 = { sourceUrl: sourceClient.url, line: 7 };
+  const location2 = { sourceUrl: sourceFront.url, line: 7 };
   setBreakpoint(threadClient, location2);
 
   packet = await executeOnNextTickAndWaitForPause(
     () => resume(threadClient),
     client
   );
   Assert.equal(packet.type, "paused");
   why = packet.why;
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-statements.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-with-multiple-statements.js
@@ -1,19 +1,19 @@
 "use strict";
 
 const SOURCE_URL = getFileUrl("setBreakpoint-on-line-with-multiple-statements.js");
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client }) => {
   const promise = waitForNewSource(threadClient, SOURCE_URL);
   loadSubScript(SOURCE_URL, debuggee);
   const { source } = await promise;
-  const sourceClient = threadClient.source(source);
+  const sourceFront = threadClient.source(source);
 
-  const location = { sourceUrl: sourceClient.url, line: 4 };
+  const location = { sourceUrl: sourceFront.url, line: 4 };
   setBreakpoint(threadClient, location);
 
   const packet = await executeOnNextTickAndWaitForPause(function() {
     Cu.evalInSandbox("f()", debuggee);
   }, client);
   Assert.equal(packet.type, "paused");
   const why = packet.why;
   Assert.equal(why.type, "breakpoint");
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets-in-gcd-script.js
@@ -3,20 +3,20 @@
 const SOURCE_URL = getFileUrl("setBreakpoint-on-line-with-no-offsets-in-gcd-script.js");
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client, targetFront }) => {
   const promise = waitForNewSource(threadClient, SOURCE_URL);
   loadSubScriptWithOptions(SOURCE_URL, {target: debuggee, ignoreCache: true});
   Cu.forceGC(); Cu.forceGC(); Cu.forceGC();
 
   const { source } = await promise;
-  const sourceClient = threadClient.source(source);
+  const sourceFront = threadClient.source(source);
 
   const location = { line: 7 };
-  let [packet, breakpointClient] = await setBreakpoint(sourceClient, location);
+  let [packet, breakpointClient] = await setBreakpoint(sourceFront, location);
   Assert.ok(packet.isPending);
   Assert.equal(false, "actualLocation" in packet);
 
   packet = await executeOnNextTickAndWaitForPause(function() {
     reload(targetFront).then(function() {
       loadSubScriptWithOptions(SOURCE_URL, {target: debuggee, ignoreCache: true});
     });
   }, client);
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line-with-no-offsets.js
@@ -1,20 +1,20 @@
 "use strict";
 
 const SOURCE_URL = getFileUrl("setBreakpoint-on-line-with-no-offsets.js");
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client }) => {
   const promise = waitForNewSource(threadClient, SOURCE_URL);
   loadSubScript(SOURCE_URL, debuggee);
   const { source } = await promise;
-  const sourceClient = threadClient.source(source);
+  const sourceFront = threadClient.source(source);
 
   const location = { line: 5 };
-  let [packet, breakpointClient] = await setBreakpoint(sourceClient, location);
+  let [packet, breakpointClient] = await setBreakpoint(sourceFront, location);
   Assert.ok(!packet.isPending);
   Assert.ok("actualLocation" in packet);
   const actualLocation = packet.actualLocation;
   Assert.equal(actualLocation.line, 6);
 
   packet = await executeOnNextTickAndWaitForPause(function() {
     Cu.evalInSandbox("f()", debuggee);
   }, client);
--- a/devtools/server/tests/unit/test_setBreakpoint-on-line.js
+++ b/devtools/server/tests/unit/test_setBreakpoint-on-line.js
@@ -1,19 +1,19 @@
 "use strict";
 
 const SOURCE_URL = getFileUrl("setBreakpoint-on-line.js");
 
 add_task(threadClientTest(async ({ threadClient, debuggee, client }) => {
   const promise = waitForNewSource(threadClient, SOURCE_URL);
   loadSubScript(SOURCE_URL, debuggee);
   const { source } = await promise;
-  const sourceClient = threadClient.source(source);
+  const sourceFront = threadClient.source(source);
 
-  const location = { sourceUrl: sourceClient.url, line: 5 };
+  const location = { sourceUrl: sourceFront.url, line: 5 };
   setBreakpoint(threadClient, location);
 
   const packet = await executeOnNextTickAndWaitForPause(function() {
     Cu.evalInSandbox("f()", debuggee);
   }, client);
   Assert.equal(packet.type, "paused");
   const why = packet.why;
   Assert.equal(why.type, "breakpoint");
--- a/devtools/server/tests/unit/test_source-01.js
+++ b/devtools/server/tests/unit/test_source-01.js
@@ -4,17 +4,17 @@
 /* eslint-disable no-shadow, max-nested-callbacks */
 
 "use strict";
 
 var gDebuggee;
 var gClient;
 var gThreadClient;
 
-// This test ensures that we can create SourceActors and SourceClients properly,
+// This test ensures that we can create SourceActors and SourceFronts properly,
 // and that they can communicate over the protocol to fetch the source text for
 // a given script.
 
 function run_test() {
   initTestDebuggerServer();
   gDebuggee = addTestGlobal("test-grips");
   Cu.evalInSandbox(
     "" + function stopMe(arg1) {
@@ -48,18 +48,18 @@ function test_source() {
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.url === SOURCE_URL;
       })[0];
 
       Assert.ok(!!source);
 
-      const sourceClient = gThreadClient.source(source);
-      sourceClient.source().then(function(response) {
+      const sourceFront = gThreadClient.source(source);
+      sourceFront.source().then(function(response) {
         Assert.ok(!!response);
         Assert.ok(!!response.contentType);
         Assert.ok(response.contentType.includes("javascript"));
 
         Assert.ok(!!response.source);
         Assert.equal(SOURCE_CONTENT,
                      response.source);
 
--- a/devtools/server/tests/unit/test_source-02.js
+++ b/devtools/server/tests/unit/test_source-02.js
@@ -4,17 +4,17 @@
 /* eslint-disable no-shadow, max-nested-callbacks */
 
 "use strict";
 
 var gDebuggee;
 var gClient;
 var gThreadClient;
 
-// This test ensures that we can create SourceActors and SourceClients properly,
+// This test ensures that we can create SourceActors and SourceFronts properly,
 // and that they can communicate over the protocol to fetch the source text for
 // a given script.
 
 function run_test() {
   initTestDebuggerServer();
   gDebuggee = addTestGlobal("test-grips");
   Cu.evalInSandbox(
     "" + function stopMe(arg1) {
@@ -53,18 +53,18 @@ function test_source() {
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.url === SOURCE_URL;
       })[0];
 
       Assert.ok(!!source);
 
-      const sourceClient = gThreadClient.source(source);
-      response = await sourceClient.getBreakpointPositions();
+      const sourceFront = gThreadClient.source(source);
+      response = await sourceFront.getBreakpointPositions();
       Assert.ok(!!response);
       Assert.deepEqual(
         response,
         [{
           line: 2,
           column: 2,
         }, {
           line: 3,
@@ -79,17 +79,17 @@ function test_source() {
           line: 4,
           column: 4,
         }, {
           line: 6,
           column: 0,
         }]
       );
 
-      response = await sourceClient.getBreakpointPositionsCompressed();
+      response = await sourceFront.getBreakpointPositionsCompressed();
       Assert.ok(!!response);
       Assert.deepEqual(
         response,
         {
           2: [2],
           3: [14, 17, 24],
           4: [4],
           6: [0],
--- a/devtools/server/tests/unit/test_wasm_source-01.js
+++ b/devtools/server/tests/unit/test_wasm_source-01.js
@@ -60,18 +60,18 @@ function test_source() {
       Assert.ok(!!response.sources);
 
       const source = response.sources.filter(function(s) {
         return s.introductionType === "wasm";
       })[0];
 
       Assert.ok(!!source);
 
-      const sourceClient = gThreadClient.source(source);
-      sourceClient.source().then(function(response) {
+      const sourceFront = gThreadClient.source(source);
+      sourceFront.source().then(function(response) {
         Assert.ok(!!response);
         Assert.ok(!!response.contentType);
         Assert.ok(response.contentType.includes("wasm"));
 
         const sourceContent = response.source;
         Assert.ok(!!sourceContent);
         Assert.equal(typeof sourceContent, "object");
         Assert.ok("binary" in sourceContent);
--- a/devtools/shared/client/moz.build
+++ b/devtools/shared/client/moz.build
@@ -9,12 +9,11 @@ DevToolsModules(
     'connection-manager.js',
     'constants.js',
     'debugger-client.js',
     'environment-client.js',
     'event-source.js',
     'long-string-client.js',
     'object-client.js',
     'property-iterator-client.js',
-    'source-client.js',
     'symbol-iterator-client.js',
     'thread-client.js',
 )
--- a/devtools/shared/client/thread-client.js
+++ b/devtools/shared/client/thread-client.js
@@ -7,17 +7,17 @@
 
 const {arg, DebuggerClient} = require("devtools/shared/client/debugger-client");
 const eventSource = require("devtools/shared/client/event-source");
 const {ThreadStateTypes} = require("devtools/shared/client/constants");
 
 loader.lazyRequireGetter(this, "ArrayBufferClient", "devtools/shared/client/array-buffer-client");
 loader.lazyRequireGetter(this, "LongStringClient", "devtools/shared/client/long-string-client");
 loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/object-client");
-loader.lazyRequireGetter(this, "SourceClient", "devtools/shared/client/source-client", true);
+loader.lazyRequireGetter(this, "SourceFront", "devtools/shared/fronts/source", true);
 
 /**
  * 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
  * @param actor string
@@ -532,24 +532,24 @@ ThreadClient.prototype = {
    * Request to set the IDs of the active event breakpoints.
    */
   setActiveEventBreakpoints: DebuggerClient.requester({
     type: "setActiveEventBreakpoints",
     ids: arg(0),
   }),
 
   /**
-   * Return an instance of SourceClient for the given source actor form.
+   * Return an instance of SourceFront for the given source actor form.
    */
   source: function(form) {
     if (form.actor in this._threadGrips) {
       return this._threadGrips[form.actor];
     }
 
-    this._threadGrips[form.actor] = new SourceClient(this.client, form, this);
+    this._threadGrips[form.actor] = new SourceFront(this.client, form, this);
     return this._threadGrips[form.actor];
   },
 
   events: ["newSource", "progress"],
 };
 
 eventSource(ThreadClient.prototype);
 
--- a/devtools/shared/fronts/moz.build
+++ b/devtools/shared/fronts/moz.build
@@ -28,14 +28,15 @@ DevToolsModules(
     'perf.js',
     'performance-recording.js',
     'performance.js',
     'preference.js',
     'promises.js',
     'reflow.js',
     'root.js',
     'screenshot.js',
+    'source.js',
     'storage.js',
     'string.js',
     'styles.js',
     'stylesheets.js',
     'webconsole.js',
 )
rename from devtools/shared/client/source-client.js
rename to devtools/shared/fronts/source.js
--- a/devtools/shared/client/source-client.js
+++ b/devtools/shared/fronts/source.js
@@ -13,17 +13,17 @@ const { FrontClassWithSpec, registerFron
  * @param client DebuggerClient
  *        The Debugger Client instance.
  * @param form Object
  *        The form sent across the remote debugging protocol.
  * @param activeThread ThreadClient
  *        The thread client parent. Used until the SourceFront marshalls LongStringFront
  *        and ArrayBuffer.
  */
-class SourceClient extends FrontClassWithSpec(sourceSpec) {
+class SourceFront extends FrontClassWithSpec(sourceSpec) {
   constructor(client, form, activeThread) {
     super(client);
     this._url = form.url;
     this._activeThread = activeThread;
     // this is here for the time being, until the source front is managed
     // via protocol.js marshalling
     this.actorID = form.actor;
     this.manage(this);
@@ -43,17 +43,17 @@ class SourceClient extends FrontClassWit
   }
 
   // Alias for source.unblackbox to avoid changing protocol.js packets
   unblackBox() {
     return this.unblackbox();
   }
 
   /**
-   * Get a long string grip for this SourceClient's source.
+   * Get a long string grip for this SourceFront's source.
    */
   async source() {
     const response = await this.onSource();
     return this._onSourceResponse(response);
   }
 
   _onSourceResponse(response) {
     if (typeof response.source === "string") {
@@ -91,10 +91,10 @@ class SourceClient extends FrontClassWit
         source: resp.substring,
         contentType: contentType,
       };
       return newResponse;
     });
   }
 }
 
-exports.SourceClient = SourceClient;
-registerFront(SourceClient);
+exports.SourceFront = SourceFront;
+registerFront(SourceFront);
--- a/devtools/shared/specs/index.js
+++ b/devtools/shared/specs/index.js
@@ -170,17 +170,17 @@ const Types = exports.__TypesForTests = 
   {
     types: ["context"],
     spec: "devtools/shared/specs/script",
     front: null,
   },
   {
     types: ["source"],
     spec: "devtools/shared/specs/source",
-    front: null,
+    front: "devtools/shared/fronts/source",
   },
   {
     types: ["cookies", "localStorage", "sessionStorage", "Cache", "indexedDB", "storage"],
     spec: "devtools/shared/specs/storage",
     front: "devtools/shared/fronts/storage",
   },
   /* longstring is special, it has a wrapper type. See its spec module */
   {