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

Unified Diff: media/audio/audio_manager_base.h

Issue 1780333007: AudioManagerBase: Create and run the audio thread lazily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 9 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
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index bcb6fe390115259d38c992c636466974d3fe7e84..2a926904fd488e36db747da7019689f964f97436 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -52,7 +52,7 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
~AudioManagerBase() override;
// AudioManager:
- scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() const override;
+ scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() override;
scoped_refptr<base::SingleThreadTaskRunner> GetWorkerTaskRunner() override;
base::string16 GetAudioInputDeviceModel() override;
void ShowAudioInputSettings() override;
@@ -171,12 +171,7 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
base::ObserverList<AudioDeviceListener> output_listeners_;
// Thread used to interact with audio streams created by this audio manager.
- base::Thread audio_thread_;
-
- // The task runner of the audio thread this object runs on. Used for internal
- // tasks which run on the audio thread even after Shutdown() has been started
- // and GetTaskRunner() starts returning NULL.
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ scoped_ptr<base::Thread> audio_thread_;
// Map of cached AudioOutputDispatcher instances. Must only be touched
// from the audio thread (no locking).

Powered by Google App Engine
This is Rietveld 408576698