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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 } | 949 } |
950 | 950 |
951 DCHECK_EQ(kProtoQUIC, alternative_service.protocol); | 951 DCHECK_EQ(kProtoQUIC, alternative_service.protocol); |
952 if (origin.host() != alternative_service.host && | 952 if (origin.host() != alternative_service.host && |
953 !session_->params() | 953 !session_->params() |
954 .enable_quic_alternative_service_with_different_host) { | 954 .enable_quic_alternative_service_with_different_host) { |
955 continue; | 955 continue; |
956 } | 956 } |
957 | 957 |
958 quic_all_broken = false; | 958 quic_all_broken = false; |
959 if (!session_->params().enable_quic) | 959 if (!session_->IsQuicEnabled()) |
960 continue; | 960 continue; |
961 | 961 |
962 if (!IsQuicWhitelistedForHost(origin.host())) | 962 if (!IsQuicWhitelistedForHost(origin.host())) |
963 continue; | 963 continue; |
964 | 964 |
965 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && | 965 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && |
966 session_->params().quic_disable_bidirectional_streams) { | 966 session_->params().quic_disable_bidirectional_streams) { |
967 continue; | 967 continue; |
968 } | 968 } |
969 | 969 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); | 1049 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); |
1050 | 1050 |
1051 if (!alternative_proxy_server->is_https() && | 1051 if (!alternative_proxy_server->is_https() && |
1052 !alternative_proxy_server->is_quic()) { | 1052 !alternative_proxy_server->is_quic()) { |
1053 // Alternative proxy server should be a secure server. | 1053 // Alternative proxy server should be a secure server. |
1054 return false; | 1054 return false; |
1055 } | 1055 } |
1056 | 1056 |
1057 if (alternative_proxy_server->is_quic()) { | 1057 if (alternative_proxy_server->is_quic()) { |
1058 // Check that QUIC is enabled globally, and it is not disabled. | 1058 // Check that QUIC is enabled globally, and it is not disabled. |
1059 if (!session_->params().enable_quic || | 1059 if (!session_->IsQuicEnabled() || |
1060 session_->quic_stream_factory()->IsQuicDisabled()) { | 1060 session_->quic_stream_factory()->IsQuicDisabled()) { |
1061 return false; | 1061 return false; |
1062 } | 1062 } |
1063 } | 1063 } |
1064 | 1064 |
1065 return true; | 1065 return true; |
1066 } | 1066 } |
1067 | 1067 |
1068 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage( | 1068 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage( |
1069 Job* job) const { | 1069 Job* job) const { |
(...skipping 24 matching lines...) Expand all Loading... |
1094 return; | 1094 return; |
1095 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); | 1095 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); |
1096 alternative_job_->Start(request_->stream_type()); | 1096 alternative_job_->Start(request_->stream_type()); |
1097 } | 1097 } |
1098 | 1098 |
1099 bool HttpStreamFactoryImpl::JobController::IsJobOrphaned(Job* job) const { | 1099 bool HttpStreamFactoryImpl::JobController::IsJobOrphaned(Job* job) const { |
1100 return !request_ || (job_bound_ && bound_job_ != job); | 1100 return !request_ || (job_bound_ && bound_job_ != job); |
1101 } | 1101 } |
1102 | 1102 |
1103 } // namespace net | 1103 } // namespace net |
OLD | NEW |