| 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();
|
| };
|
|
|