Index: Source/modules/webusb/USBDevice.h |
diff --git a/Source/modules/webusb/USBDevice.h b/Source/modules/webusb/USBDevice.h |
index ad94231ad9316e9f20bf98a129a31b5cb88f3331..95f9c283a0e9a2dfef6bea022d7d635d6de734da 100644 |
--- a/Source/modules/webusb/USBDevice.h |
+++ b/Source/modules/webusb/USBDevice.h |
@@ -7,32 +7,52 @@ |
#include "bindings/core/v8/ScriptWrappable.h" |
#include "platform/heap/Handle.h" |
+#include "public/platform/modules/webusb/WebUSBDevice.h" |
+#include "public/platform/modules/webusb/WebUSBDeviceInfo.h" |
namespace blink { |
-class USBControlTransferParameters; |
- |
class USBDevice |
: public GarbageCollectedFinalized<USBDevice> |
, public ScriptWrappable { |
DEFINE_WRAPPERTYPEINFO(); |
public: |
- static USBDevice* create() |
+ using WebType = WebUSBDeviceInfo; |
+ |
+ static USBDevice* create(PassOwnPtr<WebUSBDevice> device) |
{ |
- return new USBDevice; |
+ return new USBDevice(device); |
} |
- USBDevice() { } |
+ explicit USBDevice(PassOwnPtr<WebUSBDevice> device) |
+ : m_device(device) |
+ { |
+ } |
virtual ~USBDevice() { } |
- String guid() const |
- { |
- ASSERT_NOT_REACHED(); |
- return ""; |
- } |
+ const WebUSBDeviceInfo& info() const { return m_device->info(); } |
+ |
+ String guid() const { return info().guid; } |
+ uint8_t usbVersionMajor() { return info().usbVersionMajor; } |
+ uint8_t usbVersionMinor() { return info().usbVersionMinor; } |
+ uint8_t usbVersionSubminor() { return info().usbVersionSubminor; } |
+ uint8_t deviceClass() { return info().deviceClass; } |
+ uint8_t deviceSubclass() const { return info().deviceSubclass; } |
+ uint8_t deviceProtocol() const { return info().deviceProtocol; } |
+ uint16_t vendorId() const { return info().vendorID; } |
+ uint16_t productId() const { return info().productID; } |
+ uint8_t deviceVersionMajor() const { return info().deviceVersionMajor; } |
+ uint8_t deviceVersionMinor() const { return info().deviceVersionMinor; } |
+ uint8_t deviceVersionSubminor() const { return info().deviceVersionSubminor; } |
+ String manufacturerName() const { return info().manufacturerName; } |
+ String productName() const { return info().productName; } |
+ String serialNumber() const { return info().serialNumber; } |
DEFINE_INLINE_TRACE() { } |
+ |
+private: |
+ OwnPtr<WebUSBDevice> m_device; |
}; |
} // namespace blink |