Bug 1574090 - Make fission.autostart available via StaticPrefs. r=njn
authorHenri Sivonen <hsivonen@hsivonen.fi>
Fri, 16 Aug 2019 07:35:29 +0000
changeset 488459 22637ac7ff7f665ae02be0619c1a51fd47ef2826
parent 488458 ab84d8979801b3ba477f9cc530c63917fafffeaa
child 488460 93ae831e2fb9a6ceac0f0495a280d6538fc62f21
push id92758
push userhsivonen@mozilla.com
push dateFri, 16 Aug 2019 07:36:08 +0000
treeherderautoland@22637ac7ff7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1574090
milestone70.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 1574090 - Make fission.autostart available via StaticPrefs. r=njn Differential Revision: https://phabricator.services.mozilla.com/D42091
modules/libpref/init/StaticPrefList.yaml
toolkit/components/windowwatcher/nsWindowWatcher.cpp
xpfe/appshell/nsAppShellService.cpp
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -2561,16 +2561,23 @@
   type: bool
   value: false
   mirror: always
 
 #---------------------------------------------------------------------------
 # Prefs starting with "fission."
 #---------------------------------------------------------------------------
 
+# Whether to enable Fission.
+# Overridden in all.js on RELEASE_OR_BETA in order to add the locked attribute.
+- name: fission.autostart
+  type: bool
+  value: false
+  mirror: always
+
 # This pref has no effect within fission windows, it only controls the
 # behaviour within non-fission windows.
 - name: fission.preserve_browsing_contexts
   type: bool
   value: false
   mirror: always
 
 #---------------------------------------------------------------------------
--- a/toolkit/components/windowwatcher/nsWindowWatcher.cpp
+++ b/toolkit/components/windowwatcher/nsWindowWatcher.cpp
@@ -57,16 +57,17 @@
 #include "nsIPrefBranch.h"
 #include "nsIPrefService.h"
 #include "nsSandboxFlags.h"
 #include "nsSimpleEnumerator.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ResultExtensions.h"
+#include "mozilla/StaticPrefs_fission.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/Storage.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/dom/BrowserHost.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
 #include "nsIXULWindow.h"
@@ -469,17 +470,17 @@ nsWindowWatcher::OpenWindowWithRemoteTab
     nsContentUtils::WarnScriptWasIgnored(nullptr);
     return NS_ERROR_FAILURE;
   }
 
   if (NS_WARN_IF(!mWindowCreator)) {
     return NS_ERROR_UNEXPECTED;
   }
 
-  bool isFissionWindow = Preferences::GetBool("fission.autostart");
+  bool isFissionWindow = StaticPrefs::fission_autostart();
   bool isPrivateBrowsingWindow =
       Preferences::GetBool("browser.privatebrowsing.autostart");
 
   nsCOMPtr<nsPIDOMWindowOuter> parentWindowOuter;
   if (aRemoteTab) {
     // We need to examine the window that aRemoteTab belongs to in
     // order to inform us of what kind of window we're going to open.
     BrowserHost* openingTab = BrowserHost::GetFrom(aRemoteTab);
@@ -1798,17 +1799,17 @@ uint32_t nsWindowWatcher::CalculateChrom
     remote = WinHasOption(aFeatures, "remote", 0, &presenceFlag);
   }
 
   if (remote) {
     chromeFlags |= nsIWebBrowserChrome::CHROME_REMOTE_WINDOW;
   }
 
   // Determine whether the window should have remote subframes
-  bool fission = Preferences::GetBool("fission.autostart");
+  bool fission = StaticPrefs::fission_autostart();
 
   if (fission) {
     fission = !WinHasOption(aFeatures, "non-fission", 0, &presenceFlag);
   } else {
     fission = WinHasOption(aFeatures, "fission", 0, &presenceFlag);
   }
 
   if (fission) {
--- a/xpfe/appshell/nsAppShellService.cpp
+++ b/xpfe/appshell/nsAppShellService.cpp
@@ -35,16 +35,17 @@
 #include "nsILoadContext.h"
 #include "nsIWebNavigation.h"
 #include "nsIWindowlessBrowser.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StartupTimeline.h"
+#include "mozilla/StaticPrefs_fission.h"
 #include "mozilla/intl/LocaleService.h"
 
 #include "nsEmbedCID.h"
 #include "nsIWebBrowser.h"
 #include "nsIDocShell.h"
 #include "gfxPlatform.h"
 
 #include "nsWebBrowser.h"
@@ -699,17 +700,17 @@ nsresult nsAppShellService::JustCreateTo
       aIsHiddenWindow, aOpeningTab, aOpenerWindow, widgetInitData);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Enforce the Private Browsing autoStart pref first.
   bool isPrivateBrowsingWindow =
       Preferences::GetBool("browser.privatebrowsing.autostart");
   bool isUsingRemoteTabs = mozilla::BrowserTabsRemoteAutostart();
-  bool isUsingRemoteSubframes = Preferences::GetBool("fission.autostart");
+  bool isUsingRemoteSubframes = StaticPrefs::fission_autostart();
 
   if (aChromeMask & nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW) {
     // Caller requested a private window
     isPrivateBrowsingWindow = true;
   }
   if (aChromeMask & nsIWebBrowserChrome::CHROME_REMOTE_WINDOW) {
     isUsingRemoteTabs = true;
   }