Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: Source/modules/vr/VRDevice.h

Issue 848053002: Adding WebVR interface to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed compiler warning treated as an error on Windows Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698