Make XRSession.inputSources comply with SameObject requirement
Per the WebXR Spec, the inputSources attribute is supposed to be a live array whose input sources are updated in place. Currently the code creates a new array on every query. This changes the internal hash map of input sources to be an XRInputSourceArray object. The XRInputSourceArray object is implemented with a backing HeapHashMap so that the existing logic (i.e. looking up/setting/erasing by id) is more performant than getting by the index. This does have a side effect of meaning that an input source's position in the inputSources array can change, as it's ordering is based on the ordering of the HeapHashMap's backing .Values store. Bug: 966552 Change-Id: I21396ebbbbef6799a6bdd98791706c9159c9e061 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632872 Commit-Queue: Alexander Cooper <alcooper@chromium.org> Reviewed-by:Brandon Jones <bajones@chromium.org> Reviewed-by:
Bill Orr <billorr@chromium.org> Cr-Commit-Position: refs/heads/master@{#664463}
Showing
Please register or sign in to comment