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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |