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

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

Issue 516103003: scheduler: Tell the scheduler about frame timing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Still need to keep animate() around. 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/scheduler/Scheduler.h ('k') | Source/web/WebViewImpl.h » ('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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 { 119 {
120 } 120 }
121 121
122 Scheduler::~Scheduler() 122 Scheduler::~Scheduler()
123 { 123 {
124 while (hasPendingHighPriorityWork()) { 124 while (hasPendingHighPriorityWork()) {
125 swapQueuesAndRunPendingTasks(); 125 swapQueuesAndRunPendingTasks();
126 } 126 }
127 } 127 }
128 128
129 void Scheduler::willBeginFrame(const WebBeginFrameArgs& args)
130 {
131 // TODO: Use frame deadline and interval to schedule idle tasks.
132 }
133
134 void Scheduler::didCommitFrameToCompositor()
135 {
136 // TODO: Trigger the frame deadline immediately.
137 }
138
129 void Scheduler::scheduleIdleTask(const TraceLocation& location, const IdleTask& idleTask) 139 void Scheduler::scheduleIdleTask(const TraceLocation& location, const IdleTask& idleTask)
130 { 140 {
131 // TODO: send a real allottedTime here. 141 // TODO: send a real allottedTime here.
132 m_mainThread->postTask(new MainThreadIdleTaskAdapter(idleTask, 0, location)) ; 142 m_mainThread->postTask(new MainThreadIdleTaskAdapter(idleTask, 0, location)) ;
133 } 143 }
134 144
135 void Scheduler::postTask(const TraceLocation& location, const Task& task) 145 void Scheduler::postTask(const TraceLocation& location, const Task& task)
136 { 146 {
137 m_mainThread->postTask(new MainThreadPendingTaskRunner(task, location)); 147 m_mainThread->postTask(new MainThreadPendingTaskRunner(task, location));
138 } 148 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 268
259 void Scheduler::TracedTask::run() 269 void Scheduler::TracedTask::run()
260 { 270 {
261 TRACE_EVENT2("blink", "TracedTask::run", 271 TRACE_EVENT2("blink", "TracedTask::run",
262 "src_file", m_location.fileName(), 272 "src_file", m_location.fileName(),
263 "src_func", m_location.functionName()); 273 "src_func", m_location.functionName());
264 m_task(); 274 m_task();
265 } 275 }
266 276
267 } // namespace blink 277 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scheduler/Scheduler.h ('k') | Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698