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

Unified Diff: content/renderer/media/audio_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_device.h
diff --git a/content/renderer/media/audio_device.h b/content/renderer/media/audio_device.h
index f4654bd0a77ee9ae2633efdc37364353bc379c95..0c20deadebe17d1754698315d9ce01d79b589599 100644
--- a/content/renderer/media/audio_device.h
+++ b/content/renderer/media/audio_device.h
@@ -66,23 +66,23 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
#include "base/shared_memory.h"
#include "base/synchronization/lock.h"
#include "base/threading/simple_thread.h"
#include "content/common/content_export.h"
#include "content/renderer/media/audio_message_filter.h"
+#include "content/renderer/media/scoped_loop_observer.h"
#include "media/audio/audio_parameters.h"
#include "media/base/audio_renderer_sink.h"
-namespace base {
-class WaitableEvent;
-}
-
class CONTENT_EXPORT AudioDevice
: NON_EXPORTED_BASE(public media::AudioRendererSink),
public AudioMessageFilter::Delegate,
- public base::DelegateSimpleThread::Delegate {
+ public base::DelegateSimpleThread::Delegate,
+ public ScopedLoopObserver {
public:
// Methods called on main render thread -------------------------------------
@@ -169,6 +169,10 @@ class CONTENT_EXPORT AudioDevice
// Closes socket and joins with the audio thread.
void ShutDownAudioThread();
+ // 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
size_t buffer_size_; // in sample-frames
int channels_;

Powered by Google App Engine
This is Rietveld 408576698