Commit Graph
84 Commits
Author SHA1 Message Date
Bevis Tseng 85d5fa0e48 Bug 1384037 - Label ThrottleTimeoutsCallback. r=billm 2017-07-25 18:04:58 +08:00
Ben Kelly b00eac146d Bug 1378586 P5 Don't force setInterval() to a min 1ms delay. r=farre 2017-07-25 08:35:12 -07:00
Ben Kelly b237d4e7d9 Bug 1378586 P4 Clamp setInterval() based on nesting value instead of always. r=farre 2017-07-25 08:35:12 -07:00
Ben Kelly 8554a40e7c Bug 1378586 P2 Avoid Timeout mNestingLevel rollover by just limiting the value to the values we care about. r=farre 2017-07-25 08:35:12 -07:00
Ben Kelly 505bd948b7 Bug 1378586 P1 Track the nesting level on interval Timeout objects. r=farre 2017-07-25 08:35:12 -07:00
Ben Kelly d0441a47ea Bug 1378394 P1 Calculate next setInterval() time from start of previous callback. r=farre 2017-07-06 07:01:40 -07:00
Andreas Farre e8e3c685ac Bug 1362322 - Throttle background timeouts using budget. r=bkelly
Deduct timeout execution time from a continuously regenerating
execution budget. Then throttle timeouts by using that budget in
TimeoutManager::MinSchedulingDelay to adjust the minimum value if
the budget is negative. The minimum value is adjusted to be a
value where the budget would have regenerated to be +0 ms.

The execution budget is clamped by values in ms defined in prefs:

* dom.timeout.background_throttling_max_budget: 50
* dom.timeout.foreground_throttling_max_budget: -1

A value equal or less than 0 means that the budget is infinite.

The regeneration rate can be controlled by the following prefs:

* dom.timeout.background_budget_regeneration_rate
* dom.timeout.foreground_budget_regeneration_rate

one each for foreground and background throttling.

To not starve timeouts indefinitely we clamp the minimum delay using
the pref:

* dom.timeout.budget_throttling_max_delay: 15000

The feature is behind the pref:

