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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 bool limit_outstanding_requests() const { | 158 bool limit_outstanding_requests() const { |
159 return limit_outstanding_requests_; | 159 return limit_outstanding_requests_; |
160 } | 160 } |
161 | 161 |
162 // Returns the outstanding request limit. Only valid if | 162 // Returns the outstanding request limit. Only valid if |
163 // |IsLimitingOutstandingRequests()|. | 163 // |IsLimitingOutstandingRequests()|. |
164 size_t outstanding_request_limit() const { | 164 size_t outstanding_request_limit() const { |
165 return outstanding_request_limit_; | 165 return outstanding_request_limit_; |
166 } | 166 } |
167 | 167 |
168 // Returns the priority level above which resources are considered | |
169 // layout-blocking. | |
mmenke
2015/08/12 17:30:08
Suggesting adding something like "or high priority
Pat Meenan
2015/08/13 12:11:03
Done.
| |
170 net::RequestPriority layout_blocking_priority_threshold() const { | |
mmenke
2015/08/12 17:30:08
layout_blocking_or_high_priority_threshold (And sa
Pat Meenan
2015/08/13 12:11:03
Makes sense for this one but the others are really
| |
171 return layout_blocking_priority_threshold_; | |
172 } | |
173 | |
174 // Returns true if all delayable requests should be blocked while at least | |
175 // in_flight_layout_blocking_threshold() layout-blocking requests are | |
176 // in-flight during the layout-blocking phase of loading. | |
177 bool enable_layout_blocking_threshold() const { | |
178 return enable_layout_blocking_threshold_; | |
179 } | |
180 | |
181 // Returns the number of in-flight layout-blocking requests above which | |
182 // all delayable requests should be blocked when | |
183 // enable_layout_blocking_threshold is set. | |
184 size_t in_flight_layout_blocking_threshold() const { | |
185 return in_flight_layout_blocking_threshold_; | |
186 } | |
187 | |
188 // Returns the maximum number of delayable requests to allow be in-flight | |
189 // at any point in time while in the layout-blocking phase of loading. | |
190 size_t max_num_delayable_while_layout_blocking() const { | |
191 return max_num_delayable_while_layout_blocking_; | |
192 } | |
193 | |
194 // Returns the maximum number of delayable requests to all be in-flight at | |
195 // any point in time (across all hosts). | |
196 size_t max_num_delayable_requests() const { | |
197 return max_num_delayable_requests_; | |
198 } | |
199 | |
168 enum ClientState { | 200 enum ClientState { |
169 // Observable client. | 201 // Observable client. |
170 ACTIVE, | 202 ACTIVE, |
171 // Non-observable client. | 203 // Non-observable client. |
172 BACKGROUND, | 204 BACKGROUND, |
173 // No client found. | 205 // No client found. |
174 UNKNOWN, | 206 UNKNOWN, |
175 }; | 207 }; |
176 | 208 |
177 class RequestQueue; | 209 class RequestQueue; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 // Returns the client for the given |child_id| and |route_id| combo. | 263 // Returns the client for the given |child_id| and |route_id| combo. |
232 Client* GetClient(int child_id, int route_id); | 264 Client* GetClient(int child_id, int route_id); |
233 | 265 |
234 bool should_coalesce_; | 266 bool should_coalesce_; |
235 bool should_throttle_; | 267 bool should_throttle_; |
236 ClientMap client_map_; | 268 ClientMap client_map_; |
237 size_t active_clients_loading_; | 269 size_t active_clients_loading_; |
238 size_t coalesced_clients_; | 270 size_t coalesced_clients_; |
239 bool limit_outstanding_requests_; | 271 bool limit_outstanding_requests_; |
240 size_t outstanding_request_limit_; | 272 size_t outstanding_request_limit_; |
273 net::RequestPriority layout_blocking_priority_threshold_; | |
274 bool enable_layout_blocking_threshold_; | |
275 size_t in_flight_layout_blocking_threshold_; | |
276 size_t max_num_delayable_while_layout_blocking_; | |
277 size_t max_num_delayable_requests_; | |
241 // This is a repeating timer to initiate requests on COALESCED Clients. | 278 // This is a repeating timer to initiate requests on COALESCED Clients. |
242 scoped_ptr<base::Timer> coalescing_timer_; | 279 scoped_ptr<base::Timer> coalescing_timer_; |
243 RequestSet unowned_requests_; | 280 RequestSet unowned_requests_; |
244 }; | 281 }; |
245 | 282 |
246 } // namespace content | 283 } // namespace content |
247 | 284 |
248 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ | 285 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ |
OLD | NEW |