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