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 #include "net/socket/tcp_socket.h" | 5 #include "net/socket/tcp_socket.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <netinet/tcp.h> | 8 #include <netinet/tcp.h> |
9 #include <sys/socket.h> | 9 #include <sys/socket.h> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 NetLog* net_log, | 144 NetLog* net_log, |
145 const NetLog::Source& source) | 145 const NetLog::Source& source) |
146 : socket_performance_watcher_(std::move(socket_performance_watcher)), | 146 : socket_performance_watcher_(std::move(socket_performance_watcher)), |
147 tick_clock_(new base::DefaultTickClock()), | 147 tick_clock_(new base::DefaultTickClock()), |
148 rtt_notifications_minimum_interval_(base::TimeDelta::FromSeconds(1)), | 148 rtt_notifications_minimum_interval_(base::TimeDelta::FromSeconds(1)), |
149 use_tcp_fastopen_(false), | 149 use_tcp_fastopen_(false), |
150 tcp_fastopen_write_attempted_(false), | 150 tcp_fastopen_write_attempted_(false), |
151 tcp_fastopen_connected_(false), | 151 tcp_fastopen_connected_(false), |
152 tcp_fastopen_status_(TCP_FASTOPEN_STATUS_UNKNOWN), | 152 tcp_fastopen_status_(TCP_FASTOPEN_STATUS_UNKNOWN), |
153 logging_multiple_connect_attempts_(false), | 153 logging_multiple_connect_attempts_(false), |
154 net_log_(BoundNetLog::Make(net_log, NetLogSourceType::SOCKET)) { | 154 net_log_(NetLogWithSource::Make(net_log, NetLogSourceType::SOCKET)) { |
155 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, | 155 net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, |
156 source.ToEventParametersCallback()); | 156 source.ToEventParametersCallback()); |
157 } | 157 } |
158 | 158 |
159 TCPSocketPosix::~TCPSocketPosix() { | 159 TCPSocketPosix::~TCPSocketPosix() { |
160 net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE); | 160 net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE); |
161 Close(); | 161 Close(); |
162 } | 162 } |
163 | 163 |
164 int TCPSocketPosix::Open(AddressFamily family) { | 164 int TCPSocketPosix::Open(AddressFamily family) { |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 if (info.tcpi_rtt > 0) { | 814 if (info.tcpi_rtt > 0) { |
815 *out_rtt = base::TimeDelta::FromMicroseconds(info.tcpi_rtt); | 815 *out_rtt = base::TimeDelta::FromMicroseconds(info.tcpi_rtt); |
816 return true; | 816 return true; |
817 } | 817 } |
818 } | 818 } |
819 #endif // defined(TCP_INFO) | 819 #endif // defined(TCP_INFO) |
820 return false; | 820 return false; |
821 } | 821 } |
822 | 822 |
823 } // namespace net | 823 } // namespace net |
OLD | NEW |