| 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_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 // is a potentially recoverable error. | 941 // is a potentially recoverable error. |
| 942 // and connection_->socket == NULL and connection_->is_ssl_error() is true, | 942 // and connection_->socket == NULL and connection_->is_ssl_error() is true, |
| 943 // then the SSL handshake ran with an unrecoverable error. | 943 // then the SSL handshake ran with an unrecoverable error. |
| 944 // otherwise, the error came from one of the other pools. | 944 // otherwise, the error came from one of the other pools. |
| 945 bool ssl_started = using_ssl_ && (result == OK || connection_->socket() || | 945 bool ssl_started = using_ssl_ && (result == OK || connection_->socket() || |
| 946 connection_->is_ssl_error()); | 946 connection_->is_ssl_error()); |
| 947 | 947 |
| 948 if (ssl_started && (result == OK || IsCertificateError(result))) { | 948 if (ssl_started && (result == OK || IsCertificateError(result))) { |
| 949 if (using_quic_ && result == OK) { | 949 if (using_quic_ && result == OK) { |
| 950 was_npn_negotiated_ = true; | 950 was_npn_negotiated_ = true; |
| 951 NextProto protocol_negotiated = | 951 protocol_negotiated_ = |
| 952 SSLClientSocket::NextProtoFromString("quic/1+spdy/3"); | 952 SSLClientSocket::NextProtoFromString("quic/1+spdy/3"); |
| 953 protocol_negotiated_ = protocol_negotiated; | |
| 954 } else { | 953 } else { |
| 955 SSLClientSocket* ssl_socket = | 954 SSLClientSocket* ssl_socket = |
| 956 static_cast<SSLClientSocket*>(connection_->socket()); | 955 static_cast<SSLClientSocket*>(connection_->socket()); |
| 957 if (ssl_socket->WasNpnNegotiated()) { | 956 if (ssl_socket->WasNpnNegotiated()) { |
| 958 was_npn_negotiated_ = true; | 957 was_npn_negotiated_ = true; |
| 959 std::string proto; | 958 std::string proto; |
| 960 SSLClientSocket::NextProtoStatus status = | 959 SSLClientSocket::NextProtoStatus status = |
| 961 ssl_socket->GetNextProto(&proto); | 960 ssl_socket->GetNextProto(&proto); |
| 962 NextProto protocol_negotiated = | 961 protocol_negotiated_ = SSLClientSocket::NextProtoFromString(proto); |
| 963 SSLClientSocket::NextProtoFromString(proto); | |
| 964 protocol_negotiated_ = protocol_negotiated; | |
| 965 net_log_.AddEvent( | 962 net_log_.AddEvent( |
| 966 NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO, | 963 NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO, |
| 967 base::Bind(&NetLogHttpStreamProtoCallback, | 964 base::Bind(&NetLogHttpStreamProtoCallback, |
| 968 status, &proto)); | 965 status, &proto)); |
| 969 if (ssl_socket->was_spdy_negotiated()) | 966 if (NextProtoIsSPDY(protocol_negotiated_)) |
| 970 SwitchToSpdyMode(); | 967 SwitchToSpdyMode(); |
| 971 } | 968 } |
| 972 } | 969 } |
| 973 } else if (proxy_info_.is_https() && connection_->socket() && | 970 } else if (proxy_info_.is_https() && connection_->socket() && |
| 974 result == OK) { | 971 result == OK) { |
| 975 ProxyClientSocket* proxy_socket = | 972 ProxyClientSocket* proxy_socket = |
| 976 static_cast<ProxyClientSocket*>(connection_->socket()); | 973 static_cast<ProxyClientSocket*>(connection_->socket()); |
| 977 if (proxy_socket->IsUsingSpdy()) { | 974 if (proxy_socket->IsUsingSpdy()) { |
| 978 was_npn_negotiated_ = true; | 975 was_npn_negotiated_ = true; |
| 979 protocol_negotiated_ = proxy_socket->GetProtocolNegotiated(); | 976 protocol_negotiated_ = proxy_socket->GetProtocolNegotiated(); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 if (scheme == "https" || scheme == "wss" || IsSpdyAlternate()) | 1471 if (scheme == "https" || scheme == "wss" || IsSpdyAlternate()) |
| 1475 return ClientSocketPoolManager::SSL_GROUP; | 1472 return ClientSocketPoolManager::SSL_GROUP; |
| 1476 | 1473 |
| 1477 if (scheme == "ftp") | 1474 if (scheme == "ftp") |
| 1478 return ClientSocketPoolManager::FTP_GROUP; | 1475 return ClientSocketPoolManager::FTP_GROUP; |
| 1479 | 1476 |
| 1480 return ClientSocketPoolManager::NORMAL_GROUP; | 1477 return ClientSocketPoolManager::NORMAL_GROUP; |
| 1481 } | 1478 } |
| 1482 | 1479 |
| 1483 } // namespace net | 1480 } // namespace net |
| OLD | NEW |