mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1663216 - Have a pref to control unthrottled timers in background tabs, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D89295
This commit is contained in:
parent
7e31de8547
commit
f50042da80
@ -243,15 +243,16 @@ TimeDuration TimeoutManager::MinSchedulingDelay() const {
|
||||
isBackground ? TimeDuration::FromMilliseconds(
|
||||
StaticPrefs::dom_min_background_timeout_value())
|
||||
: TimeDuration();
|
||||
if (BudgetThrottlingEnabled(isBackground) &&
|
||||
mExecutionBudget < TimeDuration()) {
|
||||
bool budgetThrottlingEnabled = BudgetThrottlingEnabled(isBackground);
|
||||
if (budgetThrottlingEnabled && mExecutionBudget < TimeDuration()) {
|
||||
// Only throttle if execution budget is less than 0
|
||||
double factor = 1.0 / GetRegenerationFactor(mWindow.IsBackgroundInternal());
|
||||
return TimeDuration::Max(unthrottled, -mExecutionBudget.MultDouble(factor));
|
||||
}
|
||||
if (!mThrottleTimeouts && isBackground) {
|
||||
if (!budgetThrottlingEnabled && isBackground) {
|
||||
return TimeDuration::FromMilliseconds(
|
||||
StaticPrefs::dom_min_background_timeout_value_before_throttling());
|
||||
StaticPrefs::
|
||||
dom_min_background_timeout_value_without_budget_throttling());
|
||||
}
|
||||
|
||||
return unthrottled;
|
||||
|
@ -2159,8 +2159,8 @@
|
||||
value: 1000
|
||||
mirror: always
|
||||
|
||||
# Timeout clamp in ms for background windows before throttling has started.
|
||||
- name: dom.min_background_timeout_value_before_throttling
|
||||
# Timeout clamp in ms for background windows when throttling isn't enabled.
|
||||
- name: dom.min_background_timeout_value_without_budget_throttling
|
||||
type: int32_t
|
||||
value: 1000
|
||||
mirror: always
|
||||
|
Loading…
Reference in New Issue
Block a user