Title: [263256] trunk/Source/WebCore
Revision
263256
Author
svil...@igalia.com
Date
2020-06-19 00:32:14 -0700 (Fri, 19 Jun 2020)

Log Message

[WebXR] unsigned long in IDL should be translated as unsigned in C++ code
https://bugs.webkit.org/show_bug.cgi?id=213020

Reviewed by Darin Adler.

The "unsigned long" type definition in IDL must be translated to unsigned in C++ code.

I'm also replacing the very long XRFrameRequestCallback::Identifier by simply unsigned as it
isn't adding anything.

No new test required as there is no change in functionality, just removing an alias.

* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::requestAnimationFrame):
(WebCore::WebXRSession::cancelAnimationFrame):
* Modules/webxr/WebXRSession.h:
* Modules/webxr/XRFrameRequestCallback.h:
(WebCore::XRFrameRequestCallback::callbackId):
(WebCore::XRFrameRequestCallback::setCallbackId):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (263255 => 263256)


--- trunk/Source/WebCore/ChangeLog	2020-06-19 07:04:36 UTC (rev 263255)
+++ trunk/Source/WebCore/ChangeLog	2020-06-19 07:32:14 UTC (rev 263256)
@@ -1,3 +1,25 @@
+2020-06-10  Sergio Villar Senin  <svil...@igalia.com>
+
+        [WebXR] unsigned long in IDL should be translated as unsigned in C++ code
+        https://bugs.webkit.org/show_bug.cgi?id=213020
+
+        Reviewed by Darin Adler.
+
+        The "unsigned long" type definition in IDL must be translated to unsigned in C++ code.
+
+        I'm also replacing the very long XRFrameRequestCallback::Identifier by simply unsigned as it
+        isn't adding anything.
+
+        No new test required as there is no change in functionality, just removing an alias.
+
+        * Modules/webxr/WebXRSession.cpp:
+        (WebCore::WebXRSession::requestAnimationFrame):
+        (WebCore::WebXRSession::cancelAnimationFrame):
+        * Modules/webxr/WebXRSession.h:
+        * Modules/webxr/XRFrameRequestCallback.h:
+        (WebCore::XRFrameRequestCallback::callbackId):
+        (WebCore::XRFrameRequestCallback::setCallbackId):
+
 2020-06-19  Myles C. Maxfield  <mmaxfi...@apple.com>
 
         [Cocoa] Unify "font:" CSS shorthand values between macOS and iOS family

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp (263255 => 263256)


--- trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2020-06-19 07:04:36 UTC (rev 263255)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2020-06-19 07:32:14 UTC (rev 263256)
@@ -196,11 +196,11 @@
 }
 
 // https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe
-XRFrameRequestCallback::Id WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
+unsigned WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
 {
     // 1. Let session be the target XRSession object.
     // 2. Increment session's animation frame callback identifier by one.
-    XRFrameRequestCallback::Id newId = ++m_nextCallbackId;
+    unsigned newId = m_nextCallbackId++;
 
     // 3. Append callback to session's list of animation frame callbacks, associated with session's
     // animation frame callback identifier's current value.
@@ -214,7 +214,7 @@
 }
 
 // https://immersive-web.github.io/webxr/#dom-xrsession-cancelanimationframe
-void WebXRSession::cancelAnimationFrame(XRFrameRequestCallback::Id callbackId)
+void WebXRSession::cancelAnimationFrame(unsigned callbackId)
 {
     // 1. Let session be the target XRSession object.
     // 2. Find the entry in session's list of animation frame callbacks or session's list of

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSession.h (263255 => 263256)


--- trunk/Source/WebCore/Modules/webxr/WebXRSession.h	2020-06-19 07:04:36 UTC (rev 263255)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSession.h	2020-06-19 07:32:14 UTC (rev 263256)
@@ -35,7 +35,6 @@
 #include "WebXRRenderState.h"
 #include "WebXRSpace.h"
 #include "XREnvironmentBlendMode.h"
-#include "XRFrameRequestCallback.h"
 #include "XRInteractionMode.h"
 #include "XRReferenceSpaceType.h"
 #include "XRSessionMode.h"
@@ -48,6 +47,7 @@
 
 namespace WebCore {
 
+class XRFrameRequestCallback;
 class WebXRReferenceSpace;
 class WebXRSystem;
 struct XRRenderStateInit;
@@ -73,8 +73,8 @@
     void updateRenderState(const XRRenderStateInit&);
     void requestReferenceSpace(XRReferenceSpaceType, RequestReferenceSpacePromise&&);
 
-    XRFrameRequestCallback::Id requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
-    void cancelAnimationFrame(XRFrameRequestCallback::Id handle);
+    unsigned requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
+    void cancelAnimationFrame(unsigned callbackId);
 
     void end(EndPromise&&);
 
@@ -112,7 +112,7 @@
     RefPtr<WebXRRenderState> m_activeRenderState;
     RefPtr<WebXRRenderState> m_pendingRenderState;
 
-    XRFrameRequestCallback::Id m_nextCallbackId { 0 };
+    unsigned m_nextCallbackId { 1 };
     Vector<Ref<XRFrameRequestCallback>> m_callbacks;
     Vector<Ref<XRFrameRequestCallback>> m_runningCallbacks;
 

Modified: trunk/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h (263255 => 263256)


--- trunk/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h	2020-06-19 07:04:36 UTC (rev 263255)
+++ trunk/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h	2020-06-19 07:32:14 UTC (rev 263256)
@@ -41,14 +41,13 @@
 
     virtual CallbackResult<void> handleEvent(double highResTimeMs, WebXRFrame&) = 0;
 
-    using Id = unsigned long;
-    Id callbackId() { ASSERT(m_id); return m_id; }
-    void setCallbackId(Id id) { ASSERT(!m_id); m_id = id; }
+    unsigned callbackId() { ASSERT(m_id); return m_id; }
+    void setCallbackId(unsigned id) { ASSERT(!m_id); m_id = id; }
     void cancel() { m_cancelled = true; }
     bool isCancelled() const { return m_cancelled; }
 
 private:
-    Id m_id { 0 };
+    unsigned m_id { 0 };
     bool m_cancelled { false };
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to