| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // An SSL client socket implemented with the Windows Schannel. | 30 // An SSL client socket implemented with the Windows Schannel. |
| 31 class SSLClientSocketWin : public SSLClientSocket { | 31 class SSLClientSocketWin : public SSLClientSocket { |
| 32 public: | 32 public: |
| 33 // Takes ownership of the |transport_socket|, which must already be connected. | 33 // Takes ownership of the |transport_socket|, which must already be connected. |
| 34 // The given hostname will be compared with the name(s) in the server's | 34 // The given hostname will be compared with the name(s) in the server's |
| 35 // certificate during the SSL handshake. ssl_config specifies the SSL | 35 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 36 // settings. | 36 // settings. |
| 37 SSLClientSocketWin(ClientSocketHandle* transport_socket, | 37 SSLClientSocketWin(ClientSocketHandle* transport_socket, |
| 38 const std::string& hostname, | 38 const std::string& hostname, |
| 39 uint16 port, |
| 39 const SSLConfig& ssl_config); | 40 const SSLConfig& ssl_config); |
| 40 ~SSLClientSocketWin(); | 41 ~SSLClientSocketWin(); |
| 41 | 42 |
| 42 // SSLClientSocket methods: | 43 // SSLClientSocket methods: |
| 43 virtual void GetSSLInfo(SSLInfo* ssl_info); | 44 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 44 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 45 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 45 virtual NextProtoStatus GetNextProto(std::string* proto); | 46 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 46 | 47 |
| 47 // ClientSocket methods: | 48 // ClientSocket methods: |
| 48 virtual int Connect(CompletionCallback* callback); | 49 virtual int Connect(CompletionCallback* callback); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void LogConnectionTypeMetrics() const; | 98 void LogConnectionTypeMetrics() const; |
| 98 void FreeSendBuffer(); | 99 void FreeSendBuffer(); |
| 99 | 100 |
| 100 // Internal callbacks as async operations complete. | 101 // Internal callbacks as async operations complete. |
| 101 CompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; | 102 CompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; |
| 102 CompletionCallbackImpl<SSLClientSocketWin> read_callback_; | 103 CompletionCallbackImpl<SSLClientSocketWin> read_callback_; |
| 103 CompletionCallbackImpl<SSLClientSocketWin> write_callback_; | 104 CompletionCallbackImpl<SSLClientSocketWin> write_callback_; |
| 104 | 105 |
| 105 scoped_ptr<ClientSocketHandle> transport_; | 106 scoped_ptr<ClientSocketHandle> transport_; |
| 106 std::string hostname_; | 107 std::string hostname_; |
| 108 uint16 port_; |
| 107 SSLConfig ssl_config_; | 109 SSLConfig ssl_config_; |
| 108 | 110 |
| 109 // User function to callback when the Connect() completes. | 111 // User function to callback when the Connect() completes. |
| 110 CompletionCallback* user_connect_callback_; | 112 CompletionCallback* user_connect_callback_; |
| 111 | 113 |
| 112 // User function to callback when a Read() completes. | 114 // User function to callback when a Read() completes. |
| 113 CompletionCallback* user_read_callback_; | 115 CompletionCallback* user_read_callback_; |
| 114 scoped_refptr<IOBuffer> user_read_buf_; | 116 scoped_refptr<IOBuffer> user_read_buf_; |
| 115 int user_read_buf_len_; | 117 int user_read_buf_len_; |
| 116 | 118 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 190 |
| 189 // True when the decrypter needs more data in order to decrypt. | 191 // True when the decrypter needs more data in order to decrypt. |
| 190 bool need_more_data_; | 192 bool need_more_data_; |
| 191 | 193 |
| 192 BoundNetLog net_log_; | 194 BoundNetLog net_log_; |
| 193 }; | 195 }; |
| 194 | 196 |
| 195 } // namespace net | 197 } // namespace net |
| 196 | 198 |
| 197 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 199 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
| OLD | NEW |