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

Unified Diff: net/spdy/chromium/spdy_session.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
« no previous file with comments | « net/quic/chromium/quic_stream_factory_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/chromium/spdy_session.cc
diff --git a/net/spdy/chromium/spdy_session.cc b/net/spdy/chromium/spdy_session.cc
index 8f2921cb7bc0e8b4d7cd6d937d10d6b76462dc6a..f8bb21938e4d4ceca605d4dd5faa0c37c9f08c4f 100644
--- a/net/spdy/chromium/spdy_session.cc
+++ b/net/spdy/chromium/spdy_session.cc
@@ -3024,19 +3024,17 @@ void SpdySession::OnAltSvc(
// so that SpdySession::OnAltSvc and
// HttpStreamFactory::ProcessAlternativeServices
// could use the the same function.
- // Check if QUIC version is supported.
+ // Check if QUIC version is supported. Filter supported QUIC versions.
+ QuicVersionVector advertised_versions;
if (protocol == kProtoQUIC && !altsvc.version.empty()) {
bool match_found = false;
for (const QuicVersion& supported : quic_supported_versions_) {
for (const uint16_t& advertised : altsvc.version) {
if (supported == advertised) {
match_found = true;
- break;
+ advertised_versions.push_back(supported);
}
}
- if (match_found) {
- break;
- }
}
if (!match_found) {
continue;
@@ -3047,9 +3045,19 @@ void SpdySession::OnAltSvc(
altsvc.port);
const base::Time expiration =
now + base::TimeDelta::FromSeconds(altsvc.max_age);
- alternative_service_info_vector.push_back(
- AlternativeServiceInfo(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);
}
+
http_server_properties_->SetAlternativeServices(
scheme_host_port, alternative_service_info_vector);
}
« no previous file with comments | « net/quic/chromium/quic_stream_factory_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698