| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_controller.h" | 5 #include "net/http/http_stream_factory_impl_job_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 } | 941 } |
| 942 | 942 |
| 943 DCHECK_EQ(kProtoQUIC, alternative_service.protocol); | 943 DCHECK_EQ(kProtoQUIC, alternative_service.protocol); |
| 944 if (origin.host() != alternative_service.host && | 944 if (origin.host() != alternative_service.host && |
| 945 !session_->params() | 945 !session_->params() |
| 946 .enable_quic_alternative_service_with_different_host) { | 946 .enable_quic_alternative_service_with_different_host) { |
| 947 continue; | 947 continue; |
| 948 } | 948 } |
| 949 | 949 |
| 950 quic_all_broken = false; | 950 quic_all_broken = false; |
| 951 if (!session_->params().enable_quic) | 951 if (!session_->IsQuicEnabled()) |
| 952 continue; | 952 continue; |
| 953 | 953 |
| 954 if (!IsQuicWhitelistedForHost(origin.host())) | 954 if (!IsQuicWhitelistedForHost(origin.host())) |
| 955 continue; | 955 continue; |
| 956 | 956 |
| 957 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && | 957 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && |
| 958 session_->params().quic_disable_bidirectional_streams) { | 958 session_->params().quic_disable_bidirectional_streams) { |
| 959 continue; | 959 continue; |
| 960 } | 960 } |
| 961 | 961 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); | 1041 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); |
| 1042 | 1042 |
| 1043 if (!alternative_proxy_server->is_https() && | 1043 if (!alternative_proxy_server->is_https() && |
| 1044 !alternative_proxy_server->is_quic()) { | 1044 !alternative_proxy_server->is_quic()) { |
| 1045 // Alternative proxy server should be a secure server. | 1045 // Alternative proxy server should be a secure server. |
| 1046 return false; | 1046 return false; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 if (alternative_proxy_server->is_quic()) { | 1049 if (alternative_proxy_server->is_quic()) { |
| 1050 // Check that QUIC is enabled globally, and it is not disabled. | 1050 // Check that QUIC is enabled globally, and it is not disabled. |
| 1051 if (!session_->params().enable_quic || | 1051 if (!session_->IsQuicEnabled() || |
| 1052 session_->quic_stream_factory()->IsQuicDisabled()) { | 1052 session_->quic_stream_factory()->IsQuicDisabled()) { |
| 1053 return false; | 1053 return false; |
| 1054 } | 1054 } |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 return true; | 1057 return true; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage( | 1060 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage( |
| 1061 Job* job) const { | 1061 Job* job) const { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1082 } | 1082 } |
| 1083 | 1083 |
| 1084 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { | 1084 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { |
| 1085 if (!alternative_job_ || !request_) | 1085 if (!alternative_job_ || !request_) |
| 1086 return; | 1086 return; |
| 1087 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); | 1087 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); |
| 1088 alternative_job_->Start(request_->stream_type()); | 1088 alternative_job_->Start(request_->stream_type()); |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 } // namespace net | 1091 } // namespace net |
| OLD | NEW |