Bug 1164640 - Reset the flag for disabling e10s when an a11y tool is active. r=mconley, a=sledru
authorFelipe Gomes <felipc@gmail.com>
Fri, 22 May 2015 15:01:57 -0300
changeset 274961 34cc0e31bdb696a8636e57ada04e7fa319c481d9
parent 274960 d8184ba2ed3a3c6fac95741d6ff84c75ac2c4aeb
child 274962 9864769ebb1e16cecee37aefc1fd94cd4859b3fe
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)
reviewersmconley, sledru
bugs1164640
milestone40.0a2
Bug 1164640 - Reset the flag for disabling e10s when an a11y tool is active. r=mconley, a=sledru There's now a blacklist in place for the tools that should be disabled, so we want to give another change for users with tools that are not blacklisted to test e10s.
browser/components/nsBrowserGlue.js
toolkit/xre/nsAppRunner.cpp
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2824,17 +2824,17 @@ let E10SUINotification = {
 
   checkStatus: function() {
     let skipE10sChecks = false;
     try {
       let updateChannel = UpdateChannel.get();
       let channelAuthorized = updateChannel == "nightly" || updateChannel == "aurora";
 
       skipE10sChecks = !channelAuthorized ||
-                       UpdateServices.prefs.getBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y");
+                       Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y");
     } catch(e) {}
 
     if (skipE10sChecks) {
       return;
     }
 
     if (Services.appinfo.browserTabsRemoteAutostart) {
       let notice = 0;
@@ -2908,17 +2908,19 @@ let E10SUINotification = {
         }, Ci.nsIThread.DISPATCH_NORMAL);
       }
     }
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
 
   observe: function(subject, topic, data) {
-    if (topic == "a11y-init-or-shutdown" && data == "1") {
+    if (topic == "a11y-init-or-shutdown"
+        && data == "1" &&
+        Services.appinfo.accessibilityIsBlacklistedForE10S) {
       this._showE10sAccessibilityWarning();
     }
   },
 
   _showE10sActivatedNotice: function() {
     let win = RecentWindow.getMostRecentBrowserWindow();
     if (!win)
       return;
@@ -2998,17 +3000,25 @@ let E10SUINotification = {
       highlightLabel.setAttribute("value", highlight);
       doorhangerExtraContent.appendChild(highlightLabel);
     }
   },
 
   _warnedAboutAccessibility: false,
 
   _showE10sAccessibilityWarning: function() {
-    Services.prefs.setBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y", true);
+    try {
+      if (!Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y")) {
+        // Only return if the pref exists and was set to false, but not
+        // if the pref didn't exist (which will throw).
+        return;
+      }
+    } catch (e) { }
+
+    Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", true);
 
     if (this._warnedAboutAccessibility) {
       return;
     }
     this._warnedAboutAccessibility = true;
 
     let win = RecentWindow.getMostRecentBrowserWindow();
     if (!win) {
@@ -3035,17 +3045,17 @@ let E10SUINotification = {
         Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
       }
     };
     let secondaryActions = [
       {
         label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.label"),
         accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.accesskey"),
         callback: function () {
-          Services.prefs.setBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y", false);
+          Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", false);
         }
       }
     ];
     let options = {
       popupIconURL: "chrome://browser/skin/e10s-64@2x.png",
       learnMoreURL: "https://wiki.mozilla.org/Electrolysis",
       persistWhileVisible: true
     };
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4406,17 +4406,17 @@ mozilla::BrowserTabsRemoteAutostart()
   // remotely. Otherwise remote isn't allowed in non-nightly builds.
   bool testPref = Preferences::GetBool("layers.offmainthreadcomposition.testing.enabled", false);
   if (testPref && optInPref) {
     gBrowserTabsRemoteAutostart = true;
   }
 #else
   // Nightly builds, update gBrowserTabsRemoteAutostart based on all the
   // e10s remote relayed prefs we watch.
-  bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.autostart.disabled-because-using-a11y", false);
+  bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.disabled-for-a11y", false);
   // Disable for VR
   bool disabledForVR = Preferences::GetBool("dom.vr.enabled", false);
 
   if (prefEnabled) {
     if (gSafeMode) {
       status = kE10sDisabledInSafeMode;
       LogE10sBlockedReason("Safe mode");
     } else if (disabledForA11y) {