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

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: Fixed an assert issue 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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