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

Unified Diff: media/filters/gpu_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/gpu_video_decoder.h
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h
index d46e1784dd8e92f20581adf2e9dea1ca9557e826..d08eafbc75f343b33eee5bee6eae0f7f755a52eb 100644
--- a/media/filters/gpu_video_decoder.h
+++ b/media/filters/gpu_video_decoder.h
@@ -130,10 +130,6 @@ class MEDIA_EXPORT GpuVideoDecoder
bool needs_bitstream_conversion_;
- // Bound to factories_->GetMessageLoop().
- base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
- base::WeakPtr<GpuVideoDecoder> weak_this_;
-
scoped_refptr<GpuVideoAcceleratorFactories> factories_;
// Populated during Initialize() (on success) and unchanged until an error
@@ -188,6 +184,11 @@ class MEDIA_EXPORT GpuVideoDecoder
// HasAvailableOutputFrames().
int available_pictures_;
+ // Bound to factories_->GetMessageLoop(). NOTE: These must always be last so
+ // they're invalidated before other member variables might be accessed.
+ base::WeakPtr<GpuVideoDecoder> weak_this_;
Ami GONE FROM CHROMIUM 2014/03/10 22:02:08 ditto
+ base::WeakPtrFactory<GpuVideoDecoder> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GpuVideoDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698