Chromium Code Reviews| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 // Multiple outstanding requests are not supported. | 61 // Multiple outstanding requests are not supported. |
| 62 // Full duplex mode (reading and writing at the same time) is supported | 62 // Full duplex mode (reading and writing at the same time) is supported |
| 63 virtual int Read(IOBuffer* buf, | 63 virtual int Read(IOBuffer* buf, |
| 64 int buf_len, | 64 int buf_len, |
| 65 const CompletionCallback& callback) OVERRIDE; | 65 const CompletionCallback& callback) OVERRIDE; |
| 66 virtual int Write(IOBuffer* buf, | 66 virtual int Write(IOBuffer* buf, |
| 67 int buf_len, | 67 int buf_len, |
| 68 const CompletionCallback& callback) OVERRIDE; | 68 const CompletionCallback& callback) OVERRIDE; |
| 69 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; | 69 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 70 virtual bool SetSendBufferSize(int32 size) OVERRIDE; | 70 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 71 virtual NextProto GetNegotiatedProtocol() const OVERRIDE; | |
|
wtc
2012/03/30 21:19:14
Move this up to the StreamSocket implementation se
Ryan Hamilton
2012/03/30 21:53:17
Whoops, done.
| |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 // State machine for connecting the socket. | 74 // State machine for connecting the socket. |
| 74 enum ConnectState { | 75 enum ConnectState { |
| 75 CONNECT_STATE_CONNECT, | 76 CONNECT_STATE_CONNECT, |
| 76 CONNECT_STATE_CONNECT_COMPLETE, | 77 CONNECT_STATE_CONNECT_COMPLETE, |
| 77 CONNECT_STATE_NONE, | 78 CONNECT_STATE_NONE, |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 class ReadWatcher : public MessageLoopForIO::Watcher { | 81 class ReadWatcher : public MessageLoopForIO::Watcher { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 203 base::TimeTicks connect_start_time_; | 204 base::TimeTicks connect_start_time_; |
| 204 base::TimeDelta connect_time_micros_; | 205 base::TimeDelta connect_time_micros_; |
| 205 int64 num_bytes_read_; | 206 int64 num_bytes_read_; |
| 206 | 207 |
| 207 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 208 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
| 208 }; | 209 }; |
| 209 | 210 |
| 210 } // namespace net | 211 } // namespace net |
| 211 | 212 |
| 212 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 213 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| OLD | NEW |