Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1703)

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.cc

Issue 2396463002: Remove dangerous CHECK. Add unit test. (Closed)
Patch Set: Fix. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_renderer_host.cc
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index 77d21c86e51dc525f88568942af8f70d8a094911..1a6a995c1d2dbb8c6901026a82da40c034563c6b 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -495,7 +495,13 @@ void AudioRendererHost::OnCreateStream(int stream_id,
std::string device_unique_id;
const auto& auth_data = authorizations_.find(stream_id);
if (auth_data != authorizations_.end()) {
- CHECK(auth_data->second.first);
+ if (!auth_data->second.first) {
+ // The authorization for this stream is still pending, so it's an error
+ // to create it now.
+ content::bad_message::ReceivedBadMessage(
+ this, bad_message::ARH_CREATED_STREAM_WITHOUT_AUTHORIZATION);
+ return;
+ }
device_unique_id.swap(auth_data->second.second);
authorizations_.erase(auth_data);
}
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/media/audio_renderer_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698