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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 1091793002: Report the connect status of the oldest connection in the socket pool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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 0bc0056b8355a6fd2c5a3936dee61222a27076f5..1e92d14c01fe63c042a57c1b5b57303487f45efa 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -572,13 +572,11 @@ LoadState ClientSocketPoolBaseHelper::GetLoadState(
const Group& group = *group_it->second;
if (group.HasConnectJobForHandle(handle)) {
- // Just return the state of the farthest along ConnectJob for the first
- // group.jobs().size() pending requests.
- LoadState max_state = LOAD_STATE_IDLE;
- for (const auto& job : group.jobs()) {
- max_state = std::max(max_state, job->GetLoadState());
- }
- return max_state;
+ // Instead of going through all the states in the underlying protocol
+ // levels, just return the state of the oldest connect job, which is the
+ // first in the set since the connect jobs are sorted in ascending order
+ // by time.
+ return (*group.jobs().begin())->GetLoadState();
}
if (group.CanUseAdditionalSocketSlot(max_sockets_per_group_))

Powered by Google App Engine
This is Rietveld 408576698