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

Unified Diff: net/socket/client_socket_handle.cc

Issue 2647003: Do not attempt to reuse active sockets after a socket pool flush (usually a network change). (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Address eroman comments. Created 10 years, 7 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
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_handle.cc
diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc
index 4f61a68cbbe0dc296f764bdd2e9fe09f1b4e379d..4adae0254a005e128f48221ac8caf546881089c9 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();
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698