Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |