Bug 1646456 - Remove unused noCleanup argument from removeActorPool r=nchevobbe
authorJulian Descottes <jdescottes@mozilla.com>
Mon, 22 Jun 2020 12:54:26 +0000
changeset 600948 fdabfde164e98448cd76dc229e204b1749f0a00c
parent 600947 8704e81643c67e889a76479065d3ba7900a2f672
child 600949 38c2fa230269c6e1d0f6022cfb578b790cf2e6f5
push id13310
push userffxbld-merge
push dateMon, 29 Jun 2020 14:50:06 +0000
treeherdermozilla-beta@15a59a0afa5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1646456
milestone79.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 1646456 - Remove unused noCleanup argument from removeActorPool r=nchevobbe Depends on D80059 removeActorPool is only called from one spot, which always passes the second optional argument as true. Differential Revision: https://phabricator.services.mozilla.com/D80060
devtools/server/devtools-server-connection.js
devtools/shared/protocol/Pool.js
--- a/devtools/server/devtools-server-connection.js
+++ b/devtools/server/devtools-server-connection.js
@@ -118,21 +118,18 @@ DevToolsServerConnection.prototype = {
     this._extraPools.push(actorPool);
   },
 
   /**
    * Remove a previously-added pool of actors to the connection.
    *
    * @param ActorPool actorPool
    *        The ActorPool instance you want to remove.
-   * @param boolean noCleanup [optional]
-   *        True if you don't want to destroy each actor from the pool, false
-   *        otherwise.
    */
-  removeActorPool(actorPool, noCleanup) {
+  removeActorPool(actorPool) {
     // When a connection is closed, it removes each of its actor pools. When an
     // actor pool is removed, it calls the destroy method on each of its
     // actors. Some actors, such as ThreadActor, manage their own actor pools.
     // When the destroy method is called on these actors, they manually
     // remove their actor pools. Consequently, this method is reentrant.
     //
     // In addition, some actors, such as ThreadActor, perform asynchronous work
     // (in the case of ThreadActor, because they need to resume), before they
@@ -145,20 +142,17 @@ DevToolsServerConnection.prototype = {
     // _extraPools to null. As a temporary solution, it should be acceptable
     // to just return early (if this._extraPools has been set to null, all
     // actors pools for this connection should already have been removed).
     if (this._extraPools === null) {
       return;
     }
     const index = this._extraPools.lastIndexOf(actorPool);
     if (index > -1) {
-      const pool = this._extraPools.splice(index, 1);
-      if (!noCleanup) {
-        pool.forEach(p => p.destroy());
-      }
+      this._extraPools.splice(index, 1);
     }
   },
 
   /**
    * Add an actor to the default actor pool for this connection.
    */
   addActor(actor) {
     this._actorPool.manage(actor);
--- a/devtools/shared/protocol/Pool.js
+++ b/devtools/shared/protocol/Pool.js
@@ -185,17 +185,17 @@ class Pool extends EventEmitter {
       if (destroy) {
         // Disconnect destroy while we're destroying in case of (misbehaving)
         // circular ownership.
         actor.destroy = null;
         destroy.call(actor);
         actor.destroy = destroy;
       }
     }
-    this.conn.removeActorPool(this, true);
+    this.conn.removeActorPool(this);
     this.__poolMap.clear();
     this.__poolMap = null;
   }
 
   /**
    * For getting along with the devtools server pools, should be removable
    * eventually.
    */