summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool_base.cc
diff options
context:
space:
mode:
authorvandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 18:11:13 +0000
committervandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 18:11:13 +0000
commite772db3f04f1079a07d702c6aa4e0394f2147af9 (patch)
treeedfe7bec726506679a8163fb4fd207287c8df77d /net/socket/client_socket_pool_base.cc
parent1e89e05c0bae9404547e95b86cce02d233706f28 (diff)
downloadchromium_src-e772db3f04f1079a07d702c6aa4e0394f2147af9.zip
chromium_src-e772db3f04f1079a07d702c6aa4e0394f2147af9.tar.gz
chromium_src-e772db3f04f1079a07d702c6aa4e0394f2147af9.tar.bz2
Put HttpProxyClientSocket into a pool.
This CL requires http://codereview.chromium.org/2799036 - Cleanup the HttpProxyClientSocket interface a touch. - Make HttpAuthController reference counted. - Enable ClientSocketPool to return recoverable connections. BUG=42795 TEST=existing unit tests Review URL: http://codereview.chromium.org/2817033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_pool_base.cc')
-rw-r--r--net/socket/client_socket_pool_base.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 0b26b75..7e5c24fc 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -257,6 +257,11 @@ int ClientSocketPoolBaseHelper::RequestSocketInternal(
group.jobs.insert(job);
} else {
LogBoundConnectJobToRequest(connect_job->net_log().source(), request);
+ ClientSocket* error_socket = connect_job->ReleaseSocket();
+ if (error_socket) {
+ HandOutSocket(error_socket, false /* not reused */, handle,
+ base::TimeDelta(), &group, request->net_log());
+ }
if (group.IsEmpty())
group_map_.erase(group_name);
}
@@ -605,16 +610,24 @@ void ClientSocketPoolBaseHelper::OnConnectJobComplete(
OnAvailableSocketSlot(group_name, MayHaveStalledGroups());
}
} else {
- DCHECK(!socket.get());
+ // If we got a socket, it must contain error information so pass that
+ // up so that the caller can retrieve it.
+ bool handed_out_socket = false;
if (!group.pending_requests.empty()) {
scoped_ptr<const Request> r(RemoveRequestFromQueue(
group.pending_requests.begin(), &group.pending_requests));
LogBoundConnectJobToRequest(job_log.source(), r.get());
+ if (socket.get()) {
+ handed_out_socket = true;
+ HandOutSocket(socket.release(), false /* unused socket */, r->handle(),
+ base::TimeDelta(), &group, r->net_log());
+ }
r->net_log().EndEvent(NetLog::TYPE_SOCKET_POOL,
new NetLogIntegerParameter("net_error", result));
r->callback()->Run(result);
}
- OnAvailableSocketSlot(group_name, MayHaveStalledGroups());
+ if (!handed_out_socket)
+ OnAvailableSocketSlot(group_name, MayHaveStalledGroups());
}
}