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

Unified Diff: webrtc/pc/peerconnection.h

Issue 2882803002: Initialize PeerConnection members in declaration order and destroy them in reverse order. (Closed)
Patch Set: 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 | « no previous file | webrtc/pc/peerconnection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnection.h
diff --git a/webrtc/pc/peerconnection.h b/webrtc/pc/peerconnection.h
index 23e7e8e58b083b035872dd137efeeb4f2e82bf92..1e2ca3bb95487baa5d519967c3237314c0726c6c 100644
--- a/webrtc/pc/peerconnection.h
+++ b/webrtc/pc/peerconnection.h
@@ -402,14 +402,16 @@ class PeerConnection : public PeerConnectionInterface,
rtc::scoped_refptr<PeerConnectionFactory> factory_;
PeerConnectionObserver* observer_;
UMAObserver* uma_observer_;
+
+ // The EventLog needs to outlive |call_| (and any other object that uses it).
+ std::unique_ptr<RtcEventLog> event_log_;
+
SignalingState signaling_state_;
IceConnectionState ice_connection_state_;
IceGatheringState ice_gathering_state_;
PeerConnectionInterface::RTCConfiguration configuration_;
std::unique_ptr<cricket::PortAllocator> port_allocator_;
- // The EventLog needs to outlive |call_|.
- std::unique_ptr<RtcEventLog> event_log_;
// One PeerConnection has only one RTCP CNAME.
// https://tools.ietf.org/html/draft-ietf-rtcweb-rtp-usage-26#section-4.9
@@ -436,15 +438,16 @@ class PeerConnection : public PeerConnectionInterface,
bool remote_peer_supports_msid_ = false;
+ std::unique_ptr<Call> call_;
+ std::unique_ptr<WebRtcSession> session_;
+ std::unique_ptr<StatsCollector> stats_; // A pointer is passed to senders_
+ rtc::scoped_refptr<RTCStatsCollector> stats_collector_;
+
std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
senders_;
std::vector<
rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
receivers_;
- std::unique_ptr<WebRtcSession> session_;
- std::unique_ptr<Call> call_;
- std::unique_ptr<StatsCollector> stats_;
- rtc::scoped_refptr<RTCStatsCollector> stats_collector_;
};
} // namespace webrtc
« no previous file with comments | « no previous file | webrtc/pc/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698