| 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_NSS_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <certt.h> | 9 #include <certt.h> |
| 10 #include <keyt.h> | 10 #include <keyt.h> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 SSLClientSocketNSS(ClientSocketHandle* transport_socket, | 52 SSLClientSocketNSS(ClientSocketHandle* transport_socket, |
| 53 const HostPortPair& host_and_port, | 53 const HostPortPair& host_and_port, |
| 54 const SSLConfig& ssl_config, | 54 const SSLConfig& ssl_config, |
| 55 SSLHostInfo* ssl_host_info, | 55 SSLHostInfo* ssl_host_info, |
| 56 const SSLClientSocketContext& context); | 56 const SSLClientSocketContext& context); |
| 57 virtual ~SSLClientSocketNSS(); | 57 virtual ~SSLClientSocketNSS(); |
| 58 | 58 |
| 59 // For tests | 59 // For tests |
| 60 static void ClearSessionCache(); | 60 static void ClearSessionCache(); |
| 61 | 61 |
| 62 // SSLClientSocket methods: | 62 // SSLClientSocket implementation. |
| 63 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 63 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 64 virtual void GetSSLCertRequestInfo( | 64 virtual void GetSSLCertRequestInfo( |
| 65 SSLCertRequestInfo* cert_request_info) OVERRIDE; | 65 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
| 66 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 66 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
| 67 const base::StringPiece& context, | 67 const base::StringPiece& context, |
| 68 unsigned char *out, | 68 unsigned char *out, |
| 69 unsigned int outlen) OVERRIDE; | 69 unsigned int outlen) OVERRIDE; |
| 70 virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; | 70 virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; |
| 71 | 71 |
| 72 // StreamSocket methods: | 72 // StreamSocket implementation. |
| 73 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; | 73 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 74 virtual int Connect(const CompletionCallback& callback) OVERRIDE; |
| 74 virtual void Disconnect() OVERRIDE; | 75 virtual void Disconnect() OVERRIDE; |
| 75 virtual bool IsConnected() const OVERRIDE; | 76 virtual bool IsConnected() const OVERRIDE; |
| 76 virtual bool IsConnectedAndIdle() const OVERRIDE; | 77 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 77 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; | 78 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 78 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; | 79 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 79 virtual const BoundNetLog& NetLog() const OVERRIDE; | 80 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 80 virtual void SetSubresourceSpeculation() OVERRIDE; | 81 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 81 virtual void SetOmniboxSpeculation() OVERRIDE; | 82 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 82 virtual bool WasEverUsed() const OVERRIDE; | 83 virtual bool WasEverUsed() const OVERRIDE; |
| 83 virtual bool UsingTCPFastOpen() const OVERRIDE; | 84 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 84 virtual int64 NumBytesRead() const OVERRIDE; | 85 virtual int64 NumBytesRead() const OVERRIDE; |
| 85 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; | 86 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 86 | 87 |
| 87 // Socket methods: | 88 // Socket implementation. |
| 88 virtual int Read(IOBuffer* buf, | 89 virtual int Read(IOBuffer* buf, |
| 89 int buf_len, | 90 int buf_len, |
| 90 OldCompletionCallback* callback) OVERRIDE; | 91 OldCompletionCallback* callback) OVERRIDE; |
| 91 virtual int Write(IOBuffer* buf, | 92 virtual int Write(IOBuffer* buf, |
| 92 int buf_len, | 93 int buf_len, |
| 93 OldCompletionCallback* callback) OVERRIDE; | 94 OldCompletionCallback* callback) OVERRIDE; |
| 94 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 95 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 95 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 96 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 96 | 97 |
| 97 private: | 98 private: |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 // uncork_timer_ is used to limit the amount of time that we'll delay the | 216 // uncork_timer_ is used to limit the amount of time that we'll delay the |
| 216 // Finished message while waiting for a Write. | 217 // Finished message while waiting for a Write. |
| 217 base::OneShotTimer<SSLClientSocketNSS> uncork_timer_; | 218 base::OneShotTimer<SSLClientSocketNSS> uncork_timer_; |
| 218 scoped_refptr<IOBuffer> recv_buffer_; | 219 scoped_refptr<IOBuffer> recv_buffer_; |
| 219 | 220 |
| 220 CompletionCallback handshake_io_callback_; | 221 CompletionCallback handshake_io_callback_; |
| 221 scoped_ptr<ClientSocketHandle> transport_; | 222 scoped_ptr<ClientSocketHandle> transport_; |
| 222 HostPortPair host_and_port_; | 223 HostPortPair host_and_port_; |
| 223 SSLConfig ssl_config_; | 224 SSLConfig ssl_config_; |
| 224 | 225 |
| 225 OldCompletionCallback* user_connect_callback_; | 226 OldCompletionCallback* old_user_connect_callback_; |
| 227 CompletionCallback user_connect_callback_; |
| 226 OldCompletionCallback* user_read_callback_; | 228 OldCompletionCallback* user_read_callback_; |
| 227 OldCompletionCallback* user_write_callback_; | 229 OldCompletionCallback* user_write_callback_; |
| 228 | 230 |
| 229 // Used by Read function. | 231 // Used by Read function. |
| 230 scoped_refptr<IOBuffer> user_read_buf_; | 232 scoped_refptr<IOBuffer> user_read_buf_; |
| 231 int user_read_buf_len_; | 233 int user_read_buf_len_; |
| 232 | 234 |
| 233 // Used by Write function. | 235 // Used by Write function. |
| 234 scoped_refptr<IOBuffer> user_write_buf_; | 236 scoped_refptr<IOBuffer> user_write_buf_; |
| 235 int user_write_buf_len_; | 237 int user_write_buf_len_; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 // Added the following code Debugging in release mode. | 308 // Added the following code Debugging in release mode. |
| 307 mutable base::Lock lock_; | 309 mutable base::Lock lock_; |
| 308 // This is mutable so that CalledOnValidThread can set it. | 310 // This is mutable so that CalledOnValidThread can set it. |
| 309 // It's guarded by |lock_|. | 311 // It's guarded by |lock_|. |
| 310 mutable base::PlatformThreadId valid_thread_id_; | 312 mutable base::PlatformThreadId valid_thread_id_; |
| 311 }; | 313 }; |
| 312 | 314 |
| 313 } // namespace net | 315 } // namespace net |
| 314 | 316 |
| 315 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 317 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
| OLD | NEW |