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

Side by Side Diff: net/socket/ssl_client_socket.h

Issue 1575048: SPDY: Change Chrome code to support new NPN protocols. (Closed)
Patch Set: oops Created 10 years, 8 months 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 unified diff | Download patch
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_ 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_H_
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_ 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/socket/client_socket.h" 10 #include "net/socket/client_socket.h"
(...skipping 21 matching lines...) Expand all
32 // the first protocol in our list. 32 // the first protocol in our list.
33 }; 33 };
34 34
35 // Next Protocol Negotiation (NPN), if successful, results in agreement on an 35 // Next Protocol Negotiation (NPN), if successful, results in agreement on an
36 // application-level string that specifies the application level protocol to 36 // application-level string that specifies the application level protocol to
37 // use over the TLS connection. NextProto enumerates the application level 37 // use over the TLS connection. NextProto enumerates the application level
38 // protocols that we recognise. 38 // protocols that we recognise.
39 enum NextProto { 39 enum NextProto {
40 kProtoUnknown = 0, 40 kProtoUnknown = 0,
41 kProtoHTTP11 = 1, 41 kProtoHTTP11 = 1,
42 kProtoSPDY = 2, 42 kProtoSPDY1 = 2,
43 }; 43 };
44 44
45 // Gets the SSL connection information of the socket. 45 // Gets the SSL connection information of the socket.
46 virtual void GetSSLInfo(SSLInfo* ssl_info) = 0; 46 virtual void GetSSLInfo(SSLInfo* ssl_info) = 0;
47 47
48 // Gets the SSL CertificateRequest info of the socket after Connect failed 48 // Gets the SSL CertificateRequest info of the socket after Connect failed
49 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. 49 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.
50 virtual void GetSSLCertRequestInfo( 50 virtual void GetSSLCertRequestInfo(
51 SSLCertRequestInfo* cert_request_info) = 0; 51 SSLCertRequestInfo* cert_request_info) = 0;
52 52
53 // Get the application level protocol that we negotiated with the server. 53 // Get the application level protocol that we negotiated with the server.
54 // *proto is set to the resulting protocol (n.b. that the string may have 54 // *proto is set to the resulting protocol (n.b. that the string may have
55 // embedded NULs). 55 // embedded NULs).
56 // kNextProtoUnsupported: *proto is cleared. 56 // kNextProtoUnsupported: *proto is cleared.
57 // kNextProtoNegotiated: *proto is set to the negotiated protocol. 57 // kNextProtoNegotiated: *proto is set to the negotiated protocol.
58 // kNextProtoNoOverlap: *proto is set to the first protocol in the 58 // kNextProtoNoOverlap: *proto is set to the first protocol in the
59 // supported list. 59 // supported list.
60 virtual NextProtoStatus GetNextProto(std::string* proto) = 0; 60 virtual NextProtoStatus GetNextProto(std::string* proto) = 0;
61 61
62 static NextProto NextProtoFromString(const std::string& proto_string) { 62 static NextProto NextProtoFromString(const std::string& proto_string) {
63 if (proto_string == "http1.1") { 63 if (proto_string == "http1.1" || proto_string == "http/1.1") {
64 return kProtoHTTP11; 64 return kProtoHTTP11;
65 } else if (proto_string == "spdy") { 65 } else if (proto_string == "spdy" || proto_string == "spdy/1") {
66 return kProtoSPDY; 66 return kProtoSPDY1;
67 } else { 67 } else {
68 return kProtoUnknown; 68 return kProtoUnknown;
69 } 69 }
70 } 70 }
71 }; 71 };
72 72
73 } // namespace net 73 } // namespace net
74 74
75 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ 75 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698