Bug 1079573 - Fix for BrowserTabsRemoteAutostart prefEnabled boolean defined out of scope in non-nightly builds. r=mossop
authorJim Mathies <jmathies@mozilla.com>
Thu, 09 Oct 2014 12:33:35 -0500
changeset 209705 ecf7c54a9dce5c5a37e66b177d69c8b9eb688fad
parent 209589 cff6335a600972067f0fe41293b52003b0d1fa24
child 209706 3569e710513f661f0bac91d6a54d9b4b197e937f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmossop
bugs1079573
milestone35.0a1
Bug 1079573 - Fix for BrowserTabsRemoteAutostart prefEnabled boolean defined out of scope in non-nightly builds. r=mossop
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4572,26 +4572,28 @@ bool
 mozilla::BrowserTabsRemoteAutostart()
 {
   if (gBrowserTabsRemoteAutostartInitialized) {
     return gBrowserTabsRemoteAutostart;
   }
   gBrowserTabsRemoteAutostartInitialized = true;
   bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false);
   bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.1", false);
+  bool prefEnabled = optInPref || trialPref;
 #if !defined(NIGHTLY_BUILD)
-  // When running tests with 'layers.offmainthreadcomposition.testing.enabled' and autostart
-  // set to true, return enabled.  These tests must be allowed to run remotely.
+  // When running tests with 'layers.offmainthreadcomposition.testing.enabled' and
+  // autostart set to true, return enabled.  These tests must be allowed to run
+  // 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
-  bool prefEnabled = optInPref || trialPref;
-
+  // 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);
   // Only disable for IME for the automatic pref, not the opt-in one.
   bool disabledForIME = trialPref && KeyboardMayHaveIME();
 
   if (prefEnabled) {
     if (gSafeMode) {
       LogE10sBlockedReason("Firefox is in safe mode.");
     } else if (disabledForA11y) {