Chromium Code Reviews| Index: net/socket/ssl_server_socket_nss.h |
| diff --git a/net/socket/ssl_server_socket_nss.h b/net/socket/ssl_server_socket_nss.h |
| index 7953c38bf2b18b89014f5f053e51f778bf3c67b8..1080fea0161c29cff2e37d3bcc2e018d7e67bc31 100644 |
| --- a/net/socket/ssl_server_socket_nss.h |
| +++ b/net/socket/ssl_server_socket_nss.h |
| @@ -21,23 +21,17 @@ |
| namespace net { |
| -class SSLServerSocketNSS : public SSLServerSocket { |
| +class SSLServerSocketNSS : public StreamSocket { |
|
wtc
2011/06/02 23:12:58
Change this back to SSLServerSocket.
Wez
2011/06/03 17:47:07
Done.
|
| public: |
| - // This object takes ownership of the following parameters: |
| - // |socket| - A socket that is already connected. |
| - // |cert| - The certificate to be used by the server. |
| - // |
| - // The following parameters are copied in the constructor. |
| - // |ssl_config| - Options for SSL socket. |
| - // |key| - The private key used by the server. |
| - SSLServerSocketNSS(Socket* transport_socket, |
| - scoped_refptr<X509Certificate> cert, |
| + // See comments on CreateSSLServerSocket for details of how these |
| + // parameters are used. |
| + SSLServerSocketNSS(StreamSocket* socket, |
| + scoped_refptr<X509Certificate> certificate, |
| crypto::RSAPrivateKey* key, |
| const SSLConfig& ssl_config); |
| virtual ~SSLServerSocketNSS(); |
| - // SSLServerSocket implementation. |
| - virtual int Accept(CompletionCallback* callback); |
| + // Socket interface (via StreamSocket). |
| virtual int Read(IOBuffer* buf, int buf_len, |
| CompletionCallback* callback); |
| virtual int Write(IOBuffer* buf, int buf_len, |
| @@ -45,6 +39,21 @@ class SSLServerSocketNSS : public SSLServerSocket { |
| virtual bool SetReceiveBufferSize(int32 size); |
| virtual bool SetSendBufferSize(int32 size); |
| + // StreamSocket interface. |
| + virtual int Connect(CompletionCallback* callback); |
| + virtual void Disconnect(); |
| + virtual bool IsConnected() const; |
| + virtual bool IsConnectedAndIdle() const; |
| + |
| + // StreamSocket calls passed straight to the underlying StreamSocket. |
|
wtc
2011/06/02 23:12:58
I think this comment can be deleted, or be moved t
Wez
2011/06/03 17:47:07
Done.
|
| + virtual int GetPeerAddress(AddressList* address) const; |
| + virtual int GetLocalAddress(IPEndPoint* address) const; |
| + virtual const BoundNetLog& NetLog() const; |
| + virtual void SetSubresourceSpeculation(); |
| + virtual void SetOmniboxSpeculation(); |
| + virtual bool WasEverUsed() const; |
| + virtual bool UsingTCPFastOpen() const; |
| + |
| private: |
| enum State { |
| STATE_NONE, |
| @@ -69,7 +78,7 @@ class SSLServerSocketNSS : public SSLServerSocket { |
| int DoReadLoop(int result); |
| int DoWriteLoop(int result); |
| int DoHandshake(); |
| - void DoAcceptCallback(int result); |
| + void DoConnectCallback(int result); |
| void DoReadCallback(int result); |
| void DoWriteCallback(int result); |
| @@ -91,7 +100,7 @@ class SSLServerSocketNSS : public SSLServerSocket { |
| BoundNetLog net_log_; |
| - CompletionCallback* user_accept_callback_; |
| + CompletionCallback* user_connect_callback_; |
| CompletionCallback* user_read_callback_; |
| CompletionCallback* user_write_callback_; |
| @@ -109,12 +118,10 @@ class SSLServerSocketNSS : public SSLServerSocket { |
| // Buffers for the network end of the SSL state machine |
| memio_Private* nss_bufs_; |
| - // Socket for sending and receiving data. |
| - scoped_ptr<Socket> transport_socket_; |
| + // StreamSocket for sending and receiving data. |
| + scoped_ptr<StreamSocket> transport_socket_; |
| // Options for the SSL socket. |
| - // TODO(hclam): This memeber is currently not used. Should make use of this |
| - // member to configure the socket. |
| SSLConfig ssl_config_; |
| // Certificate for the server. |