зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1571544 - Convert two dom.ipc.processPriorityManager.* prefs to static prefs. r=njn
Converts dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS and dom.ipc.processPriorityManager.backgroundGracePeriodMS to static prefs and removes the initializer function they were in, as they were the last prefs initialized there. Differential Revision: https://phabricator.services.mozilla.com/D40702 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
96dd3a5524
Коммит
a4cb27d0c6
|
@ -215,7 +215,6 @@ class ParticularProcessPriorityManager final : public WakeLockObserver,
|
|||
NS_DECL_NSITIMERCALLBACK
|
||||
|
||||
virtual void Notify(const WakeLockInformation& aInfo) override;
|
||||
static void StaticInit();
|
||||
void Init();
|
||||
|
||||
int32_t Pid() const;
|
||||
|
@ -258,9 +257,6 @@ class ParticularProcessPriorityManager final : public WakeLockObserver,
|
|||
}
|
||||
|
||||
private:
|
||||
static uint32_t sBackgroundPerceivableGracePeriodMS;
|
||||
static uint32_t sBackgroundGracePeriodMS;
|
||||
|
||||
void FireTestOnlyObserverNotification(
|
||||
const char* aTopic, const nsACString& aData = EmptyCString());
|
||||
|
||||
|
@ -294,11 +290,6 @@ bool ProcessPriorityManagerImpl::sInitialized = false;
|
|||
bool ProcessPriorityManagerImpl::sPrefListenersRegistered = false;
|
||||
/* static */
|
||||
StaticRefPtr<ProcessPriorityManagerImpl> ProcessPriorityManagerImpl::sSingleton;
|
||||
/* static */
|
||||
uint32_t ParticularProcessPriorityManager::sBackgroundPerceivableGracePeriodMS =
|
||||
0;
|
||||
/* static */
|
||||
uint32_t ParticularProcessPriorityManager::sBackgroundGracePeriodMS = 0;
|
||||
|
||||
NS_IMPL_ISUPPORTS(ProcessPriorityManagerImpl, nsIObserver,
|
||||
nsISupportsWeakReference);
|
||||
|
@ -504,15 +495,6 @@ ParticularProcessPriorityManager::ParticularProcessPriorityManager(
|
|||
LOGP("Creating ParticularProcessPriorityManager.");
|
||||
}
|
||||
|
||||
void ParticularProcessPriorityManager::StaticInit() {
|
||||
Preferences::AddUintVarCache(
|
||||
&sBackgroundPerceivableGracePeriodMS,
|
||||
"dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS");
|
||||
Preferences::AddUintVarCache(
|
||||
&sBackgroundGracePeriodMS,
|
||||
"dom.ipc.processPriorityManager.backgroundGracePeriodMS");
|
||||
}
|
||||
|
||||
void ParticularProcessPriorityManager::Init() {
|
||||
RegisterWakeLockObserver(this);
|
||||
|
||||
|
@ -719,10 +701,12 @@ void ParticularProcessPriorityManager::ScheduleResetPriority(
|
|||
uint32_t timeout = 0;
|
||||
switch (aTimeoutPref) {
|
||||
case BACKGROUND_PERCEIVABLE_GRACE_PERIOD:
|
||||
timeout = sBackgroundPerceivableGracePeriodMS;
|
||||
timeout = StaticPrefs::
|
||||
dom_ipc_processPriorityManager_backgroundPerceivableGracePeriodMS();
|
||||
break;
|
||||
case BACKGROUND_GRACE_PERIOD:
|
||||
timeout = sBackgroundGracePeriodMS;
|
||||
timeout =
|
||||
StaticPrefs::dom_ipc_processPriorityManager_backgroundGracePeriodMS();
|
||||
break;
|
||||
default:
|
||||
MOZ_ASSERT(false, "Unrecognized timeout pref");
|
||||
|
@ -953,7 +937,6 @@ namespace mozilla {
|
|||
void ProcessPriorityManager::Init() {
|
||||
ProcessPriorityManagerImpl::StaticInit();
|
||||
ProcessPriorityManagerChild::StaticInit();
|
||||
ParticularProcessPriorityManager::StaticInit();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -1481,6 +1481,16 @@
|
|||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS
|
||||
type: uint32_t
|
||||
value: 0
|
||||
mirror: always
|
||||
|
||||
- name: dom.ipc.processPriorityManager.backgroundGracePeriodMS
|
||||
type: uint32_t
|
||||
value: 0
|
||||
mirror: always
|
||||
|
||||
# Is support for input type=date and type=time enabled?
|
||||
- name: dom.forms.datetime
|
||||
type: bool
|
||||
|
|
Загрузка…
Ссылка в новой задаче