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

Unified Diff: device/serial/data_stream.mojom

Issue 646063003: Change data pipe wrappers used by SerialConnection to use message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: device/serial/data_stream.mojom
diff --git a/device/serial/data_stream.mojom b/device/serial/data_stream.mojom
index 689b38148411ede1b7ca63c39c3a2f47a841027b..a6ebf880572fd41a89dde46c14874fb10ec82af1 100644
--- a/device/serial/data_stream.mojom
+++ b/device/serial/data_stream.mojom
@@ -6,30 +6,37 @@ module device.serial {
[Client=DataSourceClient]
interface DataSource {
- // Initializes this DataSource with a data pipe handle to use for data
- // transmission.
- Init(handle<data_pipe_producer> producer_handle);
+ // Initializes this DataSource with the amount of data its client will
+ // buffer.
+ Init(uint32 buffer_size);
// Resumes sending data after it has been stopped due to an error.
Resume();
+
+ AckData(uint32 bytes_received);
raymes 2014/10/17 02:11:09 Please add a comment here. Does it make more sense
raymes 2014/10/17 04:04:45 Also should we name this consistently with ReportB
Sam McNally 2014/10/20 05:12:59 It does, but there could be a stash before the res
Sam McNally 2014/10/20 05:12:59 Done.
};
interface DataSourceClient {
- // Invoked to report |error| from the DataSource, at |error_location| bytes
- // into the data stream. No further bytes beyond |error_location| will be
+ // Invoked to report |error| from the DataSource. No further bytes will be
// transmitted from the DataSource until Resume() is called.
- OnError(uint32 error_location, int32 error);
+ OnError(int32 error);
+
+ // Invoked to transmit data from the DataSource.
+ OnData(array<uint8> data);
};
[Client=DataSinkClient]
interface DataSink {
- // Initializes this DataSink with a data pipe handle to use for data
- // transmission.
- Init(handle<data_pipe_consumer> consumer_handle);
+ // Initializes this DataSink with the amount of data it is expected to
+ // buffer.
+ Init(uint32 buffer_size);
// Requests the cancellation of any data that has been written to the pipe,
// but has not yet been sent to the sink.
Cancel(int32 error);
+
+ // Invoked to pass |data| to the sink.
+ AcceptData(array<uint8> data);
raymes 2014/10/17 02:11:10 nit, optional: should we name this consistently wi
Sam McNally 2014/10/20 05:12:59 Done.
};
interface DataSinkClient {
@@ -40,7 +47,7 @@ interface DataSinkClient {
// and encountered an error: |error|. The client should respond with
// |bytes_to_flush|, the number of bytes enqueued in the data pipe but not yet
raymes 2014/10/17 02:11:10 This comment is out of date now. I'm curious why i
raymes 2014/10/17 03:16:24 I guess the callback basically ensures that all th
Sam McNally 2014/10/20 05:12:59 The sends in the pipeline are all cancelled. Other
// acked so the correct number of bytes can be flushed from the pipe.
- ReportBytesSentAndError(uint32 bytes_sent, int32 error) => (uint32 bytes_to_flush);
+ ReportBytesSentAndError(uint32 bytes_sent, int32 error) => ();
};
}

Powered by Google App Engine
This is Rietveld 408576698