mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Bug 1570212 - Convert three dom.ipc.* prefs into static prefs. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D40005 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c27392026e
commit
1e23726d7b
@ -14,6 +14,7 @@
|
||||
#include "mozilla/IntegerPrintfMacros.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/Logging.h"
|
||||
@ -144,9 +145,6 @@ class ProcessPriorityManagerImpl final : public nsIObserver,
|
||||
void TabActivityChanged(BrowserParent* aBrowserParent, bool aIsActive);
|
||||
|
||||
private:
|
||||
static bool sPrefsEnabled;
|
||||
static bool sRemoteTabsDisabled;
|
||||
static bool sTestMode;
|
||||
static bool sPrefListenersRegistered;
|
||||
static bool sInitialized;
|
||||
static StaticRefPtr<ProcessPriorityManagerImpl> sSingleton;
|
||||
@ -293,12 +291,6 @@ class ParticularProcessPriorityManager final : public WakeLockObserver,
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::sInitialized = false;
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::sPrefsEnabled = false;
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::sRemoteTabsDisabled = true;
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::sTestMode = false;
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::sPrefListenersRegistered = false;
|
||||
/* static */
|
||||
StaticRefPtr<ProcessPriorityManagerImpl> ProcessPriorityManagerImpl::sSingleton;
|
||||
@ -323,12 +315,15 @@ void ProcessPriorityManagerImpl::PrefChangedCallback(const char* aPref,
|
||||
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::PrefsEnabled() {
|
||||
return sPrefsEnabled && hal::SetProcessPrioritySupported() &&
|
||||
!sRemoteTabsDisabled;
|
||||
return StaticPrefs::dom_ipc_processPriorityManager_enabled() &&
|
||||
hal::SetProcessPrioritySupported() &&
|
||||
!StaticPrefs::dom_ipc_tabs_disabled();
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool ProcessPriorityManagerImpl::TestMode() { return sTestMode; }
|
||||
bool ProcessPriorityManagerImpl::TestMode() {
|
||||
return StaticPrefs::dom_ipc_processPriorityManager_testMode();
|
||||
}
|
||||
|
||||
/* static */
|
||||
void ProcessPriorityManagerImpl::StaticInit() {
|
||||
@ -342,14 +337,6 @@ void ProcessPriorityManagerImpl::StaticInit() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!sPrefListenersRegistered) {
|
||||
Preferences::AddBoolVarCache(&sPrefsEnabled,
|
||||
"dom.ipc.processPriorityManager.enabled");
|
||||
Preferences::AddBoolVarCache(&sRemoteTabsDisabled, "dom.ipc.tabs.disabled");
|
||||
Preferences::AddBoolVarCache(&sTestMode,
|
||||
"dom.ipc.processPriorityManager.testMode");
|
||||
}
|
||||
|
||||
// If IPC tabs aren't enabled at startup, don't bother with any of this.
|
||||
if (!PrefsEnabled()) {
|
||||
LOG("InitProcessPriorityManager bailing due to prefs.");
|
||||
|
@ -1317,6 +1317,21 @@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: dom.ipc.tabs.disabled
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: dom.ipc.processPriorityManager.enabled
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: dom.ipc.processPriorityManager.testMode
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Is support for input type=date and type=time enabled?
|
||||
- name: dom.forms.datetime
|
||||
type: bool
|
||||
|
Loading…
Reference in New Issue
Block a user