| 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" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (bind_address_) { | 228 if (bind_address_) { |
| 229 *address = *bind_address_; | 229 *address = *bind_address_; |
| 230 return OK; | 230 return OK; |
| 231 } | 231 } |
| 232 return ERR_SOCKET_NOT_CONNECTED; | 232 return ERR_SOCKET_NOT_CONNECTED; |
| 233 } | 233 } |
| 234 | 234 |
| 235 return socket_->GetLocalAddress(address); | 235 return socket_->GetLocalAddress(address); |
| 236 } | 236 } |
| 237 | 237 |
| 238 const BoundNetLog& TCPClientSocket::NetLog() const { | 238 const NetLogWithSource& TCPClientSocket::NetLog() const { |
| 239 return socket_->net_log(); | 239 return socket_->net_log(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void TCPClientSocket::SetSubresourceSpeculation() { | 242 void TCPClientSocket::SetSubresourceSpeculation() { |
| 243 use_history_.set_subresource_speculation(); | 243 use_history_.set_subresource_speculation(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void TCPClientSocket::SetOmniboxSpeculation() { | 246 void TCPClientSocket::SetOmniboxSpeculation() { |
| 247 use_history_.set_omnibox_speculation(); | 247 use_history_.set_omnibox_speculation(); |
| 248 } | 248 } |
| (...skipping 138 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 |