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

Unified Diff: media/audio/alsa/alsa_output.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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
« no previous file with comments | « media/audio/alsa/alsa_input.cc ('k') | media/audio/alsa/alsa_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/alsa/alsa_output.h
diff --git a/media/audio/alsa/alsa_output.h b/media/audio/alsa/alsa_output.h
index 65a23f751247fd2d7e4a5afb7f5442e5fb204c9d..180564584c299b151d644eb06435ae47720e3e0c 100644
--- a/media/audio/alsa/alsa_output.h
+++ b/media/audio/alsa/alsa_output.h
@@ -201,10 +201,6 @@ class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
scoped_ptr<media::SeekableBuffer> buffer_;
uint32 frames_per_packet_;
- // Allows us to run tasks on the AlsaPcmOutputStream instance which are
- // bound by its lifetime.
- base::WeakPtrFactory<AlsaPcmOutputStream> weak_factory_;
-
InternalState state_;
float volume_; // Volume level from 0.0 to 1.0.
@@ -217,6 +213,11 @@ class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream {
scoped_ptr<ChannelMixer> channel_mixer_;
scoped_ptr<AudioBus> mixed_audio_bus_;
+ // Allows us to run tasks on the AlsaPcmOutputStream instance which are
+ // bound by its lifetime.
+ // NOTE: Weak pointers must be invalidated before all other member variables.
+ base::WeakPtrFactory<AlsaPcmOutputStream> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream);
};
« no previous file with comments | « media/audio/alsa/alsa_input.cc ('k') | media/audio/alsa/alsa_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698