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

Unified Diff: device/serial/data_stream.mojom

Issue 889283002: Remove Client= from device/serial/data_stream.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: This time without racing message pipes Created 5 years, 10 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/data_source_unittest.cc ('k') | device/serial/data_stream_serialization.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/serial/data_stream.mojom
diff --git a/device/serial/data_stream.mojom b/device/serial/data_stream.mojom
index a288eb26d568a8ffce4d42eb2726db277db0211a..e8fd4ec816a777abd3cbede7ebb4bd85823dc454 100644
--- a/device/serial/data_stream.mojom
+++ b/device/serial/data_stream.mojom
@@ -4,7 +4,6 @@
module device.serial;
-[Client=DataSourceClient]
interface DataSource {
// Initializes this DataSource with the amount of data its client will
// buffer.
@@ -27,27 +26,19 @@ interface DataSourceClient {
OnData(array<uint8> data);
};
-[Client=DataSinkClient]
interface DataSink {
- // 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.
- OnData(array<uint8> data);
-};
-
-interface DataSinkClient {
- // Reports that the sink has successfully received |bytes_sent| bytes of data.
- ReportBytesSent(uint32 bytes_sent);
+ // Invoked to pass |data| to the sink. The response contains the number of
+ // bytes successfully sent and an optional error. If |error| is zero,
+ // |bytes_sent| will the size of |data|.
+ OnData(array<uint8> data) => (uint32 bytes_sent, int32 error);
- // Reports that the sink has received |bytes_sent| bytes of data (possibly 0)
- // and encountered an error: |error|. Any OnData messages received by the
- // DataSink before the response will be discarded. The client should respond
- // when it is ready to resume sending data.
- ReportBytesSentAndError(uint32 bytes_sent, int32 error) => ();
+ // Called to clear the error and resume data transmission after an error
+ // occurs. After an error is reported in response to an OnData until
+ // ClearError is called, any further OnData calls will report the same error
+ // as the first error response.
+ ClearError();
};
« no previous file with comments | « device/serial/data_source_unittest.cc ('k') | device/serial/data_stream_serialization.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698