Index: net/http/http_stream_factory_impl_job.cc |
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc |
index 680cd321227ff79cc89690419f7fa497ec4bc601..d72272786b2d22a53a2f886e48683d963951bd6f 100644 |
--- a/net/http/http_stream_factory_impl_job.cc |
+++ b/net/http/http_stream_factory_impl_job.cc |
@@ -766,19 +766,43 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() { |
} |
if (IsPreconnecting()) { |
- return PreconnectSocketsForHttpRequest( |
- origin_url_, |
- request_info_.extra_headers, |
- request_info_.load_flags, |
- priority_, |
- session_, |
- proxy_info_, |
- ShouldForceSpdySSL(), |
- want_spdy_over_npn, |
- server_ssl_config_, |
- proxy_ssl_config_, |
- net_log_, |
- num_streams_); |
+ HttpRequestInfo::RequestMotivation motivation = request_info_.motivation; |
+ if(motivation == HttpRequestInfo::MOUSE_OVER_MOTIVATED || |
+ motivation == HttpRequestInfo::MOUSE_DOWN_MOTIVATED || |
+ motivation == HttpRequestInfo::TAP_UNCONFIRMED_MOTIVATED || |
+ motivation == HttpRequestInfo::TAP_DOWN_MOTIVATED) { |
mmenke
2013/05/01 16:55:08
Different behaviors based on motivation really doe
|
+ int would_have_been_connected = |
+ PretendToPreconnectSocketsForHttpRequest( |
+ origin_url_, |
+ request_info_.extra_headers, |
+ request_info_.load_flags, |
+ priority_, |
+ session_, |
+ proxy_info_, |
+ ShouldForceSpdySSL(), |
+ want_spdy_over_npn, |
+ server_ssl_config_, |
+ proxy_ssl_config_, |
+ net_log_, |
+ num_streams_); |
+ int key = motivation * 2 + (would_have_been_connected > 0 ? 1 : 0); |
+ UMA_HISTOGRAM_ENUMERATION("Net.PretendToPreconnect", |
+ key, HttpRequestInfo::MAX_MOTIVATED * 2); |
+ return OK; |
+ } else |
+ return PreconnectSocketsForHttpRequest( |
+ origin_url_, |
+ request_info_.extra_headers, |
+ request_info_.load_flags, |
+ priority_, |
+ session_, |
+ proxy_info_, |
+ ShouldForceSpdySSL(), |
+ want_spdy_over_npn, |
+ server_ssl_config_, |
+ proxy_ssl_config_, |
+ net_log_, |
+ num_streams_); |
} else { |
// If we can't use a SPDY session, don't both checking for one after |
// the hostname is resolved. |