• Alex Cooper's avatar
    Ensure VRService is notified when sessions stop. · 4f034400
    Alex Cooper authored
    crrev.com/c/2076431 revealed an underlying race condition from the
    "TestDeviceServiceDisconnect" test case, where there is essentially a
    race between when the IsolatedVRDeviceProvider receives the disconnect
    from the underlying device provider and when the BrowserXrRuntime would
    receive it's own disconnect from the underlying device.
    
    If the IsolatedVRDeviceProvider wins the race, the BrowserXRRuntime may
    be removed before it can notify the VRService that it (and the session
    it is responsible for) is being ended. Because the renderer process has
    its own pipe to the device process, it is notified of the disconnect
    (and ended session), even if the Browser doesn't till it about this
    termination. The end result is that the only state that doesn't end up
    eventually getting cleaned up is that of the session metrics helper,
    which thinks that a session is still active, and may hit a DCHECK when
    attempting to start a new session.
    
    Change-Id: I5a448130cab0bc245cd4f3e6ef77e44512a89652
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2081528
    Commit-Queue: Alexander Cooper <alcooper@chromium.org>
    Auto-Submit: Alexander Cooper <alcooper@chromium.org>
    Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#746992}
    4f034400
browser_xr_runtime.cc 20.3 KB