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

Unified Diff: media/filters/decoder_selector.cc

Issue 398163004: Fold DecoderSelector::Abort() into the dtor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 5 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 | « media/filters/decoder_selector.h ('k') | media/filters/decoder_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decoder_selector.cc
diff --git a/media/filters/decoder_selector.cc b/media/filters/decoder_selector.cc
index 908bb5525be2abeee7e6d0d4b4cb2d7e30559d2a..7214b338be6b5bbdfb369029dcba014e589383cc 100644
--- a/media/filters/decoder_selector.cc
+++ b/media/filters/decoder_selector.cc
@@ -62,7 +62,13 @@ DecoderSelector<StreamType>::DecoderSelector(
template <DemuxerStream::Type StreamType>
DecoderSelector<StreamType>::~DecoderSelector() {
DVLOG(2) << __FUNCTION__;
- DCHECK(select_decoder_cb_.is_null());
+ DCHECK(task_runner_->BelongsToCurrentThread());
+
+ if (!select_decoder_cb_.is_null())
+ ReturnNullDecoder();
+
+ decoder_.reset();
+ decrypted_stream_.reset();
}
template <DemuxerStream::Type StreamType>
@@ -112,21 +118,6 @@ void DecoderSelector<StreamType>::SelectDecoder(
}
template <DemuxerStream::Type StreamType>
-void DecoderSelector<StreamType>::Abort() {
- DVLOG(2) << __FUNCTION__;
- DCHECK(task_runner_->BelongsToCurrentThread());
-
- // Invalidate all weak pointers so that pending callbacks won't fire.
- weak_ptr_factory_.InvalidateWeakPtrs();
-
- decoder_.reset();
- decrypted_stream_.reset();
-
- if (!select_decoder_cb_.is_null())
- ReturnNullDecoder();
-}
-
-template <DemuxerStream::Type StreamType>
void DecoderSelector<StreamType>::DecryptingDecoderInitDone(
PipelineStatus status) {
DVLOG(2) << __FUNCTION__;
« no previous file with comments | « media/filters/decoder_selector.h ('k') | media/filters/decoder_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698