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

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: 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 | « content/browser/browser_main_loop.cc ('k') | content/browser/speech/speech_recognition_browsertest.cc » ('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 90f08284b19dacb1fdce4bd12531386e145c6448..72df25f4a74aa2071a0cd655dc55c083732c558d 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)
@@ -733,6 +734,21 @@ bool RenderProcessHostImpl::Init() {
// Call the embedder first so that their IPC filters have priority.
GetContentClient()->browser()->RenderProcessWillLaunch(this);
+#if !defined(OS_MACOSX)
+ // Intentionally delay the hang monitor creation after the first renderer
+ // is created. On Mac audio thread is the UI thread, a hang monitor is not
+ // necessary or recommended.
+ media::AudioManager::StartHangMonitorIfNeeded(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
+#endif // !defined(OS_MACOSX)
+
+#if defined(OS_ANDROID)
+ // Initialize the java audio manager so that media session tests will pass.
+ // See internal b/29872494.
+ static_cast<media::AudioManagerAndroid*>(media::AudioManager::Get())->
+ InitializeIfNeeded();
+#endif // defined(OS_ANDROID)
+
CreateMessageFilters();
RegisterMojoInterfaces();
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/speech/speech_recognition_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698