Bug 913234 - Close toolboxes on disconnect. r=ochameau
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 10 Sep 2013 12:57:48 -0500
changeset 159568 99f92e712d48c6df8087020530c2405bf9ce3a20
parent 159567 22374252348314a0c9d8db01312323e322c026bf
child 159569 d9b79f9842c15cc966820f46bebad5b43903ad29
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs913234
milestone26.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 913234 - Close toolboxes on disconnect. r=ochameau
browser/devtools/app-manager/content/device.js
browser/devtools/app-manager/content/projects.js
--- a/browser/devtools/app-manager/content/device.js
+++ b/browser/devtools/app-manager/content/device.js
@@ -162,17 +162,23 @@ let UI = {
         });
       }
     });
     return deferred.promise;
   },
 
   openToolbox: function(manifest) {
     this._getTargetForApp(manifest).then((target) => {
-      gDevTools.showToolbox(target, "webconsole", devtools.Toolbox.HostType.WINDOW);
+      gDevTools.showToolbox(target,
+                            null,
+                            devtools.Toolbox.HostType.WINDOW).then(toolbox => {
+        this.connection.once(Connection.Events.DISCONNECTED, () => {
+          toolbox.destroy();
+        });
+      });
     }, console.error);
   },
 
   startApp: function(manifest) {
     let deferred = promise.defer();
 
     if (!this.listTabsResponse) {
       deferred.reject();
--- a/browser/devtools/app-manager/content/projects.js
+++ b/browser/devtools/app-manager/content/projects.js
@@ -218,18 +218,21 @@ let UI = {
   },
 
   openToolbox: function(location) {
     let project = AppProjects.get(location);
     let manifest = this._getProjectManifestURL(project);
     this._getTargetForApp(manifest).then((target) => {
       gDevTools.showToolbox(target,
                             null,
-                            devtools.Toolbox.HostType.WINDOW,
-                            this.connection.uid);
+                            devtools.Toolbox.HostType.WINDOW).then(toolbox => {
+        this.connection.once(Connection.Events.DISCONNECTED, () => {
+          toolbox.destroy();
+        });
+      });
     }, console.error);
   },
 
 
   reveal: function(location) {
     let project = AppProjects.get(location);
     if (project.type == "packaged") {
       let projectFolder = FileUtils.File(project.location);