Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: Cleanup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 } 938 }
939 939
940 DCHECK_EQ(kProtoQUIC, alternative_service.protocol); 940 DCHECK_EQ(kProtoQUIC, alternative_service.protocol);
941 if (origin.host() != alternative_service.host && 941 if (origin.host() != alternative_service.host &&
942 !session_->params() 942 !session_->params()
943 .enable_quic_alternative_service_with_different_host) { 943 .enable_quic_alternative_service_with_different_host) {
944 continue; 944 continue;
945 } 945 }
946 946
947 quic_all_broken = false; 947 quic_all_broken = false;
948 if (!session_->params().enable_quic) 948 if (!session_->IsQuicEnabled())
949 continue; 949 continue;
950 950
951 if (!IsQuicWhitelistedForHost(origin.host())) 951 if (!IsQuicWhitelistedForHost(origin.host()))
952 continue; 952 continue;
953 953
954 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && 954 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM &&
955 session_->params().quic_disable_bidirectional_streams) { 955 session_->params().quic_disable_bidirectional_streams) {
956 continue; 956 continue;
957 } 957 }
958 958
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); 1038 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server()));
1039 1039
1040 if (!alternative_proxy_server->is_https() && 1040 if (!alternative_proxy_server->is_https() &&
1041 !alternative_proxy_server->is_quic()) { 1041 !alternative_proxy_server->is_quic()) {
1042 // Alternative proxy server should be a secure server. 1042 // Alternative proxy server should be a secure server.
1043 return false; 1043 return false;
1044 } 1044 }
1045 1045
1046 if (alternative_proxy_server->is_quic()) { 1046 if (alternative_proxy_server->is_quic()) {
1047 // Check that QUIC is enabled globally, and it is not disabled. 1047 // Check that QUIC is enabled globally, and it is not disabled.
1048 if (!session_->params().enable_quic || 1048 if (!session_->IsQuicEnabled() ||
1049 session_->quic_stream_factory()->IsQuicDisabled()) { 1049 session_->quic_stream_factory()->IsQuicDisabled()) {
1050 return false; 1050 return false;
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 return true; 1054 return true;
1055 } 1055 }
1056 1056
1057 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage( 1057 void HttpStreamFactoryImpl::JobController::ReportAlternateProtocolUsage(
1058 Job* job) const { 1058 Job* job) const {
(...skipping 20 matching lines...) Expand all
1079 } 1079 }
1080 1080
1081 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() { 1081 void HttpStreamFactoryImpl::JobController::StartAlternativeProxyServerJob() {
1082 if (!alternative_job_ || !request_) 1082 if (!alternative_job_ || !request_)
1083 return; 1083 return;
1084 DCHECK(alternative_job_->alternative_proxy_server().is_valid()); 1084 DCHECK(alternative_job_->alternative_proxy_server().is_valid());
1085 alternative_job_->Start(request_->stream_type()); 1085 alternative_job_->Start(request_->stream_type());
1086 } 1086 }
1087 1087
1088 } // namespace net 1088 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698