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

Unified Diff: media/cast/audio_receiver/audio_receiver.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/cast/audio_receiver/audio_receiver.h
diff --git a/media/cast/audio_receiver/audio_receiver.h b/media/cast/audio_receiver/audio_receiver.h
index b2abfc2f4b04d86c10f8b309234b6370a0aa513f..1503cee7e5ff6351209a8cf1e3fe93d5a9db64de 100644
--- a/media/cast/audio_receiver/audio_receiver.h
+++ b/media/cast/audio_receiver/audio_receiver.h
@@ -115,8 +115,6 @@ class AudioReceiver : public base::NonThreadSafe,
// Processes raw audio events to be sent over to the cast sender via RTCP.
ReceiverRtcpEventSubscriber event_subscriber_;
- base::WeakPtrFactory<AudioReceiver> weak_factory_;
-
const transport::AudioCodec codec_;
const int frequency_;
base::TimeDelta target_delay_delta_;
@@ -140,6 +138,10 @@ class AudioReceiver : public base::NonThreadSafe,
// it allows the event to be transmitted via RTCP.
RtpTimestamp frame_id_to_rtp_timestamp_[256];
+ // NOTE: This must always be last so it's invalidated before other member
+ // variables might be accessed.
Ami GONE FROM CHROMIUM 2014/03/10 22:02:08 Call me crazy but this comment is starting to seem
DaleCurtis 2014/03/10 22:22:40 Seemingly it's only repetitive because you're look
+ base::WeakPtrFactory<AudioReceiver> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(AudioReceiver);
};

Powered by Google App Engine
This is Rietveld 408576698