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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2077983003: Intiialize AudioManager and related class lazily (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: defer StartHangMonitor() on all platforms Created 4 years, 6 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 | « content/browser/browser_main_loop.cc ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index b1085f4db112e5a683f64a0fab25f6d6c1c1e54c..05d2a6bb0e65d159eefa3d3295549cfe43dbcf3b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -188,6 +188,7 @@
#include "content/browser/mojo/service_registrar_android.h"
#include "content/browser/screen_orientation/screen_orientation_message_filter_android.h"
#include "ipc/ipc_sync_channel.h"
+#include "media/audio/android/audio_manager_android.h"
#endif
#if defined(OS_WIN)
@@ -601,6 +602,17 @@ RenderProcessHostImpl::RenderProcessHostImpl(
IPC::AttachmentBrokerPrivileged::CreateBrokerIfNeeded();
#endif // defined(OS_MACOSX)
#endif // USE_ATTACHMENT_BROKER
+
+#if !defined(OS_MACOSX)
+ // On Mac audio thread is the UI thread, a hang monitor is not
+ // necessary or recommended.
+ media::AudioManager::StartHangMonitor(
no sievers 2016/06/21 23:57:22 Doesn't this blow up if being called repeatedly?
qinmin 2016/06/22 00:15:56 That doesn't work in ChromeOS case though since au
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
+#endif // !defined(OS_MACOSX)
+#if defined(OS_ANDROID)
+ static_cast<media::AudioManagerAndroid*> (
+ media::AudioManager::Get())->InitializeIfNeeded();
+#endif // defined(OS_ANDROID)
}
// static
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | media/audio/android/audio_manager_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698