Chromium Code Reviews| 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); |