Bug 1574090 - Make fission.autostart available via StaticPrefs. r=njn

Differential Revision: https://phabricator.services.mozilla.com/D42091

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Henri Sivonen 2019-08-16 07:35:29 +00:00
Родитель adb8141652
Коммит 3201835b16
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -2566,6 +2566,13 @@
# 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

Просмотреть файл

@ -62,6 +62,7 @@
#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"
@ -474,7 +475,7 @@ nsWindowWatcher::OpenWindowWithRemoteTab(
return NS_ERROR_UNEXPECTED;
}
bool isFissionWindow = Preferences::GetBool("fission.autostart");
bool isFissionWindow = StaticPrefs::fission_autostart();
bool isPrivateBrowsingWindow =
Preferences::GetBool("browser.privatebrowsing.autostart");
@ -1803,7 +1804,7 @@ uint32_t nsWindowWatcher::CalculateChromeFlagsForParent(
}
// 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);

Просмотреть файл

@ -40,6 +40,7 @@
#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"
@ -704,7 +705,7 @@ nsresult nsAppShellService::JustCreateTopWindow(
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