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" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 virtual bool IsHighPriorityWorkAnticipated() = 0; | 164 virtual bool IsHighPriorityWorkAnticipated() = 0; |
165 | 165 |
166 // Suspends the timer queue and increments the timer queue suspension count. | 166 // Suspends the timer queue and increments the timer queue suspension count. |
167 // May only be called from the main thread. | 167 // May only be called from the main thread. |
168 virtual void SuspendTimerQueue() = 0; | 168 virtual void SuspendTimerQueue() = 0; |
169 | 169 |
170 // Decrements the timer queue suspension count and re-enables the timer queue | 170 // Decrements the timer queue suspension count and re-enables the timer queue |
171 // if the suspension count is zero and the current schduler policy allows it. | 171 // if the suspension count is zero and the current schduler policy allows it. |
172 virtual void ResumeTimerQueue() = 0; | 172 virtual void ResumeTimerQueue() = 0; |
173 | 173 |
174 // Sets whether to allow suspension of timers after the backgrounded signal is | |
175 // received via OnRendererBackgrounded. Defaults to disabled. | |
176 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; | |
177 | |
178 // Sets the default blame context to which top level work should be | 174 // Sets the default blame context to which top level work should be |
179 // attributed in this renderer. |blame_context| must outlive this scheduler. | 175 // attributed in this renderer. |blame_context| must outlive this scheduler. |
180 virtual void SetTopLevelBlameContext( | 176 virtual void SetTopLevelBlameContext( |
181 base::trace_event::BlameContext* blame_context) = 0; | 177 base::trace_event::BlameContext* blame_context) = 0; |
182 | 178 |
183 // The renderer scheduler maintains an estimated RAIL mode[1]. This observer | 179 // The renderer scheduler maintains an estimated RAIL mode[1]. This observer |
184 // can be used to get notified when the mode changes. The observer will be | 180 // can be used to get notified when the mode changes. The observer will be |
185 // called on the main thread and must outlive this class. | 181 // called on the main thread and must outlive this class. |
186 // [1] | 182 // [1] |
187 // https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-pe
rformance/rail | 183 // https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-pe
rformance/rail |
188 virtual void SetRAILModeObserver(RAILModeObserver* observer) = 0; | 184 virtual void SetRAILModeObserver(RAILModeObserver* observer) = 0; |
189 | 185 |
190 // Returns whether or not the main thread appears unresponsive, based on the | 186 // Returns whether or not the main thread appears unresponsive, based on the |
191 // length and frequency of recent main thread tasks. To be called from the | 187 // length and frequency of recent main thread tasks. To be called from the |
192 // compositor thread. | 188 // compositor thread. |
193 virtual bool MainThreadSeemsUnresponsive() = 0; | 189 virtual bool MainThreadSeemsUnresponsive() = 0; |
194 | 190 |
195 protected: | 191 protected: |
196 RendererScheduler(); | 192 RendererScheduler(); |
197 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 193 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
198 }; | 194 }; |
199 | 195 |
200 } // namespace scheduler | 196 } // namespace scheduler |
201 } // namespace blink | 197 } // namespace blink |
202 | 198 |
203 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ | 199 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ |
OLD | NEW |