Index: media/audio/mac/audio_manager_mac.h |
diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h |
index f8c99e80dfb749c01cd689223c955e02fed2b8ab..c1105387763ac51e4c4cdf85327c41d87c3af86f 100644 |
--- a/media/audio/mac/audio_manager_mac.h |
+++ b/media/audio/mac/audio_manager_mac.h |
@@ -26,12 +26,11 @@ |
// the AudioManager class. |
class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { |
public: |
- AudioManagerMac( |
- scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
- scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
- AudioLogFactory* audio_log_factory); |
+ AudioManagerMac(AudioLogFactory* audio_log_factory); |
// Implementation of AudioManager. |
+ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override; |
+ scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override; |
bool HasAudioOutputDevices() override; |
bool HasAudioInputDevices() override; |
void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; |
@@ -118,6 +117,7 @@ |
private: |
void InitializeOnAudioThread(); |
+ void ShutdownOnAudioThread(); |
int ChooseBufferSize(bool is_input, int sample_rate); |
@@ -126,6 +126,9 @@ |
void HandleDeviceChanges(); |
scoped_ptr<AudioDeviceListenerMac> output_device_listener_; |
+ |
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
+ scoped_ptr<base::Thread> worker_thread_; |
// Track the output sample-rate and the default output device |
// so we can intelligently handle device notifications only when necessary. |
@@ -138,11 +141,8 @@ |
class AudioPowerObserver; |
scoped_ptr<AudioPowerObserver> power_observer_; |
- // Tracks all constructed input and output streams. |
- // TODO(alokp): We used to track these streams to close before destruction. |
- // We no longer close the streams, so we may be able to get rid of these |
- // member variables. They are currently used by MaybeChangeBufferSize(). |
- // Investigate if we can remove these. |
+ // Tracks all constructed input and output streams so they can be stopped at |
+ // shutdown. See ShutdownOnAudioThread() for more details. |
std::list<AudioInputStream*> basic_input_streams_; |
std::list<AUAudioInputStream*> low_latency_input_streams_; |
std::list<AUHALStream*> output_streams_; |