Changeset 262718 in webkit


Ignore:
Timestamp:
Jun 8, 2020 8:59:37 AM (4 years ago)
Author:
svillar@igalia.com
Message:

[WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
https://bugs.webkit.org/show_bug.cgi?id=212529

Reviewed by Youenn Fablet.

The type of the handle returned by XRSession::requestAnimationFrame() was recently changed
to unsigned long from long as there was no point in using signed integers for that. However
we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle
returned by requestAnimationFrame().

We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now
safely also replace signed by unsigned integers in our implementation.

No new tests as there is no change in functionality.

  • Modules/webxr/WebXRSession.cpp:

(WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids.

  • Modules/webxr/WebXRSession.h: Ditto.
  • Modules/webxr/WebXRSession.idl: Ditto.
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r262716 r262718  
     12020-05-29  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WebXR] Pass an unsigned long to cancelAnimationCallback() as handle
     4        https://bugs.webkit.org/show_bug.cgi?id=212529
     5
     6        Reviewed by Youenn Fablet.
     7
     8        The type of the handle returned by XRSession::requestAnimationFrame() was recently changed
     9        to unsigned long from long as there was no point in using signed integers for that. However
     10        we forgot to update the cancelAnimationFrame() in the specs as well as it receives the handle
     11        returned by requestAnimationFrame().
     12
     13        We landed https://github.com/immersive-web/webxr/pull/1069 in the WebXR specs so we can now
     14        safely also replace signed by unsigned integers in our implementation.
     15
     16        No new tests as there is no change in functionality.
     17
     18        * Modules/webxr/WebXRSession.cpp:
     19        (WebCore::WebXRSession::cancelAnimationFrame): Use unsigned ids.
     20        * Modules/webxr/WebXRSession.h: Ditto.
     21        * Modules/webxr/WebXRSession.idl: Ditto.
     22
    1232020-06-01  Sergio Villar Senin  <svillar@igalia.com>
    224
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp

    r262299 r262718  
    192192
    193193// https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe
    194 XRFrameRequestCallback::Id WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
     194XRFrameRequestCallback::Identifier WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
    195195{
    196196    // 1. Let session be the target XRSession object.
    197197    // 2. Increment session's animation frame callback identifier by one.
    198     XRFrameRequestCallback::Id newId = ++m_nextCallbackId;
     198    XRFrameRequestCallback::Identifier newId = ++m_nextCallbackId;
    199199
    200200    // 3. Append callback to session's list of animation frame callbacks, associated with session's
     
    210210
    211211// https://immersive-web.github.io/webxr/#dom-xrsession-cancelanimationframe
    212 void WebXRSession::cancelAnimationFrame(int callbackId)
     212void WebXRSession::cancelAnimationFrame(XRFrameRequestCallback::Identifier callbackId)
    213213{
    214214    // 1. Let session be the target XRSession object.
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.h

    r262299 r262718  
    7272    void requestReferenceSpace(XRReferenceSpaceType, RequestReferenceSpacePromise&&);
    7373
    74     XRFrameRequestCallback::Id requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
    75     void cancelAnimationFrame(int handle);
     74    XRFrameRequestCallback::Identifier requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
     75    void cancelAnimationFrame(XRFrameRequestCallback::Identifier handle);
    7676
    7777    void end(EndPromise&&);
     
    110110    RefPtr<WebXRRenderState> m_pendingRenderState;
    111111
    112     XRFrameRequestCallback::Id m_nextCallbackId { 0 };
     112    XRFrameRequestCallback::Identifier m_nextCallbackId { 0 };
    113113    Vector<Ref<XRFrameRequestCallback>> m_callbacks;
    114114    Vector<Ref<XRFrameRequestCallback>> m_runningCallbacks;
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.idl

    r262188 r262718  
    4343
    4444    unsigned long requestAnimationFrame(XRFrameRequestCallback callback);
    45     void cancelAnimationFrame(long handle);
     45    void cancelAnimationFrame(unsigned long handle);
    4646
    4747    Promise<void> end();
  • trunk/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h

    r262188 r262718  
    4242    virtual CallbackResult<void> handleEvent(double highResTimeMs, WebXRFrame&) = 0;
    4343
    44     using Id = unsigned long;
    45     Id callbackId() { ASSERT(m_id); return m_id; }
    46     void setCallbackId(Id id) { ASSERT(!m_id); m_id = id; }
     44    using Identifier = unsigned long;
     45    Identifier callbackId() { ASSERT(m_id); return m_id; }
     46    void setCallbackId(Identifier id) { ASSERT(!m_id); m_id = id; }
    4747    void cancel() { m_cancelled = true; }
    4848    bool isCancelled() const { return m_cancelled; }
    4949
    5050private:
    51     Id m_id { 0 };
     51    Identifier m_id { 0 };
    5252    bool m_cancelled { false };
    5353};
Note: See TracChangeset for help on using the changeset viewer.