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}
This commit is contained in:
kwiberg
2016-04-27 06:47:29 -07:00
committed by Commit bot
parent 034154b46a
commit d1fe281e12
46 changed files with 361 additions and 341 deletions

View File

@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <memory>
#include <string>
#include <utility>
@ -19,7 +20,6 @@
#include "webrtc/api/test/fakedtlsidentitystore.h"
#include "webrtc/api/test/fakevideotrackrenderer.h"
#include "webrtc/base/gunit.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/thread.h"
#include "webrtc/media/base/fakevideocapturer.h"
#include "webrtc/media/engine/webrtccommon.h"
@ -122,7 +122,7 @@ class PeerConnectionFactoryTest : public testing::Test {
rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
NullPeerConnectionObserver observer_;
rtc::scoped_ptr<cricket::FakePortAllocator> port_allocator_;
std::unique_ptr<cricket::FakePortAllocator> port_allocator_;
// Since the PC owns the port allocator after it's been initialized,
// this should only be used when known to be safe.
cricket::FakePortAllocator* raw_port_allocator_;
@ -141,7 +141,7 @@ TEST(PeerConnectionFactoryTestInternal, CreatePCUsingInternalModules) {
NullPeerConnectionObserver observer;
webrtc::PeerConnectionInterface::RTCConfiguration config;
rtc::scoped_ptr<FakeDtlsIdentityStore> dtls_identity_store(
std::unique_ptr<FakeDtlsIdentityStore> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory->CreatePeerConnection(
config, nullptr, nullptr, std::move(dtls_identity_store), &observer));
@ -162,7 +162,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServers) {
ice_server.uri = kTurnIceServerWithTransport;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),
@ -192,7 +192,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIceServersUrls) {
ice_server.urls.push_back(kTurnIceServerWithTransport);
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),
@ -221,7 +221,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingNoUsernameInUri) {
ice_server.username = kTurnUsername;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),
@ -242,7 +242,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingTurnUrlWithTransportParam) {
ice_server.uri = kTurnIceServerWithTransport;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),
@ -267,7 +267,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingSecureTurnUrl) {
ice_server.uri = kSecureTurnIceServerWithoutTransportAndPortParam;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),
@ -302,7 +302,7 @@ TEST_F(PeerConnectionFactoryTest, CreatePCUsingIPLiteralAddress) {
ice_server.uri = kTurnIceServerWithIPv6Address;
ice_server.password = kTurnPassword;
config.servers.push_back(ice_server);
rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
std::unique_ptr<DtlsIdentityStoreInterface> dtls_identity_store(
new FakeDtlsIdentityStore());
rtc::scoped_refptr<PeerConnectionInterface> pc(factory_->CreatePeerConnection(
config, nullptr, std::move(port_allocator_),