• Will Cassella's avatar
    Remove redundant call to `GetRuntimeForOptions` · c18e73ad
    Will Cassella authored
    Since `XRRuntimeManager::GetRuntimeForOptions` returns a non-owning
    pointer, we can't pipe it all the way from `RequestSession` through
    `ShowConsentPrompt`, `OnConsentResult`, and `DoRequestSession`. However,
    we can eliminate the call in `DoRequestSession` (expecting the caller to
    provide it), and at least pass the ID through to `OnConsentResult` to
    assert that we receive the same runtime from the call there.
    
    Imagine the following scenario:
    1) `RequestSession` finds a device, and posts a consent prompt for that
    device.
    2) The device becomes unavailable.
    3) The user accepts the consent prompt.
    4) `OnConsentResult` selects a different device, and chrome caches
    consent for it.
    
    That's kind of weird, so this CL fixes that scenario.
    
    Change-Id: I71385b59f286d3d7c4a78590342eafe716175649
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1804688Reviewed-by: default avatarAlexander Cooper <alcooper@chromium.org>
    Reviewed-by: default avatarBrandon Jones <bajones@chromium.org>
    Commit-Queue: Will Cassella <cassew@google.com>
    Cr-Commit-Position: refs/heads/master@{#697259}
    c18e73ad
vr_service_impl.cc 22.3 KB