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

Unified Diff: net/socket/client_socket_pool_base.h

Issue 2678353003: Close idle H2 sockets when SpdySession is initialized. (Closed)
Patch Set: Self Created 3 years, 10 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
Index: net/socket/client_socket_pool_base.h
diff --git a/net/socket/client_socket_pool_base.h b/net/socket/client_socket_pool_base.h
index f221f8e330ca39fbf575832ae7a5f73d2d2794bf..d676153040af4814661051be542da6140af02d09 100644
--- a/net/socket/client_socket_pool_base.h
+++ b/net/socket/client_socket_pool_base.h
@@ -288,6 +288,9 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
// See ClientSocketPool::CloseIdleSockets for documentation on this function.
void CloseIdleSockets();
+ // See ClientSocketPool::CloseIdleSocketsInGroup for documentation.
+ void CloseIdleSocketsInGroup(const std::string& group_name);
+
// See ClientSocketPool::IdleSocketCount() for documentation on this function.
int idle_socket_count() const {
return idle_socket_count_;
@@ -527,6 +530,13 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
typedef std::map<const ClientSocketHandle*, CallbackResultPair>
PendingCallbackMap;
+ // Closes all idle sockets in |group| if |force| is true. Else, only closes
+ // idle sockets in |group| that timed out with respect to |now| or can't be
+ // reused.
+ void CleanupIdleSocketsInGroup(bool force,
+ Group* group,
+ const base::TimeTicks& now);
+
Group* GetOrCreateGroup(const std::string& group_name);
void RemoveGroup(const std::string& group_name);
void RemoveGroup(GroupMap::iterator it);
@@ -790,6 +800,10 @@ class ClientSocketPoolBase {
void CloseIdleSockets() { return helper_.CloseIdleSockets(); }
+ void CloseIdleSocketsInGroup(const std::string& group_name) {
+ return helper_.CloseIdleSocketsInGroup(group_name);
+ }
+
int idle_socket_count() const { return helper_.idle_socket_count(); }
int IdleSocketCountInGroup(const std::string& group_name) const {

Powered by Google App Engine
This is Rietveld 408576698