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

Unified Diff: media/filters/ffmpeg_audio_decoder.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
Index: media/filters/ffmpeg_audio_decoder.h
diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h
index 42bce45109ab5a5b82d2002a0356dac5fdc6660e..eac899b687e16ce26e22c0f97d7b853b3dd0ff04 100644
--- a/media/filters/ffmpeg_audio_decoder.h
+++ b/media/filters/ffmpeg_audio_decoder.h
@@ -68,8 +68,6 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
bool skip_eos_append);
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- base::WeakPtrFactory<FFmpegAudioDecoder> weak_factory_;
- base::WeakPtr<FFmpegAudioDecoder> weak_this_;
DemuxerStream* demuxer_stream_;
StatisticsCB statistics_cb_;
@@ -103,6 +101,11 @@ class MEDIA_EXPORT FFmpegAudioDecoder : public AudioDecoder {
// them up and hand them out as we receive Read() calls.
std::list<QueuedAudioBuffer> queued_audio_;
+ // NOTE: These must always be last so they're invalidated before other member
+ // variables might be accessed.
+ base::WeakPtr<FFmpegAudioDecoder> weak_this_;
Ami GONE FROM CHROMIUM 2014/03/10 22:02:08 ditto
+ base::WeakPtrFactory<FFmpegAudioDecoder> weak_factory_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698