| 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_TCP_CLIENT_SOCKET_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | 53 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; |
| 54 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; | 54 virtual bool GetSSLInfo(SSLInfo* ssl_info) OVERRIDE; |
| 55 | 55 |
| 56 // Socket implementation. | 56 // Socket implementation. |
| 57 // Multiple outstanding requests are not supported. | 57 // Multiple outstanding requests are not supported. |
| 58 // Full duplex mode (reading and writing at the same time) is supported. | 58 // Full duplex mode (reading and writing at the same time) is supported. |
| 59 virtual int Read(IOBuffer* buf, int buf_len, | 59 virtual int Read(IOBuffer* buf, int buf_len, |
| 60 const CompletionCallback& callback) OVERRIDE; | 60 const CompletionCallback& callback) OVERRIDE; |
| 61 virtual int Write(IOBuffer* buf, int buf_len, | 61 virtual int Write(IOBuffer* buf, int buf_len, |
| 62 const CompletionCallback& callback) OVERRIDE; | 62 const CompletionCallback& callback) OVERRIDE; |
| 63 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 63 virtual int SetReceiveBufferSize(int32 size) OVERRIDE; |
| 64 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 64 virtual int SetSendBufferSize(int32 size) OVERRIDE; |
| 65 | 65 |
| 66 virtual bool SetKeepAlive(bool enable, int delay); | 66 virtual bool SetKeepAlive(bool enable, int delay); |
| 67 virtual bool SetNoDelay(bool no_delay); | 67 virtual bool SetNoDelay(bool no_delay); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 // State machine for connecting the socket. | 70 // State machine for connecting the socket. |
| 71 enum ConnectState { | 71 enum ConnectState { |
| 72 CONNECT_STATE_CONNECT, | 72 CONNECT_STATE_CONNECT, |
| 73 CONNECT_STATE_CONNECT_COMPLETE, | 73 CONNECT_STATE_CONNECT_COMPLETE, |
| 74 CONNECT_STATE_NONE, | 74 CONNECT_STATE_NONE, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // Record of connectivity and transmissions, for use in speculative connection | 112 // Record of connectivity and transmissions, for use in speculative connection |
| 113 // histograms. | 113 // histograms. |
| 114 UseHistory use_history_; | 114 UseHistory use_history_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); | 116 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace net | 119 } // namespace net |
| 120 | 120 |
| 121 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 121 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| OLD | NEW |