| Index: net/http/http_server_properties.cc
|
| diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc
|
| index 15947b2a49e9dbb1bcbe1195953aa4d8587c37ea..a1289cae280ae14875a98cada08e1f21dec78642 100644
|
| --- a/net/http/http_server_properties.cc
|
| +++ b/net/http/http_server_properties.cc
|
| @@ -7,6 +7,7 @@
|
| #include "base/logging.h"
|
| #include "base/metrics/histogram_macros.h"
|
| #include "base/strings/stringprintf.h"
|
| +#include "net/http/http_network_session.h"
|
| #include "net/socket/ssl_client_socket.h"
|
| #include "net/ssl/ssl_config.h"
|
|
|
| @@ -78,18 +79,40 @@ bool IsAlternateProtocolValid(NextProto protocol) {
|
| return false;
|
| }
|
|
|
| +// static
|
| +AlternativeServiceInfo
|
| +AlternativeServiceInfo::CreateHttp2AlternativeServiceInfo(
|
| + const AlternativeService& alternative_service,
|
| + base::Time expiration) {
|
| + DCHECK_EQ(alternative_service.protocol, kProtoHTTP2);
|
| + return AlternativeServiceInfo(alternative_service, expiration,
|
| + QuicVersionVector());
|
| +}
|
| +
|
| +// static
|
| +AlternativeServiceInfo AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
|
| + const AlternativeService& alternative_service,
|
| + base::Time expiration,
|
| + const QuicVersionVector& advertised_versions) {
|
| + DCHECK_EQ(alternative_service.protocol, kProtoQUIC);
|
| + return AlternativeServiceInfo(alternative_service, expiration,
|
| + advertised_versions);
|
| +}
|
| +
|
| AlternativeServiceInfo::AlternativeServiceInfo() : alternative_service_() {}
|
|
|
| +AlternativeServiceInfo::~AlternativeServiceInfo() {}
|
| +
|
| AlternativeServiceInfo::AlternativeServiceInfo(
|
| const AlternativeService& alternative_service,
|
| - base::Time expiration)
|
| - : alternative_service_(alternative_service), expiration_(expiration) {}
|
| -
|
| -AlternativeServiceInfo::AlternativeServiceInfo(NextProto protocol,
|
| - const std::string& host,
|
| - uint16_t port,
|
| - base::Time expiration)
|
| - : alternative_service_(protocol, host, port), expiration_(expiration) {}
|
| + base::Time expiration,
|
| + const QuicVersionVector& advertised_versions)
|
| + : alternative_service_(alternative_service), expiration_(expiration) {
|
| + if (alternative_service_.protocol == kProtoQUIC) {
|
| + advertised_versions_ = advertised_versions;
|
| + std::sort(advertised_versions_.begin(), advertised_versions_.end());
|
| + }
|
| +}
|
|
|
| AlternativeServiceInfo::AlternativeServiceInfo(
|
| const AlternativeServiceInfo& alternative_service_info) = default;
|
|
|