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

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

Issue 2026293002: Disable HTTP/2 Alternative Service for different host. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: 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/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 if (!session_->params().enable_user_alternate_protocol_ports && 230 if (!session_->params().enable_user_alternate_protocol_ports &&
231 (alternative_service.port >= kUnrestrictedPort && 231 (alternative_service.port >= kUnrestrictedPort &&
232 origin.port() < kUnrestrictedPort)) 232 origin.port() < kUnrestrictedPort))
233 continue; 233 continue;
234 234
235 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION && 235 if (alternative_service.protocol >= NPN_SPDY_MINIMUM_VERSION &&
236 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) { 236 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) {
237 if (!HttpStreamFactory::spdy_enabled()) 237 if (!HttpStreamFactory::spdy_enabled())
238 continue; 238 continue;
239 239
240 // TODO(bnc): Re-enable when https://crbug.com/615413 is fixed.
241 if (origin.host() != alternative_service.host)
242 continue;
243
240 // Cache this entry if we don't have a non-broken Alt-Svc yet. 244 // Cache this entry if we don't have a non-broken Alt-Svc yet.
241 if (first_alternative_service.protocol == 245 if (first_alternative_service.protocol ==
242 UNINITIALIZED_ALTERNATE_PROTOCOL) 246 UNINITIALIZED_ALTERNATE_PROTOCOL)
243 first_alternative_service = alternative_service; 247 first_alternative_service = alternative_service;
244 continue; 248 continue;
245 } 249 }
246 250
247 DCHECK_EQ(QUIC, alternative_service.protocol); 251 DCHECK_EQ(QUIC, alternative_service.protocol);
248 quic_all_broken = false; 252 quic_all_broken = false;
249 if (!session_->params().enable_quic) 253 if (!session_->params().enable_quic)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 return true; 372 return true;
369 373
370 if (session_->params().transport_security_state->IsGooglePinnedHost(host)) 374 if (session_->params().transport_security_state->IsGooglePinnedHost(host))
371 return true; 375 return true;
372 376
373 return ContainsKey(session_->params().quic_host_whitelist, 377 return ContainsKey(session_->params().quic_host_whitelist,
374 base::ToLowerASCII(host)); 378 base::ToLowerASCII(host));
375 } 379 }
376 380
377 } // namespace net 381 } // 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