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

Unified Diff: net/socket/client_socket_pool.h

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.cc ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool.h
diff --git a/net/socket/client_socket_pool.h b/net/socket/client_socket_pool.h
index c58e72d1421c706e1c76a01cfa5b111cc8ebcea3..e631980d70c70dbdb5914efe1d7b4da5f881b669 100644
--- a/net/socket/client_socket_pool.h
+++ b/net/socket/client_socket_pool.h
@@ -67,9 +67,19 @@ class ClientSocketPool : public base::RefCounted<ClientSocketPool> {
// Called to release a socket once the socket is no longer needed. If the
// socket still has an established connection, then it will be added to the
// set of idle sockets to be used to satisfy future RequestSocket calls.
- // Otherwise, the ClientSocket is destroyed.
+ // Otherwise, the ClientSocket is destroyed. |id| is used to differentiate
+ // between updated versions of the same pool instance. The pool's id will
+ // change when it flushes, so it can use this |id| to discard sockets with
+ // mismatched ids.
virtual void ReleaseSocket(const std::string& group_name,
- ClientSocket* socket) = 0;
+ ClientSocket* socket,
+ int id) = 0;
+
+ // This flushes all state from the ClientSocketPool. This means that all
+ // idle and connecting sockets are discarded. Active sockets being
+ // held by ClientSocketPool clients will be discarded when released back to
+ // the pool.
+ virtual void Flush() = 0;
// Called to close any idle connections held by the connection manager.
virtual void CloseIdleSockets() = 0;
« no previous file with comments | « net/socket/client_socket_handle.cc ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698