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

Unified Diff: device/usb/webusb_descriptors.cc

Issue 2746313002: Remove RenderFrameHost pointer from ChooserController. (Closed)
Patch Set: Fix Android build and juncai@ comment. Created 3 years, 9 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/webusb_descriptors.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/webusb_descriptors.cc
diff --git a/device/usb/webusb_descriptors.cc b/device/usb/webusb_descriptors.cc
index 57468182278ebb3d1bbf7c554698a97db1b8780d..1bc243d114e573cc0190c7ebfa07aa42f7ed6a40 100644
--- a/device/usb/webusb_descriptors.cc
+++ b/device/usb/webusb_descriptors.cc
@@ -576,7 +576,9 @@ void ReadWebUsbDescriptors(scoped_refptr<UsbDeviceHandle> device_handle,
bool FindInWebUsbAllowedOrigins(
const device::WebUsbAllowedOrigins* allowed_origins,
- const GURL& origin) {
+ const GURL& origin,
+ base::Optional<uint8_t> config_value,
+ base::Optional<uint8_t> first_interface) {
if (!allowed_origins)
return false;
@@ -584,10 +586,16 @@ bool FindInWebUsbAllowedOrigins(
return true;
for (const auto& config : allowed_origins->configurations) {
+ if (config_value && *config_value != config.configuration_value)
+ continue;
+
if (base::ContainsValue(config.origins, origin))
return true;
for (const auto& function : config.functions) {
+ if (first_interface && *first_interface != function.first_interface)
+ continue;
+
if (base::ContainsValue(function.origins, origin))
return true;
}
« no previous file with comments | « device/usb/webusb_descriptors.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698