bug 1523104: remote: remove unused listener argument passed to Connection; r=ato
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 05 Mar 2019 12:08:23 -0800
changeset 521119 0c54ddfc1b58319fc5f90b8291bb9e1aeeeffbca
parent 521118 2988540931598996da8f36f2a0724c9582e1ff3b
child 521120 7ab41ce7425a4402cfffb3cdd17241081972e295
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1523104
milestone67.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 1523104: remote: remove unused listener argument passed to Connection; r=ato
remote/Connection.jsm
remote/TargetListener.jsm
--- a/remote/Connection.jsm
+++ b/remote/Connection.jsm
@@ -7,20 +7,19 @@
 var EXPORTED_SYMBOLS = ["Connection"];
 
 const {Log} = ChromeUtils.import("chrome://remote/content/Log.jsm");
 const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "log", Log.get);
 
 class Connection {
-  constructor(connID, transport, socketListener) {
+  constructor(connID, transport) {
     this.id = connID;
     this.transport = transport;
-    this.socketListener = socketListener;
 
     this.transport.hooks = this;
     this.onmessage = () => {};
   }
 
   send(message) {
     log.trace(`<-(connection ${this.id}) ${JSON.stringify(message)}`);
     // TODO(ato): Check return types
--- a/remote/TargetListener.jsm
+++ b/remote/TargetListener.jsm
@@ -48,18 +48,25 @@ class TargetListener {
       session.destructor();
       conn.close();
     }
     this.listener.close();
     this.listener = null;
     this.sessions.clear();
   }
 
+  /**
+   * SocketListener's `accepted` listener. Called whenever a new WebSocket connection is
+   * established.
+   *
+   * @param WebSocketDebuggerTransport transport
+   * @param SocketListener listener
+   */
   onConnectionAccepted(transport, listener) {
-    const conn = new Connection(this.nextConnID++, transport, listener);
+    const conn = new Connection(this.nextConnID++, transport);
     transport.ready();
     this.sessions.set(conn, new Session(conn, this.target));
   }
 
   get url() {
     if (this.listening) {
       const {network, host, port} = this.listener;
       return `${network}://${host}:${port}/`;