OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "net/http/http_stream_factory_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 | 210 |
211 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceForInternal( | 211 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceForInternal( |
212 const HttpRequestInfo& request_info, | 212 const HttpRequestInfo& request_info, |
213 HttpStreamRequest::Delegate* delegate, | 213 HttpStreamRequest::Delegate* delegate, |
214 HttpStreamRequest::StreamType stream_type) { | 214 HttpStreamRequest::StreamType stream_type) { |
215 GURL original_url = request_info.url; | 215 GURL original_url = request_info.url; |
216 | 216 |
217 if (original_url.SchemeIs("ftp")) | 217 if (original_url.SchemeIs("ftp")) |
218 return AlternativeService(); | 218 return AlternativeService(); |
219 | 219 |
220 if (!session_->params().enable_alternative_service_for_insecure_origins && | |
221 !original_url.SchemeIs("https")) | |
Ryan Hamilton
2016/05/31 23:43:42
nit: I think this should probably have {}s since t
Bence
2016/06/01 10:54:38
Sorry, I missed this. Will do in a follow-up.
| |
222 return AlternativeService(); | |
223 | |
220 url::SchemeHostPort origin(original_url); | 224 url::SchemeHostPort origin(original_url); |
221 HttpServerProperties& http_server_properties = | 225 HttpServerProperties& http_server_properties = |
222 *session_->http_server_properties(); | 226 *session_->http_server_properties(); |
223 const AlternativeServiceVector alternative_service_vector = | 227 const AlternativeServiceVector alternative_service_vector = |
224 http_server_properties.GetAlternativeServices(origin); | 228 http_server_properties.GetAlternativeServices(origin); |
225 if (alternative_service_vector.empty()) | 229 if (alternative_service_vector.empty()) |
226 return AlternativeService(); | 230 return AlternativeService(); |
227 | 231 |
228 bool quic_advertised = false; | 232 bool quic_advertised = false; |
229 bool quic_all_broken = true; | 233 bool quic_all_broken = true; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 return true; | 404 return true; |
401 | 405 |
402 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) | 406 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) |
403 return true; | 407 return true; |
404 | 408 |
405 return ContainsKey(session_->params().quic_host_whitelist, | 409 return ContainsKey(session_->params().quic_host_whitelist, |
406 base::ToLowerASCII(host)); | 410 base::ToLowerASCII(host)); |
407 } | 411 } |
408 | 412 |
409 } // namespace net | 413 } // namespace net |
OLD | NEW |