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 "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 continue; | 901 continue; |
902 | 902 |
903 if (!IsQuicWhitelistedForHost(origin.host())) | 903 if (!IsQuicWhitelistedForHost(origin.host())) |
904 continue; | 904 continue; |
905 | 905 |
906 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && | 906 if (stream_type == HttpStreamRequest::BIDIRECTIONAL_STREAM && |
907 session_->params().quic_disable_bidirectional_streams) { | 907 session_->params().quic_disable_bidirectional_streams) { |
908 continue; | 908 continue; |
909 } | 909 } |
910 | 910 |
911 if (session_->quic_stream_factory()->IsQuicDisabled( | 911 if (session_->quic_stream_factory()->IsQuicDisabled()) |
912 alternative_service.port)) | |
913 continue; | 912 continue; |
914 | 913 |
915 if (!original_url.SchemeIs("https")) | 914 if (!original_url.SchemeIs("https")) |
916 continue; | 915 continue; |
917 | 916 |
918 // Check whether there is an existing QUIC session to use for this origin. | 917 // Check whether there is an existing QUIC session to use for this origin. |
919 HostPortPair mapped_origin(origin.host(), origin.port()); | 918 HostPortPair mapped_origin(origin.host(), origin.port()); |
920 ignore_result(ApplyHostMappingRules(original_url, &mapped_origin)); | 919 ignore_result(ApplyHostMappingRules(original_url, &mapped_origin)); |
921 QuicServerId server_id(mapped_origin, request_info.privacy_mode); | 920 QuicServerId server_id(mapped_origin, request_info.privacy_mode); |
922 | 921 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 | 989 |
991 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); | 990 DCHECK(!(*alternative_proxy_server == proxy_info.proxy_server())); |
992 | 991 |
993 if (!alternative_proxy_server->is_https() && | 992 if (!alternative_proxy_server->is_https() && |
994 !alternative_proxy_server->is_quic()) { | 993 !alternative_proxy_server->is_quic()) { |
995 // Alternative proxy server should be a secure server. | 994 // Alternative proxy server should be a secure server. |
996 return false; | 995 return false; |
997 } | 996 } |
998 | 997 |
999 if (alternative_proxy_server->is_quic()) { | 998 if (alternative_proxy_server->is_quic()) { |
1000 // Check that QUIC is enabled globally, and it is not disabled on | 999 // Check that QUIC is enabled globally, and it is not disabled. |
1001 // the specified port. | |
1002 if (!session_->params().enable_quic || | 1000 if (!session_->params().enable_quic || |
1003 session_->quic_stream_factory()->IsQuicDisabled( | 1001 session_->quic_stream_factory()->IsQuicDisabled()) { |
1004 alternative_proxy_server->host_port_pair().port())) { | |
1005 return false; | 1002 return false; |
1006 } | 1003 } |
1007 } | 1004 } |
1008 | 1005 |
1009 return true; | 1006 return true; |
1010 } | 1007 } |
1011 } | 1008 } |
OLD | NEW |