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

Unified Diff: media/filters/vpx_video_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/vpx_video_decoder.h
diff --git a/media/filters/vpx_video_decoder.h b/media/filters/vpx_video_decoder.h
index f206f7cc0f95a619e62ab5895d49b9f0ca3ecdc7..67d131541bf38a817f668d5f55a83c32061f357b 100644
--- a/media/filters/vpx_video_decoder.h
+++ b/media/filters/vpx_video_decoder.h
@@ -68,8 +68,6 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder {
scoped_refptr<VideoFrame>* video_frame);
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- base::WeakPtrFactory<VpxVideoDecoder> weak_factory_;
- base::WeakPtr<VpxVideoDecoder> weak_this_;
DecoderState state_;
@@ -87,6 +85,11 @@ class MEDIA_EXPORT VpxVideoDecoder : public VideoDecoder {
VideoFramePool frame_pool_;
+ // NOTE: These must always be last so they're invalidated before other member
+ // variables might be accessed.
+ base::WeakPtr<VpxVideoDecoder> weak_this_;
Ami GONE FROM CHROMIUM 2014/03/10 22:02:08 ditto
+ base::WeakPtrFactory<VpxVideoDecoder> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(VpxVideoDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698