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

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

Issue 10690122: Change SpdySession::GetSSLInfo to get the SSLInfo from the underlying socket (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Actual working test Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // connection. 63 // connection.
64 enum NextProtoStatus { 64 enum NextProtoStatus {
65 // WARNING: These values are serialized to disk. Don't change them. 65 // WARNING: These values are serialized to disk. Don't change them.
66 66
67 kNextProtoUnsupported = 0, // The server doesn't support NPN. 67 kNextProtoUnsupported = 0, // The server doesn't support NPN.
68 kNextProtoNegotiated = 1, // We agreed on a protocol. 68 kNextProtoNegotiated = 1, // We agreed on a protocol.
69 kNextProtoNoOverlap = 2, // No protocols in common. We requested 69 kNextProtoNoOverlap = 2, // No protocols in common. We requested
70 // the first protocol in our list. 70 // the first protocol in our list.
71 }; 71 };
72 72
73 // Gets the SSL connection information of the socket.
74 //
75 // TODO(sergeyu): Move this method to the SSLSocket interface and
76 // implemented in SSLServerSocket too.
77 virtual void GetSSLInfo(SSLInfo* ssl_info) = 0;
78
79 // Gets the SSL CertificateRequest info of the socket after Connect failed 73 // Gets the SSL CertificateRequest info of the socket after Connect failed
80 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. 74 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED.
81 virtual void GetSSLCertRequestInfo( 75 virtual void GetSSLCertRequestInfo(
82 SSLCertRequestInfo* cert_request_info) = 0; 76 SSLCertRequestInfo* cert_request_info) = 0;
83 77
84 // StreamSocket: 78 // StreamSocket:
79 virtual bool WasNpnNegotiated() const OVERRIDE;
Ryan Sleevi 2012/07/11 22:50:43 Move 78+79 to 72 Put the interface implementation
Ryan Hamilton 2012/07/11 23:37:25 Done.
80
85 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; 81 virtual NextProto GetNegotiatedProtocol() const OVERRIDE;
86 82
87 // Get the application level protocol that we negotiated with the server. 83 // Get the application level protocol that we negotiated with the server.
88 // *proto is set to the resulting protocol (n.b. that the string may have 84 // *proto is set to the resulting protocol (n.b. that the string may have
89 // embedded NULs). 85 // embedded NULs).
90 // kNextProtoUnsupported: *proto is cleared. 86 // kNextProtoUnsupported: *proto is cleared.
91 // kNextProtoNegotiated: *proto is set to the negotiated protocol. 87 // kNextProtoNegotiated: *proto is set to the negotiated protocol.
92 // kNextProtoNoOverlap: *proto is set to the first protocol in the 88 // kNextProtoNoOverlap: *proto is set to the first protocol in the
93 // supported list. 89 // supported list.
94 // *server_protos is set to the server advertised protocols. 90 // *server_protos is set to the server advertised protocols.
95 virtual NextProtoStatus GetNextProto(std::string* proto, 91 virtual NextProtoStatus GetNextProto(std::string* proto,
96 std::string* server_protos) = 0; 92 std::string* server_protos) = 0;
97 93
98 static NextProto NextProtoFromString(const std::string& proto_string); 94 static NextProto NextProtoFromString(const std::string& proto_string);
99 95
100 static const char* NextProtoToString(NextProto next_proto); 96 static const char* NextProtoToString(NextProto next_proto);
101 97
102 static const char* NextProtoStatusToString(const NextProtoStatus status); 98 static const char* NextProtoStatusToString(const NextProtoStatus status);
103 99
104 // Can be used with the second argument(|server_protos|) of |GetNextProto| to 100 // Can be used with the second argument(|server_protos|) of |GetNextProto| to
105 // construct a comma separated string of server advertised protocols. 101 // construct a comma separated string of server advertised protocols.
106 static std::string ServerProtosToString(const std::string& server_protos); 102 static std::string ServerProtosToString(const std::string& server_protos);
107 103
108 static bool IgnoreCertError(int error, int load_flags); 104 static bool IgnoreCertError(int error, int load_flags);
109 105
110 // ClearSessionCache clears the SSL session cache, used to resume SSL 106 // ClearSessionCache clears the SSL session cache, used to resume SSL
111 // sessions. 107 // sessions.
112 static void ClearSessionCache(); 108 static void ClearSessionCache();
113 109
114 virtual bool was_npn_negotiated() const; 110 virtual bool was_npn_negotiated() const;
Ryan Sleevi 2012/07/11 22:50:43 How is this different than WasNpnNegotiated?
Ryan Hamilton 2012/07/11 23:37:25 *whistles innocently* Done. :>
115 111
116 virtual bool set_was_npn_negotiated(bool negotiated); 112 virtual bool set_was_npn_negotiated(bool negotiated);
117 113
118 virtual bool was_spdy_negotiated() const; 114 virtual bool was_spdy_negotiated() const;
119 115
120 virtual bool set_was_spdy_negotiated(bool negotiated); 116 virtual bool set_was_spdy_negotiated(bool negotiated);
121 117
122 virtual void set_protocol_negotiated(NextProto protocol_negotiated); 118 virtual void set_protocol_negotiated(NextProto protocol_negotiated);
123 119
124 // Returns the ServerBoundCertService used by this socket, or NULL if 120 // Returns the ServerBoundCertService used by this socket, or NULL if
(...skipping 15 matching lines...) Expand all
140 bool was_spdy_negotiated_; 136 bool was_spdy_negotiated_;
141 // Protocol that we negotiated with the server. 137 // Protocol that we negotiated with the server.
142 NextProto protocol_negotiated_; 138 NextProto protocol_negotiated_;
143 // True if a channel ID was sent. 139 // True if a channel ID was sent.
144 bool channel_id_sent_; 140 bool channel_id_sent_;
145 }; 141 };
146 142
147 } // namespace net 143 } // namespace net
148 144
149 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ 145 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698