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 VRDevice_h | 5 #ifndef VRDevice_h |
6 #define VRDevice_h | 6 #define VRDevice_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "modules/vr/VRHardwareUnit.h" | 9 #include "modules/vr/VRHardwareUnit.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class VRDevice : public GarbageCollectedFinalized<VRDevice>, public ScriptWrappa
ble { | 16 class VRDevice : public GarbageCollectedFinalized<VRDevice>, public ScriptWrappa
ble { |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 18 public: |
19 unsigned index() const { return m_hardwareUnit->index(); } | 19 unsigned index() const { return m_hardwareUnit->index(); } |
20 const String& hardwareUnitId() const { return m_hardwareUnit->hardwareUnitId
(); } | 20 const String& hardwareUnitId() const { return m_hardwareUnit->hardwareUnitId
(); } |
21 const String& deviceId() const { return m_deviceId; } | 21 const String& deviceId() const { return m_deviceId; } |
22 const String& deviceName() const { return m_deviceName; } | 22 const String& deviceName() const { return m_deviceName; } |
23 | 23 |
24 VRHardwareUnit* hardwareUnit() { return m_hardwareUnit; } | 24 VRHardwareUnit* hardwareUnit() { return m_hardwareUnit; } |
25 const VRHardwareUnit* hardwareUnit() const { return m_hardwareUnit; } | 25 const VRHardwareUnit* hardwareUnit() const { return m_hardwareUnit; } |
26 | 26 |
27 virtual void updateFromWebVRDevice(const WebVRDevice&); | 27 virtual void updateFromWebVRDevice(const WebVRDevice&); |
28 | 28 |
29 virtual void trace(Visitor*); | 29 DECLARE_VIRTUAL_TRACE(); |
30 | 30 |
31 protected: | 31 protected: |
32 explicit VRDevice(VRHardwareUnit*); | 32 explicit VRDevice(VRHardwareUnit*); |
33 | 33 |
34 private: | 34 private: |
35 Member<VRHardwareUnit> m_hardwareUnit; | 35 Member<VRHardwareUnit> m_hardwareUnit; |
36 String m_deviceId; | 36 String m_deviceId; |
37 String m_deviceName; | 37 String m_deviceName; |
38 }; | 38 }; |
39 | 39 |
40 using VRDeviceVector = HeapVector<Member<VRDevice>>; | 40 using VRDeviceVector = HeapVector<Member<VRDevice>>; |
41 | 41 |
42 } // namespace blink | 42 } // namespace blink |
43 | 43 |
44 #endif // VRDevice_h | 44 #endif // VRDevice_h |
OLD | NEW |