OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef USBAlternateInterface_h | 5 #ifndef USBAlternateInterface_h |
6 #define USBAlternateInterface_h | 6 #define USBAlternateInterface_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "device/usb/public/interfaces/device.mojom-wtf.h" | 9 #include "device/usb/public/interfaces/device.mojom-blink.h" |
10 #include "platform/heap/Heap.h" | 10 #include "platform/heap/Heap.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class ExceptionState; | 14 class ExceptionState; |
15 class USBEndpoint; | 15 class USBEndpoint; |
16 class USBInterface; | 16 class USBInterface; |
17 | 17 |
18 class USBAlternateInterface | 18 class USBAlternateInterface |
19 : public GarbageCollected<USBAlternateInterface> | 19 : public GarbageCollected<USBAlternateInterface> |
20 , public ScriptWrappable { | 20 , public ScriptWrappable { |
21 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
22 public: | 22 public: |
23 static USBAlternateInterface* create(const USBInterface*, size_t alternateIn
dex); | 23 static USBAlternateInterface* create(const USBInterface*, size_t alternateIn
dex); |
24 static USBAlternateInterface* create(const USBInterface*, size_t alternateSe
tting, ExceptionState&); | 24 static USBAlternateInterface* create(const USBInterface*, size_t alternateSe
tting, ExceptionState&); |
25 | 25 |
26 USBAlternateInterface(const USBInterface*, size_t alternateIndex); | 26 USBAlternateInterface(const USBInterface*, size_t alternateIndex); |
27 | 27 |
28 const device::usb::wtf::AlternateInterfaceInfo& info() const; | 28 const device::usb::blink::AlternateInterfaceInfo& info() const; |
29 | 29 |
30 uint8_t alternateSetting() const { return info().alternate_setting; } | 30 uint8_t alternateSetting() const { return info().alternate_setting; } |
31 uint8_t interfaceClass() const { return info().class_code; } | 31 uint8_t interfaceClass() const { return info().class_code; } |
32 uint8_t interfaceSubclass() const { return info().subclass_code; } | 32 uint8_t interfaceSubclass() const { return info().subclass_code; } |
33 uint8_t interfaceProtocol() const { return info().protocol_code; } | 33 uint8_t interfaceProtocol() const { return info().protocol_code; } |
34 String interfaceName() const { return info().interface_name; } | 34 String interfaceName() const { return info().interface_name; } |
35 HeapVector<Member<USBEndpoint>> endpoints() const; | 35 HeapVector<Member<USBEndpoint>> endpoints() const; |
36 | 36 |
37 DECLARE_TRACE(); | 37 DECLARE_TRACE(); |
38 | 38 |
39 private: | 39 private: |
40 Member<const USBInterface> m_interface; | 40 Member<const USBInterface> m_interface; |
41 const size_t m_alternateIndex; | 41 const size_t m_alternateIndex; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // USBAlternateInterface_h | 46 #endif // USBAlternateInterface_h |
OLD | NEW |