| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 module device.serial; | 5 module device.serial; |
| 6 | 6 |
| 7 import "data_stream.mojom"; | 7 import "data_stream.mojom"; |
| 8 | 8 |
| 9 // A serialized form of a DataSender. | 9 // A serialized form of a DataSender. |
| 10 struct SerializedDataSender { | 10 struct SerializedDataSender { |
| 11 // The control channel to the DataSink to which this DataSender sends data. | 11 // The control channel to the DataSink to which this DataSender sends data. |
| 12 DataSink sink; | 12 DataSink sink; |
| 13 | 13 |
| 14 // The error to report for sends in progress when a fatal error occurs. | 14 // The error to report for sends in progress when a fatal error occurs. |
| 15 int32 fatal_error_value; | 15 int32 fatal_error_value; |
| 16 | |
| 17 // The size of the send buffer. | |
| 18 uint32 buffer_size; | |
| 19 }; | 16 }; |
| 20 | 17 |
| 21 // A pending receive error. | 18 // A pending receive error. |
| 22 struct PendingReceiveError { | 19 struct PendingReceiveError { |
| 23 // The value of the error. | 20 // The value of the error. |
| 24 int32 error; | 21 int32 error; |
| 25 | 22 |
| 26 // The location of the error. | 23 // The location of the error. |
| 27 uint32 offset; | 24 uint32 offset; |
| 28 }; | 25 }; |
| 29 | 26 |
| 30 // A serialized form of a DataReceiver. | 27 // A serialized form of a DataReceiver. |
| 31 struct SerializedDataReceiver { | 28 struct SerializedDataReceiver { |
| 32 // The control channel to the DataSource from which this DataReceiver receives | 29 // The control channel to the DataSource from which this DataReceiver receives |
| 33 // data. | 30 // data. |
| 34 DataSource source; | 31 DataSource source; |
| 32 // DataSourceClient& |
| 33 handle<message_pipe> source_client; |
| 35 | 34 |
| 36 // The error to report for a receive in progress when a fatal error occurs. | 35 // The error to report for a receive in progress when a fatal error occurs. |
| 37 int32 fatal_error_value; | 36 int32 fatal_error_value; |
| 38 | 37 |
| 39 // The number of bytes this DataReceiver has received from the DataSource. | 38 // The number of bytes this DataReceiver has received from the DataSource. |
| 40 uint32 bytes_received; | 39 uint32 bytes_received; |
| 41 | 40 |
| 42 // Whether a Resume() message needs to be sent to the DataSource for it to | 41 // Whether a Resume() message needs to be sent to the DataSource for it to |
| 43 // resume sending data. | 42 // resume sending data. |
| 44 bool paused; | 43 bool paused; |
| 45 | 44 |
| 46 // The pending receive error if there is one. | 45 // The pending receive error if there is one. |
| 47 PendingReceiveError? pending_error; | 46 PendingReceiveError? pending_error; |
| 48 | 47 |
| 49 array<array<uint8>> pending_data; | 48 array<array<uint8>> pending_data; |
| 50 }; | 49 }; |
| OLD | NEW |