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

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: Removed Stop call in destructor. Added DCHECK instead. 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
Index: content/renderer/media/audio_input_message_filter.cc
===================================================================
--- content/renderer/media/audio_input_message_filter.cc (revision 97438)
+++ 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.";
+ 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);
}

Powered by Google App Engine
This is Rietveld 408576698