OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SOCKET_POSIX_H_ | 5 #ifndef NET_SOCKET_TCP_SOCKET_POSIX_H_ |
6 #define NET_SOCKET_TCP_SOCKET_POSIX_H_ | 6 #define NET_SOCKET_TCP_SOCKET_POSIX_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // NetLogEventType::TCP_CONNECT. These methods set the start/end of | 101 // NetLogEventType::TCP_CONNECT. These methods set the start/end of |
102 // NetLogEventType::TCP_CONNECT. | 102 // NetLogEventType::TCP_CONNECT. |
103 // | 103 // |
104 // TODO(yzshen): Change logging format and let TCPClientSocket log the | 104 // TODO(yzshen): Change logging format and let TCPClientSocket log the |
105 // start/end of a series of connect attempts itself. | 105 // start/end of a series of connect attempts itself. |
106 void StartLoggingMultipleConnectAttempts(const AddressList& addresses); | 106 void StartLoggingMultipleConnectAttempts(const AddressList& addresses); |
107 void EndLoggingMultipleConnectAttempts(int net_error); | 107 void EndLoggingMultipleConnectAttempts(int net_error); |
108 | 108 |
109 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock); | 109 void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock); |
110 | 110 |
111 const BoundNetLog& net_log() const { return net_log_; } | 111 const NetLogWithSource& net_log() const { return net_log_; } |
112 | 112 |
113 private: | 113 private: |
114 // States that using a socket with TCP FastOpen can lead to. | 114 // States that using a socket with TCP FastOpen can lead to. |
115 enum TCPFastOpenStatus { | 115 enum TCPFastOpenStatus { |
116 TCP_FASTOPEN_STATUS_UNKNOWN, | 116 TCP_FASTOPEN_STATUS_UNKNOWN, |
117 | 117 |
118 // The initial FastOpen connect attempted returned synchronously, | 118 // The initial FastOpen connect attempted returned synchronously, |
119 // indicating that we had and sent a cookie along with the initial data. | 119 // indicating that we had and sent a cookie along with the initial data. |
120 TCP_FASTOPEN_FAST_CONNECT_RETURN, | 120 TCP_FASTOPEN_FAST_CONNECT_RETURN, |
121 | 121 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 // connect with write. | 239 // connect with write. |
240 bool tcp_fastopen_write_attempted_; | 240 bool tcp_fastopen_write_attempted_; |
241 | 241 |
242 // True when TCP FastOpen is in use and we have done the connect. | 242 // True when TCP FastOpen is in use and we have done the connect. |
243 bool tcp_fastopen_connected_; | 243 bool tcp_fastopen_connected_; |
244 | 244 |
245 TCPFastOpenStatus tcp_fastopen_status_; | 245 TCPFastOpenStatus tcp_fastopen_status_; |
246 | 246 |
247 bool logging_multiple_connect_attempts_; | 247 bool logging_multiple_connect_attempts_; |
248 | 248 |
249 BoundNetLog net_log_; | 249 NetLogWithSource net_log_; |
250 | 250 |
251 DISALLOW_COPY_AND_ASSIGN(TCPSocketPosix); | 251 DISALLOW_COPY_AND_ASSIGN(TCPSocketPosix); |
252 }; | 252 }; |
253 | 253 |
254 } // namespace net | 254 } // namespace net |
255 | 255 |
256 #endif // NET_SOCKET_TCP_SOCKET_POSIX_H_ | 256 #endif // NET_SOCKET_TCP_SOCKET_POSIX_H_ |
OLD | NEW |