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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 2324923002: Remove OnSuspend/OnResume notifications on Android. (Closed)
Patch Set: Fix tests. 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
« no previous file with comments | « content/renderer/media/peer_connection_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index afd298b657701e96f52946849041fb91d08d9d19..c478bbd2d7dd25bd6db0e5c4bc2b7561b0c83cda 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -63,11 +63,6 @@ AudioRendererImpl::AudioRendererImpl(
audio_buffer_stream_->set_config_change_observer(base::Bind(
&AudioRendererImpl::OnConfigChange, weak_factory_.GetWeakPtr()));
-// Suspend and resume work differently on Android and are handled at a higher
-// level than here. OnSuspend() notifications will be delivered a few seconds
-// after an application is backgrounded, even if it should still be playing.
-// See http://crbug.com/623066 for more details.
-#if !defined(OS_ANDROID)
// Tests may not have a power monitor.
base::PowerMonitor* monitor = base::PowerMonitor::Get();
if (!monitor)
@@ -85,7 +80,7 @@ AudioRendererImpl::AudioRendererImpl(
base::Bind(&base::PowerMonitor::AddObserver,
base::Unretained(monitor), this));
}
-#endif
+
// Do not add anything below this line since the above actions are only safe
// as the last lines of the constructor.
}
@@ -93,10 +88,8 @@ AudioRendererImpl::AudioRendererImpl(
AudioRendererImpl::~AudioRendererImpl() {
DVLOG(1) << __func__;
DCHECK(task_runner_->BelongsToCurrentThread());
-#if !defined(OS_ANDROID)
if (base::PowerMonitor::Get())
base::PowerMonitor::Get()->RemoveObserver(this);
-#endif
// If Render() is in progress, this call will wait for Render() to finish.
// After this call, the |sink_| will not call back into |this| anymore.
« no previous file with comments | « content/renderer/media/peer_connection_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698