|
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.
Committed: https://crrev.com/484d29dcb45ca362fc9049c37dd3a51e11492f14
Cr-Commit-Position: refs/heads/master@{#294303}
Total comments: 9
Total comments: 3
Total comments: 24
Total comments: 14
Total comments: 6
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+538 lines, -804 lines) |
Patch |
 |
M |
chrome/browser/media/OWNERS
|
View
|
1
2
3
4
5
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/media/audio_stream_monitor.h
|
View
|
1
2
|
1 chunk |
+0 lines, -113 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/media/audio_stream_monitor.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -86 lines |
0 comments
|
Download
|
 |
D |
chrome/browser/media/audio_stream_monitor_unittest.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -278 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/media/media_capture_devices_dispatcher.h
|
View
|
1
2
3
4
|
1 chunk |
+0 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/media/media_capture_devices_dispatcher.cc
|
View
|
1
2
3
4
5
6
|
5 chunks |
+0 lines, -88 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/tabs/tab_utils.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/chrome_browser.gypi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/chrome_tests_unit.gypi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
content/browser/media/OWNERS
|
View
|
1
2
3
4
5
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
content/browser/media/audio_stream_monitor.h
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+64 lines, -24 lines |
0 comments
|
Download
|
 |
A + |
content/browser/media/audio_stream_monitor.cc
|
View
|
1
2
3
4
5
6
7
|
5 chunks |
+84 lines, -8 lines |
0 comments
|
Download
|
 |
A + |
content/browser/media/audio_stream_monitor_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
8 chunks |
+77 lines, -58 lines |
0 comments
|
Download
|
 |
M |
content/browser/renderer_host/media/audio_renderer_host.cc
|
View
|
1
2
3
4
5
6
|
3 chunks |
+24 lines, -33 lines |
0 comments
|
Download
|
 |
M |
content/browser/web_contents/web_contents_impl.h
|
View
|
1
2
3
4
5
6
7
8
|
7 chunks |
+46 lines, -14 lines |
0 comments
|
Download
|
 |
M |
content/browser/web_contents/web_contents_impl.cc
|
View
|
1
2
3
4
5
6
7
8
|
10 chunks |
+126 lines, -39 lines |
0 comments
|
Download
|
 |
M |
content/browser/web_contents/web_contents_impl_unittest.cc
|
View
|
1
2
3
4
5
6
7
8
|
2 chunks |
+88 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/content_browser.gypi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
content/content_tests.gypi
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
content/public/browser/media_observer.h
|
View
|
1
2
|
1 chunk |
+0 lines, -21 lines |
0 comments
|
Download
|
 |
M |
content/public/browser/web_contents.h
|
View
|
1
2
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
media/audio/audio_output_controller.h
|
View
|
1
2
3
4
|
5 chunks |
+15 lines, -7 lines |
0 comments
|
Download
|
 |
M |
media/audio/audio_output_controller.cc
|
View
|
1
2
3
4
|
5 chunks |
+3 lines, -18 lines |
0 comments
|
Download
|
Total messages: 46 (5 generated)
|