Bug 745985: Simplify treatment of DebuggerServerConnection's _actorPool. r=past
authorJim Blandy <jimb@mozilla.com>
Mon, 05 Jan 2015 16:26:27 -0800
changeset 248907 c0af000942219e2f30938e0059f128def6e51d82
parent 248906 157873c02e6df14dce33df159b22753df1f643fb
child 248908 80d398ab3ae5adc9c410bb7d90b9f63b325859d6
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs745985
milestone37.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 745985: Simplify treatment of DebuggerServerConnection's _actorPool. r=past try: -b do -p all -u xpcshell,mochitest-dt -t none
toolkit/devtools/server/main.js
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -1148,17 +1148,17 @@ if (this.exports) {
 function DebuggerServerConnection(aPrefix, aTransport)
 {
   this._prefix = aPrefix;
   this._transport = aTransport;
   this._transport.hooks = this;
   this._nextID = 1;
 
   this._actorPool = new ActorPool(this);
-  this._extraPools = [];
+  this._extraPools = [this._actorPool];
 
   // Responses to a given actor must be returned the the client
   // in the same order as the requests that they're replying to, but
   // Implementations might finish serving requests in a different
   // order.  To keep things in order we generate a promise for each
   // request, chained to the promise for the request before it.
   // This map stores the latest request promise in the chain, keyed
   // by an actor ID string.
@@ -1291,20 +1291,16 @@ DebuggerServerConnection.prototype = {
       throw new Error("Unexpected actor constructor/function in ActorPool " +
                       "for actorID=" + actorID + ".");
     }
 
     return actor;
   },
 
   poolFor: function DSC_actorPool(aActorID) {
-    if (this._actorPool && this._actorPool.has(aActorID)) {
-      return this._actorPool;
-    }
-
     for (let pool of this._extraPools) {
       if (pool.has(aActorID)) {
         return pool;
       }
     }
     return null;
   },
 
@@ -1531,36 +1527,38 @@ DebuggerServerConnection.prototype = {
   onClosed: function DSC_onClosed(aStatus) {
     dumpn("Cleaning up connection.");
     if (!this._actorPool) {
       // Ignore this call if the connection is already closed.
       return;
     }
     events.emit(this, "closed", aStatus);
 
-    this._actorPool.cleanup();
     this._actorPool = null;
     this._extraPools.map(function(p) { p.cleanup(); });
     this._extraPools = null;
 
     DebuggerServer._connectionClosed(this);
   },
 
   /*
    * Debugging helper for inspecting the state of the actor pools.
    */
   _dumpPools: function DSC_dumpPools() {
     dumpn("/-------------------- dumping pools:");
     if (this._actorPool) {
       dumpn("--------------------- actorPool actors: " +
             uneval(Object.keys(this._actorPool._actors)));
     }
-    for each (let pool in this._extraPools)
-      dumpn("--------------------- extraPool actors: " +
-            uneval(Object.keys(pool._actors)));
+    for each (let pool in this._extraPools) {
+      if (pool !== this._actorPool) {
+        dumpn("--------------------- extraPool actors: " +
+              uneval(Object.keys(pool._actors)));
+      }
+    }
   },
 
   /*
    * Debugging helper for inspecting the state of an actor pool.
    */
   _dumpPool: function DSC_dumpPools(aPool) {
     dumpn("/-------------------- dumping pool:");
     dumpn("--------------------- actorPool actors: " +