OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef WebUSBTransferInfo_h | 5 #ifndef WebUSBTransferInfo_h |
6 #define WebUSBTransferInfo_h | 6 #define WebUSBTransferInfo_h |
7 | 7 |
8 #include "public/platform/WebVector.h" | 8 #include "public/platform/WebVector.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 struct WebUSBTransferInfo { | 12 struct WebUSBTransferInfo { |
13 enum class Status { | 13 enum class Status { |
14 Ok, | 14 Ok, |
15 Stall, | 15 Stall, |
16 Babble, | 16 Babble, |
17 }; | 17 }; |
18 | 18 |
19 WebUSBTransferInfo() | 19 WebUSBTransferInfo() |
20 : status(Status::Ok) | |
21 , bytesWritten(0) | |
22 { | 20 { |
23 } | 21 } |
24 | 22 |
25 Status status; | 23 // Individual packet statuses. This vector has only one element if this was |
Ken Rockot(use gerrit already)
2016/02/03 14:19:10
nit: why past tense "was"? it may have happened or
| |
24 // not an isochronous transfer. | |
25 WebVector<Status> status; | |
26 | 26 |
27 // Data received, if this is an inbound transfer. | 27 // Data received, if this is an inbound transfer. |
28 WebVector<uint8_t> data; | 28 WebVector<uint8_t> data; |
29 | 29 |
30 // Number of bytes written if this is an outbound transfer. | 30 // Requested length of each packet if this was an inbound isochronous |
31 uint32_t bytesWritten; | 31 // transfer. |
32 WebVector<uint32_t> packetLength; | |
33 | |
34 // Number of bytes written if this is an outbound transfer. This vector has | |
35 // only one element if this was not an isochronous transfer otherwise it is | |
36 // the number of bytes transferred in each isochronous packet (inbound or | |
37 // outbound). | |
38 WebVector<uint32_t> bytesTransferred; | |
32 }; | 39 }; |
33 | 40 |
34 } // namespace blink | 41 } // namespace blink |
35 | 42 |
36 #endif // WebUSBTransferInfo_h | 43 #endif // WebUSBTransferInfo_h |
OLD | NEW |