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

Side by Side Diff: Source/platform/scheduler/Scheduler.cpp

Issue 554693004: Adds a didReceiveInputEvent api to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added some more tests Created 6 years, 3 months 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
« no previous file with comments | « Source/platform/scheduler/Scheduler.h ('k') | Source/platform/scheduler/SchedulerTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "platform/scheduler/Scheduler.h" 6 #include "platform/scheduler/Scheduler.h"
7 7
8 #include "platform/PlatformThreadData.h" 8 #include "platform/PlatformThreadData.h"
9 #include "platform/Task.h" 9 #include "platform/Task.h"
10 #include "platform/ThreadTimers.h" 10 #include "platform/ThreadTimers.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void Scheduler::postInputTask(const TraceLocation& location, const Task& task) 155 void Scheduler::postInputTask(const TraceLocation& location, const Task& task)
156 { 156 {
157 Locker<Mutex> lock(m_pendingTasksMutex); 157 Locker<Mutex> lock(m_pendingTasksMutex);
158 setLatencyMode(LowLatency); 158 setLatencyMode(LowLatency);
159 m_pendingHighPriorityTasks.append(TracedTask(task, location)); 159 m_pendingHighPriorityTasks.append(TracedTask(task, location));
160 atomicIncrement(&m_highPriorityTaskCount); 160 atomicIncrement(&m_highPriorityTaskCount);
161 maybePostMainThreadPendingHighPriorityTaskRunner(); 161 maybePostMainThreadPendingHighPriorityTaskRunner();
162 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri orityTasks", m_highPriorityTaskCount); 162 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri orityTasks", m_highPriorityTaskCount);
163 } 163 }
164 164
165 void Scheduler::didReceiveInputEvent()
eseidel 2014/09/10 16:10:34 How often is this called?
alexclarke 2014/09/11 15:21:12 At most a handful of times per frame.
166 {
167 Locker<Mutex> lock(m_pendingTasksMutex);
168 setLatencyMode(LowLatency);
169 }
170
165 void Scheduler::postCompositorTask(const TraceLocation& location, const Task& ta sk) 171 void Scheduler::postCompositorTask(const TraceLocation& location, const Task& ta sk)
166 { 172 {
167 Locker<Mutex> lock(m_pendingTasksMutex); 173 Locker<Mutex> lock(m_pendingTasksMutex);
168 m_pendingHighPriorityTasks.append(TracedTask(task, location)); 174 m_pendingHighPriorityTasks.append(TracedTask(task, location));
169 atomicIncrement(&m_highPriorityTaskCount); 175 atomicIncrement(&m_highPriorityTaskCount);
170 maybePostMainThreadPendingHighPriorityTaskRunner(); 176 maybePostMainThreadPendingHighPriorityTaskRunner();
171 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri orityTasks", m_highPriorityTaskCount); 177 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri orityTasks", m_highPriorityTaskCount);
172 } 178 }
173 179
174 void Scheduler::maybePostMainThreadPendingHighPriorityTaskRunner() 180 void Scheduler::maybePostMainThreadPendingHighPriorityTaskRunner()
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 313
308 void Scheduler::TracedTask::run() 314 void Scheduler::TracedTask::run()
309 { 315 {
310 TRACE_EVENT2("blink", "TracedTask::run", 316 TRACE_EVENT2("blink", "TracedTask::run",
311 "src_file", m_location.fileName(), 317 "src_file", m_location.fileName(),
312 "src_func", m_location.functionName()); 318 "src_func", m_location.functionName());
313 m_task(); 319 m_task();
314 } 320 }
315 321
316 } // namespace blink 322 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scheduler/Scheduler.h ('k') | Source/platform/scheduler/SchedulerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698