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

Unified Diff: media/filters/decrypting_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/decrypting_audio_decoder.h
diff --git a/media/filters/decrypting_audio_decoder.h b/media/filters/decrypting_audio_decoder.h
index 5d9c4da243580620650c3a5083a8d6dcc64b1eef..d801078c1ab023d8a9f311da8881f1f0959e7cac 100644
--- a/media/filters/decrypting_audio_decoder.h
+++ b/media/filters/decrypting_audio_decoder.h
@@ -108,8 +108,6 @@ class MEDIA_EXPORT DecryptingAudioDecoder : public AudioDecoder {
void EnqueueFrames(const Decryptor::AudioBuffers& frames);
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
- base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_;
- base::WeakPtr<DecryptingAudioDecoder> weak_this_;
State state_;
@@ -146,6 +144,11 @@ class MEDIA_EXPORT DecryptingAudioDecoder : public AudioDecoder {
scoped_ptr<AudioTimestampHelper> timestamp_helper_;
+ // NOTE: These must always be last so they're invalidated before other member
+ // variables might be accessed.
+ base::WeakPtr<DecryptingAudioDecoder> weak_this_;
+ base::WeakPtrFactory<DecryptingAudioDecoder> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder);
};

Powered by Google App Engine
This is Rietveld 408576698