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