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

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

Issue 2410743002: Remove the mojo serial interfaces and related infrastructure. (Closed)
Patch Set: Created 4 years, 2 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.mojom ('k') | device/serial/serial_connection.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_SERIAL_SERIAL_CONNECTION_H_
6 #define DEVICE_SERIAL_SERIAL_CONNECTION_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14 #include "device/serial/serial.mojom.h"
15
16 namespace device {
17
18 class DataSinkReceiver;
19 class DataSourceSender;
20 class ReadOnlyBuffer;
21 class SerialIoHandler;
22 class WritableBuffer;
23
24 class SerialConnection : public serial::Connection {
25 public:
26 SerialConnection(scoped_refptr<SerialIoHandler> io_handler,
27 mojo::InterfaceRequest<serial::DataSink> sink,
28 mojo::InterfaceRequest<serial::DataSource> source,
29 mojo::InterfacePtr<serial::DataSourceClient> source_client);
30 ~SerialConnection() override;
31
32 // serial::Connection overrides.
33 void GetInfo(const GetInfoCallback& callback) override;
34 void SetOptions(serial::ConnectionOptionsPtr options,
35 const SetOptionsCallback& callback) override;
36 void SetControlSignals(serial::HostControlSignalsPtr signals,
37 const SetControlSignalsCallback& callback) override;
38 void GetControlSignals(const GetControlSignalsCallback& callback) override;
39 void Flush(const FlushCallback& callback) override;
40
41 private:
42 void OnSendPipeReady(std::unique_ptr<ReadOnlyBuffer> buffer);
43 void OnSendCancelled(int32_t error);
44 void OnReceivePipeReady(std::unique_ptr<WritableBuffer> buffer);
45
46 scoped_refptr<SerialIoHandler> io_handler_;
47 scoped_refptr<DataSinkReceiver> receiver_;
48 scoped_refptr<DataSourceSender> sender_;
49
50 DISALLOW_COPY_AND_ASSIGN(SerialConnection);
51 };
52
53 } // namespace device
54
55 #endif // DEVICE_SERIAL_SERIAL_CONNECTION_H_
OLDNEW
« no previous file with comments | « device/serial/serial.mojom ('k') | device/serial/serial_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698