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 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 if (IsSpdyAlternative() || IsQuicAlternative()) { | 1308 if (IsSpdyAlternative() || IsQuicAlternative()) { |
1309 // We currently only support Alternate-Protocol where the original scheme | 1309 // We currently only support Alternate-Protocol where the original scheme |
1310 // is http. | 1310 // is http. |
1311 DCHECK(origin_url_.SchemeIs("http")); | 1311 DCHECK(origin_url_.SchemeIs("http")); |
1312 return origin_url_.SchemeIs("http"); | 1312 return origin_url_.SchemeIs("http"); |
1313 } | 1313 } |
1314 return request_info_.url.SchemeIs("http"); | 1314 return request_info_.url.SchemeIs("http"); |
1315 } | 1315 } |
1316 | 1316 |
1317 bool HttpStreamFactoryImpl::Job::IsSpdyAlternative() const { | 1317 bool HttpStreamFactoryImpl::Job::IsSpdyAlternative() const { |
1318 return alternative_service_.protocol >= NPN_SPDY_MINIMUM_VERSION && | 1318 return alternative_service_.protocol == NPN_HTTP_2; |
1319 alternative_service_.protocol <= NPN_SPDY_MAXIMUM_VERSION; | |
1320 } | 1319 } |
1321 | 1320 |
1322 bool HttpStreamFactoryImpl::Job::IsQuicAlternative() const { | 1321 bool HttpStreamFactoryImpl::Job::IsQuicAlternative() const { |
1323 return alternative_service_.protocol == QUIC; | 1322 return alternative_service_.protocol == QUIC; |
1324 } | 1323 } |
1325 | 1324 |
1326 void HttpStreamFactoryImpl::Job::InitSSLConfig(SSLConfig* ssl_config, | 1325 void HttpStreamFactoryImpl::Job::InitSSLConfig(SSLConfig* ssl_config, |
1327 bool is_proxy) const { | 1326 bool is_proxy) const { |
1328 if (!is_proxy) { | 1327 if (!is_proxy) { |
1329 // Prior to HTTP/2 and SPDY, some servers use TLS renegotiation to request | 1328 // Prior to HTTP/2 and SPDY, some servers use TLS renegotiation to request |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 | 1521 |
1523 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1522 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
1524 if (connection_->socket()) { | 1523 if (connection_->socket()) { |
1525 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1524 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
1526 } | 1525 } |
1527 | 1526 |
1528 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1527 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
1529 } | 1528 } |
1530 | 1529 |
1531 } // namespace net | 1530 } // namespace net |
OLD | NEW |