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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1216703002: Implement multiple alternative services per origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 0a43e7044de138be8830050881624dde11a9c72e..69d42137a521567249d180aadc2b117ef015923c 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -684,13 +684,21 @@ int QuicStreamFactory::Create(const HostPortPair& host_port_pair,
if (http_server_properties_) {
const AlternativeServiceMap& alternative_service_map =
http_server_properties_->alternative_service_map();
- AlternativeServiceMap::const_iterator it =
+ AlternativeServiceMap::const_iterator map_it =
alternative_service_map.Peek(server_id.host_port_pair());
- if (it == alternative_service_map.end() ||
- it->second.alternative_service.protocol != QUIC) {
+ if (map_it != alternative_service_map.end()) {
+ const AlternativeServiceInfoVector& alternative_service_info_vector =
+ map_it->second;
+ AlternativeServiceInfoVector::const_iterator it;
+ for (it = alternative_service_info_vector.begin();
+ it != alternative_service_info_vector.end(); ++it) {
+ if (it->alternative_service.protocol == QUIC)
+ break;
+ }
// If there is no entry for QUIC, consider that as a new server and
// don't wait for Cache thread to load the data for that server.
- load_from_disk_cache = false;
+ if (it == alternative_service_info_vector.end())
+ load_from_disk_cache = false;
}
}
if (load_from_disk_cache && CryptoConfigCacheIsEmpty(server_id)) {
@@ -1212,10 +1220,14 @@ void QuicStreamFactory::InitializeCachedStateInCryptoConfig(
if (http_server_properties_) {
if (quic_supported_servers_at_startup_.empty()) {
- for (const std::pair<const HostPortPair, AlternativeServiceInfo>&
+ for (const std::pair<const HostPortPair, AlternativeServiceInfoVector>&
key_value : http_server_properties_->alternative_service_map()) {
- if (key_value.second.alternative_service.protocol == QUIC) {
- quic_supported_servers_at_startup_.insert(key_value.first);
+ for (const AlternativeServiceInfo& alternative_service_info :
+ key_value.second) {
+ if (alternative_service_info.alternative_service.protocol == QUIC) {
+ quic_supported_servers_at_startup_.insert(key_value.first);
+ break;
+ }
}
}
}
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698