| Index: net/socket/ssl_client_socket_pool.cc
|
| diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
|
| index 2c704658820bc06a8404679c2f796be269657387..ef6a5139c4afe2c5f774fbee4bae8cef1b705965 100644
|
| --- a/net/socket/ssl_client_socket_pool.cc
|
| +++ b/net/socket/ssl_client_socket_pool.cc
|
| @@ -58,7 +58,8 @@ SSLSocketParams::SSLSocketParams(
|
| }
|
| }
|
|
|
| -SSLSocketParams::~SSLSocketParams() {}
|
| +SSLSocketParams::~SSLSocketParams() {
|
| +}
|
|
|
| SSLSocketParams::ConnectionType SSLSocketParams::GetConnectionType() const {
|
| if (direct_params_) {
|
| @@ -127,17 +128,19 @@ SSLConnectJob::SSLConnectJob(const std::string& group_name,
|
| (params->privacy_mode() == PRIVACY_MODE_ENABLED
|
| ? "pm/" + context.ssl_session_cache_shard
|
| : context.ssl_session_cache_shard)),
|
| - callback_(base::Bind(&SSLConnectJob::OnIOComplete,
|
| - base::Unretained(this))) {}
|
| + callback_(
|
| + base::Bind(&SSLConnectJob::OnIOComplete, base::Unretained(this))) {
|
| +}
|
|
|
| -SSLConnectJob::~SSLConnectJob() {}
|
| +SSLConnectJob::~SSLConnectJob() {
|
| +}
|
|
|
| LoadState SSLConnectJob::GetLoadState() const {
|
| switch (next_state_) {
|
| case STATE_TUNNEL_CONNECT_COMPLETE:
|
| if (transport_socket_handle_->socket())
|
| return LOAD_STATE_ESTABLISHING_PROXY_TUNNEL;
|
| - // else, fall through.
|
| + // else, fall through.
|
| case STATE_TRANSPORT_CONNECT:
|
| case STATE_TRANSPORT_CONNECT_COMPLETE:
|
| case STATE_SOCKS_CONNECT:
|
| @@ -340,8 +343,7 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| // If we want spdy over npn, make sure it succeeded.
|
| if (status == SSLClientSocket::kNextProtoNegotiated) {
|
| ssl_socket_->set_was_npn_negotiated(true);
|
| - NextProto protocol_negotiated =
|
| - SSLClientSocket::NextProtoFromString(proto);
|
| + NextProto protocol_negotiated = SSLClientSocket::NextProtoFromString(proto);
|
| ssl_socket_->set_protocol_negotiated(protocol_negotiated);
|
| // If we negotiated a SPDY version, it must have been present in
|
| // SSLConfig::next_protos.
|
| @@ -355,8 +357,8 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| return ERR_NPN_NEGOTIATION_FAILED;
|
|
|
| // Spdy might be turned on by default, or it might be over npn.
|
| - bool using_spdy = params_->force_spdy_over_ssl() ||
|
| - params_->want_spdy_over_npn();
|
| + bool using_spdy =
|
| + params_->force_spdy_over_ssl() || params_->want_spdy_over_npn();
|
|
|
| if (result == OK ||
|
| ssl_socket_->IgnoreCertError(result, params_->load_flags())) {
|
| @@ -392,9 +394,9 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| SSLInfo ssl_info;
|
| ssl_socket_->GetSSLInfo(&ssl_info);
|
|
|
| - UMA_HISTOGRAM_SPARSE_SLOWLY("Net.SSL_CipherSuite",
|
| - SSLConnectionStatusToCipherSuite(
|
| - ssl_info.connection_status));
|
| + UMA_HISTOGRAM_SPARSE_SLOWLY(
|
| + "Net.SSL_CipherSuite",
|
| + SSLConnectionStatusToCipherSuite(ssl_info.connection_status));
|
|
|
| if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) {
|
| UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Resume_Handshake",
|
| @@ -411,9 +413,9 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| }
|
|
|
| const std::string& host = params_->host_and_port().host();
|
| - bool is_google = host == "google.com" ||
|
| - (host.size() > 11 &&
|
| - host.rfind(".google.com") == host.size() - 11);
|
| + bool is_google =
|
| + host == "google.com" ||
|
| + (host.size() > 11 && host.rfind(".google.com") == host.size() - 11);
|
| if (is_google) {
|
| UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google2",
|
| connect_duration,
|
| @@ -421,19 +423,21 @@ int SSLConnectJob::DoSSLConnectComplete(int result) {
|
| base::TimeDelta::FromMinutes(1),
|
| 100);
|
| if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_RESUME) {
|
| - UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_"
|
| - "Resume_Handshake",
|
| - connect_duration,
|
| - base::TimeDelta::FromMilliseconds(1),
|
| - base::TimeDelta::FromMinutes(1),
|
| - 100);
|
| + UMA_HISTOGRAM_CUSTOM_TIMES(
|
| + "Net.SSL_Connection_Latency_Google_"
|
| + "Resume_Handshake",
|
| + connect_duration,
|
| + base::TimeDelta::FromMilliseconds(1),
|
| + base::TimeDelta::FromMinutes(1),
|
| + 100);
|
| } else if (ssl_info.handshake_type == SSLInfo::HANDSHAKE_FULL) {
|
| - UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_Google_"
|
| - "Full_Handshake",
|
| - connect_duration,
|
| - base::TimeDelta::FromMilliseconds(1),
|
| - base::TimeDelta::FromMinutes(1),
|
| - 100);
|
| + UMA_HISTOGRAM_CUSTOM_TIMES(
|
| + "Net.SSL_Connection_Latency_Google_"
|
| + "Full_Handshake",
|
| + connect_duration,
|
| + base::TimeDelta::FromMilliseconds(1),
|
| + base::TimeDelta::FromMinutes(1),
|
| + 100);
|
| }
|
| }
|
| }
|
| @@ -498,7 +502,7 @@ SSLClientSocketPool::SSLConnectJobFactory::SSLConnectJobFactory(
|
| max_transport_timeout = pool_timeout;
|
| }
|
| timeout_ = max_transport_timeout +
|
| - base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds);
|
| + base::TimeDelta::FromSeconds(kSSLHandshakeTimeoutInSeconds);
|
| }
|
|
|
| SSLClientSocketPool::SSLClientSocketPool(
|
| @@ -520,21 +524,24 @@ SSLClientSocketPool::SSLClientSocketPool(
|
| : transport_pool_(transport_pool),
|
| socks_pool_(socks_pool),
|
| http_proxy_pool_(http_proxy_pool),
|
| - base_(this, max_sockets, max_sockets_per_group, histograms,
|
| + base_(this,
|
| + max_sockets,
|
| + max_sockets_per_group,
|
| + histograms,
|
| ClientSocketPool::unused_idle_socket_timeout(),
|
| ClientSocketPool::used_idle_socket_timeout(),
|
| - new SSLConnectJobFactory(transport_pool,
|
| - socks_pool,
|
| - http_proxy_pool,
|
| - client_socket_factory,
|
| - host_resolver,
|
| - SSLClientSocketContext(
|
| - cert_verifier,
|
| - server_bound_cert_service,
|
| - transport_security_state,
|
| - cert_transparency_verifier,
|
| - ssl_session_cache_shard),
|
| - net_log)),
|
| + new SSLConnectJobFactory(
|
| + transport_pool,
|
| + socks_pool,
|
| + http_proxy_pool,
|
| + client_socket_factory,
|
| + host_resolver,
|
| + SSLClientSocketContext(cert_verifier,
|
| + server_bound_cert_service,
|
| + transport_security_state,
|
| + cert_transparency_verifier,
|
| + ssl_session_cache_shard),
|
| + net_log)),
|
| ssl_config_service_(ssl_config_service) {
|
| if (ssl_config_service_.get())
|
| ssl_config_service_->AddObserver(this);
|
| @@ -551,20 +558,26 @@ SSLClientSocketPool::~SSLClientSocketPool() {
|
| ssl_config_service_->RemoveObserver(this);
|
| }
|
|
|
| -scoped_ptr<ConnectJob>
|
| -SSLClientSocketPool::SSLConnectJobFactory::NewConnectJob(
|
| +scoped_ptr<ConnectJob> SSLClientSocketPool::SSLConnectJobFactory::NewConnectJob(
|
| const std::string& group_name,
|
| const PoolBase::Request& request,
|
| ConnectJob::Delegate* delegate) const {
|
| - return scoped_ptr<ConnectJob>(
|
| - new SSLConnectJob(group_name, request.priority(), request.params(),
|
| - ConnectionTimeout(), transport_pool_, socks_pool_,
|
| - http_proxy_pool_, client_socket_factory_,
|
| - host_resolver_, context_, delegate, net_log_));
|
| -}
|
| -
|
| -base::TimeDelta
|
| -SSLClientSocketPool::SSLConnectJobFactory::ConnectionTimeout() const {
|
| + return scoped_ptr<ConnectJob>(new SSLConnectJob(group_name,
|
| + request.priority(),
|
| + request.params(),
|
| + ConnectionTimeout(),
|
| + transport_pool_,
|
| + socks_pool_,
|
| + http_proxy_pool_,
|
| + client_socket_factory_,
|
| + host_resolver_,
|
| + context_,
|
| + delegate,
|
| + net_log_));
|
| +}
|
| +
|
| +base::TimeDelta SSLClientSocketPool::SSLConnectJobFactory::ConnectionTimeout()
|
| + const {
|
| return timeout_;
|
| }
|
|
|
| @@ -577,15 +590,14 @@ int SSLClientSocketPool::RequestSocket(const std::string& group_name,
|
| const scoped_refptr<SSLSocketParams>* casted_socket_params =
|
| static_cast<const scoped_refptr<SSLSocketParams>*>(socket_params);
|
|
|
| - return base_.RequestSocket(group_name, *casted_socket_params, priority,
|
| - handle, callback, net_log);
|
| + return base_.RequestSocket(
|
| + group_name, *casted_socket_params, priority, handle, callback, net_log);
|
| }
|
|
|
| -void SSLClientSocketPool::RequestSockets(
|
| - const std::string& group_name,
|
| - const void* params,
|
| - int num_sockets,
|
| - const BoundNetLog& net_log) {
|
| +void SSLClientSocketPool::RequestSockets(const std::string& group_name,
|
| + const void* params,
|
| + int num_sockets,
|
| + const BoundNetLog& net_log) {
|
| const scoped_refptr<SSLSocketParams>* casted_params =
|
| static_cast<const scoped_refptr<SSLSocketParams>*>(params);
|
|
|
| @@ -621,7 +633,8 @@ int SSLClientSocketPool::IdleSocketCountInGroup(
|
| }
|
|
|
| LoadState SSLClientSocketPool::GetLoadState(
|
| - const std::string& group_name, const ClientSocketHandle* handle) const {
|
| + const std::string& group_name,
|
| + const ClientSocketHandle* handle) const {
|
| return base_.GetLoadState(group_name, handle);
|
| }
|
|
|
| @@ -633,19 +646,16 @@ base::DictionaryValue* SSLClientSocketPool::GetInfoAsValue(
|
| if (include_nested_pools) {
|
| base::ListValue* list = new base::ListValue();
|
| if (transport_pool_) {
|
| - list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool",
|
| - "transport_socket_pool",
|
| - false));
|
| + list->Append(transport_pool_->GetInfoAsValue(
|
| + "transport_socket_pool", "transport_socket_pool", false));
|
| }
|
| if (socks_pool_) {
|
| - list->Append(socks_pool_->GetInfoAsValue("socks_pool",
|
| - "socks_pool",
|
| - true));
|
| + list->Append(
|
| + socks_pool_->GetInfoAsValue("socks_pool", "socks_pool", true));
|
| }
|
| if (http_proxy_pool_) {
|
| - list->Append(http_proxy_pool_->GetInfoAsValue("http_proxy_pool",
|
| - "http_proxy_pool",
|
| - true));
|
| + list->Append(http_proxy_pool_->GetInfoAsValue(
|
| + "http_proxy_pool", "http_proxy_pool", true));
|
| }
|
| dict->Set("nested_pools", list);
|
| }
|
|
|