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

Unified Diff: net/http/http_stream_factory.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix Canonical test 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_stream_factory.cc
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index 2c7eed610948b07a67249626b36baebbdd9c03dd..4c21ffcef890c2565ee561e7c357f085483c9588 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -51,19 +51,17 @@ void HttpStreamFactory::ProcessAlternativeServices(
!IsPortValid(alternative_service_entry.port)) {
continue;
}
- // Check if QUIC version is supported.
+ // Check if QUIC version is supported. Filter supported QUIC versions.
+ QuicVersionVector advertised_versions;
if (protocol == kProtoQUIC && !alternative_service_entry.version.empty()) {
bool match_found = false;
for (QuicVersion supported : session->params().quic_supported_versions) {
for (uint16_t advertised : alternative_service_entry.version) {
if (supported == advertised) {
match_found = true;
- break;
+ advertised_versions.push_back(supported);
}
}
- if (match_found) {
- break;
- }
}
if (!match_found) {
continue;
@@ -75,8 +73,16 @@ void HttpStreamFactory::ProcessAlternativeServices(
base::Time expiration =
base::Time::Now() +
base::TimeDelta::FromSeconds(alternative_service_entry.max_age);
- AlternativeServiceInfo alternative_service_info(alternative_service,
- expiration);
+ AlternativeServiceInfo alternative_service_info;
+ if (protocol == kProtoQUIC) {
+ alternative_service_info =
+ AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
+ alternative_service, expiration, advertised_versions);
+ } else {
+ alternative_service_info =
+ AlternativeServiceInfo::CreateHttp2AlternativeServiceInfo(
+ alternative_service, expiration);
+ }
alternative_service_info_vector.push_back(alternative_service_info);
}
« no previous file with comments | « net/http/http_server_properties_manager_unittest.cc ('k') | net/http/http_stream_factory_impl_job_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698