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

Side by Side Diff: net/socket/client_socket_pool_base.h

Issue 149545: Refactoring needed before adding good unit tests for limiting total socket count. (Closed)
Patch Set: fixes Created 11 years, 5 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 | « no previous file | net/socket/client_socket_pool_base_unittest.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_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 5 #ifndef NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 6 #define NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 void ReleaseSocket(const std::string& group_name, 143 void ReleaseSocket(const std::string& group_name,
144 ClientSocket* socket); 144 ClientSocket* socket);
145 145
146 void CloseIdleSockets(); 146 void CloseIdleSockets();
147 147
148 int idle_socket_count() const { 148 int idle_socket_count() const {
149 return idle_socket_count_; 149 return idle_socket_count_;
150 } 150 }
151 151
152 int max_sockets_per_group() const {
153 return max_sockets_per_group_;
154 }
155
152 int IdleSocketCountInGroup(const std::string& group_name) const; 156 int IdleSocketCountInGroup(const std::string& group_name) const;
153 157
154 LoadState GetLoadState(const std::string& group_name, 158 LoadState GetLoadState(const std::string& group_name,
155 const ClientSocketHandle* handle) const; 159 const ClientSocketHandle* handle) const;
156 160
157 virtual void OnConnectJobComplete(int result, ConnectJob* job); 161 virtual void OnConnectJobComplete(int result, ConnectJob* job);
158 162
159 private: 163 private:
160 // Entry for a persistent socket which became idle at time |start_time|. 164 // Entry for a persistent socket which became idle at time |start_time|.
161 struct IdleSocket { 165 struct IdleSocket {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 const int max_sockets_per_group_; 260 const int max_sockets_per_group_;
257 261
258 const scoped_ptr<ConnectJobFactory> connect_job_factory_; 262 const scoped_ptr<ConnectJobFactory> connect_job_factory_;
259 263
260 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); 264 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase);
261 }; 265 };
262 266
263 } // namespace net 267 } // namespace net
264 268
265 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 269 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
OLDNEW
« no previous file with comments | « no previous file | net/socket/client_socket_pool_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698