| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // prioritize loading tasks for a short duration afterwards. | 152 // prioritize loading tasks for a short duration afterwards. |
| 153 // Must be called from the main thread. | 153 // Must be called from the main thread. |
| 154 virtual void OnNavigationStarted() = 0; | 154 virtual void OnNavigationStarted() = 0; |
| 155 | 155 |
| 156 // Returns true if the scheduler has reason to believe that high priority work | 156 // Returns true if the scheduler has reason to believe that high priority work |
| 157 // may soon arrive on the main thread, e.g., if gesture events were observed | 157 // may soon arrive on the main thread, e.g., if gesture events were observed |
| 158 // recently. | 158 // recently. |
| 159 // Must be called from the main thread. | 159 // Must be called from the main thread. |
| 160 virtual bool IsHighPriorityWorkAnticipated() = 0; | 160 virtual bool IsHighPriorityWorkAnticipated() = 0; |
| 161 | 161 |
| 162 // Suspends the timer queue and increments the timer queue suspension count. | 162 // Suspends the timer queues and increments the timer queue suspension count. |
| 163 // May only be called from the main thread. | 163 // May only be called from the main thread. |
| 164 virtual void SuspendTimerQueue() = 0; | 164 virtual void SuspendTimerQueue() = 0; |
| 165 | 165 |
| 166 // Decrements the timer queue suspension count and re-enables the timer queue | 166 // Decrements the timer queue suspension count and re-enables the timer queues |
| 167 // if the suspension count is zero and the current schduler policy allows it. | 167 // if the suspension count is zero and the current schduler policy allows it. |
| 168 virtual void ResumeTimerQueue() = 0; | 168 virtual void ResumeTimerQueue() = 0; |
| 169 | 169 |
| 170 // Suspends the timer queues by inserting a fence that blocks any tasks posted |
| 171 // after this point from running. Orthogonal to SuspendTimerQueue. Care must |
| 172 // be taken when using this API to avoid fighting with the TaskQueueThrottler. |
| 173 virtual void InsertTimerFence() = 0; |
| 174 |
| 175 // Removes the fence added by InsertTimerFence allowing timers to execute |
| 176 // normally. Care must be taken when using this API to avoid fighting with the |
| 177 // TaskQueueThrottler. |
| 178 virtual void RemoveTimerFence() = 0; |
| 179 |
| 170 // Sets whether to allow suspension of timers after the backgrounded signal is | 180 // Sets whether to allow suspension of timers after the backgrounded signal is |
| 171 // received via OnRendererBackgrounded. Defaults to disabled. | 181 // received via OnRendererBackgrounded. Defaults to disabled. |
| 172 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; | 182 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; |
| 173 | 183 |
| 174 // Sets the default blame context to which top level work should be | 184 // Sets the default blame context to which top level work should be |
| 175 // attributed in this renderer. |blame_context| must outlive this scheduler. | 185 // attributed in this renderer. |blame_context| must outlive this scheduler. |
| 176 virtual void SetTopLevelBlameContext( | 186 virtual void SetTopLevelBlameContext( |
| 177 base::trace_event::BlameContext* blame_context) = 0; | 187 base::trace_event::BlameContext* blame_context) = 0; |
| 178 | 188 |
| 179 // The renderer scheduler maintains an estimated RAIL mode[1]. This observer | 189 // The renderer scheduler maintains an estimated RAIL mode[1]. This observer |
| (...skipping 11 matching lines...) Expand all Loading... |
| 191 | 201 |
| 192 protected: | 202 protected: |
| 193 RendererScheduler(); | 203 RendererScheduler(); |
| 194 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 204 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 195 }; | 205 }; |
| 196 | 206 |
| 197 } // namespace scheduler | 207 } // namespace scheduler |
| 198 } // namespace blink | 208 } // namespace blink |
| 199 | 209 |
| 200 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ | 210 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ |
| OLD | NEW |