Chromium Code Reviews| Index: net/socket/client_socket_pool_base.cc |
| diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc |
| index 46de10e810f7f8a5eaf45eeeeed495caa53fa8c9..de62a256c44d9f53a5b7ec3b720653ad4d387404 100644 |
| --- a/net/socket/client_socket_pool_base.cc |
| +++ b/net/socket/client_socket_pool_base.cc |
| @@ -140,7 +140,10 @@ ClientSocketPoolBaseHelper::Request::Request( |
| priority_(priority), |
| ignore_limits_(ignore_limits), |
| flags_(flags), |
| - net_log_(net_log) {} |
| + net_log_(net_log) { |
| + if (ignore_limits_) |
| + DCHECK_EQ(priority_, MAXIMUM_PRIORITY); |
| +} |
| ClientSocketPoolBaseHelper::Request::~Request() {} |
| @@ -1131,9 +1134,7 @@ void ClientSocketPoolBaseHelper::TryToCloseSocketsInLayeredPools() { |
| ClientSocketPoolBaseHelper::Group::Group() |
| : unassigned_job_count_(0), |
| - // The number of priorities is doubled since requests with |
| - // |ignore_limits| are prioritized over other requests. |
| - pending_requests_(2 * NUM_PRIORITIES), |
| + pending_requests_(NUM_PRIORITIES), |
| active_socket_count_(0) {} |
| ClientSocketPoolBaseHelper::Group::~Group() { |
| @@ -1270,11 +1271,9 @@ bool ClientSocketPoolBaseHelper::Group::HasConnectJobForHandle( |
| void ClientSocketPoolBaseHelper::Group::InsertPendingRequest( |
| scoped_ptr<const Request> request) { |
| - 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); |
| + // We must cache this value before we release |request|. |
| + RequestPriority priority = request->priority(); |
| + pending_requests_.Insert(request.release(), priority); |
|
mmenke
2013/10/30 15:54:59
Shouldn't we be calling InsertAtFront if ignore_li
akalin
2013/10/30 23:32:16
Done.
|
| } |
| scoped_ptr<const ClientSocketPoolBaseHelper::Request> |