| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "tools/battor_agent/battor_connection_impl.h" | 5 #include "tools/battor_agent/battor_connection_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "device/serial/buffer.h" | 11 #include "device/serial/buffer.h" |
| 12 #include "device/serial/serial_io_handler.h" | 12 #include "device/serial/serial_io_handler.h" |
| 13 #include "net/base/io_buffer.h" | 13 #include "net/base/io_buffer.h" |
| 14 | 14 |
| 15 using std::vector; | 15 using std::vector; |
| 16 | 16 |
| 17 namespace battor { | 17 namespace battor { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 void BattOrConnectionImpl::OnBytesSent(int bytes_sent, | 267 void BattOrConnectionImpl::OnBytesSent(int bytes_sent, |
| 268 device::serial::SendError error) { | 268 device::serial::SendError error) { |
| 269 bool success = (error == device::serial::SendError::NONE) && | 269 bool success = (error == device::serial::SendError::NONE) && |
| 270 (pending_write_length_ == static_cast<size_t>(bytes_sent)); | 270 (pending_write_length_ == static_cast<size_t>(bytes_sent)); |
| 271 base::ThreadTaskRunnerHandle::Get()->PostTask( | 271 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 272 FROM_HERE, | 272 FROM_HERE, |
| 273 base::Bind(&Listener::OnBytesSent, base::Unretained(listener_), success)); | 273 base::Bind(&Listener::OnBytesSent, base::Unretained(listener_), success)); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace battor | 276 } // namespace battor |
| OLD | NEW |