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

Unified Diff: media/audio/audio_output_dispatcher_impl.cc

Issue 2570923002: Makes AudioOutputDispatcher non-ref-counted. (Closed)
Patch Set: Created 4 years 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 | « media/audio/audio_output_dispatcher_impl.h ('k') | media/audio/audio_output_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_dispatcher_impl.cc
diff --git a/media/audio/audio_output_dispatcher_impl.cc b/media/audio/audio_output_dispatcher_impl.cc
index f50748c905d5071865ce01c32f7309f1b9c3b9d7..b538acde82cdb67b8a9117f0ba4b530091a2ddcc 100644
--- a/media/audio/audio_output_dispatcher_impl.cc
+++ b/media/audio/audio_output_dispatcher_impl.cc
@@ -32,6 +32,12 @@ AudioOutputDispatcherImpl::AudioOutputDispatcherImpl(
audio_stream_id_(0) {}
AudioOutputDispatcherImpl::~AudioOutputDispatcherImpl() {
+ CHECK(task_runner_->BelongsToCurrentThread());
+
+ // Close all idle streams immediately. The |close_timer_| will handle
+ // invalidating any outstanding tasks upon its destruction.
+ CloseAllIdleStreams();
+
// There must be no idle proxy streams.
CHECK_EQ(idle_proxies_, 0u);
@@ -122,24 +128,6 @@ void AudioOutputDispatcherImpl::CloseStream(AudioOutputProxy* stream_proxy) {
close_timer_.Reset();
}
-void AudioOutputDispatcherImpl::Shutdown() {
- DCHECK(task_runner_->BelongsToCurrentThread());
-
- // Close all idle streams immediately. The |close_timer_| will handle
- // invalidating any outstanding tasks upon its destruction.
- CloseAllIdleStreams();
-
- // No AudioOutputProxy objects should hold a reference to us when we get
- // to this stage.
- DCHECK(HasOneRef()) << "Only the AudioManager should hold a reference";
-
- LOG_IF(WARNING, idle_proxies_ > 0u) << "Idle proxy streams during shutdown: "
- << idle_proxies_;
- LOG_IF(WARNING, !proxy_to_physical_map_.empty())
- << "Active proxy streams during shutdown: "
- << proxy_to_physical_map_.size();
-}
-
bool AudioOutputDispatcherImpl::HasOutputProxies() const {
return idle_proxies_ || !proxy_to_physical_map_.empty();
}
« no previous file with comments | « media/audio/audio_output_dispatcher_impl.h ('k') | media/audio/audio_output_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698