• Bill Orr's avatar
    Fix a crash after exiting WebXR presentation · 8bd14f4b
    Bill Orr authored
    XRSession has a collection of V8 callbacks that it will call for
    animation frame requests.
    
    These callbacks were detected as unreachable from V8's perspective,
    even though XRSession was alive from blink's perspective.
    
    The fix is to make XRSession an ActiveScriptWrappable, so it is a
    root object from V8's garbage collection while there are active
    callbacks.
    
    In discussion about this bug, it was pointed out that a couple places
    we keep objects on the stack might also cause V8's garbage collector
    to think wrappers are unreachable, so I now keep those objects alive
    with explcit traceable references.
    
    BUG=870403
    
    Cq-Include-Trybots: luci.chromium.try:win_optional_gpu_tests_rel
    Change-Id: I54cfda8597439c0a988acd918a1fcc6904cca340
    Reviewed-on: https://chromium-review.googlesource.com/1166187
    Commit-Queue: Bill Orr <billorr@chromium.org>
    Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
    Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#581515}
    8bd14f4b
xr_session.idl 1.45 KB