Bug 1641929 - Add a fission.autostart getter, r=nika

This makes it easier to consider special conditions when checking the pref. It
currently returns false if safe mode is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D78798
This commit is contained in:
Kashav Madan 2020-06-08 22:59:43 +00:00
Родитель 2624663db2
Коммит c236372d7d
2 изменённых файлов: 12 добавлений и 0 удалений

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

@ -24,6 +24,7 @@
#include "mozilla/ResultExtensions.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs_fission.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Utf8.h"
#include "mozilla/intl/LocaleService.h"
@ -5054,6 +5055,10 @@ bool BrowserTabsRemoteAutostart() {
return gBrowserTabsRemoteAutostart;
}
bool FissionAutostart() {
return !gSafeMode && StaticPrefs::fission_autostart();
}
uint32_t GetMaxWebProcessCount() {
// multiOptOut is in int to allow us to run multiple experiments without
// introducing multiple prefs a la the autostart.N prefs.

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

@ -13,6 +13,13 @@ namespace mozilla {
// therefore be disabled. Bug 1065561 tracks its removal.
bool BrowserTabsRemoteAutostart();
uint32_t GetMaxWebProcessCount();
// Returns the value of the fission.autostart pref. Since fission can be
// disabled on a per-window basis, this should only be used when you need the
// global value of the pref. For other use cases, you should use
// nsILoadContext::UseRemoteSubframes instead. This will also check for special
// conditions, like safe mode, which may require fission to be disabled.
bool FissionAutostart();
}
%}