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

Unified Diff: net/socket/ssl_client_socket.cc

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/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket.cc
diff --git a/net/socket/ssl_client_socket.cc b/net/socket/ssl_client_socket.cc
index 7c91d2fb7616a559eee17ca171373a03a625b0da..a2e62264ed1868ca9642d43f3a99033a4920e9bd 100644
--- a/net/socket/ssl_client_socket.cc
+++ b/net/socket/ssl_client_socket.cc
@@ -27,6 +27,34 @@
SSLClientSocket::SSLClientSocket()
: signed_cert_timestamps_received_(false),
stapled_ocsp_response_received_(false) {}
+
+// static
+NextProto SSLClientSocket::NextProtoFromString(base::StringPiece proto_string) {
+ if (proto_string == "http1.1" || proto_string == "http/1.1") {
+ return kProtoHTTP11;
+ } else if (proto_string == "h2") {
+ return kProtoHTTP2;
+ } else if (proto_string == "quic/1+spdy/3") {
+ return kProtoQUIC;
+ } else {
+ return kProtoUnknown;
+ }
+}
+
+// static
+const char* SSLClientSocket::NextProtoToString(NextProto next_proto) {
+ switch (next_proto) {
+ case kProtoHTTP11:
+ return "http/1.1";
+ case kProtoHTTP2:
+ return "h2";
+ case kProtoQUIC:
+ return "quic/1+spdy/3";
+ case kProtoUnknown:
+ break;
+ }
+ return "unknown";
+}
// static
void SSLClientSocket::SetSSLKeyLogFile(
« no previous file with comments | « net/socket/ssl_client_socket.h ('k') | net/socket/ssl_client_socket_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698