OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 return ERR_SPDY_SESSION_ALREADY_EXISTS; | 252 return ERR_SPDY_SESSION_ALREADY_EXISTS; |
253 } | 253 } |
254 if (result < 0) { | 254 if (result < 0) { |
255 if (transport_socket_handle_->socket()) | 255 if (transport_socket_handle_->socket()) |
256 transport_socket_handle_->socket()->Disconnect(); | 256 transport_socket_handle_->socket()->Disconnect(); |
257 return ERR_PROXY_CONNECTION_FAILED; | 257 return ERR_PROXY_CONNECTION_FAILED; |
258 } | 258 } |
259 | 259 |
260 SSLClientSocket* ssl = | 260 SSLClientSocket* ssl = |
261 static_cast<SSLClientSocket*>(transport_socket_handle_->socket()); | 261 static_cast<SSLClientSocket*>(transport_socket_handle_->socket()); |
262 using_spdy_ = ssl->was_spdy_negotiated(); | |
263 protocol_negotiated_ = ssl->GetNegotiatedProtocol(); | 262 protocol_negotiated_ = ssl->GetNegotiatedProtocol(); |
| 263 using_spdy_ = NextProtoIsSPDY(protocol_negotiated_); |
264 | 264 |
265 // Reset the timer to just the length of time allowed for HttpProxy handshake | 265 // Reset the timer to just the length of time allowed for HttpProxy handshake |
266 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take | 266 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take |
267 // longer to timeout than it should. | 267 // longer to timeout than it should. |
268 ResetTimer(base::TimeDelta::FromSeconds( | 268 ResetTimer(base::TimeDelta::FromSeconds( |
269 kHttpProxyConnectJobTimeoutInSeconds)); | 269 kHttpProxyConnectJobTimeoutInSeconds)); |
270 // TODO(rch): If we ever decide to implement a "trusted" SPDY proxy | 270 // TODO(rch): If we ever decide to implement a "trusted" SPDY proxy |
271 // (one that we speak SPDY over SSL to, but to which we send HTTPS | 271 // (one that we speak SPDY over SSL to, but to which we send HTTPS |
272 // request directly instead of through CONNECT tunnels, then we | 272 // request directly instead of through CONNECT tunnels, then we |
273 // need to add a predicate to this if statement so we fall through | 273 // need to add a predicate to this if statement so we fall through |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 base_.RemoveHigherLayeredPool(higher_pool); | 556 base_.RemoveHigherLayeredPool(higher_pool); |
557 } | 557 } |
558 | 558 |
559 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { | 559 bool HttpProxyClientSocketPool::CloseOneIdleConnection() { |
560 if (base_.CloseOneIdleSocket()) | 560 if (base_.CloseOneIdleSocket()) |
561 return true; | 561 return true; |
562 return base_.CloseOneIdleConnectionInHigherLayeredPool(); | 562 return base_.CloseOneIdleConnectionInHigherLayeredPool(); |
563 } | 563 } |
564 | 564 |
565 } // namespace net | 565 } // namespace net |
OLD | NEW |