| Index: net/http/http_proxy_client_socket_pool.cc
|
| diff --git a/net/http/http_proxy_client_socket_pool.cc b/net/http/http_proxy_client_socket_pool.cc
|
| index 37ffa6d1a436567d24cdbe7ffb558c9c81d96f3b..0174b745affb403cedcb4df73afc20a078b0063a 100644
|
| --- a/net/http/http_proxy_client_socket_pool.cc
|
| +++ b/net/http/http_proxy_client_socket_pool.cc
|
| @@ -64,7 +64,8 @@ const HostResolver::RequestInfo& HttpProxySocketParams::destination() const {
|
| }
|
| }
|
|
|
| -HttpProxySocketParams::~HttpProxySocketParams() {}
|
| +HttpProxySocketParams::~HttpProxySocketParams() {
|
| +}
|
|
|
| // HttpProxyConnectJobs will time out after this many seconds. Note this is on
|
| // top of the timeout for the transport socket.
|
| @@ -74,7 +75,6 @@ static const int kHttpProxyConnectJobTimeoutInSeconds = 10;
|
| static const int kHttpProxyConnectJobTimeoutInSeconds = 30;
|
| #endif
|
|
|
| -
|
| HttpProxyConnectJob::HttpProxyConnectJob(
|
| const std::string& group_name,
|
| RequestPriority priority,
|
| @@ -85,7 +85,10 @@ HttpProxyConnectJob::HttpProxyConnectJob(
|
| HostResolver* host_resolver,
|
| Delegate* delegate,
|
| NetLog* net_log)
|
| - : ConnectJob(group_name, timeout_duration, priority, delegate,
|
| + : ConnectJob(group_name,
|
| + timeout_duration,
|
| + priority,
|
| + delegate,
|
| BoundNetLog::Make(net_log, NetLog::SOURCE_CONNECT_JOB)),
|
| weak_ptr_factory_(this),
|
| params_(params),
|
| @@ -98,7 +101,8 @@ HttpProxyConnectJob::HttpProxyConnectJob(
|
| protocol_negotiated_(kProtoUnknown) {
|
| }
|
|
|
| -HttpProxyConnectJob::~HttpProxyConnectJob() {}
|
| +HttpProxyConnectJob::~HttpProxyConnectJob() {
|
| +}
|
|
|
| LoadState HttpProxyConnectJob::GetLoadState() const {
|
| switch (next_state_) {
|
| @@ -118,7 +122,7 @@ LoadState HttpProxyConnectJob::GetLoadState() const {
|
| }
|
| }
|
|
|
| -void HttpProxyConnectJob::GetAdditionalErrorState(ClientSocketHandle * handle) {
|
| +void HttpProxyConnectJob::GetAdditionalErrorState(ClientSocketHandle* handle) {
|
| if (error_response_info_.cert_request_info.get()) {
|
| handle->set_ssl_error_response_info(error_response_info_);
|
| handle->set_is_ssl_error(true);
|
| @@ -195,8 +199,8 @@ int HttpProxyConnectJob::DoTransportConnectComplete(int result) {
|
| // Reset the timer to just the length of time allowed for HttpProxy handshake
|
| // so that a fast TCP connection plus a slow HttpProxy failure doesn't take
|
| // longer to timeout than it should.
|
| - ResetTimer(base::TimeDelta::FromSeconds(
|
| - kHttpProxyConnectJobTimeoutInSeconds));
|
| + ResetTimer(
|
| + base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds));
|
|
|
| next_state_ = STATE_HTTP_PROXY_CONNECT;
|
| return result;
|
| @@ -215,9 +219,12 @@ int HttpProxyConnectJob::DoSSLConnect() {
|
| }
|
| next_state_ = STATE_SSL_CONNECT_COMPLETE;
|
| transport_socket_handle_.reset(new ClientSocketHandle());
|
| - return transport_socket_handle_->Init(
|
| - group_name(), params_->ssl_params(), priority(), callback_,
|
| - ssl_pool_, net_log());
|
| + return transport_socket_handle_->Init(group_name(),
|
| + params_->ssl_params(),
|
| + priority(),
|
| + callback_,
|
| + ssl_pool_,
|
| + net_log());
|
| }
|
|
|
| int HttpProxyConnectJob::DoSSLConnectComplete(int result) {
|
| @@ -251,8 +258,8 @@ int HttpProxyConnectJob::DoSSLConnectComplete(int result) {
|
| // Reset the timer to just the length of time allowed for HttpProxy handshake
|
| // so that a fast SSL connection plus a slow HttpProxy failure doesn't take
|
| // longer to timeout than it should.
|
| - ResetTimer(base::TimeDelta::FromSeconds(
|
| - kHttpProxyConnectJobTimeoutInSeconds));
|
| + ResetTimer(
|
| + base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds));
|
| // TODO(rch): If we ever decide to implement a "trusted" SPDY proxy
|
| // (one that we speak SPDY over SSL to, but to which we send HTTPS
|
| // request directly instead of through CONNECT tunnels, then we
|
| @@ -315,10 +322,12 @@ int HttpProxyConnectJob::DoSpdyProxyCreateStream() {
|
| }
|
| } else {
|
| // Create a session direct to the proxy itself
|
| - spdy_session =
|
| - spdy_pool->CreateAvailableSessionFromSocket(
|
| - key, transport_socket_handle_.Pass(),
|
| - net_log(), OK, /*using_ssl_*/ true);
|
| + spdy_session = spdy_pool->CreateAvailableSessionFromSocket(
|
| + key,
|
| + transport_socket_handle_.Pass(),
|
| + net_log(),
|
| + OK,
|
| + /*using_ssl_*/ true);
|
| DCHECK(spdy_session);
|
| }
|
|
|
| @@ -360,12 +369,11 @@ int HttpProxyConnectJob::ConnectInternal() {
|
| return DoLoop(OK);
|
| }
|
|
|
| -HttpProxyClientSocketPool::
|
| -HttpProxyConnectJobFactory::HttpProxyConnectJobFactory(
|
| - TransportClientSocketPool* transport_pool,
|
| - SSLClientSocketPool* ssl_pool,
|
| - HostResolver* host_resolver,
|
| - NetLog* net_log)
|
| +HttpProxyClientSocketPool::HttpProxyConnectJobFactory::
|
| + HttpProxyConnectJobFactory(TransportClientSocketPool* transport_pool,
|
| + SSLClientSocketPool* ssl_pool,
|
| + HostResolver* host_resolver,
|
| + NetLog* net_log)
|
| : transport_pool_(transport_pool),
|
| ssl_pool_(ssl_pool),
|
| host_resolver_(host_resolver),
|
| @@ -377,14 +385,13 @@ HttpProxyConnectJobFactory::HttpProxyConnectJobFactory(
|
| if (transport_pool_)
|
| max_pool_timeout = transport_pool_->ConnectionTimeout();
|
| if (ssl_pool_)
|
| - max_pool_timeout = std::max(max_pool_timeout,
|
| - ssl_pool_->ConnectionTimeout());
|
| + max_pool_timeout =
|
| + std::max(max_pool_timeout, ssl_pool_->ConnectionTimeout());
|
| #endif
|
| timeout_ = max_pool_timeout +
|
| - base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds);
|
| + base::TimeDelta::FromSeconds(kHttpProxyConnectJobTimeoutInSeconds);
|
| }
|
|
|
| -
|
| scoped_ptr<ConnectJob>
|
| HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob(
|
| const std::string& group_name,
|
| @@ -402,8 +409,8 @@ HttpProxyClientSocketPool::HttpProxyConnectJobFactory::NewConnectJob(
|
| }
|
|
|
| base::TimeDelta
|
| -HttpProxyClientSocketPool::HttpProxyConnectJobFactory::ConnectionTimeout(
|
| - ) const {
|
| +HttpProxyClientSocketPool::HttpProxyConnectJobFactory::ConnectionTimeout()
|
| + const {
|
| return timeout_;
|
| }
|
|
|
| @@ -417,7 +424,10 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
|
| NetLog* net_log)
|
| : transport_pool_(transport_pool),
|
| ssl_pool_(ssl_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 HttpProxyConnectJobFactory(transport_pool,
|
| @@ -434,31 +444,31 @@ HttpProxyClientSocketPool::HttpProxyClientSocketPool(
|
| HttpProxyClientSocketPool::~HttpProxyClientSocketPool() {
|
| }
|
|
|
| -int HttpProxyClientSocketPool::RequestSocket(
|
| - const std::string& group_name, const void* socket_params,
|
| - RequestPriority priority, ClientSocketHandle* handle,
|
| - const CompletionCallback& callback, const BoundNetLog& net_log) {
|
| +int HttpProxyClientSocketPool::RequestSocket(const std::string& group_name,
|
| + const void* socket_params,
|
| + RequestPriority priority,
|
| + ClientSocketHandle* handle,
|
| + const CompletionCallback& callback,
|
| + const BoundNetLog& net_log) {
|
| const scoped_refptr<HttpProxySocketParams>* casted_socket_params =
|
| static_cast<const scoped_refptr<HttpProxySocketParams>*>(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 HttpProxyClientSocketPool::RequestSockets(
|
| - const std::string& group_name,
|
| - const void* params,
|
| - int num_sockets,
|
| - const BoundNetLog& net_log) {
|
| +void HttpProxyClientSocketPool::RequestSockets(const std::string& group_name,
|
| + const void* params,
|
| + int num_sockets,
|
| + const BoundNetLog& net_log) {
|
| const scoped_refptr<HttpProxySocketParams>* casted_params =
|
| static_cast<const scoped_refptr<HttpProxySocketParams>*>(params);
|
|
|
| base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
|
| }
|
|
|
| -void HttpProxyClientSocketPool::CancelRequest(
|
| - const std::string& group_name,
|
| - ClientSocketHandle* handle) {
|
| +void HttpProxyClientSocketPool::CancelRequest(const std::string& group_name,
|
| + ClientSocketHandle* handle) {
|
| base_.CancelRequest(group_name, handle);
|
| }
|
|
|
| @@ -486,7 +496,8 @@ int HttpProxyClientSocketPool::IdleSocketCountInGroup(
|
| }
|
|
|
| LoadState HttpProxyClientSocketPool::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);
|
| }
|
|
|
| @@ -498,14 +509,12 @@ base::DictionaryValue* HttpProxyClientSocketPool::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",
|
| - true));
|
| + list->Append(transport_pool_->GetInfoAsValue(
|
| + "transport_socket_pool", "transport_socket_pool", true));
|
| }
|
| if (ssl_pool_) {
|
| - list->Append(ssl_pool_->GetInfoAsValue("ssl_socket_pool",
|
| - "ssl_socket_pool",
|
| - true));
|
| + list->Append(ssl_pool_->GetInfoAsValue(
|
| + "ssl_socket_pool", "ssl_socket_pool", true));
|
| }
|
| dict->Set("nested_pools", list);
|
| }
|
|
|