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

Unified Diff: Source/modules/webusb/USBInterface.cpp

Issue 1270983002: WebUSB bindings part 4 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: punctuation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webusb/USBInterface.h ('k') | Source/modules/webusb/USBInterface.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USBInterface.cpp
diff --git a/Source/modules/webusb/USBInterface.cpp b/Source/modules/webusb/USBInterface.cpp
index 1c13bbccffb1e50de6c54073fb55cf87836bdcec..7e12e70063cc716665e815c5bf8f1d86a2cff559 100644
--- a/Source/modules/webusb/USBInterface.cpp
+++ b/Source/modules/webusb/USBInterface.cpp
@@ -6,6 +6,7 @@
#include "modules/webusb/USBInterface.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "modules/webusb/USBAlternateInterface.h"
#include "modules/webusb/USBConfiguration.h"
namespace blink {
@@ -38,6 +39,14 @@ const WebUSBDeviceInfo::Interface& USBInterface::info() const
return m_configuration->info().interfaces[m_interfaceIndex];
}
+HeapVector<Member<USBAlternateInterface>> USBInterface::alternates() const
+{
+ HeapVector<Member<USBAlternateInterface>> alternates;
+ for (size_t i = 0; i < info().alternates.size(); ++i)
+ alternates.append(USBAlternateInterface::create(this, i));
+ return alternates;
+}
+
uint8_t USBInterface::interfaceNumber() const
{
return info().interfaceNumber;
« no previous file with comments | « Source/modules/webusb/USBInterface.h ('k') | Source/modules/webusb/USBInterface.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698