Index: third_party/WebKit/Source/modules/vr/NavigatorVR.h |
diff --git a/third_party/WebKit/Source/modules/vr/NavigatorVR.h b/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
index 4a4b2a3e8d64dfeeb5a4d6bbd9d50ad63cab8297..e888bbc812a9eee03b2102e63b98cf0b9901212e 100644 |
--- a/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
+++ b/third_party/WebKit/Source/modules/vr/NavigatorVR.h |
@@ -10,6 +10,7 @@ |
#include "modules/ModulesExport.h" |
#include "modules/vr/VRDisplay.h" |
#include "modules/vr/VRDisplayEvent.h" |
+#include "platform/AsyncMethodRunner.h" |
#include "platform/Supplementable.h" |
#include "platform/heap/Handle.h" |
#include "public/platform/WebVector.h" |
@@ -21,7 +22,7 @@ class Document; |
class Navigator; |
class VRController; |
-class MODULES_EXPORT NavigatorVR final : public GarbageCollectedFinalized<NavigatorVR>, public Supplement<Navigator>, public DOMWindowProperty { |
+class MODULES_EXPORT NavigatorVR final : public GarbageCollectedFinalized<NavigatorVR>, public Supplement<Navigator>, public DOMWindowProperty, public LocalDOMWindow::EventListenerObserver { |
USING_GARBAGE_COLLECTED_MIXIN(NavigatorVR); |
WTF_MAKE_NONCOPYABLE(NavigatorVR); |
public: |
@@ -35,6 +36,8 @@ public: |
VRController* controller(); |
Document* document(); |
+ void fireVREvent(VRDisplayEvent*); |
+ |
DECLARE_VIRTUAL_TRACE(); |
private: |
@@ -47,7 +50,20 @@ private: |
void fireVRDisplayPresentChange(VRDisplay*); |
+ void dispatchOneEvent(); |
+ |
+ // LocalDOMWindow::EventListenerObserver |
+ void didAddEventListener(LocalDOMWindow*, const AtomicString&) override; |
+ void didRemoveEventListener(LocalDOMWindow*, const AtomicString&) override; |
+ void didRemoveAllEventListeners(LocalDOMWindow*) override; |
+ void didRemoveVREventListeners(); |
+ |
+ bool isVREvent(const AtomicString&); |
+ |
Member<VRController> m_controller; |
+ bool m_hasEventListener; |
+ HeapDeque<Member<VRDisplayEvent>> m_pendingEvents; |
+ Member<AsyncMethodRunner<NavigatorVR>> m_dispatchOneEventRunner; |
}; |
} // namespace blink |