| 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 <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 "components/scheduler/child/child_scheduler.h" | 12 #include "components/scheduler/child/child_scheduler.h" |
| 13 #include "components/scheduler/child/single_thread_idle_task_runner.h" | 13 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
| 14 #include "components/scheduler/renderer/render_widget_scheduling_state.h" | 14 #include "components/scheduler/renderer/render_widget_scheduling_state.h" |
| 15 #include "components/scheduler/scheduler_export.h" | 15 #include "components/scheduler/scheduler_export.h" |
| 16 #include "third_party/WebKit/public/platform/WebScheduler.h" |
| 16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 17 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 namespace trace_event { | 20 namespace trace_event { |
| 20 class BlameContext; | 21 class BlameContext; |
| 21 } | 22 } |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace cc { | 25 namespace cc { |
| 25 struct BeginFrameArgs; | 26 struct BeginFrameArgs; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // driven by this process. A stricter condition than |OnRendererHidden()|, the | 122 // driven by this process. A stricter condition than |OnRendererHidden()|, the |
| 122 // process is assumed to be foregrounded when the scheduler is constructed. | 123 // process is assumed to be foregrounded when the scheduler is constructed. |
| 123 // Must be called on the main thread. | 124 // Must be called on the main thread. |
| 124 virtual void OnRendererBackgrounded() = 0; | 125 virtual void OnRendererBackgrounded() = 0; |
| 125 | 126 |
| 126 // Tells the scheduler that the renderer process has been foregrounded. | 127 // Tells the scheduler that the renderer process has been foregrounded. |
| 127 // This is the assumed state when the scheduler is constructed. | 128 // This is the assumed state when the scheduler is constructed. |
| 128 // Must be called on the main thread. | 129 // Must be called on the main thread. |
| 129 virtual void OnRendererForegrounded() = 0; | 130 virtual void OnRendererForegrounded() = 0; |
| 130 | 131 |
| 131 // Tells the scheduler that a navigation task is pending. While any navigation | 132 // Tells the scheduler that a navigation task is pending. While any main-frame |
| 132 // tasks are pending, the scheduler will ensure that loading tasks are not | 133 // navigation tasks are pending, the scheduler will ensure that loading tasks |
| 133 // blocked even if they are expensive. Must be called on the main thread. | 134 // are not blocked even if they are expensive. Must be called on the main |
| 134 virtual void AddPendingNavigation() = 0; | 135 // thread. |
| 136 virtual void AddPendingNavigation( |
| 137 blink::WebScheduler::NavigatingFrameType type) = 0; |
| 135 | 138 |
| 136 // Tells the scheduler that a navigation task is no longer pending. | 139 // Tells the scheduler that a navigation task is no longer pending. |
| 137 // Must be called on the main thread. | 140 // Must be called on the main thread. |
| 138 virtual void RemovePendingNavigation() = 0; | 141 virtual void RemovePendingNavigation( |
| 142 blink::WebScheduler::NavigatingFrameType type) = 0; |
| 139 | 143 |
| 140 // Tells the scheduler that a navigation has started. The scheduler will | 144 // Tells the scheduler that a navigation has started. The scheduler will |
| 141 // prioritize loading tasks for a short duration afterwards. | 145 // prioritize loading tasks for a short duration afterwards. |
| 142 // Must be called from the main thread. | 146 // Must be called from the main thread. |
| 143 virtual void OnNavigationStarted() = 0; | 147 virtual void OnNavigationStarted() = 0; |
| 144 | 148 |
| 145 // 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 |
| 146 // 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 |
| 147 // recently. | 151 // recently. |
| 148 // Must be called from the main thread. | 152 // Must be called from the main thread. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 166 base::trace_event::BlameContext* blame_context) = 0; | 170 base::trace_event::BlameContext* blame_context) = 0; |
| 167 | 171 |
| 168 protected: | 172 protected: |
| 169 RendererScheduler(); | 173 RendererScheduler(); |
| 170 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 174 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 171 }; | 175 }; |
| 172 | 176 |
| 173 } // namespace scheduler | 177 } // namespace scheduler |
| 174 | 178 |
| 175 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 179 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |