Chromium Code Reviews| Index: content/renderer/scheduler/renderer_scheduler_impl.h |
| diff --git a/content/renderer/scheduler/renderer_scheduler_impl.h b/content/renderer/scheduler/renderer_scheduler_impl.h |
| index c908a974a0d8f21cf24f8cb34d36fc053a1d68c8..f7929ddc19e8176b0328be4f9bbb82e39f96ff0a 100644 |
| --- a/content/renderer/scheduler/renderer_scheduler_impl.h |
| +++ b/content/renderer/scheduler/renderer_scheduler_impl.h |
| @@ -53,6 +53,7 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { |
| private: |
| friend class RendererSchedulerImplTest; |
| + friend class MockRendererSchedulerImpl; |
| // Keep RendererSchedulerImpl::TaskQueueIdToString in sync with this enum. |
| enum QueueId { |
| @@ -118,14 +119,18 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { |
| Policy SchedulerPolicy() const; |
| // Posts a call to UpdatePolicy on the control runner to be run after |delay| |
| - void PostUpdatePolicyOnControlRunner(base::TimeDelta delay); |
| + // Ensures that there can only be one pending delayed and one non-delayed |
| + // UpdatePolicy task. |
| + void PostUpdatePolicyOnControlRunnerLocked(base::TimeDelta delay); |
|
Sami
2015/03/10 16:19:38
Should we call this MaybePost... to match the othe
|
| // Update the policy if a new signal has arrived. Must be called from the main |
| // thread. |
| void MaybeUpdatePolicy(); |
| - // Updates the scheduler policy. Must be called from the main thread. |
| - void UpdatePolicy(); |
| + // Updates the scheduler policy. Must be called from the main thread. If |
| + // |clear_pending_non_delayed_update_policy| is true then |
| + // pending_non_delayed_update_policy_ will be set to false. |
| + virtual void UpdatePolicy(bool clear_pending_non_delayed_update_policy); |
| // Helper for computing the new policy. |new_policy_duration| will be filled |
| // with the amount of time after which the policy should be updated again. If |
| @@ -159,6 +164,8 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { |
| base::Closure update_policy_closure_; |
| CancelableClosureHolder end_idle_period_closure_; |
| + CancelableClosureHolder delayed_update_policy_closure_; |
| + bool pending_non_delayed_update_policy_; |
| // Don't access current_policy_ directly, instead use SchedulerPolicy(). |
| Policy current_policy_; |