Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(914)

Side by Side Diff: content/browser/loader/resource_scheduler.h

Issue 1230133005: Fix Resource Priorities and Scheduling (Chrome Side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from review feedback Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 if the html_body has not started. It is also the threshold
170 // below which resources are considered delayable (and for completeness,
171 // a request that matches the threshold level is a high-priority but not
172 // layout-blocking request).
mmenke 2015/08/13 15:16:07 That's actually not true - "in_flight_layout_block
Pat Meenan 2015/08/13 20:56:42 Thanks - managed to confuse myself apparently. Ch
173 net::RequestPriority layout_blocking_or_high_priority_threshold() const {
174 return layout_blocking_or_high_priority_threshold_;
175 }
176
177 // Returns true if all delayable requests should be blocked while at least
178 // in_flight_layout_blocking_threshold() layout-blocking requests are
179 // in-flight during the layout-blocking phase of loading.
180 bool enable_in_flight_layout_blocking_threshold() const {
181 return enable_in_flight_layout_blocking_threshold_;
182 }
183
184 // Returns the number of in-flight layout-blocking requests above which
185 // all delayable requests should be blocked when
186 // enable_layout_blocking_threshold is set.
187 size_t in_flight_layout_blocking_threshold() const {
188 return in_flight_layout_blocking_threshold_;
189 }
190
191 // Returns the maximum number of delayable requests to allow be in-flight
192 // at any point in time while in the layout-blocking phase of loading.
193 size_t max_num_delayable_while_layout_blocking() const {
194 return max_num_delayable_while_layout_blocking_;
195 }
196
197 // Returns the maximum number of delayable requests to all be in-flight at
198 // any point in time (across all hosts).
199 size_t max_num_delayable_requests() const {
200 return max_num_delayable_requests_;
201 }
202
168 enum ClientState { 203 enum ClientState {
169 // Observable client. 204 // Observable client.
170 ACTIVE, 205 ACTIVE,
171 // Non-observable client. 206 // Non-observable client.
172 BACKGROUND, 207 BACKGROUND,
173 // No client found. 208 // No client found.
174 UNKNOWN, 209 UNKNOWN,
175 }; 210 };
176 211
177 class RequestQueue; 212 class RequestQueue;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Returns the client for the given |child_id| and |route_id| combo. 266 // Returns the client for the given |child_id| and |route_id| combo.
232 Client* GetClient(int child_id, int route_id); 267 Client* GetClient(int child_id, int route_id);
233 268
234 bool should_coalesce_; 269 bool should_coalesce_;
235 bool should_throttle_; 270 bool should_throttle_;
236 ClientMap client_map_; 271 ClientMap client_map_;
237 size_t active_clients_loading_; 272 size_t active_clients_loading_;
238 size_t coalesced_clients_; 273 size_t coalesced_clients_;
239 bool limit_outstanding_requests_; 274 bool limit_outstanding_requests_;
240 size_t outstanding_request_limit_; 275 size_t outstanding_request_limit_;
276 net::RequestPriority layout_blocking_or_high_priority_threshold_;
277 bool enable_in_flight_layout_blocking_threshold_;
278 size_t in_flight_layout_blocking_threshold_;
279 size_t max_num_delayable_while_layout_blocking_;
280 size_t max_num_delayable_requests_;
241 // This is a repeating timer to initiate requests on COALESCED Clients. 281 // This is a repeating timer to initiate requests on COALESCED Clients.
242 scoped_ptr<base::Timer> coalescing_timer_; 282 scoped_ptr<base::Timer> coalescing_timer_;
243 RequestSet unowned_requests_; 283 RequestSet unowned_requests_;
244 }; 284 };
245 285
246 } // namespace content 286 } // namespace content
247 287
248 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_ 288 #endif // CONTENT_BROWSER_LOADER_RESOURCE_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698