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

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

Issue 1904483004: Change SupportsSpdy dict, SpdySettingsMap, ServerNetworkStatsMap, AlternativeServiceMap and disk da… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile after sync code, introduced by commit 388755 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 177
178 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor( 178 AlternativeService HttpStreamFactoryImpl::GetAlternativeServiceFor(
179 const HttpRequestInfo& request_info, 179 const HttpRequestInfo& request_info,
180 HttpStreamRequest::Delegate* delegate, 180 HttpStreamRequest::Delegate* delegate,
181 HttpStreamRequest::StreamType stream_type) { 181 HttpStreamRequest::StreamType stream_type) {
182 GURL original_url = request_info.url; 182 GURL original_url = request_info.url;
183 183
184 if (original_url.SchemeIs("ftp")) 184 if (original_url.SchemeIs("ftp"))
185 return AlternativeService(); 185 return AlternativeService();
186 186
187 HostPortPair origin = HostPortPair::FromURL(original_url); 187 url::SchemeHostPort origin(original_url);
188 HttpServerProperties& http_server_properties = 188 HttpServerProperties& http_server_properties =
189 *session_->http_server_properties(); 189 *session_->http_server_properties();
190 const AlternativeServiceVector alternative_service_vector = 190 const AlternativeServiceVector alternative_service_vector =
191 http_server_properties.GetAlternativeServices(origin); 191 http_server_properties.GetAlternativeServices(origin);
192 if (alternative_service_vector.empty()) 192 if (alternative_service_vector.empty())
193 return AlternativeService(); 193 return AlternativeService();
194 194
195 bool quic_advertised = false; 195 bool quic_advertised = false;
196 bool quic_all_broken = true; 196 bool quic_all_broken = true;
197 197
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 continue; 257 continue;
258 258
259 if (!original_url.SchemeIs("https")) 259 if (!original_url.SchemeIs("https"))
260 continue; 260 continue;
261 261
262 // Check whether there is an existing QUIC session to use for this origin. 262 // Check whether there is an existing QUIC session to use for this origin.
263 HostPortPair destination(alternative_service.host_port_pair()); 263 HostPortPair destination(alternative_service.host_port_pair());
264 ignore_result(ApplyHostMappingRules(original_url, &destination)); 264 ignore_result(ApplyHostMappingRules(original_url, &destination));
265 QuicServerId server_id(destination, request_info.privacy_mode); 265 QuicServerId server_id(destination, request_info.privacy_mode);
266 266
267 HostPortPair origin_copy(origin); 267 HostPortPair origin_copy(origin.host(), origin.port());
268 ignore_result(ApplyHostMappingRules(original_url, &origin_copy)); 268 ignore_result(ApplyHostMappingRules(original_url, &origin_copy));
269 269
270 if (session_->quic_stream_factory()->CanUseExistingSession( 270 if (session_->quic_stream_factory()->CanUseExistingSession(
271 server_id, origin_copy.host())) { 271 server_id, origin_copy.host())) {
272 return alternative_service; 272 return alternative_service;
273 } 273 }
274 274
275 // Cache this entry if we don't have a non-broken Alt-Svc yet. 275 // Cache this entry if we don't have a non-broken Alt-Svc yet.
276 if (first_alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) 276 if (first_alternative_service.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL)
277 first_alternative_service = alternative_service; 277 first_alternative_service = alternative_service;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 return true; 363 return true;
364 364
365 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) 365 if (session_->params().transport_security_state->IsGooglePinnedHost(host))
366 return true; 366 return true;
367 367
368 return ContainsKey(session_->params().quic_host_whitelist, 368 return ContainsKey(session_->params().quic_host_whitelist,
369 base::ToLowerASCII(host)); 369 base::ToLowerASCII(host));
370 } 370 }
371 371
372 } // namespace net 372 } // 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