Changeset 233515 in webkit
- Timestamp:
- Jul 5, 2018, 4:42:00 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Modules/webvr/VRDisplayEvent.cpp (modified) (1 diff)
-
Modules/webvr/VRDisplayEvent.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r233512 r233515 1 2018-07-05 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebVR] Fix VRDisplayEvent implementation 4 https://bugs.webkit.org/show_bug.cgi?id=187337 5 6 Reviewed by Žan Doberšek. 7 8 VRDisplayEvent implementation had two issues. First there were no attributes storing the 9 VRDisplay the event refers to. Secondly the VRDisplayEventReason is not mandatory so it 10 should be handled via an optional. 11 12 * Modules/webvr/VRDisplayEvent.cpp: 13 (WebCore::VRDisplayEvent::VRDisplayEvent): 14 (WebCore::VRDisplayEvent::display const): Deleted. 15 (WebCore::VRDisplayEvent::reason const): Deleted. 16 * Modules/webvr/VRDisplayEvent.h: 17 1 18 2018-07-04 Carlos Garcia Campos <cgarcia@igalia.com> 2 19 -
trunk/Source/WebCore/Modules/webvr/VRDisplayEvent.cpp
r221966 r233515 32 32 VRDisplayEvent::VRDisplayEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted) 33 33 : Event(type, initializer, isTrusted) 34 , m_display(initializer.display) 35 , m_reason(initializer.reason) 36 { 37 } 38 39 VRDisplayEvent::VRDisplayEvent(const AtomicString& name, const RefPtr<VRDisplay>& display, std::optional<VRDisplayEventReason>&& reason) 40 : Event(name, false /*canBubble*/, false /*cancelable*/) 41 , m_display(display) 42 , m_reason(WTFMove(reason)) 34 43 { 35 44 } 36 45 37 46 VRDisplayEvent::~VRDisplayEvent() = default; 38 39 RefPtr<VRDisplay> VRDisplayEvent::display() const40 {41 return nullptr;42 }43 44 VRDisplayEventReason VRDisplayEvent::reason() const45 {46 return VRDisplayEventReason::Mounted;47 }48 47 49 48 EventInterface VRDisplayEvent::eventInterface() const -
trunk/Source/WebCore/Modules/webvr/VRDisplayEvent.h
r221966 r233515 34 34 class VRDisplayEvent final : public Event { 35 35 public: 36 static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, std::optional<VRDisplayEventReason>&& reason) 37 { 38 return adoptRef(*new VRDisplayEvent(type, display, WTFMove(reason))); 39 } 40 36 41 struct Init : EventInit { 37 42 RefPtr<VRDisplay> display; 38 VRDisplayEventReasonreason;43 std::optional<VRDisplayEventReason> reason; 39 44 }; 40 45 … … 46 51 virtual ~VRDisplayEvent(); 47 52 48 RefPtr<VRDisplay> display() const ;49 VRDisplayEventReason reason() const;53 RefPtr<VRDisplay> display() const { return m_display; } 54 const std::optional<VRDisplayEventReason>& reason() const { return m_reason; } 50 55 51 56 private: 52 57 VRDisplayEvent(const AtomicString&, const Init&, IsTrusted); 58 VRDisplayEvent(const AtomicString&, const RefPtr<VRDisplay>&, std::optional<VRDisplayEventReason>&&); 53 59 54 60 // Event 55 61 EventInterface eventInterface() const override; 62 63 RefPtr<VRDisplay> m_display; 64 std::optional<VRDisplayEventReason> m_reason; 56 65 }; 57 66
Note:
See TracChangeset
for help on using the changeset viewer.