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

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

Issue 1143013002: Remove mojo::InterfaceImpl from device/serial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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_factory.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 "base/bind.h" 7 #include "base/bind.h"
8 #include "device/serial/buffer.h" 8 #include "device/serial/buffer.h"
9 #include "device/serial/data_sink_receiver.h" 9 #include "device/serial/data_sink_receiver.h"
10 #include "device/serial/data_source_sender.h" 10 #include "device/serial/data_source_sender.h"
11 #include "device/serial/serial_io_handler.h" 11 #include "device/serial/serial_io_handler.h"
12 12
13 namespace device { 13 namespace device {
14 14
15 SerialConnection::SerialConnection( 15 SerialConnection::SerialConnection(
16 scoped_refptr<SerialIoHandler> io_handler, 16 scoped_refptr<SerialIoHandler> io_handler,
17 mojo::InterfaceRequest<serial::DataSink> sink, 17 mojo::InterfaceRequest<serial::DataSink> sink,
18 mojo::InterfaceRequest<serial::DataSource> source, 18 mojo::InterfaceRequest<serial::DataSource> source,
19 mojo::InterfacePtr<serial::DataSourceClient> source_client) 19 mojo::InterfacePtr<serial::DataSourceClient> source_client,
20 : io_handler_(io_handler) { 20 mojo::InterfaceRequest<serial::Connection> request)
21 : io_handler_(io_handler), binding_(this, request.Pass()) {
21 receiver_ = new DataSinkReceiver( 22 receiver_ = new DataSinkReceiver(
22 sink.Pass(), 23 sink.Pass(),
23 base::Bind(&SerialConnection::OnSendPipeReady, base::Unretained(this)), 24 base::Bind(&SerialConnection::OnSendPipeReady, base::Unretained(this)),
24 base::Bind(&SerialConnection::OnSendCancelled, base::Unretained(this)), 25 base::Bind(&SerialConnection::OnSendCancelled, base::Unretained(this)),
25 base::Bind(base::DoNothing)); 26 base::Bind(base::DoNothing));
26 sender_ = new DataSourceSender( 27 sender_ = new DataSourceSender(
27 source.Pass(), source_client.Pass(), 28 source.Pass(), source_client.Pass(),
28 base::Bind(&SerialConnection::OnReceivePipeReady, base::Unretained(this)), 29 base::Bind(&SerialConnection::OnReceivePipeReady, base::Unretained(this)),
29 base::Bind(base::DoNothing)); 30 base::Bind(base::DoNothing));
30 } 31 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 69
69 void SerialConnection::OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer) { 70 void SerialConnection::OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer) {
70 io_handler_->Write(buffer.Pass()); 71 io_handler_->Write(buffer.Pass());
71 } 72 }
72 73
73 void SerialConnection::OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer) { 74 void SerialConnection::OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer) {
74 io_handler_->Read(buffer.Pass()); 75 io_handler_->Read(buffer.Pass());
75 } 76 }
76 77
77 } // namespace device 78 } // namespace device
OLDNEW
« no previous file with comments | « device/serial/serial_connection.h ('k') | device/serial/serial_connection_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698