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 "wtf/Functional.h" | 9 #include "wtf/Functional.h" |
10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 class WebThread; | 13 class WebThread; |
14 } | 14 } |
15 | 15 |
16 namespace WebCore { | 16 namespace blink { |
17 | 17 |
18 // The scheduler is an opinionated gateway for arranging work to be run the | 18 // The scheduler is an opinionated gateway for arranging work to be run the |
19 // main thread. It decides which tasks get priority over others based on a | 19 // main thread. It decides which tasks get priority over others based on a |
20 // scheduling policy and the overall system state. | 20 // scheduling policy and the overall system state. |
21 class PLATFORM_EXPORT Scheduler { | 21 class PLATFORM_EXPORT Scheduler { |
22 WTF_MAKE_NONCOPYABLE(Scheduler); | 22 WTF_MAKE_NONCOPYABLE(Scheduler); |
23 public: | 23 public: |
24 typedef Function<void()> Task; | 24 typedef Function<void()> Task; |
25 | 25 |
26 static Scheduler* shared(); | 26 static Scheduler* shared(); |
(...skipping 25 matching lines...) Expand all Loading... |
52 | 52 |
53 static void sharedTimerAdapter(); | 53 static void sharedTimerAdapter(); |
54 void tickSharedTimer(); | 54 void tickSharedTimer(); |
55 | 55 |
56 static Scheduler* s_sharedScheduler; | 56 static Scheduler* s_sharedScheduler; |
57 blink::WebThread* m_mainThread; | 57 blink::WebThread* m_mainThread; |
58 | 58 |
59 void (*m_sharedTimerFunction)(); | 59 void (*m_sharedTimerFunction)(); |
60 }; | 60 }; |
61 | 61 |
62 } // namespace WebCore | 62 } // namespace blink |
63 | 63 |
64 #endif // Scheduler_h | 64 #endif // Scheduler_h |
OLD | NEW |