| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 const std::string& group_name, | 193 const std::string& group_name, |
| 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 net_log.AddString(StringPrintf("Requested TCP socket to: %s [port %d]", | 203 // TODO(eroman): Split out the host and port parameters. |
| 204 casted_params->destination().hostname().c_str(), | 204 net_log.AddEventWithString( |
| 205 casted_params->destination().port())); | 205 NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET, |
| 206 "host_and_port", |
| 207 StringPrintf("%s [port %d]", |
| 208 casted_params->destination().hostname().c_str(), |
| 209 casted_params->destination().port())); |
| 206 } | 210 } |
| 207 | 211 |
| 208 return base_.RequestSocket(group_name, *casted_params, priority, handle, | 212 return base_.RequestSocket(group_name, *casted_params, priority, handle, |
| 209 callback, net_log); | 213 callback, net_log); |
| 210 } | 214 } |
| 211 | 215 |
| 212 void TCPClientSocketPool::CancelRequest( | 216 void TCPClientSocketPool::CancelRequest( |
| 213 const std::string& group_name, | 217 const std::string& group_name, |
| 214 const ClientSocketHandle* handle) { | 218 const ClientSocketHandle* handle) { |
| 215 base_.CancelRequest(group_name, handle); | 219 base_.CancelRequest(group_name, handle); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 229 const std::string& group_name) const { | 233 const std::string& group_name) const { |
| 230 return base_.IdleSocketCountInGroup(group_name); | 234 return base_.IdleSocketCountInGroup(group_name); |
| 231 } | 235 } |
| 232 | 236 |
| 233 LoadState TCPClientSocketPool::GetLoadState( | 237 LoadState TCPClientSocketPool::GetLoadState( |
| 234 const std::string& group_name, const ClientSocketHandle* handle) const { | 238 const std::string& group_name, const ClientSocketHandle* handle) const { |
| 235 return base_.GetLoadState(group_name, handle); | 239 return base_.GetLoadState(group_name, handle); |
| 236 } | 240 } |
| 237 | 241 |
| 238 } // namespace net | 242 } // namespace net |
| OLD | NEW |