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

Unified Diff: net/http/http_server_properties.h

Issue 2496953002: Revert of Unify enum NextProto and enum AlternateProtocol. (Closed)
Patch Set: Created 4 years, 1 month 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/http/http_network_transaction_unittest.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698