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_LIBEVENT_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Full duplex mode (reading and writing at the same time) is supported | 63 // Full duplex mode (reading and writing at the same time) is supported |
64 virtual int Read(IOBuffer* buf, | 64 virtual int Read(IOBuffer* buf, |
65 int buf_len, | 65 int buf_len, |
66 OldCompletionCallback* callback) OVERRIDE; | 66 OldCompletionCallback* callback) OVERRIDE; |
67 virtual int Read(IOBuffer* buf, | 67 virtual int Read(IOBuffer* buf, |
68 int buf_len, | 68 int buf_len, |
69 const CompletionCallback& callback) OVERRIDE; | 69 const CompletionCallback& callback) OVERRIDE; |
70 virtual int Write(IOBuffer* buf, | 70 virtual int Write(IOBuffer* buf, |
71 int buf_len, | 71 int buf_len, |
72 OldCompletionCallback* callback) OVERRIDE; | 72 OldCompletionCallback* callback) OVERRIDE; |
73 virtual int Write(IOBuffer* buf, | |
74 int buf_len, | |
75 const CompletionCallback& callback) OVERRIDE; | |
76 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 73 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
77 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 74 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
78 | 75 |
79 private: | 76 private: |
80 // State machine for connecting the socket. | 77 // State machine for connecting the socket. |
81 enum ConnectState { | 78 enum ConnectState { |
82 CONNECT_STATE_CONNECT, | 79 CONNECT_STATE_CONNECT, |
83 CONNECT_STATE_CONNECT_COMPLETE, | 80 CONNECT_STATE_CONNECT_COMPLETE, |
84 CONNECT_STATE_NONE, | 81 CONNECT_STATE_NONE, |
85 }; | 82 }; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 base::TimeTicks connect_start_time_; | 210 base::TimeTicks connect_start_time_; |
214 base::TimeDelta connect_time_micros_; | 211 base::TimeDelta connect_time_micros_; |
215 int64 num_bytes_read_; | 212 int64 num_bytes_read_; |
216 | 213 |
217 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 214 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
218 }; | 215 }; |
219 | 216 |
220 } // namespace net | 217 } // namespace net |
221 | 218 |
222 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 219 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
OLD | NEW |