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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2383473002: [scheduler] Teach scheduler about audio state (Closed)
Patch Set: Created 4 years, 3 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/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 96b146c1eae5acbafd31e62e2dc796d19a50b033..392823aefc08243d2bc29b4f7a6a3ef234d3567f 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1737,6 +1737,16 @@ void RenderThreadImpl::OnProcessBackgrounded(bool backgrounded) {
}
}
+void RenderThreadImpl::OnAudioStateChanged(bool has_active_audio) {
+ ChildThreadImpl::OnAudioStateChanged(has_active_audio);
+
+ if (has_active_audio) {
+ renderer_scheduler_->OnAudioStarted();
+ } else {
+ renderer_scheduler_->OnAudioStopped();
+ }
+}
+
void RenderThreadImpl::OnProcessPurgeAndSuspend() {
ChildThreadImpl::OnProcessPurgeAndSuspend();
if (is_renderer_suspended_)

Powered by Google App Engine
This is Rietveld 408576698