Toolbox close debugging draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Mon, 06 Jun 2016 12:44:02 -0500
changeset 375864 22c43bb2f082458dd55fc657235d6e36d175c699
parent 375863 e36e7a7bdbee83185d5398dbade774b611ab22f9
child 375865 b32213e23ade176e372042228abefe57c049da4a
child 375866 b4feb6e653d82b70ba618eaf4db845d2645a244e
push id20402
push userbmo:jryans@gmail.com
push dateMon, 06 Jun 2016 20:31:20 +0000
milestone49.0a1
Toolbox close debugging MozReview-Commit-ID: Ir1OpNucrel
devtools/client/framework/toolbox.js
devtools/server/actors/webbrowser.js
devtools/server/main.js
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -2008,16 +2008,18 @@ Toolbox.prototype = {
    */
   destroy: function () {
     // If several things call destroy then we give them all the same
     // destruction promise so we're sure to destroy only once
     if (this._destroyer) {
       return this._destroyer;
     }
 
+    dump(`DESTROY TOOLBOX: ${new Error().stack}\n`)
+
     this.emit("destroy");
 
     this._target.off("navigate", this._refreshHostTitle);
     this._target.off("frame-update", this._updateFrames);
     this.off("select", this._refreshHostTitle);
     this.off("host-changed", this._refreshHostTitle);
     this.off("ready", this._showDevEditionPromo);
 
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -1118,16 +1118,17 @@ TabActor.prototype = {
 
     // Tell the thread actor that the tab is closed, so that it may terminate
     // instead of resuming the debuggee script.
     if (this._attached) {
       this.threadActor._tabClosed = true;
     }
 
     if (this._detach()) {
+      dump(`TabActor.exit, send detached: ${new Error().stack}\n`);
       this.conn.send({ from: this.actorID,
                        type: "tabDetached" });
     }
 
     Object.defineProperty(this, "docShell", {
       value: null,
       configurable: true
     });
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -1107,16 +1107,17 @@ var DebuggerServer = {
       events.off(aConnection, "closed", destroy);
 
       DebuggerServer._childMessageManagers.delete(mm);
     });
 
     // Listen for app process exit
     let onMessageManagerClose = function (subject, topic, data) {
       if (subject == mm) {
+        dump(`mm close, send detached: ${new Error().stack}\n`);
         destroy();
       }
     };
     Services.obs.addObserver(onMessageManagerClose,
                              "message-manager-close", false);
 
     // Listen for connection close to cleanup things
     // when user unplug the device or we lose the connection somehow.