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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 const void* params, | 194 const void* params, |
195 RequestPriority priority, | 195 RequestPriority priority, |
196 ClientSocketHandle* handle, | 196 ClientSocketHandle* handle, |
197 CompletionCallback* callback, | 197 CompletionCallback* callback, |
198 const BoundNetLog& net_log) { | 198 const BoundNetLog& net_log) { |
199 const TCPSocketParams* casted_params = | 199 const TCPSocketParams* casted_params = |
200 static_cast<const TCPSocketParams*>(params); | 200 static_cast<const TCPSocketParams*>(params); |
201 | 201 |
202 if (net_log.HasListener()) { | 202 if (net_log.HasListener()) { |
203 // TODO(eroman): Split out the host and port parameters. | 203 // TODO(eroman): Split out the host and port parameters. |
204 net_log.AddEventWithString( | 204 net_log.AddEvent( |
205 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, | 205 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, |
206 "host_and_port", | 206 new NetLogStringParameter( |
207 StringPrintf("%s [port %d]", | 207 "host_and_port", |
208 casted_params->destination().hostname().c_str(), | 208 StringPrintf("%s [port %d]", |
209 casted_params->destination().port())); | 209 casted_params->destination().hostname().c_str(), |
| 210 casted_params->destination().port()))); |
210 } | 211 } |
211 | 212 |
212 return base_.RequestSocket(group_name, *casted_params, priority, handle, | 213 return base_.RequestSocket(group_name, *casted_params, priority, handle, |
213 callback, net_log); | 214 callback, net_log); |
214 } | 215 } |
215 | 216 |
216 void TCPClientSocketPool::CancelRequest( | 217 void TCPClientSocketPool::CancelRequest( |
217 const std::string& group_name, | 218 const std::string& group_name, |
218 const ClientSocketHandle* handle) { | 219 const ClientSocketHandle* handle) { |
219 base_.CancelRequest(group_name, handle); | 220 base_.CancelRequest(group_name, handle); |
(...skipping 13 matching lines...) Expand all Loading... |
233 const std::string& group_name) const { | 234 const std::string& group_name) const { |
234 return base_.IdleSocketCountInGroup(group_name); | 235 return base_.IdleSocketCountInGroup(group_name); |
235 } | 236 } |
236 | 237 |
237 LoadState TCPClientSocketPool::GetLoadState( | 238 LoadState TCPClientSocketPool::GetLoadState( |
238 const std::string& group_name, const ClientSocketHandle* handle) const { | 239 const std::string& group_name, const ClientSocketHandle* handle) const { |
239 return base_.GetLoadState(group_name, handle); | 240 return base_.GetLoadState(group_name, handle); |
240 } | 241 } |
241 | 242 |
242 } // namespace net | 243 } // namespace net |
OLD | NEW |