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.
5 #ifndef DEVICE_USB_WEBUSB_DESCRIPTORS_H_
6 #define DEVICE_USB_WEBUSB_DESCRIPTORS_H_
15 struct WebUsbFunctionSubset
{
16 WebUsbFunctionSubset();
17 ~WebUsbFunctionSubset();
19 uint8_t first_interface
;
20 std::vector
<GURL
> origins
;
23 struct WebUsbConfigurationSubset
{
24 WebUsbConfigurationSubset();
25 ~WebUsbConfigurationSubset();
27 uint8_t configuration_value
;
28 std::vector
<GURL
> origins
;
29 std::vector
<WebUsbFunctionSubset
> functions
;
32 struct WebUsbDescriptorSet
{
33 WebUsbDescriptorSet();
34 ~WebUsbDescriptorSet();
36 bool Parse(const std::vector
<uint8_t>& bytes
);
38 std::vector
<GURL
> origins
;
39 std::vector
<WebUsbConfigurationSubset
> configurations
;
42 struct WebUsbPlatformCapabilityDescriptor
{
43 WebUsbPlatformCapabilityDescriptor();
44 ~WebUsbPlatformCapabilityDescriptor();
46 bool ParseFromBosDescriptor(const std::vector
<uint8_t>& bytes
);
54 #endif // DEVICE_USB_WEBUSB_DESCRIPTORS_H_