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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: manually fix rebase issues Created 3 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_server_properties_impl.cc
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index a02cf7869cddd51ffb5310f1d485abae00ecdcfc..aef339eb4d2a9a3388604c02d5f9f507a287d6cd 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -319,8 +319,8 @@ HttpServerPropertiesImpl::GetAlternativeServiceInfos(
++it;
continue;
}
- valid_alternative_service_infos.push_back(
- AlternativeServiceInfo(alternative_service, it->expiration));
+ valid_alternative_service_infos.push_back(AlternativeServiceInfo(
+ alternative_service, it->expiration, it->advertised_versions()));
++it;
}
if (map_it->second.empty()) {
@@ -355,8 +355,8 @@ HttpServerPropertiesImpl::GetAlternativeServiceInfos(
++it;
continue;
}
- valid_alternative_service_infos.push_back(
- AlternativeServiceInfo(alternative_service, it->expiration));
+ valid_alternative_service_infos.push_back(AlternativeServiceInfo(
+ alternative_service, it->expiration, it->advertised_versions()));
++it;
}
if (map_it->second.empty()) {
@@ -368,11 +368,18 @@ HttpServerPropertiesImpl::GetAlternativeServiceInfos(
bool HttpServerPropertiesImpl::SetAlternativeService(
const url::SchemeHostPort& origin,
const AlternativeService& alternative_service,
- base::Time expiration) {
+ base::Time expiration,
+ const QuicVersionVector& advertised_versions) {
+ // Alternative service has Non-QUIC protocol should not have any QUIC version
+ // listed in advertised versions.
+ if (alternative_service.protocol != kProtoQUIC)
+ DCHECK(advertised_versions.empty());
+
return SetAlternativeServices(
origin,
AlternativeServiceInfoVector(
- /*size=*/1, AlternativeServiceInfo(alternative_service, expiration)));
+ /*size=*/1, AlternativeServiceInfo(alternative_service, expiration,
+ advertised_versions)));
}
bool HttpServerPropertiesImpl::SetAlternativeServices(
@@ -412,6 +419,12 @@ bool HttpServerPropertiesImpl::SetAlternativeServices(
changed = true;
break;
}
+ // Also persist to disk if new entry has a different list of advertised
+ // versions.
+ if (old.advertised_versions() != new_it->advertised_versions()) {
+ changed = true;
+ break;
+ }
++new_it;
}
}

Powered by Google App Engine
This is Rietveld 408576698