diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 18:22:24 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 18:22:24 +0000 |
commit | a7e38577aab81d13d9fc1dff5a8b6fe164ed2102 (patch) | |
tree | 03c3e30bd44f33a4317bbe5606f9c0e40c27ce40 /net/socket/client_socket_handle.cc | |
parent | b846acde84543772099763542d9411eacbe684f9 (diff) | |
download | chromium_src-a7e38577aab81d13d9fc1dff5a8b6fe164ed2102.zip chromium_src-a7e38577aab81d13d9fc1dff5a8b6fe164ed2102.tar.gz chromium_src-a7e38577aab81d13d9fc1dff5a8b6fe164ed2102.tar.bz2 |
Do not attempt to reuse active sockets after a socket pool flush (usually a network change).
Implements this functionality by adding an |id_| field to ClientSocketPoolBaseHelper that is incremented on each Flush().
BUG=45872
Review URL: http://codereview.chromium.org/2647003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_handle.cc')
-rw-r--r-- | net/socket/client_socket_handle.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc index 4f61a68..4adae02 100644 --- a/net/socket/client_socket_handle.cc +++ b/net/socket/client_socket_handle.cc @@ -37,7 +37,7 @@ void ClientSocketHandle::ResetInternal(bool cancel) { if (pool_) // If we've still got a socket, release it back to the ClientSocketPool so // it can be deleted or reused. - pool_->ReleaseSocket(group_name_, release_socket()); + pool_->ReleaseSocket(group_name_, release_socket(), pool_id_); } else if (cancel) { // If we did not get initialized yet, so we've got a socket request pending. // Cancel it. @@ -50,6 +50,7 @@ void ClientSocketHandle::ResetInternal(bool cancel) { idle_time_ = base::TimeDelta(); init_time_ = base::TimeTicks(); setup_time_ = base::TimeDelta(); + pool_id_ = -1; } LoadState ClientSocketHandle::GetLoadState() const { @@ -75,6 +76,7 @@ void ClientSocketHandle::HandleInitCompletion(int result) { ResetInternal(false); // The request failed, so there's nothing to cancel. return; } + CHECK_NE(-1, pool_id_) << "Pool should have set |pool_id_| to a valid value."; setup_time_ = base::TimeTicks::Now() - init_time_; scoped_refptr<ClientSocketPoolHistograms> histograms = pool_->histograms(); |