| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
| 6 #define CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Called when a renderer is destroyed. | 116 // Called when a renderer is destroyed. |
| 117 void OnClientDeleted(int child_id, int route_id); | 117 void OnClientDeleted(int child_id, int route_id); |
| 118 | 118 |
| 119 // Called when a renderer stops or restarts loading. | 119 // Called when a renderer stops or restarts loading. |
| 120 void OnLoadingStateChanged(int child_id, int route_id, bool is_loaded); | 120 void OnLoadingStateChanged(int child_id, int route_id, bool is_loaded); |
| 121 | 121 |
| 122 // Called when a Client is shown or hidden. | 122 // Called when a Client is shown or hidden. |
| 123 void OnVisibilityChanged(int child_id, int route_id, bool is_visible); | 123 void OnVisibilityChanged(int child_id, int route_id, bool is_visible); |
| 124 | 124 |
| 125 // Called when a Client starts or stops playing audio. |
| 126 void OnAudibilityChanged(int child_id, int route_id, bool is_audible); |
| 127 |
| 125 // Signals from IPC messages directly from the renderers: | 128 // Signals from IPC messages directly from the renderers: |
| 126 | 129 |
| 127 // Called when a client navigates to a new main document. | 130 // Called when a client navigates to a new main document. |
| 128 void OnNavigate(int child_id, int route_id); | 131 void OnNavigate(int child_id, int route_id); |
| 129 | 132 |
| 130 // Called when the client has parsed the <body> element. This is a signal that | 133 // Called when the client has parsed the <body> element. This is a signal that |
| 131 // resource loads won't interfere with first paint. | 134 // resource loads won't interfere with first paint. |
| 132 void OnWillInsertBody(int child_id, int route_id); | 135 void OnWillInsertBody(int child_id, int route_id); |
| 133 | 136 |
| 134 // Signals from the IO thread: | 137 // Signals from the IO thread: |
| 135 | 138 |
| 136 // Called when we received a response to a http request that was served | 139 // Called when we received a response to a http request that was served |
| 137 // from a proxy using SPDY. | 140 // from a proxy using SPDY. |
| 138 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); | 141 void OnReceivedSpdyProxiedHttpResponse(int child_id, int route_id); |
| 139 | 142 |
| 140 // Client functions: | 143 // Client functions: |
| 141 | 144 |
| 142 // Called to check if all user observable tabs have completed loading. | 145 // Called to check if all user observable tabs have completed loading. |
| 143 bool active_clients_loaded() const { return active_clients_loading_ == 0; } | 146 bool active_clients_loaded() const { return active_clients_loading_ == 0; } |
| 144 | 147 |
| 145 // Called when a Client starts or stops playing audio. | |
| 146 void OnAudibilityChanged(int child_id, int route_id, bool is_audible); | |
| 147 | |
| 148 bool IsClientVisibleForTesting(int child_id, int route_id); | 148 bool IsClientVisibleForTesting(int child_id, int route_id); |
| 149 | 149 |
| 150 private: | 150 private: |
| 151 class RequestQueue; | 151 class RequestQueue; |
| 152 class ScheduledResourceRequest; | 152 class ScheduledResourceRequest; |
| 153 struct RequestPriorityParams; | 153 struct RequestPriorityParams; |
| 154 struct ScheduledResourceSorter { | 154 struct ScheduledResourceSorter { |
| 155 bool operator()(const ScheduledResourceRequest* a, | 155 bool operator()(const ScheduledResourceRequest* a, |
| 156 const ScheduledResourceRequest* b) const; | 156 const ScheduledResourceRequest* b) const; |
| 157 }; | 157 }; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 size_t active_clients_loading_; | 207 size_t active_clients_loading_; |
| 208 size_t coalesced_clients_; | 208 size_t coalesced_clients_; |
| 209 // This is a repeating timer to initiate requests on COALESCED Clients. | 209 // This is a repeating timer to initiate requests on COALESCED Clients. |
| 210 scoped_ptr<base::Timer> coalescing_timer_; | 210 scoped_ptr<base::Timer> coalescing_timer_; |
| 211 RequestSet unowned_requests_; | 211 RequestSet unowned_requests_; |
| 212 }; | 212 }; |
| 213 | 213 |
| 214 } // namespace content | 214 } // namespace content |
| 215 | 215 |
| 216 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 216 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
| OLD | NEW |