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

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

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: . Created 3 years, 11 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: 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 408da27deca9ce2080790b73700052b8aa8e99ab..ba3e34fe03096b3251a39a528bcb127185ab8334 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -9,8 +9,7 @@
#include <algorithm>
#include <limits>
-#include <utility>
-#include <vector>
+#include <set>
#include "base/base_switches.h"
#include "base/bind.h"
@@ -103,6 +102,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"
@@ -679,6 +679,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
gpu_observer_registered_(false),
delayed_cleanup_needed_(false),
within_process_died_observer_(false),
+ audio_stream_registry_(AudioStreamRegistryImpl::Create(id_)),
#if BUILDFLAG(ENABLE_WEBRTC)
webrtc_eventlog_host_(id_),
#endif
@@ -1076,8 +1077,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(
@@ -2790,7 +2791,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