| 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_MAC_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // authentication is requested, the host_and_port field of SSLCertRequestInfo | 34 // authentication is requested, the host_and_port field of SSLCertRequestInfo |
| 35 // will be populated with |host_and_port|. |ssl_config| specifies | 35 // will be populated with |host_and_port|. |ssl_config| specifies |
| 36 // the SSL settings. | 36 // the SSL settings. |
| 37 SSLClientSocketMac(ClientSocketHandle* transport_socket, | 37 SSLClientSocketMac(ClientSocketHandle* transport_socket, |
| 38 const HostPortPair& host_and_port, | 38 const HostPortPair& host_and_port, |
| 39 const SSLConfig& ssl_config, | 39 const SSLConfig& ssl_config, |
| 40 const SSLClientSocketContext& context); | 40 const SSLClientSocketContext& context); |
| 41 virtual ~SSLClientSocketMac(); | 41 virtual ~SSLClientSocketMac(); |
| 42 | 42 |
| 43 // SSLClientSocket methods: | 43 // SSLClientSocket methods: |
| 44 virtual void GetSSLInfo(SSLInfo* ssl_info); | 44 virtual void GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 45 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 45 virtual void GetSSLCertRequestInfo( |
| 46 SSLCertRequestInfo* cert_request_info) OVERRIDE; |
| 46 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 47 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
| 47 const base::StringPiece& context, | 48 const base::StringPiece& context, |
| 48 unsigned char *out, | 49 unsigned char *out, |
| 49 unsigned int outlen); | 50 unsigned int outlen) OVERRIDE; |
| 50 virtual NextProtoStatus GetNextProto(std::string* proto); | 51 virtual NextProtoStatus GetNextProto(std::string* proto) OVERRIDE; |
| 51 | 52 |
| 52 // StreamSocket methods: | 53 // StreamSocket methods: |
| 53 virtual int Connect(OldCompletionCallback* callback); | 54 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 54 virtual void Disconnect(); | 55 virtual void Disconnect() OVERRIDE; |
| 55 virtual bool IsConnected() const; | 56 virtual bool IsConnected() const OVERRIDE; |
| 56 virtual bool IsConnectedAndIdle() const; | 57 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 57 virtual int GetPeerAddress(AddressList* address) const; | 58 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 58 virtual int GetLocalAddress(IPEndPoint* address) const; | 59 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 59 virtual const BoundNetLog& NetLog() const; | 60 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 60 virtual void SetSubresourceSpeculation(); | 61 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 61 virtual void SetOmniboxSpeculation(); | 62 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 62 virtual bool WasEverUsed() const; | 63 virtual bool WasEverUsed() const OVERRIDE; |
| 63 virtual bool UsingTCPFastOpen() const; | 64 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 64 virtual int64 NumBytesRead() const; | 65 virtual int64 NumBytesRead() const OVERRIDE; |
| 65 virtual base::TimeDelta GetConnectTimeMicros() const; | 66 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 66 | 67 |
| 67 // Socket methods: | 68 // Socket methods: |
| 68 virtual int Read(IOBuffer* buf, int buf_len, OldCompletionCallback* callback); | 69 virtual int Read(IOBuffer* buf, |
| 69 virtual int Write(IOBuffer* buf, int buf_len, OldCompletionCallback* callback)
; | 70 int buf_len, |
| 70 virtual bool SetReceiveBufferSize(int32 size); | 71 OldCompletionCallback* callback) OVERRIDE; |
| 71 virtual bool SetSendBufferSize(int32 size); | 72 virtual int Write(IOBuffer* buf, |
| 73 int buf_len, |
| 74 OldCompletionCallback* callback) OVERRIDE; |
| 75 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 76 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 72 | 77 |
| 73 private: | 78 private: |
| 74 bool completed_handshake() const { | 79 bool completed_handshake() const { |
| 75 return next_handshake_state_ == STATE_COMPLETED_HANDSHAKE; | 80 return next_handshake_state_ == STATE_COMPLETED_HANDSHAKE; |
| 76 } | 81 } |
| 77 // Initializes the SSLContext. Returns a net error code. | 82 // Initializes the SSLContext. Returns a net error code. |
| 78 int InitializeSSLContext(); | 83 int InitializeSSLContext(); |
| 79 | 84 |
| 80 void DoConnectCallback(int result); | 85 void DoConnectCallback(int result); |
| 81 void DoReadCallback(int result); | 86 void DoReadCallback(int result); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // These are the IOBuffers used for operations on the underlying transport. | 173 // These are the IOBuffers used for operations on the underlying transport. |
| 169 scoped_refptr<IOBuffer> read_io_buf_; | 174 scoped_refptr<IOBuffer> read_io_buf_; |
| 170 scoped_refptr<IOBuffer> write_io_buf_; | 175 scoped_refptr<IOBuffer> write_io_buf_; |
| 171 | 176 |
| 172 BoundNetLog net_log_; | 177 BoundNetLog net_log_; |
| 173 }; | 178 }; |
| 174 | 179 |
| 175 } // namespace net | 180 } // namespace net |
| 176 | 181 |
| 177 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ | 182 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_MAC_H_ |
| OLD | NEW |