| 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_MAC_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // An SSL client socket implemented with Secure Transport. | 26 // An SSL client socket implemented with Secure Transport. |
| 27 class SSLClientSocketMac : public SSLClientSocket { | 27 class SSLClientSocketMac : public SSLClientSocket { |
| 28 public: | 28 public: |
| 29 // Takes ownership of the |transport_socket|, which must already be connected. | 29 // Takes ownership of the |transport_socket|, which must already be connected. |
| 30 // The given hostname will be compared with the name(s) in the server's | 30 // The given hostname will be compared with the name(s) in the server's |
| 31 // certificate during the SSL handshake. ssl_config specifies the SSL | 31 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 32 // settings. | 32 // settings. |
| 33 SSLClientSocketMac(ClientSocketHandle* transport_socket, | 33 SSLClientSocketMac(ClientSocketHandle* transport_socket, |
| 34 const std::string& hostname, | 34 const std::string& hostname, |
| 35 uint16 port, |
| 35 const SSLConfig& ssl_config); | 36 const SSLConfig& ssl_config); |
| 36 ~SSLClientSocketMac(); | 37 ~SSLClientSocketMac(); |
| 37 | 38 |
| 38 // SSLClientSocket methods: | 39 // SSLClientSocket methods: |
| 39 virtual void GetSSLInfo(SSLInfo* ssl_info); | 40 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 40 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 41 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 41 virtual NextProtoStatus GetNextProto(std::string* proto); | 42 virtual NextProtoStatus GetNextProto(std::string* proto); |
| 42 | 43 |
| 43 // ClientSocket methods: | 44 // ClientSocket methods: |
| 44 virtual int Connect(CompletionCallback* callback); | 45 virtual int Connect(CompletionCallback* callback); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static OSStatus SSLWriteCallback(SSLConnectionRef connection, | 93 static OSStatus SSLWriteCallback(SSLConnectionRef connection, |
| 93 const void* data, | 94 const void* data, |
| 94 size_t* data_length); | 95 size_t* data_length); |
| 95 | 96 |
| 96 CompletionCallbackImpl<SSLClientSocketMac> handshake_io_callback_; | 97 CompletionCallbackImpl<SSLClientSocketMac> handshake_io_callback_; |
| 97 CompletionCallbackImpl<SSLClientSocketMac> transport_read_callback_; | 98 CompletionCallbackImpl<SSLClientSocketMac> transport_read_callback_; |
| 98 CompletionCallbackImpl<SSLClientSocketMac> transport_write_callback_; | 99 CompletionCallbackImpl<SSLClientSocketMac> transport_write_callback_; |
| 99 | 100 |
| 100 scoped_ptr<ClientSocketHandle> transport_; | 101 scoped_ptr<ClientSocketHandle> transport_; |
| 101 std::string hostname_; | 102 std::string hostname_; |
| 103 uint16 port_; |
| 102 SSLConfig ssl_config_; | 104 SSLConfig ssl_config_; |
| 103 | 105 |
| 104 CompletionCallback* user_connect_callback_; | 106 CompletionCallback* user_connect_callback_; |
| 105 CompletionCallback* user_read_callback_; | 107 CompletionCallback* user_read_callback_; |
| 106 CompletionCallback* user_write_callback_; | 108 CompletionCallback* user_write_callback_; |
| 107 | 109 |
| 108 // Used by Read function. | 110 // Used by Read function. |
| 109 scoped_refptr<IOBuffer> user_read_buf_; | 111 scoped_refptr<IOBuffer> user_read_buf_; |
| 110 int user_read_buf_len_; | 112 int user_read_buf_len_; |
| 111 | 113 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // These are the IOBuffers used for operations on the underlying transport. | 154 // These are the IOBuffers used for operations on the underlying transport. |
| 153 scoped_refptr<IOBuffer> read_io_buf_; | 155 scoped_refptr<IOBuffer> read_io_buf_; |
| 154 scoped_refptr<IOBuffer> write_io_buf_; | 156 scoped_refptr<IOBuffer> write_io_buf_; |
| 155 | 157 |
| 156 BoundNetLog net_log_; | 158 BoundNetLog net_log_; |
| 157 }; | 159 }; |
| 158 | 160 |
| 159 } // namespace net | 161 } // namespace net |
| 160 | 162 |
| 161 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 163 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| OLD | NEW |