| OLD | NEW |
| 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 #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/time.h" | 10 #include "base/time.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ConnectJob* TCPClientSocketPool::TCPConnectJobFactory::NewConnectJob( | 125 ConnectJob* TCPClientSocketPool::TCPConnectJobFactory::NewConnectJob( |
| 126 const std::string& group_name, | 126 const std::string& group_name, |
| 127 const ClientSocketPoolBase::Request& request, | 127 const ClientSocketPoolBase::Request& request, |
| 128 ConnectJob::Delegate* delegate) const { | 128 ConnectJob::Delegate* delegate) const { |
| 129 return new TCPConnectJob( | 129 return new TCPConnectJob( |
| 130 group_name, request.resolve_info, request.handle, | 130 group_name, request.resolve_info, request.handle, |
| 131 client_socket_factory_, host_resolver_, delegate); | 131 client_socket_factory_, host_resolver_, delegate); |
| 132 } | 132 } |
| 133 | 133 |
| 134 TCPClientSocketPool::TCPClientSocketPool( | 134 TCPClientSocketPool::TCPClientSocketPool( |
| 135 int max_sockets, |
| 135 int max_sockets_per_group, | 136 int max_sockets_per_group, |
| 136 HostResolver* host_resolver, | 137 HostResolver* host_resolver, |
| 137 ClientSocketFactory* client_socket_factory) | 138 ClientSocketFactory* client_socket_factory) |
| 138 : base_(new ClientSocketPoolBase( | 139 : base_(new ClientSocketPoolBase( |
| 139 max_sockets_per_group, | 140 max_sockets, max_sockets_per_group, |
| 140 new TCPConnectJobFactory(client_socket_factory, host_resolver))) {} | 141 new TCPConnectJobFactory(client_socket_factory, host_resolver))) {} |
| 141 | 142 |
| 142 TCPClientSocketPool::~TCPClientSocketPool() {} | 143 TCPClientSocketPool::~TCPClientSocketPool() {} |
| 143 | 144 |
| 144 int TCPClientSocketPool::RequestSocket( | 145 int TCPClientSocketPool::RequestSocket( |
| 145 const std::string& group_name, | 146 const std::string& group_name, |
| 146 const HostResolver::RequestInfo& resolve_info, | 147 const HostResolver::RequestInfo& resolve_info, |
| 147 int priority, | 148 int priority, |
| 148 ClientSocketHandle* handle, | 149 ClientSocketHandle* handle, |
| 149 CompletionCallback* callback) { | 150 CompletionCallback* callback) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 171 const std::string& group_name) const { | 172 const std::string& group_name) const { |
| 172 return base_->IdleSocketCountInGroup(group_name); | 173 return base_->IdleSocketCountInGroup(group_name); |
| 173 } | 174 } |
| 174 | 175 |
| 175 LoadState TCPClientSocketPool::GetLoadState( | 176 LoadState TCPClientSocketPool::GetLoadState( |
| 176 const std::string& group_name, const ClientSocketHandle* handle) const { | 177 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 177 return base_->GetLoadState(group_name, handle); | 178 return base_->GetLoadState(group_name, handle); |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace net | 181 } // namespace net |
| OLD | NEW |