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

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

Issue 2655413004: Strip out stream counting from AudioRendererHost. (Closed)
Patch Set: Fix all teh tests. Created 3 years, 10 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 79eeee2ffcf4a1e6665a8871fc4bfd83e2e16baa..dbe2482c8e4d5b9322112188975b25974b32ba6d 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1572,7 +1572,13 @@ int RenderProcessHostImpl::VisibleWidgetCount() const {
return visible_widgets_;
}
-void RenderProcessHostImpl::AudioStateChanged() {
+void RenderProcessHostImpl::OnAudioStreamAdded() {
+ ++audio_stream_count_;
+ UpdateProcessPriority();
+}
+
+void RenderProcessHostImpl::OnAudioStreamRemoved() {
+ --audio_stream_count_;
o1ka 2017/02/07 09:38:02 DCHECK(audio_stream_count_ > 0)?
DaleCurtis 2017/02/07 22:09:16 Done.
UpdateProcessPriority();
}
@@ -2831,7 +2837,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_count_ == 0 &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableRendererBackgrounding);

Powered by Google App Engine
This is Rietveld 408576698