| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 int SetReceiveBufferSize(int32_t size) override; | 74 int SetReceiveBufferSize(int32_t size) override; |
| 75 int SetSendBufferSize(int32_t size) override; | 75 int SetSendBufferSize(int32_t size) override; |
| 76 | 76 |
| 77 virtual bool SetKeepAlive(bool enable, int delay); | 77 virtual bool SetKeepAlive(bool enable, int delay); |
| 78 virtual bool SetNoDelay(bool no_delay); | 78 virtual bool SetNoDelay(bool no_delay); |
| 79 | 79 |
| 80 void GetConnectionAttempts(ConnectionAttempts* out) const override; | 80 void GetConnectionAttempts(ConnectionAttempts* out) const override; |
| 81 void ClearConnectionAttempts() override; | 81 void ClearConnectionAttempts() override; |
| 82 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; | 82 void AddConnectionAttempts(const ConnectionAttempts& attempts) override; |
| 83 int64_t GetTotalReceivedBytes() const override; | 83 int64_t GetTotalReceivedBytes() const override; |
| 84 void DumpMemoryStats( |
| 85 base::trace_event::MemoryAllocatorDump* dump) const override; |
| 84 | 86 |
| 85 private: | 87 private: |
| 86 // State machine for connecting the socket. | 88 // State machine for connecting the socket. |
| 87 enum ConnectState { | 89 enum ConnectState { |
| 88 CONNECT_STATE_CONNECT, | 90 CONNECT_STATE_CONNECT, |
| 89 CONNECT_STATE_CONNECT_COMPLETE, | 91 CONNECT_STATE_CONNECT_COMPLETE, |
| 90 CONNECT_STATE_NONE, | 92 CONNECT_STATE_NONE, |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 // State machine used by Connect(). | 95 // State machine used by Connect(). |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 149 |
| 148 // Total number of bytes received by the socket. | 150 // Total number of bytes received by the socket. |
| 149 int64_t total_received_bytes_; | 151 int64_t total_received_bytes_; |
| 150 | 152 |
| 151 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); | 153 DISALLOW_COPY_AND_ASSIGN(TCPClientSocket); |
| 152 }; | 154 }; |
| 153 | 155 |
| 154 } // namespace net | 156 } // namespace net |
| 155 | 157 |
| 156 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ | 158 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_H_ |
| OLD | NEW |