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 5b249c76f3fe12d1aa0ca0d09968a7c4cfd86c4a..83cfcbfd9e0401b169c82dc1a745eef558c9b612 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 |
| @@ -160,6 +160,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| // Returns true if the |task_queue| is throttled. |
| bool IsThrottled(TaskQueue* task_queue) const; |
| + // Communicate audio state to TaskQueueThrottler. |
| + void SetIsAudioActive(bool is_audio_active); |
|
Sami
2016/09/29 13:36:07
I don't think TaskQueueThrottler should know about
altimin
2016/09/29 16:29:43
Done.
|
| + |
| // Tells the TaskQueueThrottler we're using virtual time, which disables all |
| // throttling. |
| void EnableVirtualTime(); |
| @@ -226,6 +229,16 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| void MaybeDeleteQueueMetadata(TaskQueueMap::iterator it); |
| + // Disable throttling for all queues, this setting takes precedence over |
| + // all other throttling settings. Designed to be used when a global event |
| + // disabling throttling happens (e.g. audio is playing). |
| + void DisableThrottling(); |
| + |
| + // Enable back global throttling. |
| + void EnableThrottling(); |
| + |
| + void UpdateGlobalThrottlingSetting(); |
|
alex clarke (OOO till 29th)
2016/09/29 11:16:53
Sami how do you feel about this vs UpdatePolicy? M
Sami
2016/09/29 13:36:07
Yeah I think we want to cause a policy update inst
alex clarke (OOO till 29th)
2016/09/29 13:46:18
Thinking about this more I'd suggest instead of ad
altimin
2016/09/29 16:29:43
Done.
|
| + |
| TaskQueueMap queue_details_; |
| base::Callback<void(TaskQueue*)> forward_immediate_work_callback_; |
| scoped_refptr<TaskQueue> task_runner_; |
| @@ -236,7 +249,9 @@ class BLINK_PLATFORM_EXPORT TaskQueueThrottler : public TimeDomain::Observer { |
| CancelableClosureHolder pump_throttled_tasks_closure_; |
| base::Optional<base::TimeTicks> pending_pump_throttled_tasks_runtime_; |
| + bool is_throttling_disabled_; |
|
Sami
2016/09/29 13:36:07
Negative flags hurt my head -- how about allow_thr
altimin
2016/09/29 16:29:43
Done.
|
| bool virtual_time_; |
| + bool is_audio_active_; |
| std::unordered_map<TimeBudgetPool*, std::unique_ptr<TimeBudgetPool>> |
| time_budget_pools_; |