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