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

Unified Diff: media/audio/mac/audio_manager_mac.h

Issue 1901583005: Revert of Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « media/audio/mac/audio_low_latency_input_mac_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « media/audio/mac/audio_low_latency_input_mac_unittest.cc ('k') | media/audio/mac/audio_manager_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698