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

Unified Diff: Source/modules/webusb/USBAlternateInterface.h

Issue 1245363002: Add WebUSB bindings and client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: iface ctors, OWNERS, rebase Created 5 years, 5 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/USB.idl ('k') | Source/modules/webusb/USBAlternateInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USBAlternateInterface.h
diff --git a/Source/modules/webusb/USBAlternateInterface.h b/Source/modules/webusb/USBAlternateInterface.h
new file mode 100644
index 0000000000000000000000000000000000000000..76125c3030c5bdcdd31f2601457e288ec7979719
--- /dev/null
+++ b/Source/modules/webusb/USBAlternateInterface.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef USBAlternateInterface_h
+#define USBAlternateInterface_h
+
+#include "bindings/core/v8/ScriptWrappable.h"
+#include "platform/heap/Heap.h"
+#include "public/platform/modules/webusb/WebUSBDeviceInfo.h"
+
+namespace blink {
+
+class ExceptionState;
+class USBEndpoint;
+class USBInterface;
+
+class USBAlternateInterface
+ : public GarbageCollected<USBAlternateInterface>
+ , public ScriptWrappable {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static USBAlternateInterface* create(const USBInterface*, size_t alternateIndex);
+ static USBAlternateInterface* create(const USBInterface*, size_t alternateIndex, ExceptionState&);
+
+ USBAlternateInterface(const USBInterface*, size_t alternateIndex);
+
+ const WebUSBDeviceInfo::AlternateInterface& info() const;
+
+ uint8_t alternateSetting() const;
+ uint8_t interfaceClass() const;
+ uint8_t interfaceSubclass() const;
+ uint8_t interfaceProtocol() const;
+ String interfaceName() const;
+ HeapVector<Member<USBEndpoint>> endpoints() const;
+
+ DECLARE_TRACE();
+
+private:
+ Member<const USBInterface> m_interface;
+ size_t m_alternateIndex;
+};
+
+} // namespace blink
+
+#endif // USBAlternateInterface_h
« no previous file with comments | « Source/modules/webusb/USB.idl ('k') | Source/modules/webusb/USBAlternateInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698