| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // driven by this process. A stricter condition than |OnRendererHidden()|, the | 121 // driven by this process. A stricter condition than |OnRendererHidden()|, the |
| 122 // process is assumed to be foregrounded when the scheduler is constructed. | 122 // process is assumed to be foregrounded when the scheduler is constructed. |
| 123 // Must be called on the main thread. | 123 // Must be called on the main thread. |
| 124 virtual void OnRendererBackgrounded() = 0; | 124 virtual void OnRendererBackgrounded() = 0; |
| 125 | 125 |
| 126 // Tells the scheduler that the renderer process has been foregrounded. | 126 // Tells the scheduler that the renderer process has been foregrounded. |
| 127 // This is the assumed state when the scheduler is constructed. | 127 // This is the assumed state when the scheduler is constructed. |
| 128 // Must be called on the main thread. | 128 // Must be called on the main thread. |
| 129 virtual void OnRendererForegrounded() = 0; | 129 virtual void OnRendererForegrounded() = 0; |
| 130 | 130 |
| 131 // Tells the scheduler that the render process should be suspended as long as |
| 132 // the renderer process is backgrounded. |
| 133 virtual void SuspendRendererWhenBackgrounded() = 0; |
| 134 |
| 131 // Tells the scheduler that a navigation task is pending. While any navigation | 135 // Tells the scheduler that a navigation task is pending. While any navigation |
| 132 // tasks are pending, the scheduler will ensure that loading tasks are not | 136 // tasks are pending, the scheduler will ensure that loading tasks are not |
| 133 // blocked even if they are expensive. Must be called on the main thread. | 137 // blocked even if they are expensive. Must be called on the main thread. |
| 134 virtual void AddPendingNavigation() = 0; | 138 virtual void AddPendingNavigation() = 0; |
| 135 | 139 |
| 136 // Tells the scheduler that a navigation task is no longer pending. | 140 // Tells the scheduler that a navigation task is no longer pending. |
| 137 // Must be called on the main thread. | 141 // Must be called on the main thread. |
| 138 virtual void RemovePendingNavigation() = 0; | 142 virtual void RemovePendingNavigation() = 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 |
| (...skipping 25 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 |