| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // driven by this process. A stricter condition than |OnRendererHidden()|, the | 120 // driven by this process. A stricter condition than |OnRendererHidden()|, the |
| 121 // process is assumed to be foregrounded when the scheduler is constructed. | 121 // process is assumed to be foregrounded when the scheduler is constructed. |
| 122 // Must be called on the main thread. | 122 // Must be called on the main thread. |
| 123 virtual void OnRendererBackgrounded() = 0; | 123 virtual void OnRendererBackgrounded() = 0; |
| 124 | 124 |
| 125 // Tells the scheduler that the renderer process has been foregrounded. | 125 // Tells the scheduler that the renderer process has been foregrounded. |
| 126 // This is the assumed state when the scheduler is constructed. | 126 // This is the assumed state when the scheduler is constructed. |
| 127 // Must be called on the main thread. | 127 // Must be called on the main thread. |
| 128 virtual void OnRendererForegrounded() = 0; | 128 virtual void OnRendererForegrounded() = 0; |
| 129 | 129 |
| 130 // Tells the scheduler that the renderer process has started playing audio |
| 131 // Must be called on main thread. |
| 132 virtual void OnAudioStarted() = 0; |
| 133 |
| 134 // Tells the scheduler that the renderer process has stopped playing audio. |
| 135 // Must be called on main thread. |
| 136 virtual void OnAudioStopped() = 0; |
| 137 |
| 130 // Tells the scheduler that the render process should be suspended. This can | 138 // Tells the scheduler that the render process should be suspended. This can |
| 131 // only be done when the renderer is backgrounded. The renderer will be | 139 // only be done when the renderer is backgrounded. The renderer will be |
| 132 // automatically resumed when foregrounded. | 140 // automatically resumed when foregrounded. |
| 133 virtual void SuspendRenderer() = 0; | 141 virtual void SuspendRenderer() = 0; |
| 134 | 142 |
| 135 // Tells the scheduler that a navigation task is pending. While any main-frame | 143 // Tells the scheduler that a navigation task is pending. While any main-frame |
| 136 // navigation tasks are pending, the scheduler will ensure that loading tasks | 144 // navigation tasks are pending, the scheduler will ensure that loading tasks |
| 137 // are not blocked even if they are expensive. Must be called on the main | 145 // are not blocked even if they are expensive. Must be called on the main |
| 138 // thread. | 146 // thread. |
| 139 virtual void AddPendingNavigation(WebScheduler::NavigatingFrameType type) = 0; | 147 virtual void AddPendingNavigation(WebScheduler::NavigatingFrameType type) = 0; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 188 |
| 181 protected: | 189 protected: |
| 182 RendererScheduler(); | 190 RendererScheduler(); |
| 183 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 191 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 184 }; | 192 }; |
| 185 | 193 |
| 186 } // namespace scheduler | 194 } // namespace scheduler |
| 187 } // namespace blink | 195 } // namespace blink |
| 188 | 196 |
| 189 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ | 197 #endif // THIRD_PARTY_WEBKIT_PUBLIC_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_H_ |
| OLD | NEW |