summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_manager_base.h
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 20:51:37 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-01 20:51:37 +0000
commit5f7e4518c9cec62df4ed1c34daf003382b05ec70 (patch)
tree039579d56e67f6272d1f52c788e4324cd499a83b /media/audio/audio_manager_base.h
parentf14b1320428ad7935b70b677525021c1cf628afa (diff)
downloadchromium_src-5f7e4518c9cec62df4ed1c34daf003382b05ec70.zip
chromium_src-5f7e4518c9cec62df4ed1c34daf003382b05ec70.tar.gz
chromium_src-5f7e4518c9cec62df4ed1c34daf003382b05ec70.tar.bz2
Clean up scoped_com_initializer.h, primarily by removing #ifdefs for non-Windows. Instead change files that use this to specifically #ifdef it for OS_WIN, like we do most other Windows-specific code.
I plan to factor out the "subclass base::Thread to init MTA on Windows" pattern to its own file in a followup change. BUG=none TEST=none Review URL: https://codereview.chromium.org/10990079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_manager_base.h')
-rw-r--r--media/audio/audio_manager_base.h28
1 files changed, 26 insertions, 2 deletions
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 9c831ba..06c7068 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -12,12 +12,36 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
+#include "base/threading/thread.h"
#include "media/audio/audio_manager.h"
+#if defined(OS_WIN)
+#include "base/win/scoped_com_initializer.h"
+#endif
+
namespace media {
class AudioOutputDispatcher;
-class AudioThread;
+
+// Thread that enters MTA on Windows.
+#if defined(OS_WIN)
+class AudioThread : public base::Thread {
+ public:
+ 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);
+};
+#else
+typedef base::Thread AudioThread;
+#endif
// AudioManagerBase provides AudioManager functions common for all platforms.
class MEDIA_EXPORT AudioManagerBase : public AudioManager {
@@ -105,7 +129,7 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
// Thread used to interact with AudioOutputStreams created by this
// audio manger.
- scoped_ptr<media::AudioThread> audio_thread_;
+ scoped_ptr<AudioThread> audio_thread_;
mutable base::Lock audio_thread_lock_;
// Map of cached AudioOutputDispatcher instances. Must only be touched