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

Unified Diff: content/renderer/media/audio_input_device.h

Issue 9104043: Monitor the IO message loop in the AudioDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments Created 8 years, 10 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_device.h
diff --git a/content/renderer/media/audio_input_device.h b/content/renderer/media/audio_input_device.h
index 96dd2ff3ee779f0820b700312799d9319e86de91..d93e49cc3b85c83bf637483f58bd16fe892aa101 100644
--- a/content/renderer/media/audio_input_device.h
+++ b/content/renderer/media/audio_input_device.h
@@ -78,6 +78,7 @@
#include "base/threading/simple_thread.h"
#include "content/common/content_export.h"
#include "content/renderer/media/audio_input_message_filter.h"
+#include "content/renderer/media/scoped_loop_observer.h"
#include "media/audio/audio_parameters.h"
// TODO(henrika): This class is based on the AudioDevice class and it has
@@ -88,6 +89,7 @@
class CONTENT_EXPORT AudioInputDevice
: public AudioInputMessageFilter::Delegate,
public base::DelegateSimpleThread::Delegate,
+ public ScopedLoopObserver,
public base::RefCountedThreadSafe<AudioInputDevice> {
public:
class CONTENT_EXPORT CaptureCallback {
@@ -176,6 +178,10 @@ class CONTENT_EXPORT AudioInputDevice
// DelegateSimpleThread::Delegate implementation.
virtual void Run() OVERRIDE;
+ // MessageLoop::DestructionObserver implementation for the IO loop.
+ // If the IO loop dies before we do, we shut down the audio thread from here.
+ virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+
// Format
AudioParameters audio_parameters_;

Powered by Google App Engine
This is Rietveld 408576698