Replace scoped_ptr with unique_ptr in webrtc/api/
But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.
BUG=webrtc:5520
Review URL: https://codereview.webrtc.org/1930463002
Cr-Original-Commit-Position: refs/heads/master@{#12530}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: d1fe281e12efd938683eae470bf01ce0d5ed3f9d
diff --git a/api/peerconnection.h b/api/peerconnection.h
index 1574af6..b557715 100644
--- a/api/peerconnection.h
+++ b/api/peerconnection.h
@@ -13,6 +13,7 @@
#include <string>
#include <map>
+#include <memory>
#include <vector>
#include "webrtc/api/dtlsidentitystore.h"
@@ -69,8 +70,8 @@
bool Initialize(
const PeerConnectionInterface::RTCConfiguration& configuration,
- rtc::scoped_ptr<cricket::PortAllocator> allocator,
- rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
+ std::unique_ptr<cricket::PortAllocator> allocator,
+ std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store,
PeerConnectionObserver* observer);
rtc::scoped_refptr<StreamCollectionInterface> local_streams() override;
@@ -365,15 +366,15 @@
IceConnectionState ice_connection_state_;
IceGatheringState ice_gathering_state_;
- rtc::scoped_ptr<cricket::PortAllocator> port_allocator_;
- rtc::scoped_ptr<MediaControllerInterface> media_controller_;
+ std::unique_ptr<cricket::PortAllocator> port_allocator_;
+ std::unique_ptr<MediaControllerInterface> media_controller_;
// Streams added via AddStream.
rtc::scoped_refptr<StreamCollection> local_streams_;
// Streams created as a result of SetRemoteDescription.
rtc::scoped_refptr<StreamCollection> remote_streams_;
- std::vector<rtc::scoped_ptr<MediaStreamObserver>> stream_observers_;
+ std::vector<std::unique_ptr<MediaStreamObserver>> stream_observers_;
// These lists store track info seen in local/remote descriptions.
TrackInfos remote_audio_tracks_;
@@ -392,12 +393,12 @@
std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders_;
std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers_;
- // The session_ scoped_ptr is declared at the bottom of PeerConnection
+ // The session_ unique_ptr is declared at the bottom of PeerConnection
// because its destruction fires signals (such as VoiceChannelDestroyed)
// which will trigger some final actions in PeerConnection...
- rtc::scoped_ptr<WebRtcSession> session_;
+ std::unique_ptr<WebRtcSession> session_;
// ... But stats_ depends on session_ so it should be destroyed even earlier.
- rtc::scoped_ptr<StatsCollector> stats_;
+ std::unique_ptr<StatsCollector> stats_;
};
} // namespace webrtc