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..9b7041e91ee59759d51367a847f83e1503d72c58 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,13 @@ HttpServerPropertiesImpl::GetAlternativeServiceInfos( |
bool HttpServerPropertiesImpl::SetAlternativeService( |
const url::SchemeHostPort& origin, |
const AlternativeService& alternative_service, |
- base::Time expiration) { |
+ base::Time expiration, |
+ const QuicVersionVector& advertised_versions) { |
return SetAlternativeServices( |
origin, |
AlternativeServiceInfoVector( |
- /*size=*/1, AlternativeServiceInfo(alternative_service, expiration))); |
+ /*size=*/1, AlternativeServiceInfo(alternative_service, expiration, |
+ advertised_versions))); |
} |
bool HttpServerPropertiesImpl::SetAlternativeServices( |
@@ -412,6 +414,12 @@ bool HttpServerPropertiesImpl::SetAlternativeServices( |
changed = true; |
break; |
} |
+ // Also persist to disk if advertised versions change significantly for |
Ryan Hamilton
2017/06/07 20:52:23
What does "significantly" mean here?
Zhongyi Shi
2017/06/08 23:11:16
Ah, advertised_versions used to be not sorted, and
|
+ // QUIC. |
+ if (!old.EqualAdvertisedVersions(*new_it)) { |
Ryan Hamilton
2017/06/07 20:52:23
can you just do old.advertised_services == new_it-
Zhongyi Shi
2017/06/08 23:11:16
Done.
|
+ changed = true; |
+ break; |
+ } |
++new_it; |
} |
} |