| 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 WebUSBDeviceInfo_h | 5 #ifndef WebUSBDeviceInfo_h |
| 6 #define WebUSBDeviceInfo_h | 6 #define WebUSBDeviceInfo_h |
| 7 | 7 |
| 8 #include "public/platform/WebString.h" | 8 #include "public/platform/WebString.h" |
| 9 #include "public/platform/WebVector.h" | 9 #include "public/platform/WebVector.h" |
| 10 #include "public/platform/modules/webusb/WebUSBDevice.h" | 10 #include "public/platform/modules/webusb/WebUSBDevice.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 struct WebUSBDeviceInfo { | 14 struct WebUSBDeviceInfo { |
| 15 struct Endpoint { |
| 16 enum class Type { |
| 17 Bulk, |
| 18 Interrupt, |
| 19 Isochronous |
| 20 }; |
| 21 |
| 22 Endpoint() |
| 23 : endpointNumber(0) |
| 24 , direction(WebUSBDevice::TransferDirection::In) |
| 25 , type(Type::Bulk) |
| 26 , packetSize(0) |
| 27 { |
| 28 } |
| 29 |
| 30 uint8_t endpointNumber; |
| 31 WebUSBDevice::TransferDirection direction; |
| 32 Type type; |
| 33 uint32_t packetSize; |
| 34 }; |
| 35 |
| 36 struct AlternateInterface { |
| 37 AlternateInterface() |
| 38 : alternateSetting(0) |
| 39 , classCode(0) |
| 40 , subclassCode(0) |
| 41 , protocolCode(0) |
| 42 { |
| 43 } |
| 44 |
| 45 uint8_t alternateSetting; |
| 46 uint8_t classCode; |
| 47 uint8_t subclassCode; |
| 48 uint8_t protocolCode; |
| 49 WebString interfaceName; |
| 50 WebVector<Endpoint> endpoints; |
| 51 }; |
| 52 |
| 15 struct Interface { | 53 struct Interface { |
| 16 Interface() | 54 Interface() |
| 17 : interfaceNumber(0) | 55 : interfaceNumber(0) |
| 18 { | 56 { |
| 19 } | 57 } |
| 20 | 58 |
| 21 uint8_t interfaceNumber; | 59 uint8_t interfaceNumber; |
| 22 // WebVector<AlternateInterface> alternates; | 60 WebVector<AlternateInterface> alternates; |
| 23 }; | 61 }; |
| 24 | 62 |
| 25 struct Configuration { | 63 struct Configuration { |
| 26 Configuration() | 64 Configuration() |
| 27 : configurationValue(0) | 65 : configurationValue(0) |
| 28 { | 66 { |
| 29 } | 67 } |
| 30 | 68 |
| 31 uint8_t configurationValue; | 69 uint8_t configurationValue; |
| 32 WebString configurationName; | 70 WebString configurationName; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 uint8_t deviceVersionSubminor; | 100 uint8_t deviceVersionSubminor; |
| 63 WebString manufacturerName; | 101 WebString manufacturerName; |
| 64 WebString productName; | 102 WebString productName; |
| 65 WebString serialNumber; | 103 WebString serialNumber; |
| 66 WebVector<Configuration> configurations; | 104 WebVector<Configuration> configurations; |
| 67 }; | 105 }; |
| 68 | 106 |
| 69 } // namespace blink | 107 } // namespace blink |
| 70 | 108 |
| 71 #endif // WebUSBDeviceInfo_h | 109 #endif // WebUSBDeviceInfo_h |
| OLD | NEW |