Bug 1160361 - Abort tilt commands when remote. r=bgrins
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 06 May 2015 12:34:28 -0500
changeset 272487 ba4ae6b6dcfcbe87367047b586cc49ebd2a72121
parent 272486 5cdf7ebf5d6fcf8cbb5daa339ccf5c3a82a98bd1
child 272488 0602fff3681db69f5dc2d6ef7745f4b8fabfa5f6
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1160361
milestone40.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 1160361 - Abort tilt commands when remote. r=bgrins
browser/devtools/tilt/tilt-commands.js
--- a/browser/devtools/tilt/tilt-commands.js
+++ b/browser/devtools/tilt/tilt-commands.js
@@ -43,30 +43,37 @@ exports.items = [
 {
   name: "tilt toggle",
   buttonId: "command-button-tilt",
   buttonClass: "command-button command-button-invertable",
   tooltipText: l10n.lookup("tiltToggleTooltip"),
   hidden: true,
   state: {
     isChecked: function(aTarget) {
+      if (!aTarget.tab) {
+        return false;
+      }
       let browserWindow = aTarget.tab.ownerDocument.defaultView;
       return !!TiltManager.getTiltForBrowser(browserWindow).currentInstance;
     },
     onChange: function(aTarget, aChangeHandler) {
+      if (!aTarget.tab) {
+        return;
+      }
       let browserWindow = aTarget.tab.ownerDocument.defaultView;
       let tilt = TiltManager.getTiltForBrowser(browserWindow);
       tilt.on("change", aChangeHandler);
     },
     offChange: function(aTarget, aChangeHandler) {
-      if (aTarget.tab) {
-        let browserWindow = aTarget.tab.ownerDocument.defaultView;
-        let tilt = TiltManager.getTiltForBrowser(browserWindow);
-        tilt.off("change", aChangeHandler);
+      if (!aTarget.tab) {
+        return;
       }
+      let browserWindow = aTarget.tab.ownerDocument.defaultView;
+      let tilt = TiltManager.getTiltForBrowser(browserWindow);
+      tilt.off("change", aChangeHandler);
     },
   },
   exec: function(args, context) {
     if (isMultiProcess(context)) {
       return l10n.lookupFormat("notAvailableInE10S", [this.name]);
     }
 
     let chromeWindow = context.environment.chromeDocument.defaultView;