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

Unified Diff: trunk/src/net/socket/client_socket_pool_base.cc

Issue 47563006: Revert 232802 "[Net] Assert that URLRequests with LOAD_IGNORE_LI..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/net/socket/client_socket_pool_base.cc
===================================================================
--- trunk/src/net/socket/client_socket_pool_base.cc (revision 232831)
+++ trunk/src/net/socket/client_socket_pool_base.cc (working copy)
@@ -140,10 +140,7 @@
priority_(priority),
ignore_limits_(ignore_limits),
flags_(flags),
- net_log_(net_log) {
- if (ignore_limits_)
- DCHECK_EQ(priority_, MAXIMUM_PRIORITY);
-}
+ net_log_(net_log) {}
ClientSocketPoolBaseHelper::Request::~Request() {}
@@ -1134,7 +1131,9 @@
ClientSocketPoolBaseHelper::Group::Group()
: unassigned_job_count_(0),
- pending_requests_(NUM_PRIORITIES),
+ // The number of priorities is doubled since requests with
+ // |ignore_limits| are prioritized over other requests.
+ pending_requests_(2 * NUM_PRIORITIES),
active_socket_count_(0) {}
ClientSocketPoolBaseHelper::Group::~Group() {
@@ -1271,17 +1270,11 @@
void ClientSocketPoolBaseHelper::Group::InsertPendingRequest(
scoped_ptr<const Request> request) {
- // This value must be cached before we release |request|.
- RequestPriority priority = request->priority();
- if (request->ignore_limits()) {
- // Put requests with ignore_limits == true (which should have
- // priority == MAXIMUM_PRIORITY) ahead of other requests with
- // MAXIMUM_PRIORITY.
- DCHECK_EQ(priority, MAXIMUM_PRIORITY);
- pending_requests_.InsertAtFront(request.release(), priority);
- } else {
- pending_requests_.Insert(request.release(), priority);
- }
+ RequestQueue::Priority queue_priority = request->priority();
+ // Prioritize requests with |ignore_limits| over ones that don't.
+ if (request->ignore_limits())
+ queue_priority += NUM_PRIORITIES;
+ pending_requests_.Insert(request.release(), queue_priority);
}
scoped_ptr<const ClientSocketPoolBaseHelper::Request>
« no previous file with comments | « trunk/src/net/proxy/proxy_script_fetcher_impl.cc ('k') | trunk/src/net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698