| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( | 181 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( |
| 182 const HttpRequestInfo& request_info, | 182 const HttpRequestInfo& request_info, |
| 183 HttpStreamRequest::Delegate* delegate) { | 183 HttpStreamRequest::Delegate* delegate) { |
| 184 GURL original_url = request_info.url; | 184 GURL original_url = request_info.url; |
| 185 | 185 |
| 186 if (original_url.SchemeIs("ftp")) | 186 if (original_url.SchemeIs("ftp")) |
| 187 return AlternativeService(); | 187 return AlternativeService(); |
| 188 | 188 |
| 189 HostPortPair origin = HostPortPair::FromURL(original_url); | 189 HostPortPair origin = HostPortPair::FromURL(original_url); |
| 190 SchemeOriginPair scheme_origin(original_url.scheme(), origin); |
| 190 HttpServerProperties& http_server_properties = | 191 HttpServerProperties& http_server_properties = |
| 191 *session_->http_server_properties(); | 192 *session_->http_server_properties(); |
| 192 const AlternativeServiceVector alternative_service_vector = | 193 const AlternativeServiceVector alternative_service_vector = |
| 193 http_server_properties.GetAlternativeServices(origin); | 194 http_server_properties.GetAlternativeServices(scheme_origin); |
| 194 if (alternative_service_vector.empty()) | 195 if (alternative_service_vector.empty()) |
| 195 return AlternativeService(); | 196 return AlternativeService(); |
| 196 | 197 |
| 197 bool quic_advertised = false; | 198 bool quic_advertised = false; |
| 198 bool quic_all_broken = true; | 199 bool quic_all_broken = true; |
| 199 | 200 |
| 200 const bool enable_different_host = | 201 const bool enable_different_host = |
| 201 session_->params().enable_alternative_service_with_different_host; | 202 session_->params().enable_alternative_service_with_different_host; |
| 202 | 203 |
| 203 // First Alt-Svc that is not marked as broken. | 204 // First Alt-Svc that is not marked as broken. |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 return true; | 361 return true; |
| 361 | 362 |
| 362 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) | 363 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) |
| 363 return true; | 364 return true; |
| 364 | 365 |
| 365 return ContainsKey(session_->params().quic_host_whitelist, | 366 return ContainsKey(session_->params().quic_host_whitelist, |
| 366 base::ToLowerASCII(host)); | 367 base::ToLowerASCII(host)); |
| 367 } | 368 } |
| 368 | 369 |
| 369 } // namespace net | 370 } // namespace net |
| OLD | NEW |