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

Unified Diff: media/audio/audio_manager_base.h

Issue 10990079: Clean up scoped_com_initializer.h. Remove #ifdefs for non-Windows (this is in base/win, no one sho… (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
Index: media/audio/audio_manager_base.h
===================================================================
--- media/audio/audio_manager_base.h (revision 158860)
+++ media/audio/audio_manager_base.h (working copy)
@@ -12,13 +12,37 @@
#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 {
public:
@@ -105,7 +129,7 @@
// 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

Powered by Google App Engine
This is Rietveld 408576698