From f439c41435daf21f0de13ba2e682c88f852f2bda Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Fri, 22 Feb 2019 18:32:38 +0000 Subject: [PATCH] Bug 1520835 - Removed now-useless front pool from DebuggerClient. r=jdescottes Depends on D20704 Differential Revision: https://phabricator.services.mozilla.com/D20705 --HG-- extra : moz-landing-system : lando --- devtools/shared/client/debugger-client.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/devtools/shared/client/debugger-client.js b/devtools/shared/client/debugger-client.js index d60783ec4332..8a310e3bb204 100644 --- a/devtools/shared/client/debugger-client.js +++ b/devtools/shared/client/debugger-client.js @@ -22,7 +22,6 @@ 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); /** @@ -38,16 +37,6 @@ function DebuggerClient(transport) { // 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; @@ -64,7 +53,11 @@ function DebuggerClient(transport) { 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); }); }