OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "net/socket/tcp_client_socket_pool.h" | 5 #include "net/socket/tcp_client_socket_pool.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 TCPClientSocketPool::TCPConnectJobFactory::ConnectionTimeout() const { | 171 TCPClientSocketPool::TCPConnectJobFactory::ConnectionTimeout() const { |
172 return base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds); | 172 return base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds); |
173 } | 173 } |
174 | 174 |
175 TCPClientSocketPool::TCPClientSocketPool( | 175 TCPClientSocketPool::TCPClientSocketPool( |
176 int max_sockets, | 176 int max_sockets, |
177 int max_sockets_per_group, | 177 int max_sockets_per_group, |
178 const scoped_refptr<ClientSocketPoolHistograms>& histograms, | 178 const scoped_refptr<ClientSocketPoolHistograms>& histograms, |
179 HostResolver* host_resolver, | 179 HostResolver* host_resolver, |
180 ClientSocketFactory* client_socket_factory, | 180 ClientSocketFactory* client_socket_factory, |
181 NetworkChangeNotifier* network_change_notifier, | |
182 NetLog* net_log) | 181 NetLog* net_log) |
183 : base_(max_sockets, max_sockets_per_group, histograms, | 182 : base_(max_sockets, max_sockets_per_group, histograms, |
184 base::TimeDelta::FromSeconds( | 183 base::TimeDelta::FromSeconds( |
185 ClientSocketPool::unused_idle_socket_timeout()), | 184 ClientSocketPool::unused_idle_socket_timeout()), |
186 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), | 185 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), |
187 new TCPConnectJobFactory(client_socket_factory, | 186 new TCPConnectJobFactory(client_socket_factory, |
188 host_resolver, net_log), | 187 host_resolver, net_log)) { |
189 network_change_notifier) { | |
190 base_.EnableBackupJobs(); | 188 base_.EnableBackupJobs(); |
191 } | 189 } |
192 | 190 |
193 TCPClientSocketPool::~TCPClientSocketPool() {} | 191 TCPClientSocketPool::~TCPClientSocketPool() {} |
194 | 192 |
195 int TCPClientSocketPool::RequestSocket( | 193 int TCPClientSocketPool::RequestSocket( |
196 const std::string& group_name, | 194 const std::string& group_name, |
197 const void* params, | 195 const void* params, |
198 RequestPriority priority, | 196 RequestPriority priority, |
199 ClientSocketHandle* handle, | 197 ClientSocketHandle* handle, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 const std::string& group_name) const { | 240 const std::string& group_name) const { |
243 return base_.IdleSocketCountInGroup(group_name); | 241 return base_.IdleSocketCountInGroup(group_name); |
244 } | 242 } |
245 | 243 |
246 LoadState TCPClientSocketPool::GetLoadState( | 244 LoadState TCPClientSocketPool::GetLoadState( |
247 const std::string& group_name, const ClientSocketHandle* handle) const { | 245 const std::string& group_name, const ClientSocketHandle* handle) const { |
248 return base_.GetLoadState(group_name, handle); | 246 return base_.GetLoadState(group_name, handle); |
249 } | 247 } |
250 | 248 |
251 } // namespace net | 249 } // namespace net |
OLD | NEW |