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

Unified Diff: net/http/http_stream_factory_impl_job_controller.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: Self review 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_impl_job_controller.cc
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc
index b23470229c3543532a51f1e722091ef68a865467..6f1d1668b3c13566fb9cfa81c3a7bf3fcbf84489 100644
--- a/net/http/http_stream_factory_impl_job_controller.cc
+++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -1024,7 +1024,17 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceInfoInternal(
if (session_->quic_stream_factory()->CanUseExistingSession(server_id,
destination)) {
- return alternative_service_info;
+ // If advertised versions for QUIC is missing for this
+ // AlternaitverServiceInfo, by default append the list of QUIC versions
+ // supported by this instance of network stack.
+ first_alternative_service_info = alternative_service_info;
+ if (first_alternative_service_info.alternative_service.protocol ==
+ kProtoQUIC &&
+ first_alternative_service_info.advertised_versions().empty()) {
+ first_alternative_service_info.set_advertised_versions(
+ session_->params().quic_supported_versions);
+ }
+ return first_alternative_service_info;
}
// Cache this entry if we don't have a non-broken Alt-Svc yet.
@@ -1037,6 +1047,16 @@ HttpStreamFactoryImpl::JobController::GetAlternativeServiceInfoInternal(
if (quic_advertised && quic_all_broken && delegate != nullptr)
delegate->OnQuicBroken();
+ // If advertised versions for QUIC is missing for this
+ // AlternaitverServiceInfo, by default append the list of QUIC versions
+ // supported by this instance of network stack.
+ if (first_alternative_service_info.alternative_service.protocol ==
+ kProtoQUIC &&
+ first_alternative_service_info.advertised_versions().empty()) {
+ first_alternative_service_info.set_advertised_versions(
+ session_->params().quic_supported_versions);
+ }
+
return first_alternative_service_info;
}

Powered by Google App Engine
This is Rietveld 408576698