| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/transport_client_socket_pool.h" | 5 #include "net/socket/transport_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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), | 66 BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)), |
| 67 params_(params), | 67 params_(params), |
| 68 client_socket_factory_(client_socket_factory), | 68 client_socket_factory_(client_socket_factory), |
| 69 ALLOW_THIS_IN_INITIALIZER_LIST( | 69 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 70 callback_(this, | 70 callback_(this, |
| 71 &TransportConnectJob::OnIOComplete)), | 71 &TransportConnectJob::OnIOComplete)), |
| 72 resolver_(host_resolver) {} | 72 resolver_(host_resolver) {} |
| 73 | 73 |
| 74 TransportConnectJob::~TransportConnectJob() { | 74 TransportConnectJob::~TransportConnectJob() { |
| 75 // We don't worry about cancelling the host resolution and TCP connect, since | 75 // We don't worry about cancelling the host resolution and TCP connect, since |
| 76 // ~SingleRequestHostResolver and ~ClientSocket will take care of it. | 76 // ~SingleRequestHostResolver and ~StreamSocket will take care of it. |
| 77 } | 77 } |
| 78 | 78 |
| 79 LoadState TransportConnectJob::GetLoadState() const { | 79 LoadState TransportConnectJob::GetLoadState() const { |
| 80 switch (next_state_) { | 80 switch (next_state_) { |
| 81 case STATE_RESOLVE_HOST: | 81 case STATE_RESOLVE_HOST: |
| 82 case STATE_RESOLVE_HOST_COMPLETE: | 82 case STATE_RESOLVE_HOST_COMPLETE: |
| 83 return LOAD_STATE_RESOLVING_HOST; | 83 return LOAD_STATE_RESOLVING_HOST; |
| 84 case STATE_TRANSPORT_CONNECT: | 84 case STATE_TRANSPORT_CONNECT: |
| 85 case STATE_TRANSPORT_CONNECT_COMPLETE: | 85 case STATE_TRANSPORT_CONNECT_COMPLETE: |
| 86 return LOAD_STATE_CONNECTING; | 86 return LOAD_STATE_CONNECTING; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 void TransportClientSocketPool::CancelRequest( | 265 void TransportClientSocketPool::CancelRequest( |
| 266 const std::string& group_name, | 266 const std::string& group_name, |
| 267 ClientSocketHandle* handle) { | 267 ClientSocketHandle* handle) { |
| 268 base_.CancelRequest(group_name, handle); | 268 base_.CancelRequest(group_name, handle); |
| 269 } | 269 } |
| 270 | 270 |
| 271 void TransportClientSocketPool::ReleaseSocket( | 271 void TransportClientSocketPool::ReleaseSocket( |
| 272 const std::string& group_name, | 272 const std::string& group_name, |
| 273 ClientSocket* socket, | 273 StreamSocket* socket, |
| 274 int id) { | 274 int id) { |
| 275 base_.ReleaseSocket(group_name, socket, id); | 275 base_.ReleaseSocket(group_name, socket, id); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void TransportClientSocketPool::Flush() { | 278 void TransportClientSocketPool::Flush() { |
| 279 base_.Flush(); | 279 base_.Flush(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void TransportClientSocketPool::CloseIdleSockets() { | 282 void TransportClientSocketPool::CloseIdleSockets() { |
| 283 base_.CloseIdleSockets(); | 283 base_.CloseIdleSockets(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 306 | 306 |
| 307 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { | 307 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { |
| 308 return base_.ConnectionTimeout(); | 308 return base_.ConnectionTimeout(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { | 311 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { |
| 312 return base_.histograms(); | 312 return base_.histograms(); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace net | 315 } // namespace net |
| OLD | NEW |