• Alex Cooper's avatar
    Enforce pose protection in XRFrame methods · 45931ea7
    Alex Cooper authored
    Currently there are two ways to get XRFrame's via the spec.  The first
    is in a rAF callback, and the second is as a result of an XRInputSource
    event.  Currently, if poses are not to be handed out, neither of these
    methods should fire.  However, to be fully spec compliant in the event
    of future changes (especially from AR) allowing frames to be handed out
    in other circumstances, the getPose and getViewerPose methods need to
    throw SecurityError if they should not hand out poses.  This adds the
    second layer of pose protection in that XRFrame's methods will throw if
    poses cannot or should not be handed out.
    
    Due to the fact that frames can only be achieved in the two ways
    mentioned above, both of which should be blocked when these methods
    would throw, no test is added for this behavior.
    
    Bug: 1008573
    Change-Id: If9940b290ad1c352c24d0660100ccbade3f1af59
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832486
    Commit-Queue: Alexander Cooper <alcooper@chromium.org>
    Commit-Queue: Jacob DeWitt <jacde@chromium.org>
    Auto-Submit: Alexander Cooper <alcooper@chromium.org>
    Reviewed-by: default avatarJacob DeWitt <jacde@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#701395}
    45931ea7
xr_session.h 12.4 KB