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

Unified Diff: media/audio/audio_manager_base.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/audio_manager.cc ('k') | media/audio/audio_manager_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager_base.h
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index 61292c6712f9648d54cbc8deaf42e8f423f8d8c3..d8504478530f709dae5fc19552dc1fb1d0431328 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -63,6 +63,8 @@
~AudioManagerBase() override;
// AudioManager:
+ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override;
base::string16 GetAudioInputDeviceModel() override;
void ShowAudioInputSettings() override;
void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override;
@@ -120,14 +122,11 @@
int output_stream_count() const { return num_output_streams_; }
protected:
- AudioManagerBase(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
- AudioLogFactory* audio_log_factory);
+ AudioManagerBase(AudioLogFactory* audio_log_factory);
- // Releases all the audio output dispatchers.
- // All audio streams should be closed before Shutdown() is called.
- // This must be called in the destructor of every AudioManagerBase
+ // Shuts down the audio thread and releases all the audio output dispatchers
+ // on the audio thread. All audio streams should be freed before Shutdown()
+ // is called. This must be called in the destructor of every AudioManagerBase
// implementation.
void Shutdown();
@@ -163,6 +162,9 @@
class CompareByParams;
+ // Called by Shutdown().
+ void ShutdownOnAudioThread();
+
// Max number of open output streams, modified by
// SetMaxOutputStreamsAllowed().
int max_num_output_streams_;
@@ -179,6 +181,9 @@
// Track output state change listeners.
base::ObserverList<AudioDeviceListener> output_listeners_;
+ // Thread used to interact with audio streams created by this audio manager.
+ scoped_ptr<base::Thread> audio_thread_;
+
// Map of cached AudioOutputDispatcher instances. Must only be touched
// from the audio thread (no locking).
AudioOutputDispatchers output_dispatchers_;
« no previous file with comments | « media/audio/audio_manager.cc ('k') | media/audio/audio_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698