| 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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 // is a potentially recoverable error. | 1002 // is a potentially recoverable error. |
| 1003 // and connection_->socket == NULL and connection_->is_ssl_error() is true, | 1003 // and connection_->socket == NULL and connection_->is_ssl_error() is true, |
| 1004 // then the SSL handshake ran with an unrecoverable error. | 1004 // then the SSL handshake ran with an unrecoverable error. |
| 1005 // otherwise, the error came from one of the other pools. | 1005 // otherwise, the error came from one of the other pools. |
| 1006 bool ssl_started = using_ssl_ && (result == OK || connection_->socket() || | 1006 bool ssl_started = using_ssl_ && (result == OK || connection_->socket() || |
| 1007 connection_->is_ssl_error()); | 1007 connection_->is_ssl_error()); |
| 1008 | 1008 |
| 1009 if (ssl_started && (result == OK || IsCertificateError(result))) { | 1009 if (ssl_started && (result == OK || IsCertificateError(result))) { |
| 1010 if (using_quic_ && result == OK) { | 1010 if (using_quic_ && result == OK) { |
| 1011 was_alpn_negotiated_ = true; | 1011 was_alpn_negotiated_ = true; |
| 1012 negotiated_protocol_ = kProtoQUIC1SPDY3; | 1012 negotiated_protocol_ = kProtoQUIC; |
| 1013 } else { | 1013 } else { |
| 1014 SSLClientSocket* ssl_socket = | 1014 SSLClientSocket* ssl_socket = |
| 1015 static_cast<SSLClientSocket*>(connection_->socket()); | 1015 static_cast<SSLClientSocket*>(connection_->socket()); |
| 1016 if (ssl_socket->WasNpnNegotiated()) { | 1016 if (ssl_socket->WasNpnNegotiated()) { |
| 1017 was_alpn_negotiated_ = true; | 1017 was_alpn_negotiated_ = true; |
| 1018 negotiated_protocol_ = ssl_socket->GetNegotiatedProtocol(); | 1018 negotiated_protocol_ = ssl_socket->GetNegotiatedProtocol(); |
| 1019 net_log_.AddEvent( | 1019 net_log_.AddEvent( |
| 1020 NetLogEventType::HTTP_STREAM_REQUEST_PROTO, | 1020 NetLogEventType::HTTP_STREAM_REQUEST_PROTO, |
| 1021 base::Bind(&NetLogHttpStreamProtoCallback, negotiated_protocol_)); | 1021 base::Bind(&NetLogHttpStreamProtoCallback, negotiated_protocol_)); |
| 1022 if (negotiated_protocol_ == kProtoHTTP2) | 1022 if (negotiated_protocol_ == kProtoHTTP2) |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 | 1501 |
| 1502 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1502 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1503 if (connection_->socket()) { | 1503 if (connection_->socket()) { |
| 1504 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1504 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1507 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 } // namespace net | 1510 } // namespace net |
| OLD | NEW |