| 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" |
| 11 #include "components/scheduler/child/single_thread_idle_task_runner.h" | 11 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
| 12 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 12 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
| 13 #include "components/scheduler/scheduler_export.h" | 13 #include "components/scheduler/scheduler_export.h" |
| 14 #include "third_party/WebKit/public/web/WebInputEvent.h" | 14 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 15 | 15 |
| 16 namespace base { |
| 17 namespace trace_event { |
| 18 class BlameContext; |
| 19 } |
| 20 } |
| 21 |
| 16 namespace cc { | 22 namespace cc { |
| 17 struct BeginFrameArgs; | 23 struct BeginFrameArgs; |
| 18 } | 24 } |
| 19 | 25 |
| 20 namespace blink { | 26 namespace blink { |
| 27 class WebLocalFrame; |
| 21 class WebThread; | 28 class WebThread; |
| 22 } | 29 } |
| 23 | 30 |
| 24 namespace scheduler { | 31 namespace scheduler { |
| 25 | 32 |
| 26 class RenderWidgetSchedulingState; | 33 class RenderWidgetSchedulingState; |
| 27 | 34 |
| 28 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler { | 35 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler { |
| 29 public: | 36 public: |
| 30 ~RendererScheduler() override; | 37 ~RendererScheduler() override; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 virtual void SuspendTimerQueue() = 0; | 151 virtual void SuspendTimerQueue() = 0; |
| 145 | 152 |
| 146 // Decrements the timer queue suspension count and re-enables the timer queue | 153 // Decrements the timer queue suspension count and re-enables the timer queue |
| 147 // if the suspension count is zero and the current schduler policy allows it. | 154 // if the suspension count is zero and the current schduler policy allows it. |
| 148 virtual void ResumeTimerQueue() = 0; | 155 virtual void ResumeTimerQueue() = 0; |
| 149 | 156 |
| 150 // Sets whether to allow suspension of timers after the backgrounded signal is | 157 // Sets whether to allow suspension of timers after the backgrounded signal is |
| 151 // received via OnRendererBackgrounded. Defaults to disabled. | 158 // received via OnRendererBackgrounded. Defaults to disabled. |
| 152 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; | 159 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; |
| 153 | 160 |
| 161 // Sets the default blame context to which top level work should be |
| 162 // attributed in this renderer. |blame_context| must outlive this scheduler. |
| 163 virtual void SetThreadBlameContext( |
| 164 base::trace_event::BlameContext* blame_context) = 0; |
| 165 |
| 154 protected: | 166 protected: |
| 155 RendererScheduler(); | 167 RendererScheduler(); |
| 156 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 168 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 157 }; | 169 }; |
| 158 | 170 |
| 159 } // namespace scheduler | 171 } // namespace scheduler |
| 160 | 172 |
| 161 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 173 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |