diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 05:03:15 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 05:03:15 +0000 |
commit | ccc00504d4d31bd51b3120d207d14eb8942c4f6d (patch) | |
tree | 1475aa5395f53ae2542395bfa11af38d494f7243 /net | |
parent | 9d65ad87c64ec57473b42ed290472ddec99e55c6 (diff) | |
download | chromium_src-ccc00504d4d31bd51b3120d207d14eb8942c4f6d.zip chromium_src-ccc00504d4d31bd51b3120d207d14eb8942c4f6d.tar.gz chromium_src-ccc00504d4d31bd51b3120d207d14eb8942c4f6d.tar.bz2 |
Revert r18683: "Add more CHECKs to ClientSocketPoolBase."
Looks like it might have broken block-test.html somehow.
Review URL: http://codereview.chromium.org/131020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/tcp_client_socket_pool.cc | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/net/base/tcp_client_socket_pool.cc b/net/base/tcp_client_socket_pool.cc index c4b97b8..b8bb5c6 100644 --- a/net/base/tcp_client_socket_pool.cc +++ b/net/base/tcp_client_socket_pool.cc @@ -186,7 +186,6 @@ int ClientSocketPoolBase::RequestSocket( handle->set_socket(idle_socket.socket); handle->set_is_reused(true); group.sockets_handed_out_count++; - CHECK(group.sockets_handed_out_count <= group.active_socket_count); CheckSocketCounts(group); return OK; } @@ -213,7 +212,6 @@ int ClientSocketPoolBase::RequestSocket( void ClientSocketPoolBase::CancelRequest(const std::string& group_name, const ClientSocketHandle* handle) { - CHECK(handle); CHECK(ContainsKey(group_map_, group_name)); Group& group = group_map_[group_name]; @@ -233,21 +231,19 @@ void ClientSocketPoolBase::CancelRequest(const std::string& group_name, CHECK(ContainsKey(group.connecting_requests, handle)); RequestMap::iterator map_it = group.connecting_requests.find(handle); - RemoveConnectingSocket(handle); + if (map_it != group.connecting_requests.end()) { + RemoveConnectingSocket(handle); - CheckSocketCounts(group); - group.connecting_requests.erase(map_it); - group.active_socket_count--; - CheckSocketCounts(group); + group.connecting_requests.erase(map_it); + group.active_socket_count--; - // Delete group if no longer needed. - if (group.active_socket_count == 0 && group.idle_sockets.empty()) { - CHECK(group.pending_requests.empty()); - CHECK(group.sockets_handed_out_count == 0); - CHECK(group.connecting_requests.size() == 0); - CHECK(group.connecting_requests.empty()); - group_map_.erase(group_name); - return; + // Delete group if no longer needed. + if (group.active_socket_count == 0 && group.idle_sockets.empty()) { + CHECK(group.pending_requests.empty()); + CHECK(group.connecting_requests.empty()); + group_map_.erase(group_name); + return; + } } CheckSocketCounts(group); @@ -374,7 +370,6 @@ void ClientSocketPoolBase::DoReleaseSocket(const std::string& group_name, group.active_socket_count--; group.sockets_handed_out_count--; - CHECK(group.sockets_handed_out_count >= 0); const bool can_reuse = socket->IsConnectedAndIdle(); if (can_reuse) { @@ -464,7 +459,6 @@ CompletionCallback* ClientSocketPoolBase::OnConnectingRequestComplete( request.handle->set_socket(socket); request.handle->set_is_reused(false); group.sockets_handed_out_count++; - CHECK(group.sockets_handed_out_count <= group.active_socket_count); CheckSocketCounts(group); } |