Bug 1544694 - remove unused method 'getExecutableLines' from sourceClient; r=ochameau,jdescottes,loganfsmyth
☠☠ backed out by d6cdc1f35851 ☠ ☠
authoryulia <ystartsev@mozilla.com>
Wed, 17 Apr 2019 16:15:15 +0000
changeset 470459 fc739beb6782fc83f23b15fc383f7ca5887393bd
parent 470458 7699de41e02b63c11701a27f162ba539734e484e
child 470460 63d133aae187fde835f9f9a0b9f83bdbada8dcd8
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, jdescottes, loganfsmyth
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 - remove unused method 'getExecutableLines' from sourceClient; r=ochameau,jdescottes,loganfsmyth Differential Revision: https://phabricator.services.mozilla.com/D27706
devtools/server/actors/source.js
devtools/server/tests/unit/test_get-executable-lines.js
devtools/server/tests/unit/xpcshell.ini
devtools/shared/client/source-client.js
devtools/shared/specs/source.js
--- a/devtools/server/actors/source.js
+++ b/devtools/server/actors/source.js
@@ -255,35 +255,16 @@ const SourceActor = ActorClassWithSpec(s
         this._contentType = result.contentType;
         return result;
       }, error => {
         this._reportLoadSourceError(error);
         throw error;
       });
   },
 
-  /**
-   * Get all executable lines from the current source
-   * @return Array - Executable lines of the current script
-   */
-  getExecutableLines: async function() {
-    const offsetsLines = new Set();
-    for (const s of this._findDebuggeeScripts()) {
-      for (const offset of s.getPossibleBreakpoints()) {
-        offsetsLines.add(offset.lineNumber);
-      }
-    }
-
-    const lines = [...offsetsLines];
-    lines.sort((a, b) => {
-      return a - b;
-    });
-    return lines;
-  },
-
   getBreakpointPositions(query) {
     const {
       start: {
         line: startLine = 0,
         column: startColumn = 0,
       } = {},
       end: {
         line: endLine = Infinity,
deleted file mode 100644
--- a/devtools/server/tests/unit/test_get-executable-lines.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/**
- * Test if getExecutableLines return correct information
- */
-
-var gDebuggee;
-var gClient;
-var gThreadClient;
-
-const SOURCE_MAPPED_FILE = getFileUrl("sourcemapped.js");
-
-function run_test() {
-  initTestDebuggerServer();
-  gDebuggee = addTestGlobal("test-get-executable-lines");
-  gClient = new DebuggerClient(DebuggerServer.connectPipe());
-  gClient.connect().then(function _onConnect() {
-    attachTestTabAndResume(
-      gClient,
-      "test-get-executable-lines",
-      function(response, targetFront, threadClient) {
-        gThreadClient = threadClient;
-        test_executable_lines();
-      }
-    );
-  });
-
-  do_test_pending();
-}
-
-function test_executable_lines() {
-  gThreadClient.addOneTimeListener("newSource", function _onNewSource(evt, packet) {
-    Assert.equal(evt, "newSource");
-
-    gThreadClient.getSources(function({error, sources}) {
-      Assert.ok(!error);
-      const source = gThreadClient.source(sources[0]);
-      source.getExecutableLines(function(lines) {
-        Assert.ok(arrays_equal([2, 5, 7, 8, 10, 12, 14, 16, 17], lines));
-        finishClient(gClient);
-      });
-    });
-  });
-
-  const code = readFile("sourcemapped.js");
-
-  Cu.evalInSandbox(code, gDebuggee, "1.8",
-    SOURCE_MAPPED_FILE, 1);
-}
-
-function arrays_equal(a, b) {
-  return !(a < b || b < a);
-}
--- a/devtools/server/tests/unit/xpcshell.ini
+++ b/devtools/server/tests/unit/xpcshell.ini
@@ -212,17 +212,16 @@ skip-if = true # tests for breakpoint ac
 [test_requestTypes.js]
 reason = bug 937197
 [test_layout-reflows-observer.js]
 [test_protocolSpec.js]
 [test_registerClient.js]
 [test_client_request.js]
 [test_symbols-01.js]
 [test_symbols-02.js]
-[test_get-executable-lines.js]
 [test_xpcshell_debugging.js]
 support-files = xpcshell_debugging_script.js
 [test_setBreakpoint-at-the-beginning-of-a-minified-fn.js]
 [test_setBreakpoint-at-the-end-of-a-minified-fn.js]
 [test_setBreakpoint-on-column.js]
 [test_setBreakpoint-on-column-in-gcd-script.js]
 [test_setBreakpoint-on-line.js]
 [test_setBreakpoint-on-line-in-gcd-script.js]
--- a/devtools/shared/client/source-client.js
+++ b/devtools/shared/client/source-client.js
@@ -1,18 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const {arg, DebuggerClient} = require("devtools/shared/client/debugger-client");
 
-const noop = () => {};
-
 /**
  * A SourceClient provides a way to access the source text of a script.
  *
  * @param client ThreadClient
  *        The thread client parent.
  * @param form Object
  *        The form sent across the remote debugging protocol.
  */
@@ -57,31 +55,16 @@ SourceClient.prototype = {
       type: "unblackbox",
       range: arg(0),
     },
     {
       telemetry: "UNBLACKBOX",
     },
   ),
 
-  /**
-   * Get Executable Lines from a source
-   */
-  getExecutableLines: function(cb = noop) {
-    const packet = {
-      to: this._form.actor,
-      type: "getExecutableLines",
-    };
-
-    return this._client.request(packet).then(res => {
-      cb(res.lines);
-      return res.lines;
-    });
-  },
-
   getBreakpointPositions: function(query) {
     const packet = {
       to: this._form.actor,
       type: "getBreakpointPositions",
       query,
     };
     return this._client.request(packet);
   },
--- a/devtools/shared/specs/source.js
+++ b/devtools/shared/specs/source.js
@@ -17,17 +17,16 @@ types.addDictType("breakpointquery", {
   start: "nullable:nullablesourceposition",
   end: "nullable:nullablesourceposition",
 });
 
 const sourceSpec = generateActorSpec({
   typeName: "source",
 
   methods: {
-    getExecutableLines: { response: { lines: RetVal("json") } },
     getBreakpointPositions: {
       request: {
         query: Arg(0, "nullable:breakpointquery"),
       },
       response: {
         positions: RetVal("array:sourceposition"),
       },
     },