| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_wrapper.h" | 5 #include "net/http/http_proxy_client_socket_wrapper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 } | 464 } |
| 465 if (result < 0) { | 465 if (result < 0) { |
| 466 if (transport_socket_handle_->socket()) | 466 if (transport_socket_handle_->socket()) |
| 467 transport_socket_handle_->socket()->Disconnect(); | 467 transport_socket_handle_->socket()->Disconnect(); |
| 468 return ERR_PROXY_CONNECTION_FAILED; | 468 return ERR_PROXY_CONNECTION_FAILED; |
| 469 } | 469 } |
| 470 | 470 |
| 471 SSLClientSocket* ssl = | 471 SSLClientSocket* ssl = |
| 472 static_cast<SSLClientSocket*>(transport_socket_handle_->socket()); | 472 static_cast<SSLClientSocket*>(transport_socket_handle_->socket()); |
| 473 protocol_negotiated_ = ssl->GetNegotiatedProtocol(); | 473 protocol_negotiated_ = ssl->GetNegotiatedProtocol(); |
| 474 using_spdy_ = NextProtoIsSPDY(protocol_negotiated_); | 474 using_spdy_ = protocol_negotiated_ == kProtoHTTP2; |
| 475 | 475 |
| 476 // Reset the timer to just the length of time allowed for HttpProxy handshake | 476 // Reset the timer to just the length of time allowed for HttpProxy handshake |
| 477 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take | 477 // so that a fast SSL connection plus a slow HttpProxy failure doesn't take |
| 478 // longer to timeout than it should. | 478 // longer to timeout than it should. |
| 479 SetConnectTimer(proxy_negotiation_timeout_duration_); | 479 SetConnectTimer(proxy_negotiation_timeout_duration_); |
| 480 | 480 |
| 481 // TODO(rch): If we ever decide to implement a "trusted" SPDY proxy | 481 // TODO(rch): If we ever decide to implement a "trusted" SPDY proxy |
| 482 // (one that we speak SPDY over SSL to, but to which we send HTTPS | 482 // (one that we speak SPDY over SSL to, but to which we send HTTPS |
| 483 // request directly instead of through CONNECT tunnels, then we | 483 // request directly instead of through CONNECT tunnels, then we |
| 484 // need to add a predicate to this if statement so we fall through | 484 // need to add a predicate to this if statement so we fall through |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 const HostResolver::RequestInfo& | 620 const HostResolver::RequestInfo& |
| 621 HttpProxyClientSocketWrapper::GetDestination() { | 621 HttpProxyClientSocketWrapper::GetDestination() { |
| 622 if (transport_params_) { | 622 if (transport_params_) { |
| 623 return transport_params_->destination(); | 623 return transport_params_->destination(); |
| 624 } else { | 624 } else { |
| 625 return ssl_params_->GetDirectConnectionParams()->destination(); | 625 return ssl_params_->GetDirectConnectionParams()->destination(); |
| 626 } | 626 } |
| 627 } | 627 } |
| 628 | 628 |
| 629 } // namespace net | 629 } // namespace net |
| OLD | NEW |