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

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

Issue 2017323002: Disable HTTP/2 Alternative Service for different host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Do not change port except for a small number of tests. Created 4 years, 6 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_network_transaction_unittest.cc ('k') | no next file » | 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/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 if (!session_->params().enable_user_alternate_protocol_ports && 258 if (!session_->params().enable_user_alternate_protocol_ports &&
259 (alternative_service.port >= kUnrestrictedPort && 259 (alternative_service.port >= kUnrestrictedPort &&
260 origin.port() < kUnrestrictedPort)) 260 origin.port() < kUnrestrictedPort))
261 continue; 261 continue;
262 262
263 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION && 263 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION &&
264 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) { 264 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) {
265 if (!HttpStreamFactory::spdy_enabled()) 265 if (!HttpStreamFactory::spdy_enabled())
266 continue; 266 continue;
267 267
268 // TODO(bnc): Re-enable when https://crbug.com/615413 is fixed.
269 if (origin.host() != alternative_service.host)
270 continue;
271
268 // Cache this entry if we don't have a non-broken Alt-Svc yet. 272 // Cache this entry if we don't have a non-broken Alt-Svc yet.
269 if (first_alternative_service.protocol == 273 if (first_alternative_service.protocol ==
270 UNINITIALIZED_ALTERNATE_PROTOCOL) 274 UNINITIALIZED_ALTERNATE_PROTOCOL)
271 first_alternative_service = alternative_service; 275 first_alternative_service = alternative_service;
272 continue; 276 continue;
273 } 277 }
274 278
275 DCHECK_EQ(QUIC, alternative_service.protocol); 279 DCHECK_EQ(QUIC, alternative_service.protocol);
276 quic_all_broken = false; 280 quic_all_broken = false;
277 if (!session_->params().enable_quic) 281 if (!session_->params().enable_quic)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 return true; 400 return true;
397 401
398 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) 402 if (session_->params().transport_security_state->IsGooglePinnedHost(host))
399 return true; 403 return true;
400 404
401 return ContainsKey(session_->params().quic_host_whitelist, 405 return ContainsKey(session_->params().quic_host_whitelist,
402 base::ToLowerASCII(host)); 406 base::ToLowerASCII(host));
403 } 407 }
404 408
405 } // namespace net 409 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698