| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_WIN_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <winsock2.h> | 9 #include <winsock2.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // connection. | 25 // connection. |
| 26 TCPClientSocketWin(const AddressList& addresses, | 26 TCPClientSocketWin(const AddressList& addresses, |
| 27 net::NetLog* net_log, | 27 net::NetLog* net_log, |
| 28 const net::NetLog::Source& source); | 28 const net::NetLog::Source& source); |
| 29 | 29 |
| 30 virtual ~TCPClientSocketWin(); | 30 virtual ~TCPClientSocketWin(); |
| 31 | 31 |
| 32 // AdoptSocket causes the given, connected socket to be adopted as a TCP | 32 // AdoptSocket causes the given, connected socket to be adopted as a TCP |
| 33 // socket. This object must not be connected. This object takes ownership of | 33 // socket. This object must not be connected. This object takes ownership of |
| 34 // the given socket and then acts as if Connect() had been called. This | 34 // the given socket and then acts as if Connect() had been called. This |
| 35 // function is intended for testing only. | 35 // function is used by TCPServerSocket() to adopt accepted connections |
| 36 // and for testing. |
| 36 void AdoptSocket(SOCKET socket); | 37 void AdoptSocket(SOCKET socket); |
| 37 | 38 |
| 38 // ClientSocket methods: | 39 // ClientSocket methods: |
| 39 virtual int Connect(CompletionCallback* callback); | 40 virtual int Connect(CompletionCallback* callback); |
| 40 virtual void Disconnect(); | 41 virtual void Disconnect(); |
| 41 virtual bool IsConnected() const; | 42 virtual bool IsConnected() const; |
| 42 virtual bool IsConnectedAndIdle() const; | 43 virtual bool IsConnectedAndIdle() const; |
| 43 virtual int GetPeerAddress(AddressList* address) const; | 44 virtual int GetPeerAddress(AddressList* address) const; |
| 44 virtual const BoundNetLog& NetLog() const { return net_log_; } | 45 virtual const BoundNetLog& NetLog() const { return net_log_; } |
| 45 virtual void SetSubresourceSpeculation(); | 46 virtual void SetSubresourceSpeculation(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Record of connectivity and transmissions, for use in speculative connection | 133 // Record of connectivity and transmissions, for use in speculative connection |
| 133 // histograms. | 134 // histograms. |
| 134 UseHistory use_history_; | 135 UseHistory use_history_; |
| 135 | 136 |
| 136 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); | 137 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketWin); |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace net | 140 } // namespace net |
| 140 | 141 |
| 141 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ | 142 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_WIN_H_ |
| OLD | NEW |