| Index: net/http/http_server_properties.h
|
| diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
|
| index 3733c8672b6b1474e6468afc420b3f123f805d89..eaf0468701c604de19fcfbd4ee0b0b5e1feafb3e 100644
|
| --- a/net/http/http_server_properties.h
|
| +++ b/net/http/http_server_properties.h
|
| @@ -66,17 +66,33 @@
|
| NET_EXPORT void HistogramBrokenAlternateProtocolLocation(
|
| BrokenAlternateProtocolLocation location);
|
|
|
| -NET_EXPORT bool IsAlternateProtocolValid(NextProto protocol);
|
| +enum AlternateProtocol {
|
| + NPN_HTTP_2,
|
| + QUIC,
|
| + UNINITIALIZED_ALTERNATE_PROTOCOL,
|
| +};
|
| +
|
| +NET_EXPORT bool IsAlternateProtocolValid(AlternateProtocol protocol);
|
| +
|
| +NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol);
|
| +NET_EXPORT AlternateProtocol AlternateProtocolFromString(
|
| + const std::string& str);
|
| +NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto(
|
| + NextProto next_proto);
|
|
|
| // (protocol, host, port) triple as defined in
|
| // https://tools.ietf.org/id/draft-ietf-httpbis-alt-svc-06.html
|
| struct NET_EXPORT AlternativeService {
|
| - AlternativeService() : protocol(kProtoUnknown), host(), port(0) {}
|
| -
|
| - AlternativeService(NextProto protocol, const std::string& host, uint16_t port)
|
| + AlternativeService()
|
| + : protocol(UNINITIALIZED_ALTERNATE_PROTOCOL), host(), port(0) {}
|
| +
|
| + AlternativeService(AlternateProtocol protocol,
|
| + const std::string& host,
|
| + uint16_t port)
|
| : protocol(protocol), host(host), port(port) {}
|
|
|
| - AlternativeService(NextProto protocol, const HostPortPair& host_port_pair)
|
| + AlternativeService(AlternateProtocol protocol,
|
| + const HostPortPair& host_port_pair)
|
| : protocol(protocol),
|
| host(host_port_pair.host()),
|
| port(host_port_pair.port()) {}
|
| @@ -103,7 +119,7 @@
|
|
|
| std::string ToString() const;
|
|
|
| - NextProto protocol;
|
| + AlternateProtocol protocol;
|
| std::string host;
|
| uint16_t port;
|
| };
|
| @@ -116,11 +132,12 @@
|
| : alternative_service(alternative_service),
|
| expiration(expiration) {}
|
|
|
| - AlternativeServiceInfo(NextProto protocol,
|
| + AlternativeServiceInfo(AlternateProtocol protocol,
|
| const std::string& host,
|
| uint16_t port,
|
| base::Time expiration)
|
| - : alternative_service(protocol, host, port), expiration(expiration) {}
|
| + : alternative_service(protocol, host, port),
|
| + expiration(expiration) {}
|
|
|
| AlternativeServiceInfo(
|
| const AlternativeServiceInfo& alternative_service_info) = default;
|
|
|