OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_SSL_CLIENT_SOCKET_WIN_H_ | 5 #ifndef NET_BASE_SSL_CLIENT_SOCKET_WIN_H_ |
6 #define NET_BASE_SSL_CLIENT_SOCKET_WIN_H_ | 6 #define NET_BASE_SSL_CLIENT_SOCKET_WIN_H_ |
7 | 7 |
8 #define SECURITY_WIN32 // Needs to be defined before including security.h | 8 #define SECURITY_WIN32 // Needs to be defined before including security.h |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 26 matching lines...) Expand all Loading... |
37 // SSLClientSocket methods: | 37 // SSLClientSocket methods: |
38 virtual void GetSSLInfo(SSLInfo* ssl_info); | 38 virtual void GetSSLInfo(SSLInfo* ssl_info); |
39 | 39 |
40 // ClientSocket methods: | 40 // ClientSocket methods: |
41 virtual int Connect(CompletionCallback* callback); | 41 virtual int Connect(CompletionCallback* callback); |
42 virtual void Disconnect(); | 42 virtual void Disconnect(); |
43 virtual bool IsConnected() const; | 43 virtual bool IsConnected() const; |
44 virtual bool IsConnectedAndIdle() const; | 44 virtual bool IsConnectedAndIdle() const; |
45 | 45 |
46 // Socket methods: | 46 // Socket methods: |
47 virtual int Read(char* buf, int buf_len, CompletionCallback* callback); | 47 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
48 virtual int Write(const char* buf, int buf_len, CompletionCallback* callback); | 48 virtual int Write(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
49 | 49 |
50 private: | 50 private: |
51 void DoCallback(int result); | 51 void DoCallback(int result); |
52 void OnIOComplete(int result); | 52 void OnIOComplete(int result); |
53 | 53 |
54 int DoLoop(int last_io_result); | 54 int DoLoop(int last_io_result); |
55 int DoHandshakeRead(); | 55 int DoHandshakeRead(); |
56 int DoHandshakeReadComplete(int result); | 56 int DoHandshakeReadComplete(int result); |
57 int DoHandshakeWrite(); | 57 int DoHandshakeWrite(); |
58 int DoHandshakeWriteComplete(int result); | 58 int DoHandshakeWriteComplete(int result); |
(...skipping 12 matching lines...) Expand all Loading... |
71 void FreeSendBuffer(); | 71 void FreeSendBuffer(); |
72 | 72 |
73 CompletionCallbackImpl<SSLClientSocketWin> io_callback_; | 73 CompletionCallbackImpl<SSLClientSocketWin> io_callback_; |
74 scoped_ptr<ClientSocket> transport_; | 74 scoped_ptr<ClientSocket> transport_; |
75 std::string hostname_; | 75 std::string hostname_; |
76 SSLConfig ssl_config_; | 76 SSLConfig ssl_config_; |
77 | 77 |
78 CompletionCallback* user_callback_; | 78 CompletionCallback* user_callback_; |
79 | 79 |
80 // Used by both Read and Write functions. | 80 // Used by both Read and Write functions. |
81 char* user_buf_; | 81 scoped_refptr<IOBuffer> user_buf_; |
82 int user_buf_len_; | 82 int user_buf_len_; |
83 | 83 |
| 84 // Used to Read and Write using transport_. |
| 85 scoped_refptr<IOBuffer> transport_buf_; |
| 86 |
84 enum State { | 87 enum State { |
85 STATE_NONE, | 88 STATE_NONE, |
86 STATE_HANDSHAKE_READ, | 89 STATE_HANDSHAKE_READ, |
87 STATE_HANDSHAKE_READ_COMPLETE, | 90 STATE_HANDSHAKE_READ_COMPLETE, |
88 STATE_HANDSHAKE_WRITE, | 91 STATE_HANDSHAKE_WRITE, |
89 STATE_HANDSHAKE_WRITE_COMPLETE, | 92 STATE_HANDSHAKE_WRITE_COMPLETE, |
90 STATE_VERIFY_CERT, | 93 STATE_VERIFY_CERT, |
91 STATE_VERIFY_CERT_COMPLETE, | 94 STATE_VERIFY_CERT_COMPLETE, |
92 STATE_PAYLOAD_ENCRYPT, | 95 STATE_PAYLOAD_ENCRYPT, |
93 STATE_PAYLOAD_WRITE, | 96 STATE_PAYLOAD_WRITE, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // True if the user has no client certificate. | 149 // True if the user has no client certificate. |
147 bool no_client_cert_; | 150 bool no_client_cert_; |
148 | 151 |
149 // Renegotiation is in progress. | 152 // Renegotiation is in progress. |
150 bool renegotiating_; | 153 bool renegotiating_; |
151 }; | 154 }; |
152 | 155 |
153 } // namespace net | 156 } // namespace net |
154 | 157 |
155 #endif // NET_BASE_SSL_CLIENT_SOCKET_WIN_H_ | 158 #endif // NET_BASE_SSL_CLIENT_SOCKET_WIN_H_ |
OLD | NEW |