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; |
73 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 76 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
74 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 77 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
75 | 78 |
76 private: | 79 private: |
77 // State machine for connecting the socket. | 80 // State machine for connecting the socket. |
78 enum ConnectState { | 81 enum ConnectState { |
79 CONNECT_STATE_CONNECT, | 82 CONNECT_STATE_CONNECT, |
80 CONNECT_STATE_CONNECT_COMPLETE, | 83 CONNECT_STATE_CONNECT_COMPLETE, |
81 CONNECT_STATE_NONE, | 84 CONNECT_STATE_NONE, |
82 }; | 85 }; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 base::TimeTicks connect_start_time_; | 213 base::TimeTicks connect_start_time_; |
211 base::TimeDelta connect_time_micros_; | 214 base::TimeDelta connect_time_micros_; |
212 int64 num_bytes_read_; | 215 int64 num_bytes_read_; |
213 | 216 |
214 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 217 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
215 }; | 218 }; |
216 | 219 |
217 } // namespace net | 220 } // namespace net |
218 | 221 |
219 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 222 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
OLD | NEW |