Index: Source/modules/vr/VRDevice.h |
diff --git a/Source/modules/vr/VRDevice.h b/Source/modules/vr/VRDevice.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..25b9a2708aad9b2561a9e558306fc565c3ab7e2c |
--- /dev/null |
+++ b/Source/modules/vr/VRDevice.h |
@@ -0,0 +1,44 @@ |
+// 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 VRDevice_h |
+#define VRDevice_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "modules/vr/VRHardwareUnit.h" |
+#include "platform/heap/Handle.h" |
+#include "wtf/Forward.h" |
+#include "wtf/text/WTFString.h" |
+ |
+namespace blink { |
+ |
+class VRDevice : public GarbageCollectedFinalized<VRDevice>, public ScriptWrappable { |
+ DEFINE_WRAPPERTYPEINFO(); |
+public: |
+ unsigned index() const { return m_hardwareUnit->index(); } |
+ const String& hardwareUnitId() const { return m_hardwareUnit->hardwareUnitId(); } |
+ const String& deviceId() const { return m_deviceId; } |
+ const String& deviceName() const { return m_deviceName; } |
+ |
+ VRHardwareUnit* hardwareUnit() { return m_hardwareUnit; } |
+ const VRHardwareUnit* hardwareUnit() const { return m_hardwareUnit; } |
+ |
+ virtual void updateFromWebVRDevice(const WebVRDevice&); |
+ |
+ virtual void trace(Visitor*); |
+ |
+protected: |
+ explicit VRDevice(VRHardwareUnit*); |
+ |
+private: |
+ Member<VRHardwareUnit> m_hardwareUnit; |
+ String m_deviceId; |
+ String m_deviceName; |
+}; |
+ |
+using VRDeviceVector = HeapVector<Member<VRDevice>>; |
+ |
+} // namespace blink |
+ |
+#endif // VRDevice_h |