| 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 a navigation task is pending. While any navigation | 131 // 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 | 132 // 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. | 133 // are not blocked even if they are expensive. Must be called on the main |
| 134 virtual void AddPendingNavigation() = 0; | 134 // thread. |
| 135 virtual void AddPendingNavigation(bool main_frame_navigating) = 0; |
| 135 | 136 |
| 136 // Tells the scheduler that a navigation task is no longer pending. | 137 // Tells the scheduler that a navigation task is no longer pending. |
| 137 // Must be called on the main thread. | 138 // Must be called on the main thread. |
| 138 virtual void RemovePendingNavigation() = 0; | 139 virtual void RemovePendingNavigation(bool main_frame_navigating) = 0; |
| 139 | 140 |
| 140 // Tells the scheduler that a navigation has started. The scheduler will | 141 // Tells the scheduler that a navigation has started. The scheduler will |
| 141 // prioritize loading tasks for a short duration afterwards. | 142 // prioritize loading tasks for a short duration afterwards. |
| 142 // Must be called from the main thread. | 143 // Must be called from the main thread. |
| 143 virtual void OnNavigationStarted() = 0; | 144 virtual void OnNavigationStarted() = 0; |
| 144 | 145 |
| 145 // Returns true if the scheduler has reason to believe that high priority work | 146 // 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 | 147 // may soon arrive on the main thread, e.g., if gesture events were observed |
| 147 // recently. | 148 // recently. |
| 148 // Must be called from the main thread. | 149 // Must be called from the main thread. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 166 base::trace_event::BlameContext* blame_context) = 0; | 167 base::trace_event::BlameContext* blame_context) = 0; |
| 167 | 168 |
| 168 protected: | 169 protected: |
| 169 RendererScheduler(); | 170 RendererScheduler(); |
| 170 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 171 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 171 }; | 172 }; |
| 172 | 173 |
| 173 } // namespace scheduler | 174 } // namespace scheduler |
| 174 | 175 |
| 175 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 176 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |