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

Unified Diff: media/filters/decrypting_demuxer_stream.cc

Issue 163433004: Stop DecryptingDemuxerStream in AudioRendererImpl::Stop(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 10 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.cc ('k') | media/filters/decrypting_demuxer_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_demuxer_stream.cc
diff --git a/media/filters/decrypting_demuxer_stream.cc b/media/filters/decrypting_demuxer_stream.cc
index 988d5308edccff7b58e17cfe28cbf162578987c8..1598be6870a850ff8fbae006ee8f17cbdd2e456e 100644
--- a/media/filters/decrypting_demuxer_stream.cc
+++ b/media/filters/decrypting_demuxer_stream.cc
@@ -116,7 +116,8 @@ void DecryptingDemuxerStream::Stop(const base::Closure& closure) {
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(state_ != kUninitialized) << state_;
- // Invalidate all weak pointers so that pending callbacks won't fire.
+ // Invalidate all weak pointers so that pending callbacks won't be fired into
+ // this object.
weak_factory_.InvalidateWeakPtrs();
// At this point the render thread is likely paused (in WebMediaPlayerImpl's
@@ -124,6 +125,9 @@ void DecryptingDemuxerStream::Stop(const base::Closure& closure) {
// render thread to process messages to complete (such as PPAPI methods).
if (decryptor_) {
// Clear the callback.
+ // TODO(xhwang): Since we invalidate all weak pointers during Stop(),
+ // canceling NewKeyCB seems unnecessary. Clean this up in all Decrypting*
+ // classes.
decryptor_->RegisterNewKeyCB(GetDecryptorStreamType(),
Decryptor::NewKeyCB());
decryptor_->CancelDecrypt(GetDecryptorStreamType());
« no previous file with comments | « media/filters/decoder_selector.cc ('k') | media/filters/decrypting_demuxer_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698