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

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

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: Thread checking. Created 4 years 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: 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 5948e63c9a409613478ea7abe13bd13270ac8123..eb59eabb5618b4f8f506d58330e27bffb0f9b94c 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -101,6 +101,7 @@
#include "content/browser/renderer_host/file_utilities_message_filter.h"
#include "content/browser/renderer_host/media/audio_input_renderer_host.h"
#include "content/browser/renderer_host/media/audio_renderer_host.h"
+#include "content/browser/renderer_host/media/audio_stream_registry_impl.h"
#include "content/browser/renderer_host/media/media_stream_dispatcher_host.h"
#include "content/browser/renderer_host/media/peer_connection_tracker_host.h"
#include "content/browser/renderer_host/media/video_capture_host.h"
@@ -677,6 +678,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
gpu_observer_registered_(false),
delayed_cleanup_needed_(false),
within_process_died_observer_(false),
+ audio_stream_registry_(new AudioStreamRegistryImpl(id_)),
o1ka 2016/12/16 09:48:16 It would be cleaner to have a factory method in Au
Max Morin 2016/12/19 16:29:03 Done. The interface in AudioStreamRegistry is for
#if BUILDFLAG(ENABLE_WEBRTC)
webrtc_eventlog_host_(id_),
#endif
@@ -1069,8 +1071,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
BrowserMainLoop::GetInstance()->user_input_monitor());
AddFilter(audio_input_renderer_host_.get());
audio_renderer_host_ = new AudioRendererHost(
- GetID(), audio_manager, AudioMirroringManager::GetInstance(),
- media_stream_manager,
+ GetID(), audio_stream_registry_.get(), audio_manager,
+ AudioMirroringManager::GetInstance(), media_stream_manager,
browser_context->GetResourceContext()->GetMediaDeviceIDSalt());
AddFilter(audio_renderer_host_.get());
AddFilter(
@@ -2761,7 +2763,7 @@ void RenderProcessHostImpl::UpdateProcessPriority() {
// visible widgets -- the callers must call this function whenever we
// transition in/out of those states.
const bool should_background =
- visible_widgets_ == 0 && !audio_renderer_host_->HasActiveAudio() &&
+ visible_widgets_ == 0 && !audio_stream_registry_->HasActiveAudio() &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableRendererBackgrounding);

Powered by Google App Engine
This is Rietveld 408576698