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

Unified Diff: pc/peerconnection.cc

Issue 3007973002: Mark template class RefCountedObject as final.
Patch Set: Rebased. Created 3 years, 3 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: pc/peerconnection.cc
diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc
index 91d0c90a12b2e729de5138c7a95f04e62b8a852e..d5110acc45d33ce97bf43bdb98e901c6b17c2a29 100644
--- a/pc/peerconnection.cc
+++ b/pc/peerconnection.cc
@@ -621,8 +621,9 @@ rtc::scoped_refptr<RtpSenderInterface> PeerConnection::AddTrack(
if (track->kind() == MediaStreamTrackInterface::kAudioKind) {
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(),
- new AudioRtpSender(static_cast<AudioTrackInterface*>(track),
- session_->voice_channel(), stats_.get()));
+ new rtc::RefCountedObject<AudioRtpSender>(
+ static_cast<AudioTrackInterface*>(track),
+ session_->voice_channel(), stats_.get()));
if (!streams.empty()) {
new_sender->internal()->set_stream_id(streams[0]->label());
}
@@ -634,8 +635,9 @@ rtc::scoped_refptr<RtpSenderInterface> PeerConnection::AddTrack(
} else if (track->kind() == MediaStreamTrackInterface::kVideoKind) {
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(),
- new VideoRtpSender(static_cast<VideoTrackInterface*>(track),
- session_->video_channel()));
+ new rtc::RefCountedObject<VideoRtpSender>(
+ static_cast<VideoTrackInterface*>(track),
+ session_->video_channel()));
if (!streams.empty()) {
new_sender->internal()->set_stream_id(streams[0]->label());
}
@@ -702,10 +704,12 @@ rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender(
if (kind == MediaStreamTrackInterface::kAudioKind) {
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(),
- new AudioRtpSender(session_->voice_channel(), stats_.get()));
+ new rtc::RefCountedObject<AudioRtpSender>(
+ session_->voice_channel(), stats_.get()));
} else if (kind == MediaStreamTrackInterface::kVideoKind) {
new_sender = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- signaling_thread(), new VideoRtpSender(session_->video_channel()));
+ signaling_thread(), new rtc::RefCountedObject<VideoRtpSender>(
+ session_->video_channel()));
} else {
LOG(LS_ERROR) << "CreateSender called with invalid kind: " << kind;
return new_sender;
@@ -1422,7 +1426,8 @@ void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream,
rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
signaling_thread(),
- new AudioRtpReceiver(track_id, ssrc, session_->voice_channel()));
+ new rtc::RefCountedObject<AudioRtpReceiver>(
+ track_id, ssrc, session_->voice_channel()));
stream->AddTrack(
static_cast<AudioTrackInterface*>(receiver->internal()->track().get()));
receivers_.push_back(receiver);
@@ -1437,8 +1442,9 @@ void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream,
rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
signaling_thread(),
- new VideoRtpReceiver(track_id, factory_->worker_thread(), ssrc,
- session_->video_channel()));
+ new rtc::RefCountedObject<VideoRtpReceiver>(
+ track_id, factory_->worker_thread(), ssrc,
+ session_->video_channel()));
stream->AddTrack(
static_cast<VideoTrackInterface*>(receiver->internal()->track().get()));
receivers_.push_back(receiver);
@@ -1475,8 +1481,9 @@ void PeerConnection::AddAudioTrack(AudioTrackInterface* track,
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender =
RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
signaling_thread(),
- new AudioRtpSender(track, {stream->label()},
- session_->voice_channel(), stats_.get()));
+ new rtc::RefCountedObject<AudioRtpSender>(
+ track, std::vector<std::string>({stream->label()}),
+ session_->voice_channel(), stats_.get()));
senders_.push_back(new_sender);
// If the sender has already been configured in SDP, we call SetSsrc,
// which will connect the sender to the underlying transport. This can
@@ -1520,8 +1527,10 @@ void PeerConnection::AddVideoTrack(VideoTrackInterface* track,
// Normal case; we've never seen this track before.
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender =
RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
- signaling_thread(), new VideoRtpSender(track, {stream->label()},
- session_->video_channel()));
+ signaling_thread(), new rtc::RefCountedObject<VideoRtpSender>(
+ track,
+ std::vector<std::string>({stream->label()}),
+ session_->video_channel()));
senders_.push_back(new_sender);
const TrackInfo* track_info =
FindTrackInfo(local_video_tracks_, stream->label(), track->id());

Powered by Google App Engine
This is Rietveld 408576698