Chromium Code Reviews| 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 13 matching lines...) Expand all Loading... | |
| 24 namespace net { | 24 namespace net { |
| 25 | 25 |
| 26 class CertVerifier; | 26 class CertVerifier; |
| 27 class ClientSocketHandle; | 27 class ClientSocketHandle; |
| 28 class BoundNetLog; | 28 class BoundNetLog; |
| 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 |
|
wtc
2010/11/12 00:12:55
Nit: the comment "The given hostname" probably sho
Ryan Hamilton
2010/11/12 00:47:30
Done.
| |
| 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 HostPortPair& host_and_port, |
| 39 const SSLConfig& ssl_config); | 39 const SSLConfig& ssl_config); |
| 40 ~SSLClientSocketWin(); | 40 ~SSLClientSocketWin(); |
| 41 | 41 |
| 42 // SSLClientSocket methods: | 42 // SSLClientSocket methods: |
| 43 virtual void GetSSLInfo(SSLInfo* ssl_info); | 43 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 44 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 44 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 45 virtual NextProtoStatus GetNextProto(std::string* proto); | 45 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 46 | 46 |
| 47 // ClientSocket methods: | 47 // ClientSocket methods: |
| 48 virtual int Connect(CompletionCallback* callback); | 48 virtual int Connect(CompletionCallback* callback); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 void LogConnectionTypeMetrics() const; | 97 void LogConnectionTypeMetrics() const; |
| 98 void FreeSendBuffer(); | 98 void FreeSendBuffer(); |
| 99 | 99 |
| 100 // Internal callbacks as async operations complete. | 100 // Internal callbacks as async operations complete. |
| 101 CompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; | 101 CompletionCallbackImpl<SSLClientSocketWin> handshake_io_callback_; |
| 102 CompletionCallbackImpl<SSLClientSocketWin> read_callback_; | 102 CompletionCallbackImpl<SSLClientSocketWin> read_callback_; |
| 103 CompletionCallbackImpl<SSLClientSocketWin> write_callback_; | 103 CompletionCallbackImpl<SSLClientSocketWin> write_callback_; |
| 104 | 104 |
| 105 scoped_ptr<ClientSocketHandle> transport_; | 105 scoped_ptr<ClientSocketHandle> transport_; |
| 106 std::string hostname_; | 106 std::string hostname_; |
| 107 uint16 port_; | |
| 107 SSLConfig ssl_config_; | 108 SSLConfig ssl_config_; |
| 108 | 109 |
| 109 // User function to callback when the Connect() completes. | 110 // User function to callback when the Connect() completes. |
| 110 CompletionCallback* user_connect_callback_; | 111 CompletionCallback* user_connect_callback_; |
| 111 | 112 |
| 112 // User function to callback when a Read() completes. | 113 // User function to callback when a Read() completes. |
| 113 CompletionCallback* user_read_callback_; | 114 CompletionCallback* user_read_callback_; |
| 114 scoped_refptr<IOBuffer> user_read_buf_; | 115 scoped_refptr<IOBuffer> user_read_buf_; |
| 115 int user_read_buf_len_; | 116 int user_read_buf_len_; |
| 116 | 117 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 189 |
| 189 // True when the decrypter needs more data in order to decrypt. | 190 // True when the decrypter needs more data in order to decrypt. |
| 190 bool need_more_data_; | 191 bool need_more_data_; |
| 191 | 192 |
| 192 BoundNetLog net_log_; | 193 BoundNetLog net_log_; |
| 193 }; | 194 }; |
| 194 | 195 |
| 195 } // namespace net | 196 } // namespace net |
| 196 | 197 |
| 197 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 198 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
| OLD | NEW |