| Index: net/socket/ssl_client_socket_pool.cc
|
| ===================================================================
|
| --- net/socket/ssl_client_socket_pool.cc (revision 175289)
|
| +++ net/socket/ssl_client_socket_pool.cc (working copy)
|
| @@ -129,7 +129,7 @@
|
| transport_socket_handle_.release());
|
| }
|
| handle->set_ssl_error_response_info(error_response_info_);
|
| - if (!ssl_connect_start_time_.is_null())
|
| + if (!connect_timing_.ssl_start.is_null())
|
| handle->set_is_ssl_error(true);
|
| }
|
|
|
| @@ -259,8 +259,23 @@
|
| next_state_ = STATE_SSL_CONNECT_COMPLETE;
|
| // Reset the timeout to just the time allowed for the SSL handshake.
|
| ResetTimer(base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds));
|
| - ssl_connect_start_time_ = base::TimeTicks::Now();
|
|
|
| + // If the handle has a fresh socket, get its connect start and DNS times.
|
| + // This should always be the case.
|
| + const LoadTimingInfo::ConnectTiming& socket_connect_timing =
|
| + transport_socket_handle_->connect_timing();
|
| + if (!transport_socket_handle_->is_reused() &&
|
| + !socket_connect_timing.connect_start.is_null()) {
|
| + // Overwriting |connect_start| serves two purposes - it adjusts timing so
|
| + // |connect_start| doesn't include dns times, and it adjusts the time so
|
| + // as not to include time spent waiting for an idle socket.
|
| + connect_timing_.connect_start = socket_connect_timing.connect_start;
|
| + connect_timing_.dns_start = socket_connect_timing.dns_start;
|
| + connect_timing_.dns_end = socket_connect_timing.dns_end;
|
| + }
|
| +
|
| + connect_timing_.ssl_start = base::TimeTicks::Now();
|
| +
|
| ssl_socket_.reset(client_socket_factory_->CreateSSLClientSocket(
|
| transport_socket_handle_.release(), params_->host_and_port(),
|
| params_->ssl_config(), context_));
|
| @@ -268,6 +283,8 @@
|
| }
|
|
|
| int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| + connect_timing_.ssl_end = base::TimeTicks::Now();
|
| +
|
| SSLClientSocket::NextProtoStatus status =
|
| SSLClientSocket::kNextProtoUnsupported;
|
| std::string proto;
|
| @@ -302,9 +319,9 @@
|
|
|
| if (result == OK ||
|
| ssl_socket_->IgnoreCertError(result, params_->load_flags())) {
|
| - DCHECK(ssl_connect_start_time_ != base::TimeTicks());
|
| + DCHECK(!connect_timing_.ssl_start.is_null());
|
| base::TimeDelta connect_duration =
|
| - base::TimeTicks::Now() - ssl_connect_start_time_;
|
| + connect_timing_.ssl_end - connect_timing_.ssl_start;
|
| if (using_spdy) {
|
| UMA_HISTOGRAM_CUSTOM_TIMES("Net.SpdyConnectionLatency",
|
| connect_duration,
|
|
|