Chromium Code Reviews| 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 USBConfiguration_h | 5 #ifndef USBConfiguration_h |
| 6 #define USBConfiguration_h | 6 #define USBConfiguration_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "public/platform/modules/webusb/WebUSBDeviceInfo.h" | 10 #include "public/platform/modules/webusb/WebUSBDeviceInfo.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class ExceptionState; | 14 class ExceptionState; |
| 15 class USBDevice; | 15 class USBDevice; |
| 16 class USBInterface; | 16 class USBInterface; |
| 17 | 17 |
| 18 class USBConfiguration | 18 class USBConfiguration |
| 19 : public GarbageCollected<USBConfiguration> | 19 : public GarbageCollected<USBConfiguration> |
| 20 , public ScriptWrappable { | 20 , public ScriptWrappable { |
| 21 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
| 22 public: | 22 public: |
| 23 static USBConfiguration* create(const USBDevice*, size_t configurationIndex) ; | 23 static USBConfiguration* create(const USBDevice*, size_t configurationIndex) ; |
| 24 static USBConfiguration* create(const USBDevice*, size_t configurationValue, ExceptionState&); | 24 static USBConfiguration* create(const USBDevice*, size_t configurationValue, ExceptionState&); |
| 25 static USBConfiguration* createFromValue(const USBDevice*, uint8_t configura tionValue); | 25 static USBConfiguration* createFromValue(const USBDevice*, uint8_t configura tionValue); |
| 26 | 26 |
| 27 USBConfiguration(const USBDevice*, size_t configurationIndex); | 27 USBConfiguration(const USBDevice*, size_t configurationIndex); |
| 28 | 28 |
| 29 const USBDevice* device() const; | |
| 30 size_t index() const; | |
|
juncai
2016/03/17 01:21:11
maybe use: configurationIndex() as function name?
Reilly Grant (use Gerrit)
2016/03/17 17:07:01
The name configurationValue is verbose because the
| |
| 29 const WebUSBDeviceInfo::Configuration& info() const; | 31 const WebUSBDeviceInfo::Configuration& info() const; |
| 30 | 32 |
| 31 uint8_t configurationValue() const; | 33 uint8_t configurationValue() const; |
| 32 String configurationName() const; | 34 String configurationName() const; |
| 33 HeapVector<Member<USBInterface>> interfaces() const; | 35 HeapVector<Member<USBInterface>> interfaces() const; |
| 34 | 36 |
| 35 DECLARE_TRACE(); | 37 DECLARE_TRACE(); |
| 36 | 38 |
| 37 private: | 39 private: |
| 38 Member<const USBDevice> m_device; | 40 Member<const USBDevice> m_device; |
| 39 const size_t m_configurationIndex; | 41 const size_t m_configurationIndex; |
| 40 }; | 42 }; |
| 41 | 43 |
| 42 } // namespace blink | 44 } // namespace blink |
| 43 | 45 |
| 44 #endif // USBConfiguration_h | 46 #endif // USBConfiguration_h |
| OLD | NEW |