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

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

Issue 1806163002: Track USB alternate interface state in Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink_interface_state
Patch Set: Fixed typo and rebased. Created 4 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
Index: third_party/WebKit/Source/modules/webusb/USBInterface.cpp
diff --git a/third_party/WebKit/Source/modules/webusb/USBInterface.cpp b/third_party/WebKit/Source/modules/webusb/USBInterface.cpp
index 17b14c50249c896a6b9f09d8ea0f24d920bf8d2d..7b952e6693687854da9a6df4ed1ed35f4bc203dc 100644
--- a/third_party/WebKit/Source/modules/webusb/USBInterface.cpp
+++ b/third_party/WebKit/Source/modules/webusb/USBInterface.cpp
@@ -41,6 +41,13 @@ const WebUSBDeviceInfo::Interface& USBInterface::info() const
return m_device->info().configurations[m_configurationIndex].interfaces[m_interfaceIndex];
}
+USBAlternateInterface* USBInterface::alternate() const
+{
+ if (m_device->isInterfaceClaimed(m_configurationIndex, m_interfaceIndex))
+ return USBAlternateInterface::create(this, m_device->selectedAlternateInterface(m_interfaceIndex));
+ return nullptr;
+}
+
HeapVector<Member<USBAlternateInterface>> USBInterface::alternates() const
{
HeapVector<Member<USBAlternateInterface>> alternates;
« no previous file with comments | « third_party/WebKit/Source/modules/webusb/USBInterface.h ('k') | third_party/WebKit/Source/modules/webusb/USBInterface.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698