OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NavigatorVRDevice_h |
| 6 #define NavigatorVRDevice_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "modules/vr/VRHardwareUnit.h" |
| 10 #include "platform/Supplementable.h" |
| 11 #include "platform/heap/Handle.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 class Document; |
| 16 class Navigator; |
| 17 |
| 18 class NavigatorVRDevice final : public NoBaseWillBeGarbageCollectedFinalized<Nav
igatorVRDevice>, public WillBeHeapSupplement<Navigator> { |
| 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorVRDevice); |
| 20 public: |
| 21 static NavigatorVRDevice* from(Document&); |
| 22 static NavigatorVRDevice& from(Navigator&); |
| 23 virtual ~NavigatorVRDevice(); |
| 24 |
| 25 static ScriptPromise getVRDevices(ScriptState*, Navigator&); |
| 26 ScriptPromise getVRDevices(ScriptState*); |
| 27 |
| 28 virtual void trace(Visitor*); |
| 29 |
| 30 private: |
| 31 friend VRHardwareUnit; |
| 32 |
| 33 explicit NavigatorVRDevice(); |
| 34 |
| 35 static const char* supplementName(); |
| 36 |
| 37 HeapVector<Member<VRDevice>> updateVRHardwareUnits(); |
| 38 VRHardwareUnit* getHardwareUnitForIndex(unsigned index); |
| 39 |
| 40 PersistentHeapVectorWillBeHeapVector<Member<VRHardwareUnit>> m_hardwareUnits
; |
| 41 }; |
| 42 |
| 43 } // namespace blink |
| 44 |
| 45 #endif // NavigatorVRDevice_h |
OLD | NEW |