| 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 "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // |socket_| is gone. Therefore, it is safe to use base::Unretained() here. | 285 // |socket_| is gone. Therefore, it is safe to use base::Unretained() here. |
| 286 CompletionCallback write_callback = base::Bind( | 286 CompletionCallback write_callback = base::Bind( |
| 287 &TCPClientSocket::DidCompleteWrite, base::Unretained(this), callback); | 287 &TCPClientSocket::DidCompleteWrite, base::Unretained(this), callback); |
| 288 int result = socket_->Write(buf, buf_len, write_callback); | 288 int result = socket_->Write(buf, buf_len, write_callback); |
| 289 if (result > 0) | 289 if (result > 0) |
| 290 use_history_.set_was_used_to_convey_data(); | 290 use_history_.set_was_used_to_convey_data(); |
| 291 | 291 |
| 292 return result; | 292 return result; |
| 293 } | 293 } |
| 294 | 294 |
| 295 int TCPClientSocket::SetReceiveBufferSize(int32 size) { | 295 int TCPClientSocket::SetReceiveBufferSize(int32_t size) { |
| 296 return socket_->SetReceiveBufferSize(size); | 296 return socket_->SetReceiveBufferSize(size); |
| 297 } | 297 } |
| 298 | 298 |
| 299 int TCPClientSocket::SetSendBufferSize(int32 size) { | 299 int TCPClientSocket::SetSendBufferSize(int32_t size) { |
| 300 return socket_->SetSendBufferSize(size); | 300 return socket_->SetSendBufferSize(size); |
| 301 } | 301 } |
| 302 | 302 |
| 303 bool TCPClientSocket::SetKeepAlive(bool enable, int delay) { | 303 bool TCPClientSocket::SetKeepAlive(bool enable, int delay) { |
| 304 return socket_->SetKeepAlive(enable, delay); | 304 return socket_->SetKeepAlive(enable, delay); |
| 305 } | 305 } |
| 306 | 306 |
| 307 bool TCPClientSocket::SetNoDelay(bool no_delay) { | 307 bool TCPClientSocket::SetNoDelay(bool no_delay) { |
| 308 return socket_->SetNoDelay(no_delay); | 308 return socket_->SetNoDelay(no_delay); |
| 309 } | 309 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 void TCPClientSocket::EmitTCPMetricsHistogramsOnDisconnect() { | 378 void TCPClientSocket::EmitTCPMetricsHistogramsOnDisconnect() { |
| 379 base::TimeDelta rtt; | 379 base::TimeDelta rtt; |
| 380 if (socket_->GetEstimatedRoundTripTime(&rtt)) { | 380 if (socket_->GetEstimatedRoundTripTime(&rtt)) { |
| 381 UMA_HISTOGRAM_CUSTOM_TIMES("Net.TcpRtt.AtDisconnect", rtt, | 381 UMA_HISTOGRAM_CUSTOM_TIMES("Net.TcpRtt.AtDisconnect", rtt, |
| 382 base::TimeDelta::FromMilliseconds(1), | 382 base::TimeDelta::FromMilliseconds(1), |
| 383 base::TimeDelta::FromMinutes(10), 100); | 383 base::TimeDelta::FromMinutes(10), 100); |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace net | 387 } // namespace net |
| OLD | NEW |