зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1637708 - Convert toolkit.content-background-hang-monitor.disabled to a static pref r=njn
Converts `toolkit.content-background-hang-monitor.disabled` to a static pref. Lets us remove the IsDisabled() call in the BHM. Differential Revision: https://phabricator.services.mozilla.com/D76376
This commit is contained in:
Родитель
51439289c1
Коммит
3420ea8aed
|
@ -8729,6 +8729,12 @@
|
|||
# Prefs starting with "toolkit."
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
# Returns true if BHR is disabled.
|
||||
- name: toolkit.content-background-hang-monitor.disabled
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
- name: toolkit.scrollbox.horizontalScrollDistance
|
||||
type: RelaxedAtomicInt32
|
||||
value: 5
|
||||
|
|
|
@ -824,8 +824,6 @@ pref("toolkit.telemetry.unified", true);
|
|||
// Extra logging for AsyncShutdown barriers and phases
|
||||
pref("toolkit.asyncshutdown.log", false);
|
||||
|
||||
pref("toolkit.content-background-hang-monitor.disabled", false);
|
||||
|
||||
// Enable JS dump() function.
|
||||
// IMPORTANT: These prefs must be here even though they're also defined in
|
||||
// StaticPrefList.yaml. They are required because MOZILLA_OFFICIAL is false in
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include "mozilla/LinkedList.h"
|
||||
#include "mozilla/Monitor.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPrefs_toolkit.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
@ -607,18 +608,6 @@ bool BackgroundHangMonitor::ShouldDisableOnBeta(const nsCString& clientID) {
|
|||
return strtol(suffix, NULL, 16) % BHR_BETA_MOD;
|
||||
}
|
||||
|
||||
bool BackgroundHangMonitor::IsDisabled() {
|
||||
static bool sPrefCached = false;
|
||||
static bool sPrefCacheValue = false;
|
||||
if (!sPrefCached) {
|
||||
sPrefCached = true;
|
||||
Preferences::AddBoolVarCache(
|
||||
&sPrefCacheValue, "toolkit.content-background-hang-monitor.disabled");
|
||||
}
|
||||
|
||||
return sPrefCacheValue;
|
||||
}
|
||||
|
||||
bool BackgroundHangMonitor::DisableOnBeta() {
|
||||
nsAutoCString clientID;
|
||||
nsresult rv =
|
||||
|
@ -643,7 +632,8 @@ void BackgroundHangMonitor::Startup() {
|
|||
#ifdef MOZ_ENABLE_BACKGROUND_HANG_MONITOR
|
||||
MOZ_ASSERT(!BackgroundHangManager::sInstance, "Already initialized");
|
||||
|
||||
if (XRE_IsContentProcess() && IsDisabled()) {
|
||||
if (XRE_IsContentProcess() &&
|
||||
StaticPrefs::toolkit_content_background_hang_monitor_disabled()) {
|
||||
BackgroundHangManager::sDisabled = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -135,11 +135,6 @@ class BackgroundHangMonitor {
|
|||
*/
|
||||
static void Shutdown();
|
||||
|
||||
/**
|
||||
* Returns true if BHR is disabled.
|
||||
*/
|
||||
static bool IsDisabled();
|
||||
|
||||
/**
|
||||
* Start monitoring hangs for the current thread.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче