OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/serial/serial_connection.h" | 5 #include "device/serial/serial_connection.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "device/serial/buffer.h" | 10 #include "device/serial/buffer.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) { | 64 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) { |
65 callback.Run(io_handler_->Flush()); | 65 callback.Run(io_handler_->Flush()); |
66 } | 66 } |
67 | 67 |
68 void SerialConnection::OnSendCancelled(int32_t error) { | 68 void SerialConnection::OnSendCancelled(int32_t error) { |
69 io_handler_->CancelWrite(static_cast<serial::SendError>(error)); | 69 io_handler_->CancelWrite(static_cast<serial::SendError>(error)); |
70 } | 70 } |
71 | 71 |
72 void SerialConnection::OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer) { | 72 void SerialConnection::OnSendPipeReady(std::unique_ptr<ReadOnlyBuffer> buffer) { |
73 io_handler_->Write(std::move(buffer)); | 73 io_handler_->Write(std::move(buffer)); |
74 } | 74 } |
75 | 75 |
76 void SerialConnection::OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer) { | 76 void SerialConnection::OnReceivePipeReady( |
| 77 std::unique_ptr<WritableBuffer> buffer) { |
77 io_handler_->Read(std::move(buffer)); | 78 io_handler_->Read(std::move(buffer)); |
78 } | 79 } |
79 | 80 |
80 } // namespace device | 81 } // namespace device |
OLD | NEW |