| 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 18 matching lines...) Expand all Loading... |
| 29 // connection. | 29 // connection. |
| 30 TCPClientSocketLibevent(const AddressList& addresses, | 30 TCPClientSocketLibevent(const AddressList& addresses, |
| 31 net::NetLog* net_log, | 31 net::NetLog* net_log, |
| 32 const net::NetLog::Source& source); | 32 const net::NetLog::Source& source); |
| 33 | 33 |
| 34 virtual ~TCPClientSocketLibevent(); | 34 virtual ~TCPClientSocketLibevent(); |
| 35 | 35 |
| 36 // AdoptSocket causes the given, connected socket to be adopted as a TCP | 36 // AdoptSocket causes the given, connected socket to be adopted as a TCP |
| 37 // socket. This object must not be connected. This object takes ownership of | 37 // socket. This object must not be connected. This object takes ownership of |
| 38 // the given socket and then acts as if Connect() had been called. This | 38 // the given socket and then acts as if Connect() had been called. This |
| 39 // function is intended for testing only. | 39 // function is used by TCPServerSocket() to adopt accepted connections |
| 40 // and for testing. |
| 40 void AdoptSocket(int socket); | 41 void AdoptSocket(int socket); |
| 41 | 42 |
| 42 // ClientSocket methods: | 43 // ClientSocket methods: |
| 43 virtual int Connect(CompletionCallback* callback); | 44 virtual int Connect(CompletionCallback* callback); |
| 44 virtual void Disconnect(); | 45 virtual void Disconnect(); |
| 45 virtual bool IsConnected() const; | 46 virtual bool IsConnected() const; |
| 46 virtual bool IsConnectedAndIdle() const; | 47 virtual bool IsConnectedAndIdle() const; |
| 47 virtual int GetPeerAddress(AddressList* address) const; | 48 virtual int GetPeerAddress(AddressList* address) const; |
| 48 virtual const BoundNetLog& NetLog() const; | 49 virtual const BoundNetLog& NetLog() const; |
| 49 virtual void SetSubresourceSpeculation(); | 50 virtual void SetSubresourceSpeculation(); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 191 |
| 191 // True when TCP FastOpen is in use and we have done the connect. | 192 // True when TCP FastOpen is in use and we have done the connect. |
| 192 bool tcp_fastopen_connected_; | 193 bool tcp_fastopen_connected_; |
| 193 | 194 |
| 194 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 195 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 } // namespace net | 198 } // namespace net |
| 198 | 199 |
| 199 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 200 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| OLD | NEW |