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" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // driven by this process. A stricter condition than |OnRendererHidden()|, the | 122 // driven by this process. A stricter condition than |OnRendererHidden()|, the |
123 // process is assumed to be foregrounded when the scheduler is constructed. | 123 // process is assumed to be foregrounded when the scheduler is constructed. |
124 // Must be called on the main thread. | 124 // Must be called on the main thread. |
125 virtual void OnRendererBackgrounded() = 0; | 125 virtual void OnRendererBackgrounded() = 0; |
126 | 126 |
127 // Tells the scheduler that the renderer process has been foregrounded. | 127 // Tells the scheduler that the renderer process has been foregrounded. |
128 // This is the assumed state when the scheduler is constructed. | 128 // This is the assumed state when the scheduler is constructed. |
129 // Must be called on the main thread. | 129 // Must be called on the main thread. |
130 virtual void OnRendererForegrounded() = 0; | 130 virtual void OnRendererForegrounded() = 0; |
131 | 131 |
| 132 // Tells the scheduler that the render process should be suspended. This can |
| 133 // only be done when the renderer is backgrounded. The renderer will be |
| 134 // automatically resumed when foregrounded. |
| 135 virtual void SuspendRenderer() = 0; |
| 136 |
132 // Tells the scheduler that a navigation task is pending. While any main-frame | 137 // Tells the scheduler that a navigation task is pending. While any main-frame |
133 // navigation tasks are pending, the scheduler will ensure that loading tasks | 138 // navigation tasks are pending, the scheduler will ensure that loading tasks |
134 // are not blocked even if they are expensive. Must be called on the main | 139 // are not blocked even if they are expensive. Must be called on the main |
135 // thread. | 140 // thread. |
136 virtual void AddPendingNavigation( | 141 virtual void AddPendingNavigation( |
137 blink::WebScheduler::NavigatingFrameType type) = 0; | 142 blink::WebScheduler::NavigatingFrameType type) = 0; |
138 | 143 |
139 // Tells the scheduler that a navigation task is no longer pending. | 144 // Tells the scheduler that a navigation task is no longer pending. |
140 // Must be called on the main thread. | 145 // Must be called on the main thread. |
141 virtual void RemovePendingNavigation( | 146 virtual void RemovePendingNavigation( |
(...skipping 28 matching lines...) Expand all Loading... |
170 base::trace_event::BlameContext* blame_context) = 0; | 175 base::trace_event::BlameContext* blame_context) = 0; |
171 | 176 |
172 protected: | 177 protected: |
173 RendererScheduler(); | 178 RendererScheduler(); |
174 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 179 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
175 }; | 180 }; |
176 | 181 |
177 } // namespace scheduler | 182 } // namespace scheduler |
178 | 183 |
179 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 184 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
OLD | NEW |