summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 21:47:35 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-10 21:47:35 +0000
commite1b19760199e7a1004684840c1641f934029f27a (patch)
treeb28c8a812a92a97aadd90b36affe143e368540e9 /net
parentaf03ffa2e41ce53568634ec0dba705c8251af1f3 (diff)
downloadchromium_src-e1b19760199e7a1004684840c1641f934029f27a.zip
chromium_src-e1b19760199e7a1004684840c1641f934029f27a.tar.gz
chromium_src-e1b19760199e7a1004684840c1641f934029f27a.tar.bz2
Add static function to convert NPN strings to an enum.
http://codereview.chromium.org/487012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34287 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/socket/ssl_client_socket.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h
index 8bd4c088..1b12ebc 100644
--- a/net/socket/ssl_client_socket.h
+++ b/net/socket/ssl_client_socket.h
@@ -20,6 +20,16 @@ class SSLInfo;
//
class SSLClientSocket : public ClientSocket {
public:
+ // Next Protocol Negotiation (NPN), if successful, results in agreement on an
+ // application-level string that specifies the application level protocol to
+ // use over the TLS connection. NextProto enumerates the application level
+ // protocols that we recognise.
+ enum NextProto {
+ kProtoUnknown = 0,
+ kProtoHTTP11 = 1,
+ kProtoSPDY = 2,
+ };
+
// Gets the SSL connection information of the socket.
virtual void GetSSLInfo(SSLInfo* ssl_info) = 0;
@@ -27,6 +37,16 @@ class SSLClientSocket : public ClientSocket {
// with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.
virtual void GetSSLCertRequestInfo(
SSLCertRequestInfo* cert_request_info) = 0;
+
+ static NextProto NextProtoFromString(const std::string& proto_string) {
+ if (proto_string == "http1.1") {
+ return kProtoHTTP11;
+ } else if (proto_string == "spdy") {
+ return kProtoSPDY;
+ } else {
+ return kProtoUnknown;
+ }
+ }
};
} // namespace net