| 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_H_ | 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // Helper used by Disconnect(), which disconnects minus resetting | 90 // Helper used by Disconnect(), which disconnects minus resetting |
| 91 // current_address_index_ and bind_address_. | 91 // current_address_index_ and bind_address_. |
| 92 void DoDisconnect(); | 92 void DoDisconnect(); |
| 93 | 93 |
| 94 void DidCompleteConnect(int result); | 94 void DidCompleteConnect(int result); |
| 95 void DidCompleteReadWrite(const CompletionCallback& callback, int result); | 95 void DidCompleteReadWrite(const CompletionCallback& callback, int result); |
| 96 | 96 |
| 97 int OpenSocket(AddressFamily family); | 97 int OpenSocket(AddressFamily family); |
| 98 | 98 |
| 99 // Emits histograms for TCP metrics, at the time the socket is |
| 100 // disconnected. |
| 101 void EmitTCPMetricsHistogramsOnDisconnect(); |
| 102 |
| 99 scoped_ptr<TCPSocket> socket_; | 103 scoped_ptr<TCPSocket> socket_; |
| 100 | 104 |
| 101 // Local IP address and port we are bound to. Set to NULL if Bind() | 105 // Local IP address and port we are bound to. Set to NULL if Bind() |
| 102 // wasn't called (in that case OS chooses address/port). | 106 // wasn't called (in that case OS chooses address/port). |
| 103 scoped_ptr<IPEndPoint> bind_address_; | 107 scoped_ptr<IPEndPoint> bind_address_; |
| 104 | 108 |
| 105 // The list of addresses we should try in order to establish a connection. | 109 // The list of addresses we should try in order to establish a connection. |
| 106 AddressList addresses_; | 110 AddressList addresses_; |
| 107 | 111 |
| 108 // Where we are in above list. Set to -1 if uninitialized. | 112 // Where we are in above list. Set to -1 if uninitialized. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 | 127 |
| 124 // Failed connection attempts made while trying to connect this socket. | 128 // Failed connection attempts made while trying to connect this socket. |
| 125 ConnectionAttempts connection_attempts_; | 129 ConnectionAttempts connection_attempts_; |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); | 131 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 } // namespace net | 134 } // namespace net |
| 131 | 135 |
| 132 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 136 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| OLD | NEW |