| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
| 12 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 16 #include "net/base/net_errors.h" | 16 #include "net/base/net_errors.h" |
| 17 #include "net/base/socket_performance_watcher.h" | 17 #include "net/socket/socket_performance_watcher.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 TCPClientSocket::TCPClientSocket( | 21 TCPClientSocket::TCPClientSocket( |
| 22 const AddressList& addresses, | 22 const AddressList& addresses, |
| 23 scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 23 scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
| 24 net::NetLog* net_log, | 24 net::NetLog* net_log, |
| 25 const net::NetLog::Source& source) | 25 const net::NetLog::Source& source) |
| 26 : socket_performance_watcher_(socket_performance_watcher.get()), | 26 : socket_performance_watcher_(socket_performance_watcher.get()), |
| 27 socket_(new TCPSocket(std::move(socket_performance_watcher), | 27 socket_(new TCPSocket(std::move(socket_performance_watcher), |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 void TCPClientSocket::EmitTCPMetricsHistogramsOnDisconnect() { | 387 void TCPClientSocket::EmitTCPMetricsHistogramsOnDisconnect() { |
| 388 base::TimeDelta rtt; | 388 base::TimeDelta rtt; |
| 389 if (socket_->GetEstimatedRoundTripTime(&rtt)) { | 389 if (socket_->GetEstimatedRoundTripTime(&rtt)) { |
| 390 UMA_HISTOGRAM_CUSTOM_TIMES("Net.TcpRtt.AtDisconnect", rtt, | 390 UMA_HISTOGRAM_CUSTOM_TIMES("Net.TcpRtt.AtDisconnect", rtt, |
| 391 base::TimeDelta::FromMilliseconds(1), | 391 base::TimeDelta::FromMilliseconds(1), |
| 392 base::TimeDelta::FromMinutes(10), 100); | 392 base::TimeDelta::FromMinutes(10), 100); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 | 395 |
| 396 } // namespace net | 396 } // namespace net |
| OLD | NEW |