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

Unified Diff: media/audio/audio_manager_base.h

Issue 10909271: Adds COM init to AudioManager thread for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « no previous file | media/audio/audio_manager_base.cc » ('j') | media/audio/audio_manager_base.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager_base.h
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 61f95834145048c408f5a5ceaef72078dcd95919..a7f30bf49fce6977b628de21a5a500dd137630ba 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -12,16 +12,30 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread.h"
+#include "base/win/scoped_com_initializer.h"
#include "media/audio/audio_manager.h"
-namespace base {
-class Thread;
-}
-
namespace media {
class AudioOutputDispatcher;
+// Initializes the COM library for use by this thread and sets the thread's
+// concurrency model to multi-threaded.
tommi (sloooow) - chröme 2012/09/17 15:56:45 s/concurrency model to multi-threaded/COM threadin
henrika (OOO until Aug 14) 2012/09/17 16:43:29 Done.
+class AudioThread : public base::Thread {
scherkus (not reviewing) 2012/09/17 16:23:48 nit: this class can be forward declared + moved to
henrika (OOO until Aug 14) 2012/09/17 16:43:29 Done.
+public:
tommi (sloooow) - chröme 2012/09/17 15:56:45 indent (and below)
henrika (OOO until Aug 14) 2012/09/17 16:43:29 Done.
+ explicit AudioThread(const char* name);
+ virtual ~AudioThread();
+
+protected:
+ virtual void Init() OVERRIDE;
+ virtual void CleanUp() OVERRIDE;
+
+private:
+ scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_;
+ DISALLOW_COPY_AND_ASSIGN(AudioThread);
+};
+
// AudioManagerBase provides AudioManager functions common for all platforms.
class MEDIA_EXPORT AudioManagerBase : public AudioManager {
public:
@@ -108,7 +122,7 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
// Thread used to interact with AudioOutputStreams created by this
// audio manger.
- scoped_ptr<base::Thread> audio_thread_;
+ scoped_ptr<media::AudioThread> audio_thread_;
mutable base::Lock audio_thread_lock_;
// Map of cached AudioOutputDispatcher instances. Must only be touched
« no previous file with comments | « no previous file | media/audio/audio_manager_base.cc » ('j') | media/audio/audio_manager_base.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698