Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

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: Remove unintended clang format change. Updated a comment Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 // compositor priority policy - http://crbug.com/429814. 95 // compositor priority policy - http://crbug.com/429814.
96 base::AutoLock lock(incoming_signals_lock_); 96 base::AutoLock lock(incoming_signals_lock_);
97 if (last_input_time_.is_null()) { 97 if (last_input_time_.is_null()) {
98 // Update scheduler policy if should start a new compositor policy mode. 98 // Update scheduler policy if should start a new compositor policy mode.
99 policy_may_need_update_.SetLocked(true); 99 policy_may_need_update_.SetLocked(true);
100 PostUpdatePolicyOnControlRunner(base::TimeDelta()); 100 PostUpdatePolicyOnControlRunner(base::TimeDelta());
101 } 101 }
102 last_input_time_ = Now(); 102 last_input_time_ = Now();
103 } 103 }
104 104
105 void RendererSchedulerImpl::DidAnimateForInputOnCompositorThread() {
106 DidReceiveInputEventOnCompositorThread();
rmcilroy 2014/11/06 19:45:12 Maybe pull out the code in DidReceiveInputEventOnC
alex clarke (OOO till 29th) 2014/11/06 21:19:05 Done.
107 }
108
105 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() { 109 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() {
106 main_thread_checker_.CalledOnValidThread(); 110 main_thread_checker_.CalledOnValidThread();
107 if (!task_queue_manager_) 111 if (!task_queue_manager_)
108 return false; 112 return false;
109 113
110 MaybeUpdatePolicy(); 114 MaybeUpdatePolicy();
111 // We only yield if we are in the compositor priority and there is compositor 115 // We only yield if we are in the compositor priority and there is compositor
112 // work outstanding. Note: even though the control queue is higher priority 116 // work outstanding. Note: even though the control queue is higher priority
113 // we don't yield for it since these tasks are not user-provided work and they 117 // we don't yield for it since these tasks are not user-provided work and they
114 // are only intended to run before the next task, not interrupt the tasks. 118 // are only intended to run before the next task, not interrupt the tasks.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void RendererSchedulerImpl::PollableNeedsUpdateFlag::SetLocked(bool value) { 213 void RendererSchedulerImpl::PollableNeedsUpdateFlag::SetLocked(bool value) {
210 write_lock_->AssertAcquired(); 214 write_lock_->AssertAcquired();
211 base::subtle::Release_Store(&flag_, value); 215 base::subtle::Release_Store(&flag_, value);
212 } 216 }
213 217
214 bool RendererSchedulerImpl::PollableNeedsUpdateFlag::IsSet() const { 218 bool RendererSchedulerImpl::PollableNeedsUpdateFlag::IsSet() const {
215 thread_checker_.CalledOnValidThread(); 219 thread_checker_.CalledOnValidThread();
216 return base::subtle::Acquire_Load(&flag_) != 0; 220 return base::subtle::Acquire_Load(&flag_) != 0;
217 } 221 }
218 } // namespace content 222 } // 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
This is Rietveld 408576698