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

Unified Diff: net/base/client_socket_pool.cc

Issue 99205: Add a histogram to measure the number of idle sockets when a TCP connection is established. (Closed)
Patch Set: Use a const ref (woops!) instead of copying a string. Add comments. Created 11 years, 8 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/base/client_socket_pool.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/client_socket_pool.cc
diff --git a/net/base/client_socket_pool.cc b/net/base/client_socket_pool.cc
index 651fbe275a75449cb09d23f8ed7a80f1649e4207..4171b0c3d07de2d76f4819675ec0c00cf7bf5a2a 100644
--- a/net/base/client_socket_pool.cc
+++ b/net/base/client_socket_pool.cc
@@ -122,6 +122,14 @@ void ClientSocketPool::CloseIdleSockets() {
CleanupIdleSockets(true);
}
+int ClientSocketPool::IdleSocketCountInGroup(
+ const std::string& group_name) const {
+ GroupMap::const_iterator i = group_map_.find(group_name);
+ DCHECK(i != group_map_.end());
+
+ return i->second.idle_sockets.size();
+}
+
bool ClientSocketPool::IdleSocket::ShouldCleanup(base::TimeTicks now) const {
bool timed_out = (now - start_time) >=
base::TimeDelta::FromSeconds(kIdleTimeout);
« no previous file with comments | « net/base/client_socket_pool.h ('k') | net/http/http_network_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698