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 THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_H_ |
6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_H_ | 6 #define THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "public/platform/WebCommon.h" | 13 #include "public/platform/WebCommon.h" |
14 #include "public/platform/WebInputEvent.h" | |
15 #include "public/platform/WebInputEventResult.h" | 14 #include "public/platform/WebInputEventResult.h" |
16 #include "public/platform/WebScheduler.h" | |
17 #include "public/platform/scheduler/child/child_scheduler.h" | 15 #include "public/platform/scheduler/child/child_scheduler.h" |
18 #include "public/platform/scheduler/child/single_thread_idle_task_runner.h" | 16 #include "public/platform/scheduler/child/single_thread_idle_task_runner.h" |
19 #include "public/platform/scheduler/renderer/render_widget_scheduling_state.h" | 17 #include "public/platform/scheduler/renderer/render_widget_scheduling_state.h" |
20 #include "v8/include/v8.h" | 18 #include "v8/include/v8.h" |
21 | 19 |
22 namespace base { | 20 namespace base { |
23 namespace trace_event { | 21 namespace trace_event { |
24 class BlameContext; | 22 class BlameContext; |
25 } | 23 } |
26 } | 24 } |
27 | 25 |
28 namespace cc { | 26 namespace cc { |
29 struct BeginFrameArgs; | 27 struct BeginFrameArgs; |
30 } | 28 } |
31 | 29 |
32 namespace blink { | 30 namespace blink { |
33 class WebThread; | 31 class WebThread; |
| 32 class WebInputEvent; |
34 } | 33 } |
35 | 34 |
36 namespace blink { | 35 namespace blink { |
37 namespace scheduler { | 36 namespace scheduler { |
38 | 37 |
39 class RenderWidgetSchedulingState; | 38 class RenderWidgetSchedulingState; |
40 | 39 |
41 class BLINK_PLATFORM_EXPORT RendererScheduler : public ChildScheduler { | 40 class BLINK_PLATFORM_EXPORT RendererScheduler : public ChildScheduler { |
42 public: | 41 public: |
43 class BLINK_PLATFORM_EXPORT RAILModeObserver { | 42 class BLINK_PLATFORM_EXPORT RAILModeObserver { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // only be done when the renderer is backgrounded. The renderer will be | 122 // only be done when the renderer is backgrounded. The renderer will be |
124 // automatically resumed when foregrounded. | 123 // automatically resumed when foregrounded. |
125 virtual void SuspendRenderer() = 0; | 124 virtual void SuspendRenderer() = 0; |
126 | 125 |
127 // Tells the scheduler that the render process should be resumed. This can | 126 // Tells the scheduler that the render process should be resumed. This can |
128 // only be done when the renderer is suspended. TabManager (in the future, | 127 // only be done when the renderer is suspended. TabManager (in the future, |
129 // MemoryCoordinator) will suspend the renderer again if continuously | 128 // MemoryCoordinator) will suspend the renderer again if continuously |
130 // backgrounded. | 129 // backgrounded. |
131 virtual void ResumeRenderer() = 0; | 130 virtual void ResumeRenderer() = 0; |
132 | 131 |
| 132 enum class NavigatingFrameType { kMainFrame, kChildFrame }; |
| 133 |
133 // Tells the scheduler that a navigation task is pending. While any main-frame | 134 // Tells the scheduler that a navigation task is pending. While any main-frame |
134 // navigation tasks are pending, the scheduler will ensure that loading tasks | 135 // navigation tasks are pending, the scheduler will ensure that loading tasks |
135 // are not blocked even if they are expensive. Must be called on the main | 136 // are not blocked even if they are expensive. Must be called on the main |
136 // thread. | 137 // thread. |
137 virtual void AddPendingNavigation(WebScheduler::NavigatingFrameType type) = 0; | 138 virtual void AddPendingNavigation(NavigatingFrameType type) = 0; |
138 | 139 |
139 // Tells the scheduler that a navigation task is no longer pending. | 140 // Tells the scheduler that a navigation task is no longer pending. |
140 // Must be called on the main thread. | 141 // Must be called on the main thread. |
141 virtual void RemovePendingNavigation( | 142 virtual void RemovePendingNavigation(NavigatingFrameType type) = 0; |
142 WebScheduler::NavigatingFrameType type) = 0; | |
143 | 143 |
144 // Tells the scheduler that a navigation has started. The scheduler will | 144 // Tells the scheduler that a navigation has started. The scheduler will |
145 // prioritize loading tasks for a short duration afterwards. | 145 // prioritize loading tasks for a short duration afterwards. |
146 // Must be called from the main thread. | 146 // Must be called from the main thread. |
147 virtual void OnNavigationStarted() = 0; | 147 virtual void OnNavigationStarted() = 0; |
148 | 148 |
149 // Returns true if the scheduler has reason to believe that high priority work | 149 // Returns true if the scheduler has reason to believe that high priority work |
150 // may soon arrive on the main thread, e.g., if gesture events were observed | 150 // may soon arrive on the main thread, e.g., if gesture events were observed |
151 // recently. | 151 // recently. |
152 // Must be called from the main thread. | 152 // Must be called from the main thread. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 protected: | 185 protected: |
186 RendererScheduler(); | 186 RendererScheduler(); |
187 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 187 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace scheduler | 190 } // namespace scheduler |
191 } // namespace blink | 191 } // namespace blink |
192 | 192 |
193 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ | 193 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ |
OLD | NEW |