зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1569004 - Convert dom.timeout.max_consecutive_callbacks_ms to static pref. r=njn
Converts dom.timeout.max_consecutive_callbacks_ms varcache pref in TimeoutManager.cpp to static pref, removes associated variables and all.js entry, and adds entry to StaticPrefList.yaml. Differential Revision: https://phabricator.services.mozilla.com/D39425 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7c1f644ceb
Коммит
3d34dc8c5b
|
@ -414,11 +414,6 @@ uint32_t TimeoutManager::sNestingLevel = 0;
|
|||
|
||||
namespace {
|
||||
|
||||
// The maximum number of milliseconds to allow consecutive timer callbacks
|
||||
// to run in a single event loop runnable.
|
||||
#define DEFAULT_MAX_CONSECUTIVE_CALLBACKS_MILLISECONDS 4
|
||||
uint32_t gMaxConsecutiveCallbacksMilliseconds;
|
||||
|
||||
// Only propagate the open window click permission if the setTimeout() is equal
|
||||
// to or less than this value.
|
||||
#define DEFAULT_DISABLE_OPEN_CLICK_DELAY 0
|
||||
|
@ -467,10 +462,6 @@ TimeoutManager::~TimeoutManager() {
|
|||
|
||||
/* static */
|
||||
void TimeoutManager::Initialize() {
|
||||
Preferences::AddUintVarCache(&gMaxConsecutiveCallbacksMilliseconds,
|
||||
"dom.timeout.max_consecutive_callbacks_ms",
|
||||
DEFAULT_MAX_CONSECUTIVE_CALLBACKS_MILLISECONDS);
|
||||
|
||||
Preferences::AddIntVarCache(&gDisableOpenClickDelay,
|
||||
"dom.disable_open_click_delay",
|
||||
DEFAULT_DISABLE_OPEN_CLICK_DELAY);
|
||||
|
@ -682,7 +673,7 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
|
|||
|
||||
// Limit the overall time spent in RunTimeout() to reduce jank.
|
||||
uint32_t totalTimeLimitMS =
|
||||
std::max(1u, gMaxConsecutiveCallbacksMilliseconds);
|
||||
std::max(1u, StaticPrefs::dom_timeout_max_consecutive_callbacks_ms());
|
||||
const TimeDuration totalTimeLimit =
|
||||
TimeDuration::Min(TimeDuration::FromMilliseconds(totalTimeLimitMS),
|
||||
TimeDuration::Max(TimeDuration(), mExecutionBudget));
|
||||
|
|
|
@ -1819,6 +1819,13 @@
|
|||
value: true
|
||||
mirror: always
|
||||
|
||||
# Maximum amount of time in milliseconds consecutive setTimeout()/setInterval()
|
||||
# callback are allowed to run before yielding the event loop.
|
||||
- name: dom.timeout.max_consecutive_callbacks_ms
|
||||
type: uint32_t
|
||||
value: 4
|
||||
mirror: always
|
||||
|
||||
# Maximum deferral time for setTimeout/Interval in milliseconds
|
||||
- name: dom.timeout.max_idle_defer_ms
|
||||
type: uint32_t
|
||||
|
|
|
@ -5451,10 +5451,6 @@ pref("browser.sanitizer.loglevel", "Warn");
|
|||
// To disable blocking of auth prompts, set the limit to -1.
|
||||
pref("prompts.authentication_dialog_abuse_limit", 2);
|
||||
|
||||
// Maximum amount of time in milliseconds consecutive setTimeout()/setInterval()
|
||||
// callback are allowed to run before yielding the event loop.
|
||||
pref("dom.timeout.max_consecutive_callbacks_ms", 4);
|
||||
|
||||
// Payment Request API preferences
|
||||
pref("dom.payments.loglevel", "Warn");
|
||||
pref("dom.payments.defaults.saveCreditCard", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче