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

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

Issue 7661017: Refactor AudioInputDevice to remove race conditions and allow more flexible calling sequences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Minor changes based on review by Andrew Created 9 years, 4 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/audio_input_device.cc ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_input_message_filter.cc
===================================================================
--- content/renderer/media/audio_input_message_filter.cc (revision 98001)
+++ content/renderer/media/audio_input_message_filter.cc (working copy)
@@ -71,15 +71,17 @@
base::FileDescriptor socket_descriptor,
#endif
uint32 length) {
+#if !defined(OS_WIN)
+ base::SyncSocket::Handle socket_handle = socket_descriptor.fd;
+#endif
Delegate* delegate = delegates_.Lookup(stream_id);
if (!delegate) {
DLOG(WARNING) << "Got audio stream event for a non-existent or removed"
- " audio capturer.";
+ " audio capturer (stream_id=" << stream_id << ").";
+ base::SharedMemory::CloseHandle(handle);
+ base::SyncSocket socket(socket_handle);
return;
}
-#if !defined(OS_WIN)
- base::SyncSocket::Handle socket_handle = socket_descriptor.fd;
-#endif
// Forward message to the stream delegate.
delegate->OnLowLatencyCreated(handle, socket_handle, length);
}
@@ -99,5 +101,6 @@
}
void AudioInputMessageFilter::RemoveDelegate(int32 id) {
+ VLOG(1) << "AudioInputMessageFilter::RemoveDelegate(id=" << id << ")";
delegates_.Remove(id);
}
« no previous file with comments | « content/renderer/media/audio_input_device.cc ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698