Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1540)

Unified Diff: net/socket/ssl_client_socket_pool.cc

Issue 11428150: LoadTiming implementation in net, part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Try upload again Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/socket/ssl_client_socket_pool.cc
===================================================================
--- net/socket/ssl_client_socket_pool.cc (revision 172981)
+++ 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,20 @@
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 is currently always be the case.
+ const ConnectTiming& socket_connect_timing =
+ transport_socket_handle_->connect_timing();
+ if (!transport_socket_handle_->is_reused() &&
+ !socket_connect_timing.connect_start.is_null()) {
+ 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;
eroman 2012/12/14 04:08:35 can you access it directly instead? (i.e. make the
mmenke 2012/12/14 13:36:12 Done.
+ }
+
+ 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 +280,8 @@
}
int SSLConnectJob::DoSSLConnectComplete(int result) {
+ connect_timing().ssl_end = base::TimeTicks::Now();
+
SSLClientSocket::NextProtoStatus status =
SSLClientSocket::kNextProtoUnsupported;
std::string proto;
@@ -302,9 +316,9 @@
if (result == OK ||
ssl_socket_->IgnoreCertError(result, params_->load_flags())) {
- DCHECK(ssl_connect_start_time_ != base::TimeTicks());
+ DCHECK(connect_timing().ssl_start != base::TimeTicks());
eroman 2012/12/14 04:08:35 !x.is_null() ?
mmenke 2012/12/14 13:36:12 Done.
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,

Powered by Google App Engine
This is Rietveld 408576698