| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_WIN_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #define SECURITY_WIN32 // Needs to be defined before including security.h | 9 #define SECURITY_WIN32 // Needs to be defined before including security.h |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // in the server's certificate during the SSL handshake. If SSL client | 38 // in the server's certificate during the SSL handshake. If SSL client |
| 39 // authentication is requested, the host_and_port field of SSLCertRequestInfo | 39 // authentication is requested, the host_and_port field of SSLCertRequestInfo |
| 40 // will be populated with |host_and_port|. |ssl_config| specifies | 40 // will be populated with |host_and_port|. |ssl_config| specifies |
| 41 // the SSL settings. | 41 // the SSL settings. |
| 42 SSLClientSocketWin(ClientSocketHandle* transport_socket, | 42 SSLClientSocketWin(ClientSocketHandle* transport_socket, |
| 43 const HostPortPair& host_and_port, | 43 const HostPortPair& host_and_port, |
| 44 const SSLConfig& ssl_config, | 44 const SSLConfig& ssl_config, |
| 45 const SSLClientSocketContext& context); | 45 const SSLClientSocketContext& context); |
| 46 ~SSLClientSocketWin(); | 46 ~SSLClientSocketWin(); |
| 47 | 47 |
| 48 // SSLClientSocket methods: | 48 // SSLClientSocket implementation. |
| 49 virtual void GetSSLInfo(SSLInfo* ssl_info); | 49 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 50 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 50 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 51 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 51 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
| 52 const base::StringPiece& context, | 52 const base::StringPiece& context, |
| 53 unsigned char *out, | 53 unsigned char *out, |
| 54 unsigned int outlen); | 54 unsigned int outlen); |
| 55 virtual NextProtoStatus GetNextProto(std::string* proto); | 55 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 56 | 56 |
| 57 // StreamSocket methods: | 57 // StreamSocket implementation. |
| 58 virtual int Connect(OldCompletionCallback* callback); | 58 virtual int Connect(OldCompletionCallback* callback); |
| 59 virtual int Connect(const CompletionCallback& callback); |
| 59 virtual void Disconnect(); | 60 virtual void Disconnect(); |
| 60 virtual bool IsConnected() const; | 61 virtual bool IsConnected() const; |
| 61 virtual bool IsConnectedAndIdle() const; | 62 virtual bool IsConnectedAndIdle() const; |
| 62 virtual int GetPeerAddress(AddressList* address) const; | 63 virtual int GetPeerAddress(AddressList* address) const; |
| 63 virtual int GetLocalAddress(IPEndPoint* address) const; | 64 virtual int GetLocalAddress(IPEndPoint* address) const; |
| 64 virtual const BoundNetLog& NetLog() const { return net_log_; } | 65 virtual const BoundNetLog& NetLog() const { return net_log_; } |
| 65 virtual void SetSubresourceSpeculation(); | 66 virtual void SetSubresourceSpeculation(); |
| 66 virtual void SetOmniboxSpeculation(); | 67 virtual void SetOmniboxSpeculation(); |
| 67 virtual bool WasEverUsed() const; | 68 virtual bool WasEverUsed() const; |
| 68 virtual bool UsingTCPFastOpen() const; | 69 virtual bool UsingTCPFastOpen() const; |
| 69 virtual int64 NumBytesRead() const; | 70 virtual int64 NumBytesRead() const; |
| 70 virtual base::TimeDelta GetConnectTimeMicros() const; | 71 virtual base::TimeDelta GetConnectTimeMicros() const; |
| 71 | 72 |
| 72 // Socket methods: | 73 // Socket implementation. |
| 73 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 74 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); |
| 74 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 75 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; |
| 75 | 76 |
| 76 virtual bool SetReceiveBufferSize(int32 size); | 77 virtual bool SetReceiveBufferSize(int32 size); |
| 77 virtual bool SetSendBufferSize(int32 size); | 78 virtual bool SetSendBufferSize(int32 size); |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 bool completed_handshake() const { | 81 bool completed_handshake() const { |
| 81 return next_state_ == STATE_COMPLETED_HANDSHAKE; | 82 return next_state_ == STATE_COMPLETED_HANDSHAKE; |
| 82 } | 83 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 113 // Internal callbacks as async operations complete. | 114 // Internal callbacks as async operations complete. |
| 114 OldCompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; | 115 OldCompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; |
| 115 OldCompletionCallbackImpl<SSLClientSocketWin> read_callback_; | 116 OldCompletionCallbackImpl<SSLClientSocketWin> read_callback_; |
| 116 OldCompletionCallbackImpl<SSLClientSocketWin> write_callback_; | 117 OldCompletionCallbackImpl<SSLClientSocketWin> write_callback_; |
| 117 | 118 |
| 118 scoped_ptr<ClientSocketHandle> transport_; | 119 scoped_ptr<ClientSocketHandle> transport_; |
| 119 HostPortPair host_and_port_; | 120 HostPortPair host_and_port_; |
| 120 SSLConfig ssl_config_; | 121 SSLConfig ssl_config_; |
| 121 | 122 |
| 122 // User function to callback when the Connect() completes. | 123 // User function to callback when the Connect() completes. |
| 123 OldCompletionCallback* user_connect_callback_; | 124 OldCompletionCallback* old_user_connect_callback_; |
| 125 CompletionCallback user_connect_callback_; |
| 124 | 126 |
| 125 // User function to callback when a Read() completes. | 127 // User function to callback when a Read() completes. |
| 126 OldCompletionCallback* user_read_callback_; | 128 OldCompletionCallback* user_read_callback_; |
| 127 scoped_refptr<IOBuffer> user_read_buf_; | 129 scoped_refptr<IOBuffer> user_read_buf_; |
| 128 int user_read_buf_len_; | 130 int user_read_buf_len_; |
| 129 | 131 |
| 130 // User function to callback when a Write() completes. | 132 // User function to callback when a Write() completes. |
| 131 OldCompletionCallback* user_write_callback_; | 133 OldCompletionCallback* user_write_callback_; |
| 132 scoped_refptr<IOBuffer> user_write_buf_; | 134 scoped_refptr<IOBuffer> user_write_buf_; |
| 133 int user_write_buf_len_; | 135 int user_write_buf_len_; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 204 |
| 203 // True when the decrypter needs more data in order to decrypt. | 205 // True when the decrypter needs more data in order to decrypt. |
| 204 bool need_more_data_; | 206 bool need_more_data_; |
| 205 | 207 |
| 206 BoundNetLog net_log_; | 208 BoundNetLog net_log_; |
| 207 }; | 209 }; |
| 208 | 210 |
| 209 } // namespace net | 211 } // namespace net |
| 210 | 212 |
| 211 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 213 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
| OLD | NEW |