Chromium Code Reviews| Index: net/socket/ssl_server_socket.h |
| diff --git a/net/socket/ssl_server_socket.h b/net/socket/ssl_server_socket.h |
| index 61877d2f5f9bff775d3f405387a5bd1948e4fa53..6519c361d21f53dff223d090a62504d4f1118f0b 100644 |
| --- a/net/socket/ssl_server_socket.h |
| +++ b/net/socket/ssl_server_socket.h |
| @@ -8,7 +8,7 @@ |
| #include "base/basictypes.h" |
| #include "net/base/completion_callback.h" |
| #include "net/base/net_api.h" |
| -#include "net/socket/socket.h" |
| +#include "net/socket/stream_socket.h" |
| namespace crypto { |
| class RSAPrivateKey; |
| @@ -20,33 +20,33 @@ class IOBuffer; |
| struct SSLConfig; |
| class X509Certificate; |
| -// SSLServerSocket takes an already connected socket and performs SSL on top of |
| -// it. |
| -// |
| -// This class is designed to work in a peer-to-peer connection and is not |
| -// intended to be used as a standalone SSL server. |
| -class SSLServerSocket : public Socket { |
| +class SSLServerSocket : public net::StreamSocket { |
| public: |
| virtual ~SSLServerSocket() {} |
| - // Performs an SSL server handshake on the existing socket. The given socket |
| - // must have already been connected. |
| - // |
| - // Accept either returns ERR_IO_PENDING, in which case the given callback |
| - // will be called in the future with the real result, or it completes |
| - // synchronously, returning the result immediately. |
| - virtual int Accept(CompletionCallback* callback) = 0; |
| + // Start the SSL server handshake, and notify the supplied callback |
| + // when the process completes, or fails. If Disconnect is called on |
|
wtc
2011/06/10 22:17:35
Nit: change "process" to "handshake" to be more sp
Wez
2011/06/11 01:08:33
Reworded this anyway.
|
| + // the SSLServerSocket then the callback will be silently dropped, in |
| + // the same way as for other StreamSocket calls. |
| + virtual int StartHandshake(CompletionCallback* callback) = 0; |
|
wtc
2011/06/10 22:17:35
Just call this method "Handshake" unless "handshak
Wez
2011/06/11 01:08:33
Done.
|
| }; |
| -// Creates an SSL server socket using an already connected socket. A certificate |
| -// and private key needs to be provided. |
| +// Creates an SSL server-side StreamSocket over an already-connected transport |
| +// StreamSocket. The caller must provide the server certificate and private |
| +// key to use. |
| +// |
| +// The returned SSLServerSocket takes ownership of |socket|. Stubbed versions |
| +// of CreateSSLServerSocket will delete |socket| and return NULL. |
| +// It takes a reference to |certificate|. |
| +// The |key| and |ssl_config| parameters are copied. |key| cannot be const |
| +// because the methods used to copy its contents are non-const. |
| // |
| -// This created server socket will take ownership of |socket|. However |key| |
| -// is copied. |
| -// TODO(hclam): Defines ServerSocketFactory to create SSLServerSocket. This will |
| -// make mocking easier. |
| +// The caller starts the SSL server handshake by calling StartHandshake on the |
| +// returned socket. |
| NET_API SSLServerSocket* CreateSSLServerSocket( |
| - Socket* socket, X509Certificate* certificate, crypto::RSAPrivateKey* key, |
| + StreamSocket* socket, |
| + X509Certificate* certificate, |
| + crypto::RSAPrivateKey* key, |
| const SSLConfig& ssl_config); |
| } // namespace net |