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

Side by Side Diff: device/usb/webusb_descriptors.h

Issue 1256113006: Add utilities to parse WebUSB device descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment tweaks. 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 | « device/usb/usb.gyp ('k') | device/usb/webusb_descriptors.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « device/usb/usb.gyp ('k') | device/usb/webusb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698