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

Side by Side Diff: media/cast/audio_sender/audio_sender.cc

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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/cast/audio_sender/audio_sender.h" 5 #include "media/cast/audio_sender/audio_sender.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/cast/audio_sender/audio_encoder.h" 10 #include "media/cast/audio_sender/audio_encoder.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 rtp_timestamp_ = rtp_timestamp; 79 rtp_timestamp_ = rtp_timestamp;
80 } 80 }
81 81
82 private: 82 private:
83 transport::CastTransportSender* const transport_sender_; 83 transport::CastTransportSender* const transport_sender_;
84 int frequency_; 84 int frequency_;
85 transport::RtcpSenderInfo sender_info_; 85 transport::RtcpSenderInfo sender_info_;
86 base::TimeTicks time_sent_; 86 base::TimeTicks time_sent_;
87 uint32 rtp_timestamp_; 87 uint32 rtp_timestamp_;
88 88
89 // NOTE: This must always be last so it's invalidated before other member
90 // variables might be accessed.
89 base::WeakPtrFactory<LocalRtpSenderStatistics> weak_factory_; 91 base::WeakPtrFactory<LocalRtpSenderStatistics> weak_factory_;
90 92
91 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalRtpSenderStatistics); 93 DISALLOW_IMPLICIT_CONSTRUCTORS(LocalRtpSenderStatistics);
92 }; 94 };
93 95
94 // TODO(mikhal): Reduce heap allocation when not needed. 96 // TODO(mikhal): Reduce heap allocation when not needed.
95 AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment, 97 AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment,
96 const AudioSenderConfig& audio_config, 98 const AudioSenderConfig& audio_config,
97 transport::CastTransportSender* const transport_sender) 99 transport::CastTransportSender* const transport_sender)
98 : cast_environment_(cast_environment), 100 : cast_environment_(cast_environment),
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 208 }
207 209
208 void AudioSender::ResendPacketsOnTransportThread( 210 void AudioSender::ResendPacketsOnTransportThread(
209 const transport::MissingFramesAndPacketsMap& missing_packets) { 211 const transport::MissingFramesAndPacketsMap& missing_packets) {
210 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT)); 212 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::TRANSPORT));
211 transport_sender_->ResendPackets(true, missing_packets); 213 transport_sender_->ResendPackets(true, missing_packets);
212 } 214 }
213 215
214 } // namespace cast 216 } // namespace cast
215 } // namespace media 217 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698