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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 int TransportConnectJob::DoTransportConnect() { | 218 int TransportConnectJob::DoTransportConnect() { |
219 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE; | 219 next_state_ = STATE_TRANSPORT_CONNECT_COMPLETE; |
220 transport_socket_.reset(client_socket_factory_->CreateTransportClientSocket( | 220 transport_socket_.reset(client_socket_factory_->CreateTransportClientSocket( |
221 addresses_, net_log().net_log(), net_log().source())); | 221 addresses_, net_log().net_log(), net_log().source())); |
222 connect_start_time_ = base::TimeTicks::Now(); | 222 connect_start_time_ = base::TimeTicks::Now(); |
223 int rv = transport_socket_->Connect(&callback_); | 223 int rv = transport_socket_->Connect(&callback_); |
224 if (rv == ERR_IO_PENDING && | 224 if (rv == ERR_IO_PENDING && |
225 AddressListStartsWithIPv6AndHasAnIPv4Addr(addresses_)) { | 225 AddressListStartsWithIPv6AndHasAnIPv4Addr(addresses_)) { |
226 fallback_timer_.Start(FROM_HERE, | 226 fallback_timer_.Start( |
227 base::TimeDelta::FromMilliseconds(kIPv6FallbackTimerInMs), | 227 base::TimeDelta::FromMilliseconds(kIPv6FallbackTimerInMs), |
228 this, &TransportConnectJob::DoIPv6FallbackTransportConnect); | 228 this, &TransportConnectJob::DoIPv6FallbackTransportConnect); |
229 } | 229 } |
230 return rv; | 230 return rv; |
231 } | 231 } |
232 | 232 |
233 int TransportConnectJob::DoTransportConnectComplete(int result) { | 233 int TransportConnectJob::DoTransportConnectComplete(int result) { |
234 if (result == OK) { | 234 if (result == OK) { |
235 bool is_ipv4 = addresses_.head()->ai_family != AF_INET6; | 235 bool is_ipv4 = addresses_.head()->ai_family != AF_INET6; |
236 DCHECK(connect_start_time_ != base::TimeTicks()); | 236 DCHECK(connect_start_time_ != base::TimeTicks()); |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 | 482 |
483 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { | 483 base::TimeDelta TransportClientSocketPool::ConnectionTimeout() const { |
484 return base_.ConnectionTimeout(); | 484 return base_.ConnectionTimeout(); |
485 } | 485 } |
486 | 486 |
487 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { | 487 ClientSocketPoolHistograms* TransportClientSocketPool::histograms() const { |
488 return base_.histograms(); | 488 return base_.histograms(); |
489 } | 489 } |
490 | 490 |
491 } // namespace net | 491 } // namespace net |
OLD | NEW |