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

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

Issue 1806313003: Pass task runners to AudioManager constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK -> CHECK 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
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 c1105387763ac51e4c4cdf85327c41d87c3af86f..f8c99e80dfb749c01cd689223c955e02fed2b8ab 100644
--- a/media/audio/mac/audio_manager_mac.h
+++ b/media/audio/mac/audio_manager_mac.h
@@ -26,11 +26,12 @@ class AUHALStream;
// the AudioManager class.
class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
public:
- AudioManagerMac(AudioLogFactory* audio_log_factory);
+ AudioManagerMac(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
+ 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;
@@ -117,7 +118,6 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
private:
void InitializeOnAudioThread();
- void ShutdownOnAudioThread();
int ChooseBufferSize(bool is_input, int sample_rate);
@@ -127,9 +127,6 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
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.
int current_sample_rate_;
@@ -141,8 +138,11 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
class AudioPowerObserver;
scoped_ptr<AudioPowerObserver> power_observer_;
- // Tracks all constructed input and output streams so they can be stopped at
- // shutdown. See ShutdownOnAudioThread() for more details.
+ // Tracks all constructed input and output streams.
+ // TODO(alokp): We used to track these streams to close before destruction.
DaleCurtis 2016/04/14 00:00:35 Delete these? You already removed the stop streams
alokp 2016/04/14 13:30:03 Sorry I do not understand your comment. Remove the
+ // 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.
std::list<AudioInputStream*> basic_input_streams_;
std::list<AUAudioInputStream*> low_latency_input_streams_;
std::list<AUHALStream*> output_streams_;

Powered by Google App Engine
This is Rietveld 408576698