Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 kNextProtoUnsupported = 0, // The server doesn't support NPN. | 74 kNextProtoUnsupported = 0, // The server doesn't support NPN. |
| 75 kNextProtoNegotiated = 1, // We agreed on a protocol. | 75 kNextProtoNegotiated = 1, // We agreed on a protocol. |
| 76 kNextProtoNoOverlap = 2, // No protocols in common. We requested | 76 kNextProtoNoOverlap = 2, // No protocols in common. We requested |
| 77 // the first protocol in our list. | 77 // the first protocol in our list. |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 // StreamSocket: | 80 // StreamSocket: |
| 81 virtual bool WasNpnNegotiated() const OVERRIDE; | 81 virtual bool WasNpnNegotiated() const OVERRIDE; |
| 82 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 82 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
| 83 | 83 |
| 84 // Returns true if there is a cache entry in the ssl session cache | |
| 85 // for the given cache key. | |
| 86 // | |
| 87 // The cache key consists of a host_and_port concatenated with a session | |
|
mmenke
2014/07/08 21:02:05
I don't see any object named host_and_port. I thi
mshelley
2014/07/09 19:51:00
Done.
| |
| 88 // cache shard. | |
| 89 virtual bool InSessionCache() const = 0; | |
| 90 | |
| 91 // Tells the session cache to monitor this socket's session and inform | |
| 92 // its SSLConnectJobMessenger upon the session's completion. | |
|
wtc
2014/07/08 01:25:42
I don't understand what "session's completion" mea
mshelley
2014/07/09 19:51:00
This refers to the completion of the connection fo
| |
| 93 virtual void WatchSessionForCompletion( | |
| 94 const base::Closure& callback) const = 0; | |
| 95 | |
| 96 // Sets the callback to be used if the socket's connection should fail. | |
| 97 virtual void SetSocketFailureCallback(const base::Closure& callback) = 0; | |
| 98 | |
| 99 // Sets the |is_leader_| variable to true. | |
|
wtc
2014/07/08 01:25:42
This header doesn't have the "is_leader_" variable
mshelley
2014/07/09 19:51:00
Done.
| |
| 100 virtual void SetIsLeader() = 0; | |
| 101 | |
| 102 // In the case of a failed connection, run the appropriate callback. | |
| 103 virtual void OnSocketFailure() = 0; | |
| 104 | |
| 84 // Gets the SSL CertificateRequest info of the socket after Connect failed | 105 // Gets the SSL CertificateRequest info of the socket after Connect failed |
| 85 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. | 106 // with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. |
| 86 virtual void GetSSLCertRequestInfo( | 107 virtual void GetSSLCertRequestInfo( |
| 87 SSLCertRequestInfo* cert_request_info) = 0; | 108 SSLCertRequestInfo* cert_request_info) = 0; |
| 88 | 109 |
| 89 // Get the application level protocol that we negotiated with the server. | 110 // Get the application level protocol that we negotiated with the server. |
| 90 // *proto is set to the resulting protocol (n.b. that the string may have | 111 // *proto is set to the resulting protocol (n.b. that the string may have |
| 91 // embedded NULs). | 112 // embedded NULs). |
| 92 // kNextProtoUnsupported: *proto is cleared. | 113 // kNextProtoUnsupported: *proto is cleared. |
| 93 // kNextProtoNegotiated: *proto is set to the negotiated protocol. | 114 // kNextProtoNegotiated: *proto is set to the negotiated protocol. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 virtual ServerBoundCertService* GetServerBoundCertService() const = 0; | 147 virtual ServerBoundCertService* GetServerBoundCertService() const = 0; |
| 127 | 148 |
| 128 // Returns true if a channel ID was sent on this connection. | 149 // Returns true if a channel ID was sent on this connection. |
| 129 // This may be useful for protocols, like SPDY, which allow the same | 150 // This may be useful for protocols, like SPDY, which allow the same |
| 130 // connection to be shared between multiple domains, each of which need | 151 // connection to be shared between multiple domains, each of which need |
| 131 // a channel ID. | 152 // a channel ID. |
| 132 // | 153 // |
| 133 // Public for ssl_client_socket_openssl_unittest.cc. | 154 // Public for ssl_client_socket_openssl_unittest.cc. |
| 134 virtual bool WasChannelIDSent() const; | 155 virtual bool WasChannelIDSent() const; |
| 135 | 156 |
| 157 // Enable SSLConnectJob waiting if |enable| is true. | |
| 158 static NET_EXPORT void EnableJobWaiting(bool enable); | |
|
wtc
2014/07/08 01:25:42
EnableJobWaiting => EnableConnectJobWaiting.
GetE
mshelley
2014/07/09 19:51:00
Done.
| |
| 159 | |
| 160 static NET_EXPORT bool GetEnableJobWaiting(); | |
| 161 | |
| 136 protected: | 162 protected: |
| 137 virtual void set_channel_id_sent(bool channel_id_sent); | 163 virtual void set_channel_id_sent(bool channel_id_sent); |
| 138 | 164 |
| 139 virtual void set_signed_cert_timestamps_received( | 165 virtual void set_signed_cert_timestamps_received( |
| 140 bool signed_cert_timestamps_received); | 166 bool signed_cert_timestamps_received); |
| 141 | 167 |
| 142 virtual void set_stapled_ocsp_response_received( | 168 virtual void set_stapled_ocsp_response_received( |
| 143 bool stapled_ocsp_response_received); | 169 bool stapled_ocsp_response_received); |
| 144 | 170 |
| 145 // Records histograms for channel id support during full handshakes - resumed | 171 // Records histograms for channel id support during full handshakes - resumed |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 // True if NPN successfully negotiated SPDY. | 204 // True if NPN successfully negotiated SPDY. |
| 179 bool was_spdy_negotiated_; | 205 bool was_spdy_negotiated_; |
| 180 // Protocol that we negotiated with the server. | 206 // Protocol that we negotiated with the server. |
| 181 NextProto protocol_negotiated_; | 207 NextProto protocol_negotiated_; |
| 182 // True if a channel ID was sent. | 208 // True if a channel ID was sent. |
| 183 bool channel_id_sent_; | 209 bool channel_id_sent_; |
| 184 // True if SCTs were received via a TLS extension. | 210 // True if SCTs were received via a TLS extension. |
| 185 bool signed_cert_timestamps_received_; | 211 bool signed_cert_timestamps_received_; |
| 186 // True if a stapled OCSP response was received. | 212 // True if a stapled OCSP response was received. |
| 187 bool stapled_ocsp_response_received_; | 213 bool stapled_ocsp_response_received_; |
| 214 | |
| 215 static bool enable_job_waiting_; | |
| 188 }; | 216 }; |
| 189 | 217 |
| 190 } // namespace net | 218 } // namespace net |
| 191 | 219 |
| 192 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ | 220 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_H_ |
| OLD | NEW |