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