| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 base::TimeDelta | 170 base::TimeDelta |
| 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 std::string& name, | 178 const std::string& name, |
| 179 HostResolver* host_resolver, | 179 HostResolver* host_resolver, |
| 180 ClientSocketFactory* client_socket_factory) | 180 ClientSocketFactory* client_socket_factory, |
| 181 NetworkChangeNotifier* network_change_notifier) |
| 181 : base_(max_sockets, max_sockets_per_group, name, | 182 : base_(max_sockets, max_sockets_per_group, name, |
| 182 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), | 183 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), |
| 183 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), | 184 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), |
| 184 new TCPConnectJobFactory(client_socket_factory, host_resolver)) { | 185 new TCPConnectJobFactory(client_socket_factory, host_resolver), |
| 186 network_change_notifier) { |
| 185 base_.enable_backup_jobs(); | 187 base_.enable_backup_jobs(); |
| 186 } | 188 } |
| 187 | 189 |
| 188 TCPClientSocketPool::~TCPClientSocketPool() {} | 190 TCPClientSocketPool::~TCPClientSocketPool() {} |
| 189 | 191 |
| 190 int TCPClientSocketPool::RequestSocket( | 192 int TCPClientSocketPool::RequestSocket( |
| 191 const std::string& group_name, | 193 const std::string& group_name, |
| 192 const void* params, | 194 const void* params, |
| 193 RequestPriority priority, | 195 RequestPriority priority, |
| 194 ClientSocketHandle* handle, | 196 ClientSocketHandle* handle, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 const std::string& group_name) const { | 234 const std::string& group_name) const { |
| 233 return base_.IdleSocketCountInGroup(group_name); | 235 return base_.IdleSocketCountInGroup(group_name); |
| 234 } | 236 } |
| 235 | 237 |
| 236 LoadState TCPClientSocketPool::GetLoadState( | 238 LoadState TCPClientSocketPool::GetLoadState( |
| 237 const std::string& group_name, const ClientSocketHandle* handle) const { | 239 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 238 return base_.GetLoadState(group_name, handle); | 240 return base_.GetLoadState(group_name, handle); |
| 239 } | 241 } |
| 240 | 242 |
| 241 } // namespace net | 243 } // namespace net |
| OLD | NEW |