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

Unified Diff: content/renderer/media/webrtc_audio_device_impl.cc

Issue 310463002: Fix the aec dump crash when users disable aec dump without closing the "Save File" overlay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the bots Created 6 years, 7 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/renderer/media/webrtc/peer_connection_dependency_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_impl.cc
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index ae37d2074b2f1159605f9cf97197f40f976b5e6b..0a65aff2aa00cd648c75b209f69b68e865ba4cd7 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -524,7 +524,14 @@ bool WebRtcAudioDeviceImpl::GetAuthorizedDeviceInfoForAudioRenderer(
void WebRtcAudioDeviceImpl::EnableAecDump(base::File aec_dump_file) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(aec_dump_file.IsValid());
- DCHECK(!aec_dump_file_.IsValid());
+
+ // Close the previous AEC dump file description if it has not been consumed.
+ // This can happen if no getUserMedia has been made yet.
+ // TODO(xians): DCHECK(!aec_dump_file_.IsValid()) after the browser
+ // guarantees it won't call EnableAecDump() more than once in a row.
+ if (aec_dump_file_.IsValid())
+ aec_dump_file_.Close();
+
aec_dump_file_ = aec_dump_file.Pass();
MaybeStartAecDump();
}
« no previous file with comments | « content/renderer/media/webrtc/peer_connection_dependency_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698