OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
| 6 #define DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 #include <vector> |
| 10 |
| 11 #include "url/gurl.h" |
| 12 |
| 13 namespace device { |
| 14 |
| 15 struct WebUsbFunctionSubset { |
| 16 WebUsbFunctionSubset(); |
| 17 ~WebUsbFunctionSubset(); |
| 18 |
| 19 uint8_t first_interface; |
| 20 std::vector<GURL> origins; |
| 21 }; |
| 22 |
| 23 struct WebUsbConfigurationSubset { |
| 24 WebUsbConfigurationSubset(); |
| 25 ~WebUsbConfigurationSubset(); |
| 26 |
| 27 uint8_t configuration_value; |
| 28 std::vector<GURL> origins; |
| 29 std::vector<WebUsbFunctionSubset> functions; |
| 30 }; |
| 31 |
| 32 struct WebUsbDescriptorSet { |
| 33 WebUsbDescriptorSet(); |
| 34 ~WebUsbDescriptorSet(); |
| 35 |
| 36 bool Parse(const std::vector<uint8_t>& bytes); |
| 37 |
| 38 std::vector<GURL> origins; |
| 39 std::vector<WebUsbConfigurationSubset> configurations; |
| 40 }; |
| 41 |
| 42 struct WebUsbPlatformCapabilityDescriptor { |
| 43 WebUsbPlatformCapabilityDescriptor(); |
| 44 ~WebUsbPlatformCapabilityDescriptor(); |
| 45 |
| 46 bool ParseFromBosDescriptor(const std::vector<uint8_t>& bytes); |
| 47 |
| 48 uint16_t version; |
| 49 uint8_t vendor_code; |
| 50 }; |
| 51 |
| 52 } // device |
| 53 |
| 54 #endif // DEVICE_USB_WEBUSB_DESCRIPTORS_H_ |
OLD | NEW |