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

Unified Diff: content/browser/media/media_web_contents_observer.cc

Issue 2496173003: Communicate audio state to renderer process on Android. (Closed)
Patch Set: Make power_level_monitoring_available private Created 4 years, 1 month 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
« no previous file with comments | « content/browser/media/audio_stream_monitor.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_web_contents_observer.cc
diff --git a/content/browser/media/media_web_contents_observer.cc b/content/browser/media/media_web_contents_observer.cc
index ef3f5dc9c9d5194480f0a5c99e351f872ac0491c..6e5987584b92d7df80be18a1858847ffb04ac20e 100644
--- a/content/browser/media/media_web_contents_observer.cc
+++ b/content/browser/media/media_web_contents_observer.cc
@@ -43,9 +43,6 @@ void MediaWebContentsObserver::RenderFrameDeleted(
}
void MediaWebContentsObserver::MaybeUpdateAudibleState() {
- if (!AudioStreamMonitor::monitoring_available())
- return;
-
AudioStreamMonitor* audio_stream_monitor =
static_cast<WebContentsImpl*>(web_contents())->audio_stream_monitor();
@@ -132,17 +129,9 @@ void MediaWebContentsObserver::OnMediaPlaying(
return;
const MediaPlayerId id(render_frame_host, delegate_id);
- if (has_audio) {
+ if (has_audio)
AddMediaPlayerEntry(id, &active_audio_players_);
- // If we don't have audio stream monitoring, allocate the audio power save
- // blocker here instead of during NotifyNavigationStateChanged().
- if (!audio_power_save_blocker_ &&
- !AudioStreamMonitor::monitoring_available()) {
- CreateAudioPowerSaveBlocker();
- }
- }
-
if (has_video) {
AddMediaPlayerEntry(id, &active_video_players_);
@@ -204,14 +193,6 @@ void MediaWebContentsObserver::CreateVideoPowerSaveBlocker() {
}
void MediaWebContentsObserver::MaybeReleasePowerSaveBlockers() {
- // If there are no more audio players and we don't have audio stream
- // monitoring, release the audio power save blocker here instead of during
- // NotifyNavigationStateChanged().
- if (active_audio_players_.empty() &&
- !AudioStreamMonitor::monitoring_available()) {
- audio_power_save_blocker_.reset();
- }
-
// If there are no more video players, clear the video power save blocker.
if (active_video_players_.empty())
video_power_save_blocker_.reset();
« no previous file with comments | « content/browser/media/audio_stream_monitor.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698