Bug 1281726 - Emit TabActor.tabDetached whenever the actor is detached. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 13 Jul 2016 23:34:17 -0700
changeset 347061 867ead052c7457d5f5504b7f344fd9c5b1bcca53
parent 347060 e8071e322140e6ec07a1dc2b2f4ae121b9ae74c4
child 347062 7345b89fb14fb8a05513b4dced4b6c6796267dda
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1281726
milestone50.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 1281726 - Emit TabActor.tabDetached whenever the actor is detached. r=jryans
devtools/server/actors/webbrowser.js
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -1139,20 +1139,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()) {
-      this.conn.send({ from: this.actorID,
-                       type: "tabDetached" });
-    }
+    this._detach();
 
     Object.defineProperty(this, "docShell", {
       value: null,
       configurable: true
     });
 
     this._extraActors = null;
 
@@ -1534,16 +1531,19 @@ TabActor.prototype = {
 
     if (this._workerActorPool !== null) {
       this.conn.removeActorPool(this._workerActorPool);
       this._workerActorPool = null;
     }
 
     this._attached = false;
 
+    this.conn.send({ from: this.actorID,
+                     type: "tabDetached" });
+
     return true;
   },
 
   // Protocol Request Handlers
 
   onAttach(request) {
     if (this.exited) {
       return { type: "exited" };