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

Unified Diff: Source/modules/vr/NavigatorVRDevice.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/NavigatorVRDevice.h
diff --git a/Source/modules/vr/NavigatorVRDevice.h b/Source/modules/vr/NavigatorVRDevice.h
new file mode 100644
index 0000000000000000000000000000000000000000..156711c9a0880e83300a66ded6ec6127e19e09ab
--- /dev/null
+++ b/Source/modules/vr/NavigatorVRDevice.h
@@ -0,0 +1,46 @@
+// 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 NavigatorVRDevice_h
+#define NavigatorVRDevice_h
+
+#include "bindings/core/v8/ScriptPromise.h"
+#include "modules/vr/VRDevice.h"
+#include "modules/vr/VRHardwareUnit.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class Document;
+class Navigator;
+
+class NavigatorVRDevice final : public NoBaseWillBeGarbageCollectedFinalized<NavigatorVRDevice>, public WillBeHeapSupplement<Navigator> {
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorVRDevice);
+public:
+ static NavigatorVRDevice* from(Document&);
+ static NavigatorVRDevice& from(Navigator&);
+ virtual ~NavigatorVRDevice();
+
+ static ScriptPromise getVRDevices(ScriptState*, Navigator&);
+ ScriptPromise getVRDevices(ScriptState*);
+
+ virtual void trace(Visitor*);
+
+private:
+ friend VRHardwareUnit;
+
+ NavigatorVRDevice();
+
+ static const char* supplementName();
+
+ VRDeviceVector getUpdatedVRHardwareUnits();
+ VRHardwareUnit* getHardwareUnitForIndex(unsigned index);
+
+ PersistentHeapVectorWillBeHeapVector<Member<VRHardwareUnit>> m_hardwareUnits;
+};
+
+} // namespace blink
+
+#endif // NavigatorVRDevice_h

Powered by Google App Engine
This is Rietveld 408576698