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

Unified Diff: content/renderer/media/rtc_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: content/renderer/media/rtc_video_decoder.h
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h
index 007f9b0490a3bf38d992ee583eccf91c9f2d7c6f..fa3dbc673f01d40e750549dbf4180837b77f8ebe 100644
--- a/content/renderer/media/rtc_video_decoder.h
+++ b/content/renderer/media/rtc_video_decoder.h
@@ -270,7 +270,8 @@ class CONTENT_EXPORT RTCVideoDecoder
int32 reset_bitstream_buffer_id_;
// Factory used to populate |weak_this_|. Must be destroyed, or invalidated,
- // on |vda_loop_proxy_|.
+ // on |vda_loop_proxy_|. NOTE: This must always be last so it's invalidated
+ // before other member variables might be accessed.
base::WeakPtrFactory<RTCVideoDecoder> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(RTCVideoDecoder);

Powered by Google App Engine
This is Rietveld 408576698