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-Commit-Position: refs/heads/master@{#12530}
diff --git a/webrtc/api/peerconnectionfactoryproxy.h b/webrtc/api/peerconnectionfactoryproxy.h
index ef47cdb..f60f9e9 100644
--- a/webrtc/api/peerconnectionfactoryproxy.h
+++ b/webrtc/api/peerconnectionfactoryproxy.h
@@ -11,6 +11,7 @@
#ifndef WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_
#define WEBRTC_API_PEERCONNECTIONFACTORYPROXY_H_
+#include <memory>
#include <string>
#include <utility>
@@ -22,13 +23,13 @@
BEGIN_SIGNALING_PROXY_MAP(PeerConnectionFactory)
PROXY_METHOD1(void, SetOptions, const Options&)
- // Can't use PROXY_METHOD5 because scoped_ptr must be moved.
- // TODO(tommi,hbos): Use of templates to support scoped_ptr?
+ // Can't use PROXY_METHOD5 because unique_ptr must be moved.
+ // TODO(tommi,hbos): Use of templates to support unique_ptr?
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& a1,
const MediaConstraintsInterface* a2,
- rtc::scoped_ptr<cricket::PortAllocator> a3,
- rtc::scoped_ptr<DtlsIdentityStoreInterface> a4,
+ std::unique_ptr<cricket::PortAllocator> a3,
+ std::unique_ptr<DtlsIdentityStoreInterface> a4,
PeerConnectionObserver* a5) override {
return signaling_thread_
->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>(
@@ -37,8 +38,8 @@
}
rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& a1,
- rtc::scoped_ptr<cricket::PortAllocator> a3,
- rtc::scoped_ptr<DtlsIdentityStoreInterface> a4,
+ std::unique_ptr<cricket::PortAllocator> a3,
+ std::unique_ptr<DtlsIdentityStoreInterface> a4,
PeerConnectionObserver* a5) override {
return signaling_thread_
->Invoke<rtc::scoped_refptr<PeerConnectionInterface>>(
@@ -77,8 +78,8 @@
cricket::PortAllocator* a3,
DtlsIdentityStoreInterface* a4,
PeerConnectionObserver* a5) {
- rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3);
- rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
+ std::unique_ptr<cricket::PortAllocator> ptr_a3(a3);
+ std::unique_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
return c_->CreatePeerConnection(a1, a2, std::move(ptr_a3),
std::move(ptr_a4), a5);
}
@@ -88,8 +89,8 @@
cricket::PortAllocator* a3,
DtlsIdentityStoreInterface* a4,
PeerConnectionObserver* a5) {
- rtc::scoped_ptr<cricket::PortAllocator> ptr_a3(a3);
- rtc::scoped_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
+ std::unique_ptr<cricket::PortAllocator> ptr_a3(a3);
+ std::unique_ptr<DtlsIdentityStoreInterface> ptr_a4(a4);
return c_->CreatePeerConnection(a1, std::move(ptr_a3), std::move(ptr_a4),
a5);
}