• Jeremy Roman's avatar
    Factor out AudioNodeInput/AudioNodeOutput wiring logic and fix an ordering issue. · 817c2bd0
    Jeremy Roman authored
    Previously, AudioNodeOutput::RemoveInput could call AudioHandler::BreakConnectionWithLock
    at a time when one of the mutual sets of raw pointers has been updated but the other has
    not. This causes the Disable logic to go awry, leading to DCHECK failures and, after
    another recent change, ASAN violations, since it can be entered as part of
    AudioHandler::DisableOutputsIfNecessary during BreakConnectionWithLock.
    
    This was not obvious by inspection in part because this logic was distributed across
    several methods in different classes. To make the order in which these adjustments are
    made more clear, factor out the wiring logic from AudioNodeInput and AudioNodeOutput
    (and strictly for consistency, AudioParamHandler) into a collection of dedicated
    functions.
    
    Call sites are rewritten to call this code, which manages all changes to inputs_,
    outputs_ and disabled_outputs_ centrally.
    
    Bug: 910098
    Change-Id: Ide367d89cf6601e823169082833d7a41f1019f81
    Reviewed-on: https://chromium-review.googlesource.com/c/1359134
    Commit-Queue: Jeremy Roman <jbroman@chromium.org>
    Reviewed-by: default avatarHongchan Choi <hongchan@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#614755}
    817c2bd0
BUILD.gn 4 KB