Chromium Code Reviews| Index: third_party/WebKit/Source/platform/scheduler/renderer/budget_pool.h |
| diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/budget_pool.h b/third_party/WebKit/Source/platform/scheduler/renderer/budget_pool.h |
| index e602b93a5ed587bcba7bc85ceee0c20513aac65b..75f6489b961000ef7e587304689acffa2fd6b57d 100644 |
| --- a/third_party/WebKit/Source/platform/scheduler/renderer/budget_pool.h |
| +++ b/third_party/WebKit/Source/platform/scheduler/renderer/budget_pool.h |
| @@ -61,6 +61,9 @@ class BLINK_PLATFORM_EXPORT BudgetPool { |
| virtual void RecordTaskRunTime(base::TimeTicks start_time, |
| base::TimeTicks end_time) = 0; |
| + // Call TaskQueueThrottler::BlockThrottledQueue for all relevant queues. |
|
Sami
2017/03/14 18:43:00
This is an abstract interface with no obvious ties
altimin
2017/03/14 20:04:28
Done.
|
| + virtual void BlockThrottledQueues(base::TimeTicks now) = 0; |
| + |
| // All queues should be removed before calling Close(). |
| virtual void Close() = 0; |
| @@ -79,6 +82,12 @@ class BLINK_PLATFORM_EXPORT BudgetPool { |
| // on total cpu time. |
| class BLINK_PLATFORM_EXPORT CPUTimeBudgetPool : public BudgetPool { |
| public: |
| + CPUTimeBudgetPool(const char* name, |
| + TaskQueueThrottler* task_queue_throttler, |
| + base::TimeTicks now, |
| + base::Optional<base::TimeDelta> max_budget_level, |
| + base::Optional<base::TimeDelta> max_throttling_duration); |
| + |
| ~CPUTimeBudgetPool(); |
| // Throttle task queues from this time budget pool if tasks are running |
| @@ -105,6 +114,7 @@ class BLINK_PLATFORM_EXPORT CPUTimeBudgetPool : public BudgetPool { |
| bool IsThrottlingEnabled() const override; |
| void RecordTaskRunTime(base::TimeTicks start_time, |
| base::TimeTicks end_time) override; |
| + void BlockThrottledQueues(base::TimeTicks now) override; |
| void Close() override; |
| bool HasEnoughBudgetToRun(base::TimeTicks now) override; |
| base::TimeTicks GetNextAllowedRunTime() override; |
| @@ -112,23 +122,12 @@ class BLINK_PLATFORM_EXPORT CPUTimeBudgetPool : public BudgetPool { |
| base::TimeTicks now) const override; |
| private: |
| - friend class TaskQueueThrottler; |
| - |
| FRIEND_TEST_ALL_PREFIXES(TaskQueueThrottlerTest, CPUTimeBudgetPool); |
| - CPUTimeBudgetPool(const char* name, |
| - TaskQueueThrottler* task_queue_throttler, |
| - base::TimeTicks now, |
| - base::Optional<base::TimeDelta> max_budget_level, |
| - base::Optional<base::TimeDelta> max_throttling_duration); |
| - |
| // Advances |last_checkpoint_| to |now| if needed and recalculates |
| // budget level. |
| void Advance(base::TimeTicks now); |
| - // Disable all associated throttled queues. |
| - void BlockThrottledQueues(base::TimeTicks now); |
| - |
| // Increase |current_budget_level_| to satisfy max throttling duration |
| // condition if necessary. |
| // Decrease |current_budget_level_| to satisfy max budget level |