Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: net/http/http_stream_factory_impl.cc

Issue 1824903002: Change the AlternativeServiceMap with SchemeOriginPair key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698