| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 base::TimeDelta | 169 base::TimeDelta |
| 170 TCPClientSocketPool::TCPConnectJobFactory::ConnectionTimeout() const { | 170 TCPClientSocketPool::TCPConnectJobFactory::ConnectionTimeout() const { |
| 171 return base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds); | 171 return base::TimeDelta::FromSeconds(kTCPConnectJobTimeoutInSeconds); |
| 172 } | 172 } |
| 173 | 173 |
| 174 TCPClientSocketPool::TCPClientSocketPool( | 174 TCPClientSocketPool::TCPClientSocketPool( |
| 175 int max_sockets, | 175 int max_sockets, |
| 176 int max_sockets_per_group, | 176 int max_sockets_per_group, |
| 177 const std::string& name, | 177 const std::string& name, |
| 178 HostResolver* host_resolver, | 178 HostResolver* host_resolver, |
| 179 ClientSocketFactory* client_socket_factory) | 179 ClientSocketFactory* client_socket_factory, |
| 180 NetworkChangeNotifier* network_change_notifier) |
| 180 : base_(max_sockets, max_sockets_per_group, name, | 181 : base_(max_sockets, max_sockets_per_group, name, |
| 181 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), | 182 base::TimeDelta::FromSeconds(kUnusedIdleSocketTimeout), |
| 182 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), | 183 base::TimeDelta::FromSeconds(kUsedIdleSocketTimeout), |
| 183 new TCPConnectJobFactory(client_socket_factory, host_resolver)) { | 184 new TCPConnectJobFactory(client_socket_factory, host_resolver), |
| 185 network_change_notifier) { |
| 184 base_.enable_backup_jobs(); | 186 base_.enable_backup_jobs(); |
| 185 } | 187 } |
| 186 | 188 |
| 187 TCPClientSocketPool::~TCPClientSocketPool() {} | 189 TCPClientSocketPool::~TCPClientSocketPool() {} |
| 188 | 190 |
| 189 int TCPClientSocketPool::RequestSocket( | 191 int TCPClientSocketPool::RequestSocket( |
| 190 const std::string& group_name, | 192 const std::string& group_name, |
| 191 const void* params, | 193 const void* params, |
| 192 RequestPriority priority, | 194 RequestPriority priority, |
| 193 ClientSocketHandle* handle, | 195 ClientSocketHandle* handle, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 const std::string& group_name) const { | 228 const std::string& group_name) const { |
| 227 return base_.IdleSocketCountInGroup(group_name); | 229 return base_.IdleSocketCountInGroup(group_name); |
| 228 } | 230 } |
| 229 | 231 |
| 230 LoadState TCPClientSocketPool::GetLoadState( | 232 LoadState TCPClientSocketPool::GetLoadState( |
| 231 const std::string& group_name, const ClientSocketHandle* handle) const { | 233 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 232 return base_.GetLoadState(group_name, handle); | 234 return base_.GetLoadState(group_name, handle); |
| 233 } | 235 } |
| 234 | 236 |
| 235 } // namespace net | 237 } // namespace net |
| OLD | NEW |