Title: [266782] trunk
Revision
266782
Author
[email protected]
Date
2020-09-09 09:00:27 -0700 (Wed, 09 Sep 2020)

Log Message

[WebXR] Implement XRSession end event
https://bugs.webkit.org/show_bug.cgi?id=216181

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/webxr/xrSession_end.https-expected.txt: Added.

Source/WebCore:

Implemented the end event dispatched by the XRSession whenever the shutdown process is executed.

* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::shutdown): Added end event dispatch.
* Modules/webxr/XRSessionEvent.cpp:
(WebCore::XRSessionEvent::create): New method receiving a XRSession.
(WebCore::XRSessionEvent::XRSessionEvent): New constructor receiving a XRSession.
(WebCore::XRSessionEvent::eventInterface const): New. Overrides the Event method.
* Modules/webxr/XRSessionEvent.h: Ditto.

LayoutTests:

* platform/wpe/TestExpectations: Added a new test that passes now.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (266781 => 266782)


--- trunk/LayoutTests/ChangeLog	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/LayoutTests/ChangeLog	2020-09-09 16:00:27 UTC (rev 266782)
@@ -1,3 +1,12 @@
+2020-09-04  Sergio Villar Senin  <[email protected]>
+
+        [WebXR] Implement XRSession end event
+        https://bugs.webkit.org/show_bug.cgi?id=216181
+
+        Reviewed by Darin Adler.
+
+        * platform/wpe/TestExpectations: Added a new test that passes now.
+
 2020-09-09  Aditya Keerthi  <[email protected]>
 
         [macOS] Add editability to input type=time

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (266781 => 266782)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-09-09 16:00:27 UTC (rev 266782)
@@ -1,3 +1,12 @@
+2020-09-04  Sergio Villar Senin  <[email protected]>
+
+        [WebXR] Implement XRSession end event
+        https://bugs.webkit.org/show_bug.cgi?id=216181
+
+        Reviewed by Darin Adler.
+
+        * web-platform-tests/webxr/xrSession_end.https-expected.txt: Added.
+
 2020-09-08  Chris Dumez  <[email protected]>
 
         Unreviewed, rebaseline flaky webaudio WPT tests.

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt (0 => 266782)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt	2020-09-09 16:00:27 UTC (rev 266782)
@@ -0,0 +1,4 @@
+
+PASS end event fires when immersive session ends 
+PASS end event fires when non-immersive session ends 
+
Property changes on: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_end.https-expected.txt
___________________________________________________________________

Added: svn:eol-style

+LF \ No newline at end of property

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (266781 => 266782)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2020-09-09 16:00:27 UTC (rev 266782)
@@ -929,6 +929,7 @@
 imported/w3c/web-platform-tests/webxr/xrSession_prevent_multiple_exclusive.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/render_state_vertical_fov_immersive.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/render_state_update.https.html [ Pass ]
+imported/w3c/web-platform-tests/webxr/xrSession_end.https.html [ Pass ]
 
 # Passing since r259532.
 imported/w3c/web-platform-tests/css/css-ui/outline-019.html

Modified: trunk/Source/WebCore/ChangeLog (266781 => 266782)


--- trunk/Source/WebCore/ChangeLog	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/Source/WebCore/ChangeLog	2020-09-09 16:00:27 UTC (rev 266782)
@@ -1,3 +1,20 @@
+2020-09-04  Sergio Villar Senin  <[email protected]>
+
+        [WebXR] Implement XRSession end event
+        https://bugs.webkit.org/show_bug.cgi?id=216181
+
+        Reviewed by Darin Adler.
+
+        Implemented the end event dispatched by the XRSession whenever the shutdown process is executed.
+
+        * Modules/webxr/WebXRSession.cpp:
+        (WebCore::WebXRSession::shutdown): Added end event dispatch.
+        * Modules/webxr/XRSessionEvent.cpp:
+        (WebCore::XRSessionEvent::create): New method receiving a XRSession.
+        (WebCore::XRSessionEvent::XRSessionEvent): New constructor receiving a XRSession.
+        (WebCore::XRSessionEvent::eventInterface const): New. Overrides the Event method.
+        * Modules/webxr/XRSessionEvent.h: Ditto.
+
 2020-09-09  Zalan Bujtas  <[email protected]>
 
         [LFC][IFC] Line should not know about floats

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp (266781 => 266782)


--- trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2020-09-09 16:00:27 UTC (rev 266782)
@@ -28,6 +28,7 @@
 
 #if ENABLE(WEBXR)
 
+#include "EventNames.h"
 #include "JSWebXRReferenceSpace.h"
 #include "WebXRBoundedReferenceSpace.h"
 #include "WebXRFrame.h"
@@ -34,6 +35,7 @@
 #include "WebXRSystem.h"
 #include "XRFrameRequestCallback.h"
 #include "XRRenderStateInit.h"
+#include "XRSessionEvent.h"
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/RefPtr.h>
 
@@ -328,6 +330,8 @@
     //  6.2. Deallocating any graphics resources acquired by session for presentation to the XR device.
     //  6.3. Putting the XR device in a state such that a different source may be able to initiate a session with the same device if session is an immersive session.
     // 7. Queue a task that fires an XRSessionEvent named end on session.
+    auto event = XRSessionEvent::create(eventNames().endEvent, { makeRefPtr(*this) });
+    queueTaskToDispatchEvent(*this, TaskSource::WebXR, WTFMove(event));
 }
 
 // https://immersive-web.github.io/webxr/#dom-xrsession-end

Modified: trunk/Source/WebCore/Modules/webxr/XRSessionEvent.cpp (266781 => 266782)


--- trunk/Source/WebCore/Modules/webxr/XRSessionEvent.cpp	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/Source/WebCore/Modules/webxr/XRSessionEvent.cpp	2020-09-09 16:00:27 UTC (rev 266782)
@@ -49,8 +49,14 @@
 
 XRSessionEvent::~XRSessionEvent() = default;
 
+EventInterface XRSessionEvent::eventInterface() const
+{
+    return XRSessionEventInterfaceType;
+}
+
 const WebXRSession& XRSessionEvent::session() const
 {
+    ASSERT(m_session);
     return *m_session;
 }
 

Modified: trunk/Source/WebCore/Modules/webxr/XRSessionEvent.h (266781 => 266782)


--- trunk/Source/WebCore/Modules/webxr/XRSessionEvent.h	2020-09-09 15:16:19 UTC (rev 266781)
+++ trunk/Source/WebCore/Modules/webxr/XRSessionEvent.h	2020-09-09 16:00:27 UTC (rev 266782)
@@ -28,15 +28,19 @@
 #if ENABLE(WEBXR)
 
 #include "Event.h"
+#include "WebXRSession.h"
 
 namespace WebCore {
 
-class WebXRSession;
-
 class XRSessionEvent final : public Event {
     WTF_MAKE_ISO_ALLOCATED(XRSessionEvent);
 public:
     struct Init : EventInit {
+        Init() = default;
+        Init(RefPtr<WebXRSession>&& session)
+            : EventInit()
+            , session(WTFMove(session))
+        { }
         RefPtr<WebXRSession> session;
     };
 
@@ -48,6 +52,9 @@
 private:
     XRSessionEvent(const AtomString&, const Init&, IsTrusted);
 
+    // Event.
+    EventInterface eventInterface() const final;
+
     RefPtr<WebXRSession> m_session;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to