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

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 14348007: Reland: Remove reference counting from media::VideoDecoder and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 8 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/vpx_video_decoder.h ('k') | media/tools/player_x11/player_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 0b92a7d8459c4e152bbd7261b56ce7dcc1c32ffe..baab01741ab4a49bd3a02df5e400b0b80bbf0d12 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -58,6 +58,7 @@ static int GetThreadCount() {
VpxVideoDecoder::VpxVideoDecoder(
const scoped_refptr<base::MessageLoopProxy>& message_loop)
: message_loop_(message_loop),
+ weak_factory_(this),
state_(kUninitialized),
vpx_codec_(NULL) {
}
@@ -73,6 +74,7 @@ void VpxVideoDecoder::Initialize(
const StatisticsCB& statistics_cb) {
DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK(!demuxer_stream_) << "Already initialized.";
+ weak_this_ = weak_factory_.GetWeakPtr();
if (!stream) {
status_cb.Run(PIPELINE_ERROR_DECODE);
@@ -182,7 +184,7 @@ void VpxVideoDecoder::ReadFromDemuxerStream() {
DCHECK(!read_cb_.is_null());
demuxer_stream_->Read(base::Bind(
- &VpxVideoDecoder::DoDecryptOrDecodeBuffer, this));
+ &VpxVideoDecoder::DoDecryptOrDecodeBuffer, weak_this_));
}
void VpxVideoDecoder::DoDecryptOrDecodeBuffer(
« no previous file with comments | « media/filters/vpx_video_decoder.h ('k') | media/tools/player_x11/player_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698