* dom.timeout.enable_budget_timer_throttling
2017-07-02 18:02:38 +02:00
Ben Kelly 785a9817a4 Bug 1375287 Make TimeoutManager use a pref cache variable for dom.disable_open_click_delay. r=ehsan 2017-06-23 07:03:30 -07:00
Andreas Farre 7fba5882dd Bug 1373536 - Clean up static API of TimeoutBudgetManager. r=smaug 2017-06-19 10:11:47 +02:00
Andreas Farre 50c5a42af5 Bug 1373536 - Move TimeoutBudgetManager to its own file. r=bkelly 2017-06-16 09:17:09 +02:00
Andreas Farre eb63589149 Bug 1373536 - Unify execution measurements. r=bkelly
Expose the utility framework for computing runnable execution time for
telemetry to be able to use it for managing budget times.
2017-05-30 13:08:11 +02:00
Sebastian Hengst b879d28128 Backed out changeset 10676fd9e6ad (bug 1373536) for failing asan-fuzzing at dom/base/TimeoutHandler.h:26 with unknown type name 'NS_DECL_CYCLE_COLLECTION_CLASS' and more. r=backout 2017-06-20 17:47:54 +02:00
Sebastian Hengst f1aeafe17b Backed out changeset 5bde0b2dd768 (bug 1373536) 2017-06-20 17:46:22 +02:00
Sebastian Hengst 27a8e9ef06 Backed out changeset d377000dbcc9 (bug 1373536) 2017-06-20 17:46:18 +02:00
Andreas Farre 5a246772d0 Bug 1373536 - Clean up static API of TimeoutBudgetManager. r=smaug 2017-06-20 00:40:00 +02:00
Andreas Farre 8b8b571592 Bug 1373536 - Move TimeoutBudgetManager to its own file. r=bkelly 2017-06-19 01:18:00 +02:00
Andreas Farre d7e4c73d5f Bug 1373536 - Unify execution measurements. r=bkelly
Expose the utility framework for computing runnable execution time for
telemetry to be able to use it for managing budget times.
2017-06-16 07:40:00 +02:00
Ben Kelly b7abc9fed8 Bug 1371787 P8 Change Timeout::mInterval member to a TimeDuration. r=ehsan 2017-06-15 17:30:48 -07:00
Ben Kelly 13b51e0da8 Bug 1371787 P7 Make CalculateDelay() return a TimeDuration. r=ehsan 2017-06-15 17:30:48 -07:00
Ben Kelly a3a0824f2a Bug 1371787 P6 Move the std::max() calculation into DOMMinTimeoutValue() and rename the method to CalculateDelay(). r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly 0b0cff3742 Bug 1371787 P5 Move the Timeout conditional checking into DOMMinTimeoutValue(). r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly 0f8eebc74c Bug 1371787 P4 Pass Timeout to DOMMinTimeoutValue(). r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly ff37f2bc4c Bug 1371787 P3 Move some Timeout initialization earlier. r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly e92b8bfdb1 Bug 1371787 P2 Don't adjust Timeout::When() values in TimeoutManager::Resume(). r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly 4a074d4186 Bug 1371787 P1 Rename TimeoutManager "min timeout" values to "min clamp timeout" for clarity. r=ehsan 2017-06-15 17:30:47 -07:00
Ben Kelly 7ad41638d7 Bug 1371664 P4 Remove old TimeoutManager code that adjusted Timeout::When() while in background. r=ehsan 2017-06-13 18:08:28 -07:00
Ben Kelly b1f901e58b Bug 1371664 P3 Pass a minimum delay to TimeoutExecutor::MaybeSchedule() based on TimeoutManager::IsBackground(). r=ehsan 2017-06-13 18:08:27 -07:00
Ben Kelly 25f85897ab Bug 1371664 P2 Make nsGlobalWindow::SetIsBackground() call new TimeoutManager::UpdateBackgroundState(). r=ehsan 2017-06-13 18:08:27 -07:00
Ben Kelly 79f927f616 Bug 1371020 P3 Cleanup some IsFrozen()/IsSuspended() checking in TimeoutManager. r=ehsan 2017-06-08 19:13:37 -07:00
Ben Kelly 1b3820e042 Bug 1371020 P2 Avoid scheduling TimeoutExecutor if the window becomes suspended in RunTimeout. r=ehsan 2017-06-08 19:13:37 -07:00
Ben Kelly f0c4ee45a7 Bug 1371020 P1 Avoid rescheduling the TimeoutExecutor in ClearTimeout() in some cases. r=ehsan 2017-06-08 19:13:36 -07:00
Ben Kelly 3dad53eb71 Bug 1370537 P2 Remove TimeoutManager::RunTimeout()'s last expired timeout reference. r=ehsan 2017-06-08 05:51:59 -07:00
Ben Kelly 52ac523931 Bug 1370537 P1 Stop iterating in TimeoutManager::RunTimeout() when we see an invalid firing ID. r=ehsan 2017-06-08 05:51:58 -07:00
Ben Kelly d487989fec Bug 1370025 P5 Remove the old TimeoutManager insertion point logic. r=ehsan 2017-06-05 12:42:33 -07:00
Ben Kelly f15b34ab24 Bug 1370025 P4 Use FiringId validity in TimeoutManager::Timeouts::Insert() and ::ResetTimersForThrottleReduction(). r=ehsan 2017-06-05 12:42:33 -07:00
Ben Kelly 3352102a70 Bug 1370025 P3 Give the Timeouts structure a reference back to its owning TimeoutManager. r=ehsan 2017-06-05 12:42:33 -07:00
Ben Kelly 0e6aea45f3 Bug 1370025 P2 Add TimeoutManager::IsValidFiringId() helper routine. r=ehsan 2017-06-05 12:42:33 -07:00
Ben Kelly 642ba52b36 Bug 1370025 P1 Better optimize the single mFiringIdStack case in IsInvalidFiringId(). r=ehsan 2017-06-05 12:42:33 -07:00
Ben Kelly 69eee722dc Bug 1363829 P8 Remove TimeoutManager back pressure mechanism. r=smaug 2017-05-31 17:13:19 -07:00
Ben Kelly 0a97320c46 Bug 1363829 P6 Use the TimeoutExecutor in TimeoutManager. r=ehsan 2017-05-31 17:13:19 -07:00
Ben Kelly 322ac915e3 Bug 1363829 P5 Add an executor class to represent the single timer executing timers for a window. r=ehsan 2017-05-31 17:13:19 -07:00
Ben Kelly 1ab86d69e0 Bug 1363829 P4 Store the scheduled delay on Timeout instead of relying on the nsITimer to hold it. r=ehsan 2017-05-31 17:13:18 -07:00
Ben Kelly f4e57f4b1f Bug 1363829 P3 Improve Timeout ref counting to avoide bare AddRef/Release calls. r=ehsan 2017-05-31 17:13:18 -07:00
Ben Kelly 45574d8865 Bug 1363829 P2 Removing the Timeout argument to TimeoutManager::RunTimeout(). r=ehsan 2017-05-31 17:13:18 -07:00
Ben Kelly 05ba4d929e Bug 1363829 P1 Remove some deadcode in TimeoutManager related to processing pending timers. r=ehsan 2017-05-31 17:13:18 -07:00
Ehsan Akhgari 47c52b41d6 Bug 1366812 - Account for the fact that the load event may fire even though mIsDocumentLoaded is true in TimeoutManager; r=cpearce a=topcrasher 2017-05-26 01:11:39 -04:00
Ehsan Akhgari fec0922261 Bug 1366812 - Initialize TimeoutManager::mThrottleTrackingTimeouts to false; r=smaug
This way we won't rely on code which may have potentially not run yet.
2017-05-24 14:48:53 -04:00
Andreas Farre 0a2d66f72f Bug 1367025 - Don't start throttling delay timers while suspended. r=bkelly
From c350a6db4069d1a33a21546a287714bfe07e0590 Mon Sep 17 00:00:00 2001
---
 dom/base/TimeoutManager.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
2017-05-23 15:36:08 +02:00
Ben Kelly 8937ee90df Bug 1343912 P5 Removed the fixed limit on consecutive Timeout callbacks. r=ehsan 2017-05-19 13:45:55 -07:00
Ben Kelly b2659cf1e7 Bug 1343912 P4 Only execute consecutive timeout handlers for a limit period of time. r=ehsan 2017-05-19 13:45:55 -07:00