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

Side by Side Diff: device/serial/data_stream.mojom

Issue 873293006: Revert of Remove Client= from device/serial/data_stream.mojom. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 [Client=DataSourceClient]
7 interface DataSource { 8 interface DataSource {
8 // Initializes this DataSource with the amount of data its client will 9 // Initializes this DataSource with the amount of data its client will
9 // buffer. 10 // buffer.
10 Init(uint32 buffer_size); 11 Init(uint32 buffer_size);
11 12
12 // Resumes sending data after it has been stopped due to an error. 13 // Resumes sending data after it has been stopped due to an error.
13 Resume(); 14 Resume();
14 15
15 // Reports that |bytes_sent| bytes have been successfully passed to the 16 // Reports that |bytes_sent| bytes have been successfully passed to the
16 // client. 17 // client.
17 ReportBytesReceived(uint32 bytes_sent); 18 ReportBytesReceived(uint32 bytes_sent);
18 }; 19 };
19 20
20 interface DataSourceClient { 21 interface DataSourceClient {
21 // Invoked to report |error| from the DataSource. No further bytes will be 22 // Invoked to report |error| from the DataSource. No further bytes will be
22 // transmitted from the DataSource until Resume() is called. 23 // transmitted from the DataSource until Resume() is called.
23 OnError(int32 error); 24 OnError(int32 error);
24 25
25 // Invoked to transmit data from the DataSource. 26 // Invoked to transmit data from the DataSource.
26 OnData(array<uint8> data); 27 OnData(array<uint8> data);
27 }; 28 };
28 29
30 [Client=DataSinkClient]
29 interface DataSink { 31 interface DataSink {
30 // Initializes this DataSink with the amount of data it is expected to 32 // Initializes this DataSink with the amount of data it is expected to
31 // buffer. 33 // buffer.
32 Init(uint32 buffer_size); 34 Init(uint32 buffer_size);
33 35
34 // Requests the cancellation of any data that has been written to the pipe, 36 // Requests the cancellation of any data that has been written to the pipe,
35 // but has not yet been sent to the sink. 37 // but has not yet been sent to the sink.
36 Cancel(int32 error); 38 Cancel(int32 error);
37 39
38 // Invoked to pass |data| to the sink. 40 // Invoked to pass |data| to the sink.
39 OnData(array<uint8> data); 41 OnData(array<uint8> data);
40 }; 42 };
41 43
42 interface DataSinkClient { 44 interface DataSinkClient {
43 // Reports that the sink has successfully received |bytes_sent| bytes of data. 45 // Reports that the sink has successfully received |bytes_sent| bytes of data.
44 ReportBytesSent(uint32 bytes_sent); 46 ReportBytesSent(uint32 bytes_sent);
45 47
46 // Reports that the sink has received |bytes_sent| bytes of data (possibly 0) 48 // Reports that the sink has received |bytes_sent| bytes of data (possibly 0)
47 // and encountered an error: |error|. Any OnData messages received by the 49 // and encountered an error: |error|. Any OnData messages received by the
48 // DataSink before the response will be discarded. The client should respond 50 // DataSink before the response will be discarded. The client should respond
49 // when it is ready to resume sending data. 51 // when it is ready to resume sending data.
50 ReportBytesSentAndError(uint32 bytes_sent, int32 error) => (); 52 ReportBytesSentAndError(uint32 bytes_sent, int32 error) => ();
51 }; 53 };
OLDNEW
« 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