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

Unified Diff: webrtc/p2p/quic/quicsession_unittest.cc

Issue 1923163003: Replace scoped_ptr with unique_ptr in webrtc/p2p/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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 | « webrtc/p2p/quic/quicsession.cc ('k') | webrtc/p2p/quic/quictransportchannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/quic/quicsession_unittest.cc
diff --git a/webrtc/p2p/quic/quicsession_unittest.cc b/webrtc/p2p/quic/quicsession_unittest.cc
index 04b7d1ee7faa1b948844e2b8cf8d2df6ed4c89ca..eae0a2b451b0ca69a708134dbb1f8db89e74be89 100644
--- a/webrtc/p2p/quic/quicsession_unittest.cc
+++ b/webrtc/p2p/quic/quicsession_unittest.cc
@@ -10,6 +10,7 @@
#include "webrtc/p2p/quic/quicsession.h"
+#include <memory>
#include <string>
#include <vector>
@@ -117,7 +118,7 @@ class FakeProofVerifier : public net::ProofVerifier {
const std::string& signature,
const net::ProofVerifyContext* verify_context,
std::string* error_details,
- scoped_ptr<net::ProofVerifyDetails>* verify_details,
+ std::unique_ptr<net::ProofVerifyDetails>* verify_details,
net::ProofVerifierCallback* callback) override {
return success_ ? net::QUIC_SUCCESS : net::QUIC_FAILURE;
}
@@ -179,9 +180,9 @@ class FakeQuicPacketWriter : public QuicPacketWriter {
// Wrapper for QuicSession and transport channel that stores incoming data.
class QuicSessionForTest : public QuicSession {
public:
- QuicSessionForTest(rtc::scoped_ptr<net::QuicConnection> connection,
+ QuicSessionForTest(std::unique_ptr<net::QuicConnection> connection,
const net::QuicConfig& config,
- rtc::scoped_ptr<FakeTransportChannel> channel)
+ std::unique_ptr<FakeTransportChannel> channel)
: QuicSession(std::move(connection), config),
channel_(std::move(channel)) {
channel_->SignalReadPacket.connect(
@@ -219,7 +220,7 @@ class QuicSessionForTest : public QuicSession {
private:
// Transports QUIC packets to/from peer.
- rtc::scoped_ptr<FakeTransportChannel> channel_;
+ std::unique_ptr<FakeTransportChannel> channel_;
// Stores data received by peer once it is sent from the other peer.
std::string last_received_data_;
// Handles incoming streams from sender.
@@ -235,8 +236,8 @@ class QuicSessionTest : public ::testing::Test,
// Instantiates |client_peer_| and |server_peer_|.
void CreateClientAndServerSessions();
- rtc::scoped_ptr<QuicSessionForTest> CreateSession(
- rtc::scoped_ptr<FakeTransportChannel> channel,
+ std::unique_ptr<QuicSessionForTest> CreateSession(
+ std::unique_ptr<FakeTransportChannel> channel,
Perspective perspective);
QuicCryptoClientStream* CreateCryptoClientStream(QuicSessionForTest* session,
@@ -244,7 +245,7 @@ class QuicSessionTest : public ::testing::Test,
QuicCryptoServerStream* CreateCryptoServerStream(QuicSessionForTest* session,
bool handshake_success);
- rtc::scoped_ptr<QuicConnection> CreateConnection(
+ std::unique_ptr<QuicConnection> CreateConnection(
FakeTransportChannel* channel,
Perspective perspective);
@@ -268,16 +269,16 @@ class QuicSessionTest : public ::testing::Test,
QuicConfig config_;
QuicClock clock_;
- rtc::scoped_ptr<QuicSessionForTest> client_peer_;
- rtc::scoped_ptr<QuicSessionForTest> server_peer_;
+ std::unique_ptr<QuicSessionForTest> client_peer_;
+ std::unique_ptr<QuicSessionForTest> server_peer_;
};
// Initializes "client peer" who begins crypto handshake and "server peer" who
// establishes encryption with client.
void QuicSessionTest::CreateClientAndServerSessions() {
- rtc::scoped_ptr<FakeTransportChannel> channel1(
+ std::unique_ptr<FakeTransportChannel> channel1(
new FakeTransportChannel("channel1", 0));
- rtc::scoped_ptr<FakeTransportChannel> channel2(
+ std::unique_ptr<FakeTransportChannel> channel2(
new FakeTransportChannel("channel2", 0));
// Prevent channel1->OnReadPacket and channel2->OnReadPacket from calling
@@ -294,12 +295,12 @@ void QuicSessionTest::CreateClientAndServerSessions() {
server_peer_ = CreateSession(std::move(channel2), Perspective::IS_SERVER);
}
-rtc::scoped_ptr<QuicSessionForTest> QuicSessionTest::CreateSession(
- rtc::scoped_ptr<FakeTransportChannel> channel,
+std::unique_ptr<QuicSessionForTest> QuicSessionTest::CreateSession(
+ std::unique_ptr<FakeTransportChannel> channel,
Perspective perspective) {
- rtc::scoped_ptr<QuicConnection> quic_connection =
+ std::unique_ptr<QuicConnection> quic_connection =
CreateConnection(channel.get(), perspective);
- return rtc::scoped_ptr<QuicSessionForTest>(new QuicSessionForTest(
+ return std::unique_ptr<QuicSessionForTest>(new QuicSessionForTest(
std::move(quic_connection), config_, std::move(channel)));
}
@@ -326,7 +327,7 @@ QuicCryptoServerStream* QuicSessionTest::CreateCryptoServerStream(
return new QuicCryptoServerStream(server_config, session);
}
-rtc::scoped_ptr<QuicConnection> QuicSessionTest::CreateConnection(
+std::unique_ptr<QuicConnection> QuicSessionTest::CreateConnection(
FakeTransportChannel* channel,
Perspective perspective) {
FakeQuicPacketWriter* writer = new FakeQuicPacketWriter(channel);
@@ -334,7 +335,7 @@ rtc::scoped_ptr<QuicConnection> QuicSessionTest::CreateConnection(
IPAddress ip(0, 0, 0, 0);
bool owns_writer = true;
- return rtc::scoped_ptr<QuicConnection>(new QuicConnection(
+ return std::unique_ptr<QuicConnection>(new QuicConnection(
0, net::IPEndPoint(ip, 0), &quic_helper_, writer, owns_writer,
perspective, net::QuicSupportedVersions()));
}
« no previous file with comments | « webrtc/p2p/quic/quicsession.cc ('k') | webrtc/p2p/quic/quictransportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698