Index: net/socket/ssl_client_socket.h |
diff --git a/net/socket/ssl_client_socket.h b/net/socket/ssl_client_socket.h |
index 9993bb6b64c19bcf0855471e093349c81c3784ee..74423c1a626194545e5c672d466f485f819f1a62 100644 |
--- a/net/socket/ssl_client_socket.h |
+++ b/net/socket/ssl_client_socket.h |
@@ -17,8 +17,10 @@ |
namespace net { |
class CertVerifier; |
-class CTVerifier; |
class ChannelIDService; |
+class CTVerifier; |
+class HostPortPair; |
+class ServerBoundCertService; |
class SSLCertRequestInfo; |
struct SSLConfig; |
class SSLInfo; |
@@ -81,6 +83,46 @@ class NET_EXPORT SSLClientSocket : public SSLSocket { |
virtual bool WasNpnNegotiated() const OVERRIDE; |
virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
+ // Formats a unique key for the SSL session cache. This method |
+ // is necessary so that all classes create cache keys in a consistent |
+ // manner. |
+ // TODO(mshelley) This method will be deleted in an upcoming CL when |
+ // it will no longer be necessary to generate a cache key outside of |
+ // an SSLClientSocket. |
+ static std::string CreateSessionCacheKey( |
+ const HostPortPair& host_and_port, |
+ const std::string& ssl_session_cache_shard); |
+ |
+ // Returns true if there is a cache entry in the SSL session cache |
+ // for the cache key of the SSL socket. |
+ // |
+ // The cache key consists of a host and port concatenated with a session |
+ // cache shard. These two strings are passed to the constructor of most |
+ // subclasses of SSLClientSocket. |
+ virtual bool InSessionCache() const = 0; |
+ |
+ // Sets |callback| to be run when the handshake has fully completed. |
+ // For example, in the case of False Start, Connect() will return |
+ // early, before the peer's TLS Finished message has been verified, |
+ // in order to allow the caller to call Write() and send application |
+ // data with the client's Finished message. |
+ // In such situations, |callback| will be invoked sometime after |
+ // Connect() - either during a Write() or Read() call, and before |
+ // invoking the Read() or Write() callback. |
+ // Otherwise, during a traditional TLS connection (i.e. no False |
+ // Start), this will be called right before the Connect() callback |
+ // is called. |
+ // |
+ // Note that it's not valid to mutate this socket during such |
+ // callbacks, including deleting the socket. |
+ // |
+ // TODO(mshelley): Provide additional details about whether or not |
+ // the handshake actually succeeded or not. This can be inferred |
+ // from the result to Connect()/Read()/Write(), but may be useful |
+ // to inform here as well. |
+ virtual void SetHandshakeCompletionCallback( |
+ const base::Closure& callback) = 0; |
+ |
// Gets the SSL CertificateRequest info of the socket after Connect failed |
// with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. |
virtual void GetSSLCertRequestInfo( |