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

Unified Diff: device/usb/webusb_descriptors.h

Issue 1646783002: Update webusb_descriptors.cc to parse the new WebUSB descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@io_buffer
Patch Set: Sometimes MSVC complains about passing size_type to BarrierClosure. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/usb/usb_service_impl.cc ('k') | device/usb/webusb_descriptors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/webusb_descriptors.h
diff --git a/device/usb/webusb_descriptors.h b/device/usb/webusb_descriptors.h
index 7f6dc59a23a5c377e0461a808f3435b31645a3ee..44f9c1c49ff7ad238350bf551b7ccfc4965c8f12 100644
--- a/device/usb/webusb_descriptors.h
+++ b/device/usb/webusb_descriptors.h
@@ -8,15 +8,20 @@
#include <stdint.h>
#include <vector>
+#include "base/callback_forward.h"
+#include "base/memory/ref_counted.h"
#include "url/gurl.h"
namespace device {
+class UsbDeviceHandle;
+
struct WebUsbFunctionSubset {
WebUsbFunctionSubset();
~WebUsbFunctionSubset();
uint8_t first_interface;
+ std::vector<uint8_t> origin_ids;
std::vector<GURL> origins;
};
@@ -25,16 +30,18 @@ struct WebUsbConfigurationSubset {
~WebUsbConfigurationSubset();
uint8_t configuration_value;
+ std::vector<uint8_t> origin_ids;
std::vector<GURL> origins;
std::vector<WebUsbFunctionSubset> functions;
};
-struct WebUsbDescriptorSet {
- WebUsbDescriptorSet();
- ~WebUsbDescriptorSet();
+struct WebUsbAllowedOrigins {
+ WebUsbAllowedOrigins();
+ ~WebUsbAllowedOrigins();
bool Parse(const std::vector<uint8_t>& bytes);
+ std::vector<uint8_t> origin_ids;
std::vector<GURL> origins;
std::vector<WebUsbConfigurationSubset> configurations;
};
@@ -47,10 +54,17 @@ struct WebUsbPlatformCapabilityDescriptor {
uint16_t version;
uint8_t vendor_code;
+ uint8_t landing_page_id;
+ GURL landing_page;
};
bool ParseWebUsbUrlDescriptor(const std::vector<uint8_t>& bytes, GURL* output);
+void ReadWebUsbDescriptors(
+ scoped_refptr<UsbDeviceHandle> device_handle,
+ const base::Callback<void(scoped_ptr<WebUsbAllowedOrigins> allowed_origins,
+ const GURL& landing_page)>& callback);
+
} // device
#endif // DEVICE_USB_WEBUSB_DESCRIPTORS_H_
« no previous file with comments | « device/usb/usb_service_impl.cc ('k') | device/usb/webusb_descriptors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698