| 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/profiler/scoped_tracker.h" | 9 #include "base/profiler/scoped_tracker.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 } | 320 } |
| 321 | 321 |
| 322 void TCPClientSocket::DidCompleteReadWrite(const CompletionCallback& callback, | 322 void TCPClientSocket::DidCompleteReadWrite(const CompletionCallback& callback, |
| 323 int result) { | 323 int result) { |
| 324 if (result > 0) | 324 if (result > 0) |
| 325 use_history_.set_was_used_to_convey_data(); | 325 use_history_.set_was_used_to_convey_data(); |
| 326 | 326 |
| 327 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 327 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
| 328 tracked_objects::ScopedTracker tracking_profile( | 328 tracked_objects::ScopedTracker tracking_profile( |
| 329 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 329 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 330 "TCPClientSocket::DidCompleteReadWrite")); | 330 "418183 TCPClientSocket::DidCompleteReadWrite")); |
| 331 callback.Run(result); | 331 callback.Run(result); |
| 332 } | 332 } |
| 333 | 333 |
| 334 int TCPClientSocket::OpenSocket(AddressFamily family) { | 334 int TCPClientSocket::OpenSocket(AddressFamily family) { |
| 335 DCHECK(!socket_->IsValid()); | 335 DCHECK(!socket_->IsValid()); |
| 336 | 336 |
| 337 int result = socket_->Open(family); | 337 int result = socket_->Open(family); |
| 338 if (result != OK) | 338 if (result != OK) |
| 339 return result; | 339 return result; |
| 340 | 340 |
| 341 socket_->SetDefaultOptionsForClient(); | 341 socket_->SetDefaultOptionsForClient(); |
| 342 | 342 |
| 343 return OK; | 343 return OK; |
| 344 } | 344 } |
| 345 | 345 |
| 346 } // namespace net | 346 } // namespace net |
| OLD | NEW |