Chromium Code Reviews

Side by Side Diff: content/renderer/scheduler/renderer_scheduler_impl.cc

Issue 692483002: Hook up DidReceiveInputEvent to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Passing the input event type through to the scheduler Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/scheduler/renderer_scheduler_impl.h" 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "cc/output/begin_frame_args.h" 8 #include "cc/output/begin_frame_args.h"
9 #include "content/renderer/scheduler/renderer_task_queue_selector.h" 9 #include "content/renderer/scheduler/renderer_task_queue_selector.h"
10 #include "ui/gfx/frame_time.h" 10 #include "ui/gfx/frame_time.h"
(...skipping 72 matching lines...)
83 return; 83 return;
84 84
85 base::TimeTicks now(Now()); 85 base::TimeTicks now(Now());
86 if (now < estimated_next_frame_begin_) { 86 if (now < estimated_next_frame_begin_) {
87 StartIdlePeriod(); 87 StartIdlePeriod();
88 control_task_runner_->PostDelayedTask(FROM_HERE, end_idle_period_closure_, 88 control_task_runner_->PostDelayedTask(FROM_HERE, end_idle_period_closure_,
89 estimated_next_frame_begin_ - now); 89 estimated_next_frame_begin_ - now);
90 } 90 }
91 } 91 }
92 92
93 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread() { 93 void RendererSchedulerImpl::DidReceiveInputEventOnCompositorThread(
94 blink::WebInputEvent::Type type) {
94 // TODO(rmcilroy): Decide whether only a subset of input events should trigger 95 // TODO(rmcilroy): Decide whether only a subset of input events should trigger
jdduke (slow) 2014/11/07 18:12:38 Can we decide this now? if (WebInputEvent::isMous
alex clarke (OOO till 29th) 2014/11/07 18:31:55 Done.
95 // compositor priority policy - http://crbug.com/429814. 96 // compositor priority policy - http://crbug.com/429814.
97 UpdateForInputEvent();
98 }
99
100 void RendererSchedulerImpl::DidAnimateForInputOnCompositorThread() {
101 UpdateForInputEvent();
102 }
103
104 void RendererSchedulerImpl::UpdateForInputEvent() {
96 base::AutoLock lock(incoming_signals_lock_); 105 base::AutoLock lock(incoming_signals_lock_);
97 if (last_input_time_.is_null()) { 106 if (last_input_time_.is_null()) {
98 // Update scheduler policy if should start a new compositor policy mode. 107 // Update scheduler policy if should start a new compositor policy mode.
99 policy_may_need_update_.SetLocked(true); 108 policy_may_need_update_.SetLocked(true);
100 PostUpdatePolicyOnControlRunner(base::TimeDelta()); 109 PostUpdatePolicyOnControlRunner(base::TimeDelta());
101 } 110 }
102 last_input_time_ = Now(); 111 last_input_time_ = Now();
103 } 112 }
104 113
105 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() { 114 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() {
(...skipping 103 matching lines...)
209 void RendererSchedulerImpl::PollableNeedsUpdateFlag::SetLocked(bool value) { 218 void RendererSchedulerImpl::PollableNeedsUpdateFlag::SetLocked(bool value) {
210 write_lock_->AssertAcquired(); 219 write_lock_->AssertAcquired();
211 base::subtle::Release_Store(&flag_, value); 220 base::subtle::Release_Store(&flag_, value);
212 } 221 }
213 222
214 bool RendererSchedulerImpl::PollableNeedsUpdateFlag::IsSet() const { 223 bool RendererSchedulerImpl::PollableNeedsUpdateFlag::IsSet() const {
215 thread_checker_.CalledOnValidThread(); 224 thread_checker_.CalledOnValidThread();
216 return base::subtle::Acquire_Load(&flag_) != 0; 225 return base::subtle::Acquire_Load(&flag_) != 0;
217 } 226 }
218 } // namespace content 227 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/scheduler/renderer_scheduler_impl.h ('k') | content/renderer/scheduler/renderer_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine