Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Side by Side Diff: device/serial/serial_connection.cc

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/serial/serial_connection.h ('k') | device/serial/serial_connection_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « device/serial/serial_connection.h ('k') | device/serial/serial_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698