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

Unified Diff: media/audio/audio_manager.cc

Issue 2077983003: Intiialize AudioManager and related class lazily (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix MediaSessionTest Created 4 years, 5 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager.cc
diff --git a/media/audio/audio_manager.cc b/media/audio/audio_manager.cc
index fae54bfd166dcf263aaf1bcb158fb5254590c7db..30304b231db697b275bb39d71b15336492a97645 100644
--- a/media/audio/audio_manager.cc
+++ b/media/audio/audio_manager.cc
@@ -78,6 +78,9 @@ class AudioManagerHelper : public base::PowerObserver {
base::Unretained(this)));
}
+ base::SingleThreadTaskRunner* monitor_task_runner() const {
+ return monitor_task_runner_.get();
+ }
AudioLogFactory* fake_log_factory() { return &fake_log_factory_; }
#if defined(OS_WIN)
@@ -327,8 +330,11 @@ ScopedAudioManagerPtr AudioManager::CreateForTesting(
}
// static
-void AudioManager::StartHangMonitor(
+void AudioManager::StartHangMonitorIfNeeded(
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ if (g_helper.Pointer()->monitor_task_runner())
+ return;
+
DCHECK(AudioManager::Get());
DCHECK(task_runner);
DCHECK_NE(task_runner, AudioManager::Get()->GetTaskRunner());
« no previous file with comments | « media/audio/audio_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698