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 COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "components/scheduler/child/child_scheduler.h" | 10 #include "components/scheduler/child/child_scheduler.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace scheduler { | 24 namespace scheduler { |
25 | 25 |
26 class RenderWidgetSchedulingState; | 26 class RenderWidgetSchedulingState; |
27 | 27 |
28 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler { | 28 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler { |
29 public: | 29 public: |
30 ~RendererScheduler() override; | 30 ~RendererScheduler() override; |
31 static scoped_ptr<RendererScheduler> Create(); | 31 static scoped_ptr<RendererScheduler> Create(); |
32 | 32 |
33 // Returns the compositor task runner. | 33 // Returns the compositor task runner. |
34 virtual scoped_refptr<base::SingleThreadTaskRunner> | 34 virtual scoped_refptr<TaskQueue> CompositorTaskRunner() = 0; |
35 CompositorTaskRunner() = 0; | |
36 | 35 |
37 // Keep RendererScheduler::UseCaseToString in sync with this enum. | 36 // Keep RendererScheduler::UseCaseToString in sync with this enum. |
38 enum class UseCase { | 37 enum class UseCase { |
39 NONE, | 38 NONE, |
40 COMPOSITOR_GESTURE, | 39 COMPOSITOR_GESTURE, |
41 MAIN_THREAD_GESTURE, | 40 MAIN_THREAD_GESTURE, |
42 SYNCHRONIZED_GESTURE, // Both threads in the critical path. | 41 SYNCHRONIZED_GESTURE, // Both threads in the critical path. |
43 TOUCHSTART, | 42 TOUCHSTART, |
44 LOADING, | 43 LOADING, |
45 // Must be the last entry. | 44 // Must be the last entry. |
46 USE_CASE_COUNT, | 45 USE_CASE_COUNT, |
47 FIRST_USE_CASE = NONE, | 46 FIRST_USE_CASE = NONE, |
48 }; | 47 }; |
49 static const char* UseCaseToString(UseCase use_case); | 48 static const char* UseCaseToString(UseCase use_case); |
50 | 49 |
51 // Creates a WebThread implementation for the renderer main thread. | 50 // Creates a WebThread implementation for the renderer main thread. |
52 virtual scoped_ptr<blink::WebThread> CreateMainThread() = 0; | 51 virtual scoped_ptr<blink::WebThread> CreateMainThread() = 0; |
53 | 52 |
54 // Returns the loading task runner. This queue is intended for tasks related | 53 // Returns the loading task runner. This queue is intended for tasks related |
55 // to resource dispatch, foreground HTML parsing, etc... | 54 // to resource dispatch, foreground HTML parsing, etc... |
56 virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; | 55 virtual scoped_refptr<TaskQueue> LoadingTaskRunner() = 0; |
57 | 56 |
58 // Returns the timer task runner. This queue is intended for DOM Timers. | 57 // Returns the timer task runner. This queue is intended for DOM Timers. |
59 // TODO(alexclarke): Get rid of this default timer queue. | 58 // TODO(alexclarke): Get rid of this default timer queue. |
60 virtual scoped_refptr<TaskQueue> TimerTaskRunner() = 0; | 59 virtual scoped_refptr<TaskQueue> TimerTaskRunner() = 0; |
61 | 60 |
62 // Returns a new loading task runner. This queue is intended for tasks related | 61 // Returns a new loading task runner. This queue is intended for tasks related |
63 // to resource dispatch, foreground HTML parsing, etc... | 62 // to resource dispatch, foreground HTML parsing, etc... |
64 virtual scoped_refptr<TaskQueue> NewLoadingTaskRunner(const char* name) = 0; | 63 virtual scoped_refptr<TaskQueue> NewLoadingTaskRunner(const char* name) = 0; |
65 | 64 |
66 // Returns a new timer task runner. This queue is intended for DOM Timers. | 65 // Returns a new timer task runner. This queue is intended for DOM Timers. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 virtual double MonotonicallyIncreasingVirtualTimeSeconds() const = 0; | 164 virtual double MonotonicallyIncreasingVirtualTimeSeconds() const = 0; |
166 | 165 |
167 protected: | 166 protected: |
168 RendererScheduler(); | 167 RendererScheduler(); |
169 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 168 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
170 }; | 169 }; |
171 | 170 |
172 } // namespace scheduler | 171 } // namespace scheduler |
173 | 172 |
174 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 173 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
OLD | NEW |