Bug 1160361 - Abort tilt commands when remote. r=bgrins
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 06 May 2015 12:34:28 -0500
changeset 274012 ba4ae6b6dcfcbe87367047b586cc49ebd2a72121
parent 274011 5cdf7ebf5d6fcf8cbb5daa339ccf5c3a82a98bd1
child 274013 0602fff3681db69f5dc2d6ef7745f4b8fabfa5f6
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [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;