Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h |
| diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h |
| index d18481751d9e14b06f8f24029969a79069aa57af..218ef775ce7b8e751f19e6943a2595a9eb09ddfe 100644 |
| --- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h |
| +++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h |
| @@ -69,7 +69,8 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| // is scheduled. |
| void RemoveQueue(base::TimeTicks now, TaskQueue* queue); |
| - void RecordTaskRunTime(base::TimeDelta task_run_time); |
| + void RecordTaskRunTime(base::TimeTicks start_time, |
| + base::TimeTicks end_time); |
| // Enables this time budget pool. Queues from this pool will be |
| // throttled based on their run time. |
| @@ -95,7 +96,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| TimeBudgetPool(const char* name, |
| TaskQueueThrottler* task_queue_throttler, |
| - base::TimeTicks now); |
| + base::TimeTicks now, |
| + base::Optional<base::TimeDelta> max_budget_level, |
| + base::Optional<base::TimeDelta> max_throttling_duration); |
| bool HasEnoughBudgetToRun(base::TimeTicks now); |
| base::TimeTicks GetNextAllowedRunTime(); |
| @@ -111,12 +114,22 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| // Disable all associated throttled queues. |
| void BlockThrottledQueues(base::TimeTicks now); |
| + // Increase current_budget_level_ to satisfy max throttling duration |
| + // condition if necessary. |
| + void EnforceMaximalThrottlingDuration(); |
| + |
| const char* name_; // NOT OWNED |
| TaskQueueThrottler* task_queue_throttler_; |
| + // Max budget level is the maximal amount of time which the time budget pool |
| + // is allowed to run for after a very long period of inactivity. |
|
Sami
2016/10/14 00:33:02
Hmm, is this the maximum budget we can accrue? Thi
altimin
2016/10/14 16:18:55
Rephrased.
|
| + base::Optional<base::TimeDelta> max_budget_level_; |
| + // Max throttling duration is the amount of time after which the task will |
|
Sami
2016/10/14 00:33:02
Would it be simpler to say this is the maximum del
altimin
2016/10/14 16:18:55
No. In fact, it's just a lower bound on time budge
|
| + // be run after a very long period of full activity. |
| + base::Optional<base::TimeDelta> max_throttling_duration_; |
| + |
| base::TimeDelta current_budget_level_; |
| - base::TimeDelta max_budget_level_; |
| base::TimeTicks last_checkpoint_; |
| double cpu_percentage_; |
| bool is_enabled_; |
| @@ -236,6 +249,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| const char* tracing_category_; // NOT OWNED |
| std::unique_ptr<ThrottledTimeDomain> time_domain_; |
| + base::Optional<base::TimeDelta> max_budget_level_; |
| + base::Optional<base::TimeDelta> max_throttling_duration_; |
| + |
| CancelableClosureHolder pump_throttled_tasks_closure_; |
| base::Optional<base::TimeTicks> pending_pump_throttled_tasks_runtime_; |
| bool virtual_time_; |