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

Side by Side Diff: public/platform/modules/webusb/WebUSBDeviceInfo.h

Issue 1270983002: WebUSB bindings part 4 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: punctuation Created 5 years, 4 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 | « Source/modules/webusb/USBInterface.idl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/modules/webusb/USBInterface.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698