| 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_OPENSSL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual void GetSSLInfo(SSLInfo* ssl_info); | 56 virtual void GetSSLInfo(SSLInfo* ssl_info); |
| 57 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 57 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
| 58 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 58 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
| 59 const base::StringPiece& context, | 59 const base::StringPiece& context, |
| 60 unsigned char *out, | 60 unsigned char *out, |
| 61 unsigned int outlen); | 61 unsigned int outlen); |
| 62 virtual NextProtoStatus GetNextProto(std::string* proto, | 62 virtual NextProtoStatus GetNextProto(std::string* proto, |
| 63 std::string* server_protos); | 63 std::string* server_protos); |
| 64 | 64 |
| 65 // StreamSocket implementation. | 65 // StreamSocket implementation. |
| 66 virtual int Connect(OldCompletionCallback* callback); | |
| 67 virtual int Connect(const CompletionCallback& callback); | 66 virtual int Connect(const CompletionCallback& callback); |
| 68 virtual void Disconnect(); | 67 virtual void Disconnect(); |
| 69 virtual bool IsConnected() const; | 68 virtual bool IsConnected() const; |
| 70 virtual bool IsConnectedAndIdle() const; | 69 virtual bool IsConnectedAndIdle() const; |
| 71 virtual int GetPeerAddress(AddressList* address) const; | 70 virtual int GetPeerAddress(AddressList* address) const; |
| 72 virtual int GetLocalAddress(IPEndPoint* address) const; | 71 virtual int GetLocalAddress(IPEndPoint* address) const; |
| 73 virtual const BoundNetLog& NetLog() const; | 72 virtual const BoundNetLog& NetLog() const; |
| 74 virtual void SetSubresourceSpeculation(); | 73 virtual void SetSubresourceSpeculation(); |
| 75 virtual void SetOmniboxSpeculation(); | 74 virtual void SetOmniboxSpeculation(); |
| 76 virtual bool WasEverUsed() const; | 75 virtual bool WasEverUsed() const; |
| 77 virtual bool UsingTCPFastOpen() const; | 76 virtual bool UsingTCPFastOpen() const; |
| 78 virtual int64 NumBytesRead() const; | 77 virtual int64 NumBytesRead() const; |
| 79 virtual base::TimeDelta GetConnectTimeMicros() const; | 78 virtual base::TimeDelta GetConnectTimeMicros() const; |
| 80 | 79 |
| 81 // Socket implementation. | 80 // Socket implementation. |
| 82 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | |
| 83 virtual int Read(IOBuffer* buf, int buf_len, | 81 virtual int Read(IOBuffer* buf, int buf_len, |
| 84 const CompletionCallback& callback); | 82 const CompletionCallback& callback); |
| 85 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 83 virtual int Write(IOBuffer* buf, int buf_len, |
| 84 const CompletionCallback& callback); |
| 86 virtual bool SetReceiveBufferSize(int32 size); | 85 virtual bool SetReceiveBufferSize(int32 size); |
| 87 virtual bool SetSendBufferSize(int32 size); | 86 virtual bool SetSendBufferSize(int32 size); |
| 88 | 87 |
| 89 private: | 88 private: |
| 90 bool Init(); | 89 bool Init(); |
| 91 void DoReadCallback(int result); | 90 void DoReadCallback(int result); |
| 92 void DoWriteCallback(int result); | 91 void DoWriteCallback(int result); |
| 93 | 92 |
| 94 bool DoTransportIO(); | 93 bool DoTransportIO(); |
| 95 int DoHandshake(); | 94 int DoHandshake(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 108 int DoPayloadRead(); | 107 int DoPayloadRead(); |
| 109 int DoPayloadWrite(); | 108 int DoPayloadWrite(); |
| 110 | 109 |
| 111 int BufferSend(); | 110 int BufferSend(); |
| 112 int BufferRecv(); | 111 int BufferRecv(); |
| 113 void BufferSendComplete(int result); | 112 void BufferSendComplete(int result); |
| 114 void BufferRecvComplete(int result); | 113 void BufferRecvComplete(int result); |
| 115 void TransportWriteComplete(int result); | 114 void TransportWriteComplete(int result); |
| 116 void TransportReadComplete(int result); | 115 void TransportReadComplete(int result); |
| 117 | 116 |
| 118 OldCompletionCallbackImpl<SSLClientSocketOpenSSL> buffer_send_callback_; | |
| 119 OldCompletionCallbackImpl<SSLClientSocketOpenSSL> buffer_recv_callback_; | |
| 120 bool transport_send_busy_; | 117 bool transport_send_busy_; |
| 121 scoped_refptr<DrainableIOBuffer> send_buffer_; | 118 scoped_refptr<DrainableIOBuffer> send_buffer_; |
| 122 bool transport_recv_busy_; | 119 bool transport_recv_busy_; |
| 123 scoped_refptr<IOBuffer> recv_buffer_; | 120 scoped_refptr<IOBuffer> recv_buffer_; |
| 124 | 121 |
| 125 OldCompletionCallback* old_user_connect_callback_; | |
| 126 CompletionCallback user_connect_callback_; | 122 CompletionCallback user_connect_callback_; |
| 127 OldCompletionCallback* old_user_read_callback_; | |
| 128 CompletionCallback user_read_callback_; | 123 CompletionCallback user_read_callback_; |
| 129 OldCompletionCallback* user_write_callback_; | 124 CompletionCallback user_write_callback_; |
| 130 | 125 |
| 131 // Used by Read function. | 126 // Used by Read function. |
| 132 scoped_refptr<IOBuffer> user_read_buf_; | 127 scoped_refptr<IOBuffer> user_read_buf_; |
| 133 int user_read_buf_len_; | 128 int user_read_buf_len_; |
| 134 | 129 |
| 135 // Used by Write function. | 130 // Used by Write function. |
| 136 scoped_refptr<IOBuffer> user_write_buf_; | 131 scoped_refptr<IOBuffer> user_write_buf_; |
| 137 int user_write_buf_len_; | 132 int user_write_buf_len_; |
| 138 | 133 |
| 139 // Set when handshake finishes. | 134 // Set when handshake finishes. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 169 State next_handshake_state_; | 164 State next_handshake_state_; |
| 170 NextProtoStatus npn_status_; | 165 NextProtoStatus npn_status_; |
| 171 std::string npn_proto_; | 166 std::string npn_proto_; |
| 172 std::string server_protos_; | 167 std::string server_protos_; |
| 173 BoundNetLog net_log_; | 168 BoundNetLog net_log_; |
| 174 }; | 169 }; |
| 175 | 170 |
| 176 } // namespace net | 171 } // namespace net |
| 177 | 172 |
| 178 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 173 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| OLD | NEW |