| 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 1bd5d15bfa102e53e663a1bbc69188e9a830534f..409c43cdc4fbd07daf86a75e1aa95d5311b393bb 100644
|
| --- a/content/renderer/scheduler/renderer_scheduler_impl.h
|
| +++ b/content/renderer/scheduler/renderer_scheduler_impl.h
|
| @@ -41,6 +41,7 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler {
|
| void DidReceiveInputEventOnCompositorThread(
|
| const blink::WebInputEvent& web_input_event) override;
|
| void DidAnimateForInputOnCompositorThread() override;
|
| + bool CanExceedIdleDeadlineIfRequired() const override;
|
| bool IsHighPriorityWorkAnticipated() override;
|
| bool ShouldYieldForHighPriorityWork() override;
|
| void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override;
|
| @@ -78,6 +79,12 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler {
|
| ACTIVE_AND_AWAITING_TOUCHSTART_RESPONSE
|
| };
|
|
|
| + enum class IdlePeriodState {
|
| + NOT_WITHIN_IDLE_PERIOD,
|
| + WITHIN_IDLE_PERIOD,
|
| + WITHIN_MAX_DEADLINE_IDLE_PERIOD
|
| + };
|
| +
|
| class PollableNeedsUpdateFlag {
|
| public:
|
| PollableNeedsUpdateFlag(base::Lock* write_lock);
|
| @@ -102,6 +109,7 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler {
|
| static const char* TaskQueueIdToString(QueueId queue_id);
|
| static const char* PolicyToString(Policy policy);
|
| static const char* InputStreamStateToString(InputStreamState state);
|
| + static const char* IdlePeriodStateToString(IdlePeriodState state);
|
|
|
| static InputStreamState ComputeNewInputStreamState(
|
| InputStreamState current_state,
|
| @@ -151,19 +159,19 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler {
|
| // input was processed.
|
| void DidProcessInputEvent(base::TimeTicks begin_frame_time);
|
|
|
| - // Returns true if we should initiate a long idle time now. Fills in
|
| + // Returns the new idle period state for the next long idle period. Fills in
|
| // |next_long_idle_period_delay_out| with the next time we should try to
|
| // initiate the next idle period.
|
| - bool ShouldStartLongIdlePeriod(
|
| + IdlePeriodState ComputeNewLongIdlePeriodState(
|
| const base::TimeTicks now,
|
| - base::TimeDelta* next_long_idle_period_delay_out);
|
| + base::TimeDelta* next_long_idle_period_delay);
|
|
|
| // Initiate a long idle period.
|
| void InitiateLongIdlePeriod();
|
| void InitiateLongIdlePeriodAfterWakeup();
|
|
|
| // Start and end an idle period.
|
| - void StartIdlePeriod();
|
| + void StartIdlePeriod(IdlePeriodState new_idle_period_state);
|
| void EndIdlePeriod();
|
|
|
| base::TimeTicks Now() const;
|
| @@ -185,7 +193,7 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler {
|
|
|
| // Don't access current_policy_ directly, instead use SchedulerPolicy().
|
| Policy current_policy_;
|
| - bool in_idle_period_;
|
| + IdlePeriodState idle_period_state_;
|
|
|
| base::TimeTicks estimated_next_frame_begin_;
|
| base::TimeTicks current_policy_expiration_time_;
|
|
|