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

Unified Diff: media/filters/fake_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/fake_video_decoder.h
diff --git a/media/filters/fake_video_decoder.h b/media/filters/fake_video_decoder.h
index bd0b28450a917ddd6a47b285a058fce364f41616..ead2f0c3a7b09639bcbd7949e8843b194185fd4a 100644
--- a/media/filters/fake_video_decoder.h
+++ b/media/filters/fake_video_decoder.h
@@ -72,8 +72,6 @@ class FakeVideoDecoder : public VideoDecoder {
void DoStop();
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- base::WeakPtrFactory<FakeVideoDecoder> weak_factory_;
- base::WeakPtr<FakeVideoDecoder> weak_this_;
const int decoding_delay_;
@@ -90,6 +88,11 @@ class FakeVideoDecoder : public VideoDecoder {
int total_bytes_decoded_;
+ // NOTE: These must always be last so they're invalidated before other member
+ // variables might be accessed.
+ base::WeakPtr<FakeVideoDecoder> weak_this_;
+ base::WeakPtrFactory<FakeVideoDecoder> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(FakeVideoDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698