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

Side by Side Diff: net/base/client_socket_pool.h

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, 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 unified diff | Download patch
« no previous file with comments | « net/base/client_socket_handle.h ('k') | net/base/client_socket_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_BASE_CLIENT_SOCKET_POOL_H_
6 #define NET_BASE_CLIENT_SOCKET_POOL_H_ 6 #define NET_BASE_CLIENT_SOCKET_POOL_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 void ReleaseSocket(ClientSocketHandle* handle); 66 void ReleaseSocket(ClientSocketHandle* handle);
67 67
68 // Called to close any idle connections held by the connection manager. 68 // Called to close any idle connections held by the connection manager.
69 void CloseIdleSockets(); 69 void CloseIdleSockets();
70 70
71 // The total number of idle sockets in the pool. 71 // The total number of idle sockets in the pool.
72 int idle_socket_count() const { 72 int idle_socket_count() const {
73 return idle_socket_count_; 73 return idle_socket_count_;
74 } 74 }
75 75
76 // The total number of idle sockets in a connection group.
77 int IdleSocketCountInGroup(const std::string& group_name) const;
78
76 private: 79 private:
77 friend class base::RefCounted<ClientSocketPool>; 80 friend class base::RefCounted<ClientSocketPool>;
78 81
79 typedef scoped_ptr<ClientSocket> ClientSocketPtr; 82 typedef scoped_ptr<ClientSocket> ClientSocketPtr;
80 83
81 // A Request is allocated per call to RequestSocket that results in 84 // A Request is allocated per call to RequestSocket that results in
82 // ERR_IO_PENDING. 85 // ERR_IO_PENDING.
83 struct Request { 86 struct Request {
84 ClientSocketHandle* handle; 87 ClientSocketHandle* handle;
85 CompletionCallback* callback; 88 CompletionCallback* callback;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 150
148 // The maximum number of sockets kept per group. 151 // The maximum number of sockets kept per group.
149 int max_sockets_per_group_; 152 int max_sockets_per_group_;
150 153
151 DISALLOW_COPY_AND_ASSIGN(ClientSocketPool); 154 DISALLOW_COPY_AND_ASSIGN(ClientSocketPool);
152 }; 155 };
153 156
154 } // namespace net 157 } // namespace net
155 158
156 #endif // NET_BASE_CLIENT_SOCKET_POOL_H_ 159 #endif // NET_BASE_CLIENT_SOCKET_POOL_H_
OLDNEW
« no previous file with comments | « net/base/client_socket_handle.h ('k') | net/base/client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698