From 484d29dcb45ca362fc9049c37dd3a51e11492f14 Mon Sep 17 00:00:00 2001 From: dalecurtis Date: Wed, 10 Sep 2014 19:51:40 -0700 Subject: Use AudioStreamMonitor to control power save blocking. Prevents looping, soundless videos from preventing system sleep if they're in a background tab. We don't want soundless videos in the main tab to allow sleeping as they'll impact the muted video + captions use case. Reworks WebContentsImpl to track active media players and whether the attached WebContents is visible. When visible and there's an active video player, it will create a power save blocker. One blocker is shared for all active media players for simplicity. Reworks AudioStreamMonitor to handle the PowerSaveBlocker for audio such that one is only created when non-silent audio is present. To prevent splitting power blocking duties across chrome/ and content/, AudioStreamMonitor now lives in content/. WebContents exposes a WasRecentlyAudible() method for the existing tab audio indicator. BUG=43667,367785 TEST=manual. Review URL: https://codereview.chromium.org/478543003 Cr-Commit-Position: refs/heads/master@{#294303} --- chrome/chrome_browser.gypi | 2 -- 1 file changed, 2 deletions(-) (limited to 'chrome/chrome_browser.gypi') diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 59f24a1..a873dec 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -631,8 +631,6 @@ 'browser/mac/relauncher.h', 'browser/mac/security_wrappers.cc', 'browser/mac/security_wrappers.h', - 'browser/media/audio_stream_monitor.cc', - 'browser/media/audio_stream_monitor.h', 'browser/media/cast_transport_host_filter.cc', 'browser/media/cast_transport_host_filter.h', 'browser/media/desktop_media_list.h', -- cgit v1.1