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

Unified Diff: device/serial/serial_connection.h

Issue 488363002: Implement the host side of serial connection I/O on data pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win x64 build 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/serial/serial.mojom ('k') | device/serial/serial_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/serial_connection.h
diff --git a/device/serial/serial_connection.h b/device/serial/serial_connection.h
index 31d5fc3a894cbdac3a2b90e43d9000b31c9d155c..807e173700f6ae52870490b531a243376b7af98a 100644
--- a/device/serial/serial_connection.h
+++ b/device/serial/serial_connection.h
@@ -6,16 +6,23 @@
#define DEVICE_SERIAL_SERIAL_CONNECTION_H_
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "device/serial/serial.mojom.h"
#include "mojo/public/cpp/bindings/interface_impl.h"
namespace device {
+class DataSinkReceiver;
+class DataSourceSender;
+class ReadOnlyBuffer;
class SerialIoHandler;
+class WritableBuffer;
class SerialConnection : public mojo::InterfaceImpl<serial::Connection> {
public:
- explicit SerialConnection(scoped_refptr<SerialIoHandler> io_handler);
+ SerialConnection(scoped_refptr<SerialIoHandler> io_handler,
+ mojo::InterfaceRequest<serial::DataSink> sink,
+ mojo::InterfaceRequest<serial::DataSource> source);
virtual ~SerialConnection();
// mojo::InterfaceImpl<serial::Connection> overrides.
@@ -31,7 +38,13 @@ class SerialConnection : public mojo::InterfaceImpl<serial::Connection> {
virtual void Flush(const mojo::Callback<void(bool)>& callback) OVERRIDE;
private:
+ void OnSendPipeReady(scoped_ptr<ReadOnlyBuffer> buffer);
+ void OnSendCancelled(int32_t error);
+ void OnReceivePipeReady(scoped_ptr<WritableBuffer> buffer);
+
scoped_refptr<SerialIoHandler> io_handler_;
+ scoped_refptr<DataSinkReceiver> receiver_;
+ scoped_refptr<DataSourceSender> sender_;
DISALLOW_COPY_AND_ASSIGN(SerialConnection);
};
« 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