| 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/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( | 183 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( |
| 184 const HttpRequestInfo& request_info, | 184 const HttpRequestInfo& request_info, |
| 185 HttpStreamRequest::Delegate* delegate, | 185 HttpStreamRequest::Delegate* delegate, |
| 186 HttpStreamRequest::StreamType stream_type) { | 186 HttpStreamRequest::StreamType stream_type) { |
| 187 GURL original_url = request_info.url; | 187 GURL original_url = request_info.url; |
| 188 | 188 |
| 189 if (original_url.SchemeIs("ftp")) | 189 if (original_url.SchemeIs("ftp")) |
| 190 return AlternativeService(); | 190 return AlternativeService(); |
| 191 | 191 |
| 192 if (!session_->params().enable_alternative_service_for_insecure_origins && |
| 193 !original_url.SchemeIs("https")) |
| 194 return AlternativeService(); |
| 195 |
| 192 url::SchemeHostPort origin(original_url); | 196 url::SchemeHostPort origin(original_url); |
| 193 HttpServerProperties& http_server_properties = | 197 HttpServerProperties& http_server_properties = |
| 194 *session_->http_server_properties(); | 198 *session_->http_server_properties(); |
| 195 const AlternativeServiceVector alternative_service_vector = | 199 const AlternativeServiceVector alternative_service_vector = |
| 196 http_server_properties.GetAlternativeServices(origin); | 200 http_server_properties.GetAlternativeServices(origin); |
| 197 if (alternative_service_vector.empty()) | 201 if (alternative_service_vector.empty()) |
| 198 return AlternativeService(); | 202 return AlternativeService(); |
| 199 | 203 |
| 200 bool quic_advertised = false; | 204 bool quic_advertised = false; |
| 201 bool quic_all_broken = true; | 205 bool quic_all_broken = true; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 return true; | 376 return true; |
| 373 | 377 |
| 374 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) | 378 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) |
| 375 return true; | 379 return true; |
| 376 | 380 |
| 377 return ContainsKey(session_->params().quic_host_whitelist, | 381 return ContainsKey(session_->params().quic_host_whitelist, |
| 378 base::ToLowerASCII(host)); | 382 base::ToLowerASCII(host)); |
| 379 } | 383 } |
| 380 | 384 |
| 381 } // namespace net | 385 } // namespace net |
| OLD | NEW |