From 9f05df43d65561bd8c8add8f55e5633c74aca630 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Tue, 24 Mar 2020 23:41:31 +0200 Subject: [PATCH] Backed out changeset 4aa0213b5603 (bug 1602468) for dt failures on framework/toolbox.js . CLOSED TREE --- devtools/client/framework/toolbox.js | 4 ---- devtools/client/fronts/object.js | 7 ------- devtools/shared/protocol/Pool.js | 23 ----------------------- 3 files changed, 34 deletions(-) diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index 941658b8fa9d..5a2930940c0a 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -3602,10 +3602,6 @@ Toolbox.prototype = { _destroyToolbox: async function() { this.emit("destroy"); - // This flag will be checked by Fronts in order to decide if they should - // skip their destroy. - this.target.client.isToolboxDestroy = true; - this.off("select", this._onToolSelected); this.off("host-changed", this._refreshHostTitle); diff --git a/devtools/client/fronts/object.js b/devtools/client/fronts/object.js index cff4a5621d49..b88b886cc67e 100644 --- a/devtools/client/fronts/object.js +++ b/devtools/client/fronts/object.js @@ -30,13 +30,6 @@ class ObjectFront extends FrontClassWithSpec(objectSpec) { parentFront.manage(this); } - skipDestroy() { - // Object fronts are simple fronts, they don't need to be cleaned up on - // toolbox destroy. `conn` is a DebuggerClient instance, check the - // `isToolboxDestroy` flag to skip the destroy. - return this.conn && this.conn.isToolboxDestroy; - } - getGrip() { return this._grip; } diff --git a/devtools/shared/protocol/Pool.js b/devtools/shared/protocol/Pool.js index 0d6f4a9bc5ca..517ec272571b 100644 --- a/devtools/shared/protocol/Pool.js +++ b/devtools/shared/protocol/Pool.js @@ -141,22 +141,6 @@ class Pool extends EventEmitter { } } - /** - * Pools can override this method in order to opt-out of a destroy sequence. - * - * For instance, Fronts are destroyed during the toolbox destroy. However when - * the toolbox is destroyed, the document holding the toolbox is also - * destroyed. So it should not be necessary to cleanup Fronts during toolbox - * destroy. - * - * For the time being, Fronts (or Pools in general) which want to opt-out of - * toolbox destroy can override this method and check the value of - * `this.conn.isToolboxDestroy`. - */ - skipDestroy() { - return false; - } - /** * Destroy this item, removing it from a parent if it has one, * and destroying all children if necessary. @@ -174,13 +158,6 @@ class Pool extends EventEmitter { if (actor === this) { continue; } - - // Some pool-managed values don't extend Pool and won't have skipDestroy - // defined. For instance, the root actor and the lazy actors. - if (typeof actor.skipDestroy === "function" && actor.skipDestroy()) { - continue; - } - const destroy = actor.destroy; if (destroy) { // Disconnect destroy while we're destroying in case of (misbehaving)