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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual void SetOmniboxSpeculation(); | 68 virtual void SetOmniboxSpeculation(); |
69 virtual bool WasEverUsed() const; | 69 virtual bool WasEverUsed() const; |
70 virtual bool UsingTCPFastOpen() const; | 70 virtual bool UsingTCPFastOpen() const; |
71 virtual int64 NumBytesRead() const; | 71 virtual int64 NumBytesRead() const; |
72 virtual base::TimeDelta GetConnectTimeMicros() const; | 72 virtual base::TimeDelta GetConnectTimeMicros() const; |
73 | 73 |
74 // Socket implementation. | 74 // Socket implementation. |
75 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 75 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); |
76 virtual int Read(IOBuffer* buf, int buf_len, | 76 virtual int Read(IOBuffer* buf, int buf_len, |
77 const CompletionCallback& callback); | 77 const CompletionCallback& callback); |
78 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 78 virtual int Write(IOBuffer* buf, int buf_len, |
| 79 OldCompletionCallback* callback); |
| 80 virtual int Write(IOBuffer* buf, int buf_len, |
| 81 const CompletionCallback& callback); |
79 | 82 |
80 virtual bool SetReceiveBufferSize(int32 size); | 83 virtual bool SetReceiveBufferSize(int32 size); |
81 virtual bool SetSendBufferSize(int32 size); | 84 virtual bool SetSendBufferSize(int32 size); |
82 | 85 |
83 private: | 86 private: |
84 bool completed_handshake() const { | 87 bool completed_handshake() const { |
85 return next_state_ == STATE_COMPLETED_HANDSHAKE; | 88 return next_state_ == STATE_COMPLETED_HANDSHAKE; |
86 } | 89 } |
87 | 90 |
88 // Initializes the SSL options and security context. Returns a net error code. | 91 // Initializes the SSL options and security context. Returns a net error code. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 OldCompletionCallback* old_user_connect_callback_; | 130 OldCompletionCallback* old_user_connect_callback_; |
128 CompletionCallback user_connect_callback_; | 131 CompletionCallback user_connect_callback_; |
129 | 132 |
130 // User function to callback when a Read() completes. | 133 // User function to callback when a Read() completes. |
131 OldCompletionCallback* old_user_read_callback_; | 134 OldCompletionCallback* old_user_read_callback_; |
132 CompletionCallback user_read_callback_; | 135 CompletionCallback user_read_callback_; |
133 scoped_refptr<IOBuffer> user_read_buf_; | 136 scoped_refptr<IOBuffer> user_read_buf_; |
134 int user_read_buf_len_; | 137 int user_read_buf_len_; |
135 | 138 |
136 // User function to callback when a Write() completes. | 139 // User function to callback when a Write() completes. |
137 OldCompletionCallback* user_write_callback_; | 140 OldCompletionCallback* old_user_write_callback_; |
| 141 CompletionCallback user_write_callback_; |
138 scoped_refptr<IOBuffer> user_write_buf_; | 142 scoped_refptr<IOBuffer> user_write_buf_; |
139 int user_write_buf_len_; | 143 int user_write_buf_len_; |
140 | 144 |
141 // Used to Read and Write using transport_. | 145 // Used to Read and Write using transport_. |
142 scoped_refptr<IOBuffer> transport_read_buf_; | 146 scoped_refptr<IOBuffer> transport_read_buf_; |
143 scoped_refptr<IOBuffer> transport_write_buf_; | 147 scoped_refptr<IOBuffer> transport_write_buf_; |
144 | 148 |
145 enum State { | 149 enum State { |
146 STATE_NONE, | 150 STATE_NONE, |
147 STATE_HANDSHAKE_READ, | 151 STATE_HANDSHAKE_READ, |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 212 |
209 // True when the decrypter needs more data in order to decrypt. | 213 // True when the decrypter needs more data in order to decrypt. |
210 bool need_more_data_; | 214 bool need_more_data_; |
211 | 215 |
212 BoundNetLog net_log_; | 216 BoundNetLog net_log_; |
213 }; | 217 }; |
214 | 218 |
215 } // namespace net | 219 } // namespace net |
216 | 220 |
217 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ | 221 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_WIN_H_ |
OLD | NEW |