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 low latency mode for a little while. |
| 47 void didReceiveInputEvent(); |
| 48 |
46 // Returns true if we're in low latency mode and there is high priority work
pending on the | 49 // Returns true if we're in low latency mode and there is high priority work
pending on the |
47 // main thread and the caller should yield to let the scheduler service that
work. | 50 // main thread and the caller should yield to let the scheduler service that
work. |
48 // Can be called on any thread. | 51 // Can be called on any thread. |
49 bool shouldYieldForHighPriorityWork() const; | 52 bool shouldYieldForHighPriorityWork() const; |
50 | 53 |
51 // The shared timer can be used to schedule a periodic callback which may | 54 // The shared timer can be used to schedule a periodic callback which may |
52 // get preempted by higher priority work. | 55 // get preempted by higher priority work. |
53 void setSharedTimerFiredFunction(void (*function)()); | 56 void setSharedTimerFiredFunction(void (*function)()); |
54 void setSharedTimerFireInterval(double); | 57 void setSharedTimerFireInterval(double); |
55 void stopSharedTimer(); | 58 void stopSharedTimer(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 volatile int m_latencyMode; | 128 volatile int m_latencyMode; |
126 double m_lowLatencyModeEndTimeSeconds; | 129 double m_lowLatencyModeEndTimeSeconds; |
127 | 130 |
128 // The time we should stay in low latency mode for after a touch event. | 131 // The time we should stay in low latency mode for after a touch event. |
129 static double s_lowLatencyModeAfterTouchTimeSeconds; | 132 static double s_lowLatencyModeAfterTouchTimeSeconds; |
130 }; | 133 }; |
131 | 134 |
132 } // namespace blink | 135 } // namespace blink |
133 | 136 |
134 #endif // Scheduler_h | 137 #endif // Scheduler_h |
OLD | NEW |