Changeset 263256 in webkit


Ignore:
Timestamp:
Jun 19, 2020 12:32:14 AM (4 years ago)
Author:
svillar@igalia.com
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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r263255 r263256  
     12020-06-10  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [WebXR] unsigned long in IDL should be translated as unsigned in C++ code
     4        https://bugs.webkit.org/show_bug.cgi?id=213020
     5
     6        Reviewed by Darin Adler.
     7
     8        The "unsigned long" type definition in IDL must be translated to unsigned in C++ code.
     9
     10        I'm also replacing the very long XRFrameRequestCallback::Identifier by simply unsigned as it
     11        isn't adding anything.
     12
     13        No new test required as there is no change in functionality, just removing an alias.
     14
     15        * Modules/webxr/WebXRSession.cpp:
     16        (WebCore::WebXRSession::requestAnimationFrame):
     17        (WebCore::WebXRSession::cancelAnimationFrame):
     18        * Modules/webxr/WebXRSession.h:
     19        * Modules/webxr/XRFrameRequestCallback.h:
     20        (WebCore::XRFrameRequestCallback::callbackId):
     21        (WebCore::XRFrameRequestCallback::setCallbackId):
     22
    1232020-06-19  Myles C. Maxfield  <mmaxfield@apple.com>
    224
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp

    r262898 r263256  
    197197
    198198// https://immersive-web.github.io/webxr/#dom-xrsession-requestanimationframe
    199 XRFrameRequestCallback::Id WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
     199unsigned WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&& callback)
    200200{
    201201    // 1. Let session be the target XRSession object.
    202202    // 2. Increment session's animation frame callback identifier by one.
    203     XRFrameRequestCallback::Id newId = ++m_nextCallbackId;
     203    unsigned newId = m_nextCallbackId++;
    204204
    205205    // 3. Append callback to session's list of animation frame callbacks, associated with session's
     
    215215
    216216// https://immersive-web.github.io/webxr/#dom-xrsession-cancelanimationframe
    217 void WebXRSession::cancelAnimationFrame(XRFrameRequestCallback::Id callbackId)
     217void WebXRSession::cancelAnimationFrame(unsigned callbackId)
    218218{
    219219    // 1. Let session be the target XRSession object.
  • trunk/Source/WebCore/Modules/webxr/WebXRSession.h

    r262898 r263256  
    3636#include "WebXRSpace.h"
    3737#include "XREnvironmentBlendMode.h"
    38 #include "XRFrameRequestCallback.h"
    3938#include "XRInteractionMode.h"
    4039#include "XRReferenceSpaceType.h"
     
    4948namespace WebCore {
    5049
     50class XRFrameRequestCallback;
    5151class WebXRReferenceSpace;
    5252class WebXRSystem;
     
    7474    void requestReferenceSpace(XRReferenceSpaceType, RequestReferenceSpacePromise&&);
    7575
    76     XRFrameRequestCallback::Id requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
    77     void cancelAnimationFrame(XRFrameRequestCallback::Id handle);
     76    unsigned requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
     77    void cancelAnimationFrame(unsigned callbackId);
    7878
    7979    void end(EndPromise&&);
     
    113113    RefPtr<WebXRRenderState> m_pendingRenderState;
    114114
    115     XRFrameRequestCallback::Id m_nextCallbackId { 0 };
     115    unsigned m_nextCallbackId { 1 };
    116116    Vector<Ref<XRFrameRequestCallback>> m_callbacks;
    117117    Vector<Ref<XRFrameRequestCallback>> m_runningCallbacks;
  • trunk/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h

    r262857 r263256  
    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    unsigned callbackId() { ASSERT(m_id); return m_id; }
     45    void setCallbackId(unsigned id) { ASSERT(!m_id); m_id = id; }
    4746    void cancel() { m_cancelled = true; }
    4847    bool isCancelled() const { return m_cancelled; }
    4948
    5049private:
    51     Id m_id { 0 };
     50    unsigned m_id { 0 };
    5251    bool m_cancelled { false };
    5352};
Note: See TracChangeset for help on using the changeset viewer.