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

Unified Diff: media/cast/sender/audio_sender.cc

Issue 2867013003: Remove base::SupportsWeakPtr from {Audio,Video}Sender (Closed)
Patch Set: Remove base::SupportsWeakPtr Created 3 years, 7 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/cast/sender/audio_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/sender/audio_sender.cc
diff --git a/media/cast/sender/audio_sender.cc b/media/cast/sender/audio_sender.cc
index 1dee7bcb876bc0addf52488d14b723c5839f5cb7..13db1005bfea12aac2240e51e09754e2e0084a86 100644
--- a/media/cast/sender/audio_sender.cc
+++ b/media/cast/sender/audio_sender.cc
@@ -30,8 +30,8 @@ AudioSender::AudioSender(scoped_refptr<CastEnvironment> cast_environment,
audio_encoder_.reset(new AudioEncoder(
cast_environment, audio_config.channels, audio_config.rtp_timebase,
audio_config.max_bitrate, audio_config.codec,
- base::Bind(&AudioSender::OnEncodedAudioFrame,
- weak_factory_.GetWeakPtr(), audio_config.max_bitrate)));
+ base::Bind(&AudioSender::OnEncodedAudioFrame, AsWeakPtr(),
+ audio_config.max_bitrate)));
}
// AudioEncoder provides no operational status changes during normal use.
@@ -72,6 +72,10 @@ void AudioSender::InsertAudio(std::unique_ptr<AudioBus> audio_bus,
audio_encoder_->InsertAudio(std::move(audio_bus), recorded_time);
}
+base::WeakPtr<AudioSender> AudioSender::AsWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
int AudioSender::GetNumberOfFramesInEncoder() const {
// Note: It's possible for a partial frame to be in the encoder, but returning
// the floor() is good enough for the "design limit" check in FrameSender.
« no previous file with comments | « media/cast/sender/audio_sender.h ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698