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 // DataSinkClient& | |
14 handle<message_pipe> sink_client; | |
15 | 13 |
16 // 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. |
17 int32 fatal_error_value; | 15 int32 fatal_error_value; |
18 | 16 |
19 // The size of the send buffer. | 17 // The size of the send buffer. |
20 uint32 buffer_size; | 18 uint32 buffer_size; |
21 }; | 19 }; |
22 | 20 |
23 // A pending receive error. | 21 // A pending receive error. |
24 struct PendingReceiveError { | 22 struct PendingReceiveError { |
25 // The value of the error. | 23 // The value of the error. |
26 int32 error; | 24 int32 error; |
27 | 25 |
28 // The location of the error. | 26 // The location of the error. |
29 uint32 offset; | 27 uint32 offset; |
30 }; | 28 }; |
31 | 29 |
32 // A serialized form of a DataReceiver. | 30 // A serialized form of a DataReceiver. |
33 struct SerializedDataReceiver { | 31 struct SerializedDataReceiver { |
34 // The control channel to the DataSource from which this DataReceiver receives | 32 // The control channel to the DataSource from which this DataReceiver receives |
35 // data. | 33 // data. |
36 DataSource source; | 34 DataSource source; |
37 // DataSourceClient& | |
38 handle<message_pipe> source_client; | |
39 | 35 |
40 // The error to report for a receive in progress when a fatal error occurs. | 36 // The error to report for a receive in progress when a fatal error occurs. |
41 int32 fatal_error_value; | 37 int32 fatal_error_value; |
42 | 38 |
43 // The number of bytes this DataReceiver has received from the DataSource. | 39 // The number of bytes this DataReceiver has received from the DataSource. |
44 uint32 bytes_received; | 40 uint32 bytes_received; |
45 | 41 |
46 // Whether a Resume() message needs to be sent to the DataSource for it to | 42 // Whether a Resume() message needs to be sent to the DataSource for it to |
47 // resume sending data. | 43 // resume sending data. |
48 bool paused; | 44 bool paused; |
49 | 45 |
50 // The pending receive error if there is one. | 46 // The pending receive error if there is one. |
51 PendingReceiveError? pending_error; | 47 PendingReceiveError? pending_error; |
52 | 48 |
53 array<array<uint8>> pending_data; | 49 array<array<uint8>> pending_data; |
54 }; | 50 }; |
OLD | NEW |