Revert of Remove webrtc/base/scoped_ptr.h (patchset #3 id:100001 of https://codereview.webrtc.org/1942823002/ )
Reason for revert:
Breaks user code. Said code needs to stop using scoped_ptr!
Original issue's description:
> Remove webrtc/base/scoped_ptr.h
>
> BUG=webrtc:5520
>
> NOTRY=True
>
> Committed: https://crrev.com/65fc62e9dd8a8716db625aaef76ab92f542ecc5a
> Cr-Commit-Position: refs/heads/master@{#12684}
TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5520
Review-Url: https://codereview.webrtc.org/1965063003
Cr-Commit-Position: refs/heads/master@{#12686}
diff --git a/webrtc/api/peerconnectioninterface_unittest.cc b/webrtc/api/peerconnectioninterface_unittest.cc
index 466c402..2594b6c 100644
--- a/webrtc/api/peerconnectioninterface_unittest.cc
+++ b/webrtc/api/peerconnectioninterface_unittest.cc
@@ -934,20 +934,20 @@
ASSERT_TRUE(stream->AddTrack(video_track));
}
- std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() {
+ rtc::scoped_ptr<SessionDescriptionInterface> CreateOfferWithOneAudioStream() {
CreatePeerConnection();
AddVoiceStream(kStreamLabel1);
- std::unique_ptr<SessionDescriptionInterface> offer;
+ rtc::scoped_ptr<SessionDescriptionInterface> offer;
EXPECT_TRUE(DoCreateOffer(&offer, nullptr));
return offer;
}
- std::unique_ptr<SessionDescriptionInterface>
+ rtc::scoped_ptr<SessionDescriptionInterface>
CreateAnswerWithOneAudioStream() {
- std::unique_ptr<SessionDescriptionInterface> offer =
+ rtc::scoped_ptr<SessionDescriptionInterface> offer =
CreateOfferWithOneAudioStream();
EXPECT_TRUE(DoSetRemoteDescription(offer.release()));
- std::unique_ptr<SessionDescriptionInterface> answer;
+ rtc::scoped_ptr<SessionDescriptionInterface> answer;
EXPECT_TRUE(DoCreateAnswer(&answer, nullptr));
return answer;
}
@@ -973,18 +973,18 @@
// The CNAMEs are expected to be generated randomly. It is possible
// that the test fails, though the possibility is very low.
TEST_F(PeerConnectionInterfaceTest, CnameGenerationInOffer) {
- std::unique_ptr<SessionDescriptionInterface> offer1 =
+ rtc::scoped_ptr<SessionDescriptionInterface> offer1 =
CreateOfferWithOneAudioStream();
- std::unique_ptr<SessionDescriptionInterface> offer2 =
+ rtc::scoped_ptr<SessionDescriptionInterface> offer2 =
CreateOfferWithOneAudioStream();
EXPECT_NE(GetFirstAudioStreamCname(offer1.get()),
GetFirstAudioStreamCname(offer2.get()));
}
TEST_F(PeerConnectionInterfaceTest, CnameGenerationInAnswer) {
- std::unique_ptr<SessionDescriptionInterface> answer1 =
+ rtc::scoped_ptr<SessionDescriptionInterface> answer1 =
CreateAnswerWithOneAudioStream();
- std::unique_ptr<SessionDescriptionInterface> answer2 =
+ rtc::scoped_ptr<SessionDescriptionInterface> answer2 =
CreateAnswerWithOneAudioStream();
EXPECT_NE(GetFirstAudioStreamCname(answer1.get()),
GetFirstAudioStreamCname(answer2.get()));