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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 void Scheduler::postInputTask(const TraceLocation& location, const Task& task) | 157 void Scheduler::postInputTask(const TraceLocation& location, const Task& task) |
158 { | 158 { |
159 Locker<Mutex> lock(m_pendingTasksMutex); | 159 Locker<Mutex> lock(m_pendingTasksMutex); |
160 m_pendingHighPriorityTasks.append(TracedTask(task, location)); | 160 m_pendingHighPriorityTasks.append(TracedTask(task, location)); |
161 atomicIncrement(&m_highPriorityTaskCount); | 161 atomicIncrement(&m_highPriorityTaskCount); |
162 maybePostMainThreadPendingHighPriorityTaskRunner(); | 162 maybePostMainThreadPendingHighPriorityTaskRunner(); |
163 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri
orityTasks", m_highPriorityTaskCount); | 163 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.scheduler"), "PendingHighPri
orityTasks", m_highPriorityTaskCount); |
164 } | 164 } |
165 | 165 |
| 166 void Scheduler::didReceiveInputEvent() |
| 167 { |
| 168 enterSchedulerPolicy(CompositorPriority); |
| 169 } |
| 170 |
166 void Scheduler::postCompositorTask(const TraceLocation& location, const Task& ta
sk) | 171 void Scheduler::postCompositorTask(const TraceLocation& location, const Task& ta
sk) |
167 { | 172 { |
168 Locker<Mutex> lock(m_pendingTasksMutex); | 173 Locker<Mutex> lock(m_pendingTasksMutex); |
169 m_pendingHighPriorityTasks.append(TracedTask(task, location)); | 174 m_pendingHighPriorityTasks.append(TracedTask(task, location)); |
170 atomicIncrement(&m_highPriorityTaskCount); | 175 atomicIncrement(&m_highPriorityTaskCount); |
171 maybePostMainThreadPendingHighPriorityTaskRunner(); | 176 maybePostMainThreadPendingHighPriorityTaskRunner(); |
172 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); |
173 } | 178 } |
174 | 179 |
175 void Scheduler::maybePostMainThreadPendingHighPriorityTaskRunner() | 180 void Scheduler::maybePostMainThreadPendingHighPriorityTaskRunner() |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 | 333 |
329 void Scheduler::TracedTask::run() | 334 void Scheduler::TracedTask::run() |
330 { | 335 { |
331 TRACE_EVENT2("blink", "TracedTask::run", | 336 TRACE_EVENT2("blink", "TracedTask::run", |
332 "src_file", m_location.fileName(), | 337 "src_file", m_location.fileName(), |
333 "src_func", m_location.functionName()); | 338 "src_func", m_location.functionName()); |
334 m_task(); | 339 m_task(); |
335 } | 340 } |
336 | 341 |
337 } // namespace blink | 342 } // namespace blink |
OLD | NEW |