Commit 73481a5e authored by Guido Urdaneta's avatar Guido Urdaneta Committed by Commit Bot

Update AudioStreamMonitor to handle updates to nonexistent streams

A crash has been reported where apparently it is possible for
a state update to arrive for a stream after the stream has been
removed.

This CL makes AudioStreamMonitor handle this case instead of DCHECKing.

Bug: 795501
Change-Id: Id43c3c4a846af5d8e7d1d387d36ed31e45724ad8
Reviewed-on: https://chromium-review.googlesource.com/832186Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524719}
parent 22d92b5c
...@@ -149,7 +149,9 @@ void AudioStreamMonitor::UpdateStreamAudibleStateOnUIThread(const StreamID& sid, ...@@ -149,7 +149,9 @@ void AudioStreamMonitor::UpdateStreamAudibleStateOnUIThread(const StreamID& sid,
bool is_audible) { bool is_audible) {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
auto it = streams_.find(sid); auto it = streams_.find(sid);
DCHECK(it != streams_.end()); if (it == streams_.end())
return;
it->second = is_audible; it->second = is_audible;
UpdateStreams(); UpdateStreams();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment