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 #include "net/socket/tcp_socket_win.h" | 6 #include "net/socket/tcp_socket_win.h" |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <mstcpip.h> | 9 #include <mstcpip.h> |
10 | 10 |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
13 #include "base/callback_helpers.h" | 13 #include "base/callback_helpers.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/profiler/scoped_tracker.h" | 17 #include "base/profiler/scoped_tracker.h" |
18 #include "net/base/address_list.h" | 18 #include "net/base/address_list.h" |
19 #include "net/base/io_buffer.h" | 19 #include "net/base/io_buffer.h" |
20 #include "net/base/ip_endpoint.h" | 20 #include "net/base/ip_endpoint.h" |
21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
22 #include "net/base/network_activity_monitor.h" | 22 #include "net/base/network_activity_monitor.h" |
23 #include "net/base/network_change_notifier.h" | 23 #include "net/base/network_change_notifier.h" |
24 #include "net/base/sockaddr_storage.h" | 24 #include "net/base/sockaddr_storage.h" |
25 #include "net/base/winsock_init.h" | 25 #include "net/base/winsock_init.h" |
26 #include "net/base/winsock_util.h" | 26 #include "net/base/winsock_util.h" |
| 27 #include "net/log/net_log.h" |
27 #include "net/log/net_log_event_type.h" | 28 #include "net/log/net_log_event_type.h" |
| 29 #include "net/log/net_log_source.h" |
28 #include "net/log/net_log_source_type.h" | 30 #include "net/log/net_log_source_type.h" |
29 #include "net/socket/socket_descriptor.h" | 31 #include "net/socket/socket_descriptor.h" |
30 #include "net/socket/socket_net_log_params.h" | 32 #include "net/socket/socket_net_log_params.h" |
31 | 33 |
32 namespace net { | 34 namespace net { |
33 | 35 |
34 namespace { | 36 namespace { |
35 | 37 |
36 const int kTCPKeepAliveSeconds = 45; | 38 const int kTCPKeepAliveSeconds = 45; |
37 | 39 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 core_->socket_->DidCompleteWrite(); | 241 core_->socket_->DidCompleteWrite(); |
240 | 242 |
241 core_->Release(); | 243 core_->Release(); |
242 } | 244 } |
243 | 245 |
244 //----------------------------------------------------------------------------- | 246 //----------------------------------------------------------------------------- |
245 | 247 |
246 TCPSocketWin::TCPSocketWin( | 248 TCPSocketWin::TCPSocketWin( |
247 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 249 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
248 net::NetLog* net_log, | 250 net::NetLog* net_log, |
249 const net::NetLog::Source& source) | 251 const net::NetLogSource& source) |
250 : socket_(INVALID_SOCKET), | 252 : socket_(INVALID_SOCKET), |
251 socket_performance_watcher_(std::move(socket_performance_watcher)), | 253 socket_performance_watcher_(std::move(socket_performance_watcher)), |
252 accept_event_(WSA_INVALID_EVENT), | 254 accept_event_(WSA_INVALID_EVENT), |
253 accept_socket_(NULL), | 255 accept_socket_(NULL), |
254 accept_address_(NULL), | 256 accept_address_(NULL), |
255 waiting_connect_(false), | 257 waiting_connect_(false), |
256 waiting_read_(false), | 258 waiting_read_(false), |
257 waiting_write_(false), | 259 waiting_write_(false), |
258 connect_os_error_(0), | 260 connect_os_error_(0), |
259 logging_multiple_connect_attempts_(false), | 261 logging_multiple_connect_attempts_(false), |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 } | 1009 } |
1008 | 1010 |
1009 bool TCPSocketWin::GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const { | 1011 bool TCPSocketWin::GetEstimatedRoundTripTime(base::TimeDelta* out_rtt) const { |
1010 DCHECK(out_rtt); | 1012 DCHECK(out_rtt); |
1011 // TODO(bmcquade): Consider implementing using | 1013 // TODO(bmcquade): Consider implementing using |
1012 // GetPerTcpConnectionEStats/GetPerTcp6ConnectionEStats. | 1014 // GetPerTcpConnectionEStats/GetPerTcp6ConnectionEStats. |
1013 return false; | 1015 return false; |
1014 } | 1016 } |
1015 | 1017 |
1016 } // namespace net | 1018 } // namespace net |
OLD | NEW |