Bug 1520835 - Removed now-useless front pool from DebuggerClient. r=jdescottes
authorAlexandre Poirot <poirot.alex@gmail.com>
Fri, 22 Feb 2019 18:32:38 +0000
changeset 519330 e867319290bb166b515f8a45a327abcf9c6dcf01
parent 519329 b81205ec0a0b7c42a306d197ee09f2dd5daddac9
child 519331 e5da75d979ef6cd6807c7ecb2aa89c8c4bf2781c
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)
reviewersjdescottes
bugs1520835
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 1520835 - Removed now-useless front pool from DebuggerClient. r=jdescottes Depends on D20704 Differential Revision: https://phabricator.services.mozilla.com/D20705
devtools/shared/client/debugger-client.js
--- a/devtools/shared/client/debugger-client.js
+++ b/devtools/shared/client/debugger-client.js
@@ -17,59 +17,52 @@ const {
 
 loader.lazyRequireGetter(this, "Authentication", "devtools/shared/security/auth");
 loader.lazyRequireGetter(this, "DebuggerSocket", "devtools/shared/security/socket", true);
 loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
 
 loader.lazyRequireGetter(this, "RootFront", "devtools/shared/fronts/root", true);
 loader.lazyRequireGetter(this, "ThreadClient", "devtools/shared/client/thread-client");
 loader.lazyRequireGetter(this, "ObjectClient", "devtools/shared/client/object-client");
-loader.lazyRequireGetter(this, "Pool", "devtools/shared/protocol", true);
 loader.lazyRequireGetter(this, "Front", "devtools/shared/protocol", true);
 
 /**
  * Creates a client for the remote debugging protocol server. This client
  * provides the means to communicate with the server and exchange the messages
  * required by the protocol in a traditional JavaScript API.
  */
 function DebuggerClient(transport) {
   this._transport = transport;
   this._transport.hooks = this;
 
   // Map actor ID to client instance for each actor type.
   // To be removed once all clients are refactored to protocol.js
   this._clients = new Map();
 
-  // Pool of fronts instanciated by this class.
-  // This is useful for actors that have already been transitioned to protocol.js
-  // Once RootClient becomes a protocol.js actor, these actors can be attached to it
-  // instead of this pool.
-  // This Pool will automatically be added to this._pools via addActorPool once the first
-  // Front will be added to it (in attachTarget, ...).
-  // And it does not need to destroyed explicitly as all Pools are destroyed on client
-  // closing.
-  this._frontPool = new Pool(this);
-
   this._pendingRequests = new Map();
   this._activeRequests = new Map();
   this._eventsEnabled = true;
 
   this.traits = {};
 
   this.request = this.request.bind(this);
   this.localTransport = this._transport.onOutputStreamReady === undefined;
 
   /*
    * As the first thing on the connection, expect a greeting packet from
    * the connection's root actor.
    */
   this.mainRoot = null;
   this.expectReply("root", (packet) => {
     this.mainRoot = new RootFront(this, packet);
-    this._frontPool.manage(this.mainRoot);
+
+    // Root Front is a special case, managing itself as it doesn't have any parent.
+    // It will register itself to DebuggerClient as a Pool via Front._poolMap.
+    this.mainRoot.manage(this.mainRoot);
+
     this.emit("connected", packet.applicationType, packet.traits);
   });
 }
 
 /**
  * A declarative helper for defining methods that send requests to the server.
  *
  * @param packetSkeleton