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

Unified Diff: webrtc/pc/webrtcsession.cc

Issue 2748253003: Pass ownership of candidate to PeerConnection::OnIceCandidate (Closed)
Patch Set: Pass ownership through std::unique_ptr Created 3 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 | « webrtc/pc/webrtcsession.h ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/webrtcsession.cc
diff --git a/webrtc/pc/webrtcsession.cc b/webrtc/pc/webrtcsession.cc
index 78078e169c115101fb9c25aa541f84457c37c81e..c6046e905fd48e3a57b98315d49bebe091b56dfd 100644
--- a/webrtc/pc/webrtcsession.cc
+++ b/webrtc/pc/webrtcsession.cc
@@ -1502,12 +1502,13 @@ void WebRtcSession::OnTransportControllerCandidatesGathered(
for (cricket::Candidates::const_iterator citer = candidates.begin();
citer != candidates.end(); ++citer) {
// Use transport_name as the candidate media id.
- JsepIceCandidate candidate(transport_name, sdp_mline_index, *citer);
- if (ice_observer_) {
- ice_observer_->OnIceCandidate(&candidate);
- }
+ std::unique_ptr<JsepIceCandidate> candidate(
+ new JsepIceCandidate(transport_name, sdp_mline_index, *citer));
if (local_description()) {
- mutable_local_description()->AddCandidate(&candidate);
+ mutable_local_description()->AddCandidate(candidate.get());
+ }
+ if (ice_observer_) {
+ ice_observer_->OnIceCandidate(std::move(candidate));
}
}
}
« no previous file with comments | « webrtc/pc/webrtcsession.h ('k') | webrtc/pc/webrtcsession_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698