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

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

Issue 423373002: Convert SerialIoHandler to use buffer interfaces for I/O API methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@js-serial
Patch Set: rebase Created 6 years, 4 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
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 "device/serial/serial_io_handler.h" 7 #include "device/serial/serial_io_handler.h"
8 8
9 namespace device { 9 namespace device {
10 10
11 SerialConnection::SerialConnection(scoped_refptr<SerialIoHandler> io_handler) 11 SerialConnection::SerialConnection(scoped_refptr<SerialIoHandler> io_handler)
12 : io_handler_(io_handler) { 12 : io_handler_(io_handler) {
13 // TODO(sammc): Call io_handler_->Initialize() once we support send and recv.
14 } 13 }
15 14
16 SerialConnection::~SerialConnection() { 15 SerialConnection::~SerialConnection() {
17 } 16 }
18 17
19 void SerialConnection::GetInfo( 18 void SerialConnection::GetInfo(
20 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback) { 19 const mojo::Callback<void(serial::ConnectionInfoPtr)>& callback) {
21 callback.Run(io_handler_->GetPortInfo()); 20 callback.Run(io_handler_->GetPortInfo());
22 } 21 }
23 22
(...skipping 12 matching lines...) Expand all
36 void SerialConnection::GetControlSignals( 35 void SerialConnection::GetControlSignals(
37 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback) { 36 const mojo::Callback<void(serial::DeviceControlSignalsPtr)>& callback) {
38 callback.Run(io_handler_->GetControlSignals()); 37 callback.Run(io_handler_->GetControlSignals());
39 } 38 }
40 39
41 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) { 40 void SerialConnection::Flush(const mojo::Callback<void(bool)>& callback) {
42 callback.Run(io_handler_->Flush()); 41 callback.Run(io_handler_->Flush());
43 } 42 }
44 43
45 } // namespace device 44 } // namespace device
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698