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 #ifndef Scheduler_h | 5 #ifndef Scheduler_h |
6 #define Scheduler_h | 6 #define Scheduler_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/TraceLocation.h" | 9 #include "platform/TraceLocation.h" |
10 #include "wtf/DoubleBufferedDeque.h" | 10 #include "wtf/DoubleBufferedDeque.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Called to notify that a previously begun frame was committed. | 36 // Called to notify that a previously begun frame was committed. |
37 void didCommitFrameToCompositor(); | 37 void didCommitFrameToCompositor(); |
38 | 38 |
39 // The following entrypoints are used to schedule different types of tasks | 39 // The following entrypoints are used to schedule different types of tasks |
40 // to be run on the main thread. They can be called from any thread. | 40 // to be run on the main thread. They can be called from any thread. |
41 void postInputTask(const TraceLocation&, const Task&); | 41 void postInputTask(const TraceLocation&, const Task&); |
42 void postCompositorTask(const TraceLocation&, const Task&); | 42 void postCompositorTask(const TraceLocation&, const Task&); |
43 void postTask(const TraceLocation&, const Task&); // For generic (low priori
ty) tasks. | 43 void postTask(const TraceLocation&, const Task&); // For generic (low priori
ty) tasks. |
44 void postIdleTask(const TraceLocation&, const IdleTask&); // For non-critica
l tasks which may be reordered relative to other task types. | 44 void postIdleTask(const TraceLocation&, const IdleTask&); // For non-critica
l tasks which may be reordered relative to other task types. |
45 | 45 |
| 46 // Tells the scheduler that the system received an input event. This causes
the scheduler to go into |
| 47 // Compositor Priority mode for a short duration. |
| 48 void didReceiveInputEvent(); |
| 49 |
46 // Returns true if there is high priority work pending on the main thread | 50 // Returns true if there is high priority work pending on the main thread |
47 // and the caller should yield to let the scheduler service that work. | 51 // and the caller should yield to let the scheduler service that work. |
48 // Can be called on any thread. | 52 // Can be called on any thread. |
49 bool shouldYieldForHighPriorityWork() const; | 53 bool shouldYieldForHighPriorityWork() const; |
50 | 54 |
51 // The shared timer can be used to schedule a periodic callback which may | 55 // The shared timer can be used to schedule a periodic callback which may |
52 // get preempted by higher priority work. | 56 // get preempted by higher priority work. |
53 void setSharedTimerFiredFunction(void (*function)()); | 57 void setSharedTimerFiredFunction(void (*function)()); |
54 void setSharedTimerFireInterval(double); | 58 void setSharedTimerFireInterval(double); |
55 void stopSharedTimer(); | 59 void stopSharedTimer(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 volatile int m_highPriorityTaskCount; | 137 volatile int m_highPriorityTaskCount; |
134 bool m_highPriorityTaskRunnerPosted; | 138 bool m_highPriorityTaskRunnerPosted; |
135 | 139 |
136 // Don't access m_schedulerPolicy directly, use enterSchedulerPolicyLocked a
nd SchedulerPolicy instead. | 140 // Don't access m_schedulerPolicy directly, use enterSchedulerPolicyLocked a
nd SchedulerPolicy instead. |
137 volatile int m_schedulerPolicy; | 141 volatile int m_schedulerPolicy; |
138 }; | 142 }; |
139 | 143 |
140 } // namespace blink | 144 } // namespace blink |
141 | 145 |
142 #endif // Scheduler_h | 146 #endif // Scheduler_h |
OLD | NEW |