Chromium Code Reviews| Index: Source/platform/scheduler/Scheduler.h |
| diff --git a/Source/platform/scheduler/Scheduler.h b/Source/platform/scheduler/Scheduler.h |
| index 7f7835abcf76d6ac90c6780e6fdad520e3808d80..86ab076cdbb4c1a4137e0ef59e245975a19ffacd 100644 |
| --- a/Source/platform/scheduler/Scheduler.h |
| +++ b/Source/platform/scheduler/Scheduler.h |
| @@ -10,6 +10,7 @@ |
| #include "wtf/DoubleBufferedDeque.h" |
| #include "wtf/Functional.h" |
| #include "wtf/Noncopyable.h" |
| +#include "wtf/OwnPtr.h" |
| #include "wtf/ThreadingPrimitives.h" |
| namespace blink { |
| @@ -64,6 +65,7 @@ protected: |
| class MainThreadPendingHighPriorityTaskRunner; |
| friend class MainThreadPendingTaskRunner; |
| friend class MainThreadPendingHighPriorityTaskRunner; |
| + friend class TracedIdleTask; |
| enum SchedulerPolicy { |
| Normal, |
| @@ -73,8 +75,8 @@ protected: |
| Scheduler(); |
| virtual ~Scheduler(); |
| - void scheduleIdleTask(const TraceLocation&, const IdleTask&); |
| void postHighPriorityTaskInternal(const TraceLocation&, const Task&, const char* traceName); |
| + void postIdleTaskInternal(const TraceLocation&, const IdleTask&, const char* traceName); |
| static void sharedTimerAdapter(); |
| @@ -89,7 +91,19 @@ protected: |
| void swapQueuesRunPendingTasksAndAllowHighPriorityTaskRunnerPosting(); |
| // Returns true if any work was done. |
| - bool executeHighPriorityTasks(Deque<TracedTask>&); |
| + bool executeHighPriorityTasks(Deque<OwnPtr<TracedTask> >&); |
| + |
| + // Returns true if any work was done. |
| + bool swapQueuesAndRunPendingIdleTasks(); |
| + |
| + // Returns true if any work was done. |
| + bool executeIdleTasks(Deque<OwnPtr<TracedTask> >&); |
| + |
| + // Reposts all the tasks in idleTasks onto the idle task queue. |
| + void repostAllIdleTasks(Deque<OwnPtr<TracedTask> >&); |
| + |
| + // Returns the time in seconds until the current frame deadline expires. |
| + double getSecondsUntilFrameDeadline() const; |
|
Sami
2014/09/24 14:00:40
nit: drop the |get|, it's cleaner
rmcilroy
2014/09/29 17:42:57
Done.
|
| // Return the current SchedulerPolicy. |
| SchedulerPolicy schedulerPolicy() const; |
| @@ -118,9 +132,12 @@ protected: |
| // This mutex protects calls to the pending task queue, m_highPriorityTaskRunnerPosted and |
| // m_compositorPriorityPolicyEndTimeSeconds. |
| Mutex m_pendingTasksMutex; |
| - DoubleBufferedDeque<TracedTask> m_pendingHighPriorityTasks; |
| + DoubleBufferedDeque<OwnPtr<TracedTask> > m_pendingHighPriorityTasks; |
|
Sami
2014/09/24 14:00:40
As of Nico's email to chromium-dev@ yesterday I th
rmcilroy
2014/09/29 17:42:57
Acknowledged.
|
| + DoubleBufferedDeque<OwnPtr<TracedTask> > m_pendingIdleTasks; |
| double m_compositorPriorityPolicyEndTimeSeconds; |
| + double m_currentFrameDeadlineSeconds; |
| + |
| // Declared volatile as it is atomically incremented. |
| volatile int m_highPriorityTaskCount; |