Factor out AudioNodeInput/AudioNodeOutput wiring logic and fix an ordering issue.
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:Hongchan Choi <hongchan@chromium.org> Cr-Commit-Position: refs/heads/master@{#614755}
Showing
Please register or sign in to comment