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-23 04:33:52 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-23 04:33:52 +0000
commit458e9521995681381912ece90eb2a8ea210ae07d (patch)
treed5eeabdee1104f65f42990bbd7edc238a57480d5 /media/audio/audio_manager_base.h
parent1822c9949f19195ca0000f0be929a5398a7c24e6 (diff)
downloadchromium_src-458e9521995681381912ece90eb2a8ea210ae07d.zip
chromium_src-458e9521995681381912ece90eb2a8ea210ae07d.tar.gz
chromium_src-458e9521995681381912ece90eb2a8ea210ae07d.tar.bz2
Add methods to base::Thread to allow Windows consumers to ask for COM to be intialized on the Thread.
This makes one functional change: when COM is initialized in STA mode, the Thread is forced to use a TYPE_UI message loop. Most of the modified consumers here didn't previously do that, but after discussion with cpu and siggi, it seems safest, even though it's more heavyweight. BUG=none TEST=none Review URL: https://codereview.chromium.org/11048029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_manager_base.h')
-rw-r--r--media/audio/audio_manager_base.h27
1 files changed, 5 insertions, 22 deletions
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 8d06ab8..3c06522 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -13,37 +13,20 @@
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.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 base {
+class Thread;
+}
+
namespace media {
class AudioOutputDispatcher;
-// 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 {
public:
@@ -168,7 +151,7 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
ObserverList<AudioDeviceListener> output_listeners_;
// Thread used to interact with audio streams created by this audio manager.
- scoped_ptr<AudioThread> audio_thread_;
+ scoped_ptr<base::Thread> audio_thread_;
mutable base::Lock audio_thread_lock_;
// The message loop of the audio thread this object runs on. Set on Init().