Switch QuicMakeUnique to std::make_unique, part 1: //third_party/quic
gfe-relnote: n/a (no functional change)
PiperOrigin-RevId: 267662077
Change-Id: Ic63023042eafb77aa80d88749845f841b3078c57
diff --git a/quic/quartc/quartc_crypto_helpers.cc b/quic/quartc/quartc_crypto_helpers.cc
index 4f39271..1d5dc86 100644
--- a/quic/quartc/quartc_crypto_helpers.cc
+++ b/quic/quartc/quartc_crypto_helpers.cc
@@ -83,8 +83,8 @@
std::unique_ptr<QuicCryptoClientConfig> CreateCryptoClientConfig(
QuicStringPiece pre_shared_key) {
- auto config = QuicMakeUnique<QuicCryptoClientConfig>(
- QuicMakeUnique<InsecureProofVerifier>());
+ auto config = std::make_unique<QuicCryptoClientConfig>(
+ std::make_unique<InsecureProofVerifier>());
config->set_pad_inchoate_hello(false);
config->set_pad_full_hello(false);
if (!pre_shared_key.empty()) {
@@ -103,9 +103,10 @@
// handshakes, but for transient clients it does not matter.
char source_address_token_secret[kInputKeyingMaterialLength];
random->RandBytes(source_address_token_secret, kInputKeyingMaterialLength);
- auto config = QuicMakeUnique<QuicCryptoServerConfig>(
+ auto config = std::make_unique<QuicCryptoServerConfig>(
std::string(source_address_token_secret, kInputKeyingMaterialLength),
- random, QuicMakeUnique<DummyProofSource>(), KeyExchangeSource::Default());
+ random, std::make_unique<DummyProofSource>(),
+ KeyExchangeSource::Default());
// We run QUIC over ICE, and ICE is verifying remote side with STUN pings.
// We disable source address token validation in order to allow for 0-rtt
diff --git a/quic/quartc/quartc_endpoint.cc b/quic/quartc/quartc_endpoint.cc
index 7d01ce8..e6ac6be 100644
--- a/quic/quartc/quartc_endpoint.cc
+++ b/quic/quartc/quartc_endpoint.cc
@@ -57,12 +57,12 @@
delegate_(delegate),
serialized_server_config_(serialized_server_config),
version_manager_(version_manager ? std::move(version_manager)
- : QuicMakeUnique<QuicVersionManager>(
+ : std::make_unique<QuicVersionManager>(
AllSupportedVersions())),
create_session_alarm_(QuicWrapUnique(
alarm_factory_->CreateAlarm(new CreateSessionDelegate(this)))),
connection_helper_(
- QuicMakeUnique<QuartcConnectionHelper>(clock_, random)),
+ std::make_unique<QuartcConnectionHelper>(clock_, random)),
config_(config) {}
void QuartcClientEndpoint::Connect(QuartcPacketTransport* packet_transport) {
@@ -153,10 +153,10 @@
delegate_(delegate),
config_(config),
version_manager_(version_manager ? std::move(version_manager)
- : QuicMakeUnique<QuicVersionManager>(
+ : std::make_unique<QuicVersionManager>(
AllSupportedVersions())),
pre_connection_helper_(
- QuicMakeUnique<QuartcConnectionHelper>(clock, random)),
+ std::make_unique<QuartcConnectionHelper>(clock, random)),
crypto_config_(
CreateCryptoServerConfig(pre_connection_helper_->GetRandomGenerator(),
clock,
@@ -164,14 +164,14 @@
void QuartcServerEndpoint::Connect(QuartcPacketTransport* packet_transport) {
DCHECK(pre_connection_helper_ != nullptr);
- dispatcher_ = QuicMakeUnique<QuartcDispatcher>(
- QuicMakeUnique<QuicConfig>(CreateQuicConfig(config_)),
+ dispatcher_ = std::make_unique<QuartcDispatcher>(
+ std::make_unique<QuicConfig>(CreateQuicConfig(config_)),
std::move(crypto_config_.config), version_manager_.get(),
std::move(pre_connection_helper_),
- QuicMakeUnique<QuartcCryptoServerStreamHelper>(),
- QuicMakeUnique<QuartcAlarmFactoryWrapper>(alarm_factory_),
- QuicMakeUnique<QuartcPacketWriter>(packet_transport,
- config_.max_packet_size),
+ std::make_unique<QuartcCryptoServerStreamHelper>(),
+ std::make_unique<QuartcAlarmFactoryWrapper>(alarm_factory_),
+ std::make_unique<QuartcPacketWriter>(packet_transport,
+ config_.max_packet_size),
this);
// The dispatcher requires at least one call to |ProcessBufferedChlos| to
// set the number of connections it is allowed to create.
diff --git a/quic/quartc/quartc_endpoint_test.cc b/quic/quartc/quartc_endpoint_test.cc
index eedbf6a..7eb45d0 100644
--- a/quic/quartc/quartc_endpoint_test.cc
+++ b/quic/quartc/quartc_endpoint_test.cc
@@ -32,7 +32,7 @@
QuicTime::Delta::FromMilliseconds(1)),
server_endpoint_delegate_(&server_stream_delegate_,
simulator_.GetClock()),
- server_endpoint_(QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_(std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
simulator_.GetRandomGenerator(),
@@ -40,7 +40,7 @@
QuartcSessionConfig())),
client_endpoint_delegate_(&client_stream_delegate_,
simulator_.GetClock()),
- client_endpoint_(QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_(std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
simulator_.GetRandomGenerator(),
@@ -85,21 +85,21 @@
ParsedQuicVersionVector client_versions;
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_46});
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &client_endpoint_delegate_,
QuartcSessionConfig(),
/*serialized_server_config=*/"",
- QuicMakeUnique<QuicVersionManager>(client_versions));
+ std::make_unique<QuicVersionManager>(client_versions));
// Reset the server endpoint to only speak version 43.
ParsedQuicVersionVector server_versions;
server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &server_endpoint_delegate_,
QuartcSessionConfig(),
- QuicMakeUnique<QuicVersionManager>(server_versions));
+ std::make_unique<QuicVersionManager>(server_versions));
// The endpoints should be able to establish a connection using version 46.
server_endpoint_->Connect(&server_transport_);
@@ -124,23 +124,23 @@
// Reset the client endpoint to only speak version 43.
ParsedQuicVersionVector client_versions;
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &client_endpoint_delegate_,
QuartcSessionConfig(),
/*serialized_server_config=*/"",
- QuicMakeUnique<QuicVersionManager>(client_versions));
+ std::make_unique<QuicVersionManager>(client_versions));
// Reset the server endpoint to prefer version 46 but also be capable of
// speaking version 43.
ParsedQuicVersionVector server_versions;
server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_46});
server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &server_endpoint_delegate_,
QuartcSessionConfig(),
- QuicMakeUnique<QuicVersionManager>(server_versions));
+ std::make_unique<QuicVersionManager>(server_versions));
// The endpoints should be able to establish a connection using version 46.
server_endpoint_->Connect(&server_transport_);
@@ -165,21 +165,21 @@
// Reset the client endpoint to only speak version 43.
ParsedQuicVersionVector client_versions;
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &client_endpoint_delegate_,
QuartcSessionConfig(),
/*serialized_server_config=*/"",
- QuicMakeUnique<QuicVersionManager>(client_versions));
+ std::make_unique<QuicVersionManager>(client_versions));
// Reset the server endpoint to only speak version 46.
ParsedQuicVersionVector server_versions;
server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_46});
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &server_endpoint_delegate_,
QuartcSessionConfig(),
- QuicMakeUnique<QuicVersionManager>(server_versions));
+ std::make_unique<QuicVersionManager>(server_versions));
// The endpoints should be unable to establish a connection.
server_endpoint_->Connect(&server_transport_);
@@ -205,21 +205,21 @@
ParsedQuicVersionVector client_versions;
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_46});
client_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &client_endpoint_delegate_,
QuartcSessionConfig(),
/*serialized_server_config=*/"",
- QuicMakeUnique<QuicVersionManager>(client_versions));
+ std::make_unique<QuicVersionManager>(client_versions));
// Reset the server endpoint to only speak version 43.
ParsedQuicVersionVector server_versions;
server_versions.push_back({PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_43});
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), &server_endpoint_delegate_,
QuartcSessionConfig(),
- QuicMakeUnique<QuicVersionManager>(server_versions));
+ std::make_unique<QuicVersionManager>(server_versions));
// The endpoints should be able to establish a connection using version 46.
server_endpoint_->Connect(&server_transport_);
diff --git a/quic/quartc/quartc_factory.cc b/quic/quartc/quartc_factory.cc
index 6742b89..8896404 100644
--- a/quic/quartc/quartc_factory.cc
+++ b/quic/quartc/quartc_factory.cc
@@ -28,7 +28,7 @@
DCHECK(packet_transport);
// QuartcSession will eventually own both |writer| and |quic_connection|.
- auto writer = QuicMakeUnique<QuartcPacketWriter>(
+ auto writer = std::make_unique<QuartcPacketWriter>(
packet_transport, quartc_session_config.max_packet_size);
// While the QuicConfig is not directly used by the connection, creating it
@@ -51,7 +51,7 @@
.max_ack_delay()
.ToMilliseconds());
- return QuicMakeUnique<QuartcClientSession>(
+ return std::make_unique<QuartcClientSession>(
std::move(quic_connection), quic_config, supported_versions, clock,
std::move(writer),
CreateCryptoClientConfig(quartc_session_config.pre_shared_key),
@@ -79,8 +79,8 @@
// Note: flag settings have no effect for Exoblaze builds since
// SetQuicReloadableFlag() gets stubbed out.
- SetQuicReloadableFlag(quic_bbr_less_probe_rtt, true); // Enable BBR6,7,8.
- SetQuicReloadableFlag(quic_unified_iw_options, true); // Enable IWXX opts.
+ SetQuicReloadableFlag(quic_bbr_less_probe_rtt, true); // Enable BBR6,7,8.
+ SetQuicReloadableFlag(quic_unified_iw_options, true); // Enable IWXX opts.
SetQuicReloadableFlag(quic_bbr_flexible_app_limited, true); // Enable BBR9.
// Fix GetPacketHeaderSize
@@ -194,7 +194,7 @@
QuicPacketWriter* packet_writer,
Perspective perspective,
ParsedQuicVersionVector supported_versions) {
- auto quic_connection = QuicMakeUnique<QuicConnection>(
+ auto quic_connection = std::make_unique<QuicConnection>(
connection_id, peer_address, connection_helper, alarm_factory,
packet_writer,
/*owns_writer=*/false, perspective, supported_versions);
diff --git a/quic/quartc/quartc_multiplexer.cc b/quic/quartc/quartc_multiplexer.cc
index 001e219..36197c8 100644
--- a/quic/quartc/quartc_multiplexer.cc
+++ b/quic/quartc/quartc_multiplexer.cc
@@ -114,7 +114,7 @@
QuartcSendChannel* QuartcMultiplexer::CreateSendChannel(
uint64_t channel_id,
QuartcSendChannel::Delegate* delegate) {
- send_channels_.push_back(QuicMakeUnique<QuartcSendChannel>(
+ send_channels_.push_back(std::make_unique<QuartcSendChannel>(
this, channel_id, allocator_, delegate));
if (session_) {
send_channels_.back()->OnSessionCreated(session_);
diff --git a/quic/quartc/quartc_multiplexer_test.cc b/quic/quartc/quartc_multiplexer_test.cc
index 64609cb..8490b64 100644
--- a/quic/quartc/quartc_multiplexer_test.cc
+++ b/quic/quartc/quartc_multiplexer_test.cc
@@ -185,14 +185,14 @@
server_multiplexer_(simulator_.GetStreamSendBufferAllocator(),
&server_session_delegate_,
&server_default_receiver_),
- client_endpoint_(QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_(std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
simulator_.GetRandomGenerator(),
&client_multiplexer_,
quic::QuartcSessionConfig(),
/*serialized_server_config=*/"")),
- server_endpoint_(QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_(std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(),
simulator_.GetClock(),
simulator_.GetRandomGenerator(),
diff --git a/quic/quartc/quartc_packet_writer.cc b/quic/quartc/quartc_packet_writer.cc
index 223ad3d..ad897b5 100644
--- a/quic/quartc/quartc_packet_writer.cc
+++ b/quic/quartc/quartc_packet_writer.cc
@@ -7,7 +7,7 @@
namespace quic {
std::unique_ptr<PerPacketOptions> QuartcPerPacketOptions::Clone() const {
- return QuicMakeUnique<QuartcPerPacketOptions>(*this);
+ return std::make_unique<QuartcPerPacketOptions>(*this);
}
QuartcPacketWriter::QuartcPacketWriter(QuartcPacketTransport* packet_transport,
diff --git a/quic/quartc/quartc_session.cc b/quic/quartc/quartc_session.cc
index 117b137..a3bff24 100644
--- a/quic/quartc/quartc_session.cc
+++ b/quic/quartc/quartc_session.cc
@@ -31,7 +31,7 @@
/*num_expected_unidirectional_static_streams = */ 0),
connection_(std::move(connection)),
clock_(clock),
- per_packet_options_(QuicMakeUnique<QuartcPerPacketOptions>()) {
+ per_packet_options_(std::make_unique<QuartcPerPacketOptions>()) {
per_packet_options_->connection = connection_.get();
connection_->set_per_packet_options(per_packet_options_.get());
}
@@ -293,7 +293,8 @@
// Encryption not active so no stream created
return nullptr;
}
- return InitializeDataStream(QuicMakeUnique<QuartcStream>(id, this), priority);
+ return InitializeDataStream(std::make_unique<QuartcStream>(id, this),
+ priority);
}
std::unique_ptr<QuartcStream> QuartcSession::InitializeDataStream(
@@ -391,7 +392,7 @@
}
}
- crypto_stream_ = QuicMakeUnique<QuicCryptoClientStream>(
+ crypto_stream_ = std::make_unique<QuicCryptoClientStream>(
server_id, this,
client_crypto_config_->proof_verifier()->CreateDefaultContext(),
client_crypto_config_.get(), this);
@@ -438,7 +439,7 @@
}
void QuartcServerSession::StartCryptoHandshake() {
- crypto_stream_ = QuicMakeUnique<QuicCryptoServerStream>(
+ crypto_stream_ = std::make_unique<QuicCryptoServerStream>(
server_crypto_config_, compressed_certs_cache_, this, stream_helper_);
Initialize();
}
diff --git a/quic/quartc/quartc_session_test.cc b/quic/quartc/quartc_session_test.cc
index 3b55314..d314f8c 100644
--- a/quic/quartc/quartc_session_test.cc
+++ b/quic/quartc/quartc_session_test.cc
@@ -50,39 +50,39 @@
void Init(bool create_client_endpoint = true) {
client_transport_ =
- QuicMakeUnique<simulator::SimulatedQuartcPacketTransport>(
+ std::make_unique<simulator::SimulatedQuartcPacketTransport>(
&simulator_, "client_transport", "server_transport",
10 * kDefaultMaxPacketSize);
server_transport_ =
- QuicMakeUnique<simulator::SimulatedQuartcPacketTransport>(
+ std::make_unique<simulator::SimulatedQuartcPacketTransport>(
&simulator_, "server_transport", "client_transport",
10 * kDefaultMaxPacketSize);
- client_filter_ = QuicMakeUnique<simulator::CountingPacketFilter>(
+ client_filter_ = std::make_unique<simulator::CountingPacketFilter>(
&simulator_, "client_filter", client_transport_.get());
- client_server_link_ = QuicMakeUnique<simulator::SymmetricLink>(
+ client_server_link_ = std::make_unique<simulator::SymmetricLink>(
client_filter_.get(), server_transport_.get(),
QuicBandwidth::FromKBitsPerSecond(10 * 1000), kPropagationDelay);
- client_stream_delegate_ = QuicMakeUnique<FakeQuartcStreamDelegate>();
- client_session_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
+ client_stream_delegate_ = std::make_unique<FakeQuartcStreamDelegate>();
+ client_session_delegate_ = std::make_unique<FakeQuartcEndpointDelegate>(
client_stream_delegate_.get(), simulator_.GetClock());
- server_stream_delegate_ = QuicMakeUnique<FakeQuartcStreamDelegate>();
- server_session_delegate_ = QuicMakeUnique<FakeQuartcEndpointDelegate>(
+ server_stream_delegate_ = std::make_unique<FakeQuartcStreamDelegate>();
+ server_session_delegate_ = std::make_unique<FakeQuartcEndpointDelegate>(
server_stream_delegate_.get(), simulator_.GetClock());
// No 0-rtt setup, because server config is empty.
// CannotCreateDataStreamBeforeHandshake depends on 1-rtt setup.
if (create_client_endpoint) {
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), client_session_delegate_.get(),
quic::QuartcSessionConfig(),
/*serialized_server_config=*/"");
}
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), server_session_delegate_.get(),
quic::QuartcSessionConfig());
@@ -628,7 +628,7 @@
server_endpoint_->Connect(server_transport_.get());
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), client_session_delegate_.get(),
QuartcSessionConfig(),
diff --git a/quic/quartc/quartc_stream.cc b/quic/quartc/quartc_stream.cc
index f18d42d..7ec18a8 100644
--- a/quic/quartc/quartc_stream.cc
+++ b/quic/quartc/quartc_stream.cc
@@ -39,7 +39,7 @@
size_t iov_length = sequencer()->ReadableBytes() /
QuicStreamSequencerBuffer::kBlockSizeBytes +
2;
- std::unique_ptr<iovec[]> iovecs = QuicMakeUnique<iovec[]>(iov_length);
+ std::unique_ptr<iovec[]> iovecs = std::make_unique<iovec[]>(iov_length);
iov_length = sequencer()->GetReadableRegions(iovecs.get(), iov_length);
bytes_consumed = delegate_->OnReceived(this, iovecs.get(), iov_length, fin);
diff --git a/quic/quartc/quartc_stream_test.cc b/quic/quartc/quartc_stream_test.cc
index eb4d412..52314fa 100644
--- a/quic/quartc/quartc_stream_test.cc
+++ b/quic/quartc/quartc_stream_test.cc
@@ -224,19 +224,19 @@
ip.FromString("0.0.0.0");
bool owns_writer = true;
- alarm_factory_ = QuicMakeUnique<test::MockAlarmFactory>();
+ alarm_factory_ = std::make_unique<test::MockAlarmFactory>();
- connection_ = QuicMakeUnique<QuicConnection>(
+ connection_ = std::make_unique<QuicConnection>(
QuicUtils::CreateZeroConnectionId(
CurrentSupportedVersions()[0].transport_version),
QuicSocketAddress(ip, 0), this /*QuicConnectionHelperInterface*/,
alarm_factory_.get(), new DummyPacketWriter(), owns_writer, perspective,
ParsedVersionOfIndex(CurrentSupportedVersions(), 0));
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
- session_ = QuicMakeUnique<MockQuicSession>(connection_.get(), QuicConfig(),
- &write_buffer_);
+ session_ = std::make_unique<MockQuicSession>(connection_.get(),
+ QuicConfig(), &write_buffer_);
mock_stream_delegate_ =
- QuicMakeUnique<MockQuartcStreamDelegate>(kStreamId, &read_buffer_);
+ std::make_unique<MockQuartcStreamDelegate>(kStreamId, &read_buffer_);
stream_ = new QuartcStream(kStreamId, session_.get());
stream_->SetDelegate(mock_stream_delegate_.get());
session_->ActivateReliableStream(std::unique_ptr<QuartcStream>(stream_));
diff --git a/quic/quartc/simulated_packet_transport.cc b/quic/quartc/simulated_packet_transport.cc
index 8e82d98..cb4f97a 100644
--- a/quic/quartc/simulated_packet_transport.cc
+++ b/quic/quartc/simulated_packet_transport.cc
@@ -33,7 +33,7 @@
last_packet_number_ = info.packet_number;
- auto packet = QuicMakeUnique<Packet>();
+ auto packet = std::make_unique<Packet>();
packet->contents = std::string(buffer, buf_len);
packet->size = buf_len;
packet->tx_timestamp = clock_->Now();
diff --git a/quic/quartc/test/bidi_test_runner.cc b/quic/quartc/test/bidi_test_runner.cc
index 07ad80e..f4d7489 100644
--- a/quic/quartc/test/bidi_test_runner.cc
+++ b/quic/quartc/test/bidi_test_runner.cc
@@ -88,11 +88,11 @@
}
bool BidiTestRunner::RunTest(QuicTime::Delta test_duration) {
- client_peer_ = QuicMakeUnique<QuartcPeer>(
+ client_peer_ = std::make_unique<QuartcPeer>(
simulator_->GetClock(), simulator_->GetAlarmFactory(),
simulator_->GetRandomGenerator(),
simulator_->GetStreamSendBufferAllocator(), client_configs_);
- server_peer_ = QuicMakeUnique<QuartcPeer>(
+ server_peer_ = std::make_unique<QuartcPeer>(
simulator_->GetClock(), simulator_->GetAlarmFactory(),
simulator_->GetRandomGenerator(),
simulator_->GetStreamSendBufferAllocator(), server_configs_);
@@ -102,7 +102,7 @@
server_interceptor_->SetDelegate(server_delegate);
server_delegate = server_interceptor_;
}
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_->GetAlarmFactory(), simulator_->GetClock(),
simulator_->GetRandomGenerator(), server_delegate, QuartcSessionConfig());
@@ -111,7 +111,7 @@
client_interceptor_->SetDelegate(client_delegate);
client_delegate = client_interceptor_;
}
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_->GetAlarmFactory(), simulator_->GetClock(),
simulator_->GetRandomGenerator(), client_delegate, QuartcSessionConfig(),
server_endpoint_->server_crypto_config());
diff --git a/quic/quartc/test/quartc_bidi_test.cc b/quic/quartc/test/quartc_bidi_test.cc
index 3722619..3581881 100644
--- a/quic/quartc/test/quartc_bidi_test.cc
+++ b/quic/quartc/test/quartc_bidi_test.cc
@@ -31,8 +31,10 @@
random_.set_seed(seed);
simulator_.set_random_generator(&random_);
- client_trace_interceptor_ = QuicMakeUnique<QuicTraceInterceptor>("client");
- server_trace_interceptor_ = QuicMakeUnique<QuicTraceInterceptor>("server");
+ client_trace_interceptor_ =
+ std::make_unique<QuicTraceInterceptor>("client");
+ server_trace_interceptor_ =
+ std::make_unique<QuicTraceInterceptor>("server");
}
void CreateTransports(QuicBandwidth bandwidth,
@@ -41,38 +43,38 @@
int loss_percent) {
// Endpoints which serve as the transports for client and server.
client_transport_ =
- QuicMakeUnique<simulator::SimulatedQuartcPacketTransport>(
+ std::make_unique<simulator::SimulatedQuartcPacketTransport>(
&simulator_, "client_transport", "server_transport", queue_length);
server_transport_ =
- QuicMakeUnique<simulator::SimulatedQuartcPacketTransport>(
+ std::make_unique<simulator::SimulatedQuartcPacketTransport>(
&simulator_, "server_transport", "client_transport", queue_length);
// Filters on each of the endpoints facilitate random packet loss.
- client_filter_ = QuicMakeUnique<simulator::RandomPacketFilter>(
+ client_filter_ = std::make_unique<simulator::RandomPacketFilter>(
&simulator_, "client_filter", client_transport_.get());
- server_filter_ = QuicMakeUnique<simulator::RandomPacketFilter>(
+ server_filter_ = std::make_unique<simulator::RandomPacketFilter>(
&simulator_, "server_filter", server_transport_.get());
client_filter_->set_loss_percent(loss_percent);
server_filter_->set_loss_percent(loss_percent);
// Each endpoint connects directly to a switch.
- client_switch_ = QuicMakeUnique<simulator::Switch>(
+ client_switch_ = std::make_unique<simulator::Switch>(
&simulator_, "client_switch", /*port_count=*/8, 2 * queue_length);
- server_switch_ = QuicMakeUnique<simulator::Switch>(
+ server_switch_ = std::make_unique<simulator::Switch>(
&simulator_, "server_switch", /*port_count=*/8, 2 * queue_length);
// Links to the switch have significantly higher bandwidth than the
// bottleneck and insignificant propagation delay.
- client_link_ = QuicMakeUnique<simulator::SymmetricLink>(
+ client_link_ = std::make_unique<simulator::SymmetricLink>(
client_filter_.get(), client_switch_->port(1), 10 * bandwidth,
QuicTime::Delta::FromMicroseconds(1));
- server_link_ = QuicMakeUnique<simulator::SymmetricLink>(
+ server_link_ = std::make_unique<simulator::SymmetricLink>(
server_filter_.get(), server_switch_->port(1), 10 * bandwidth,
QuicTime::Delta::FromMicroseconds(1));
// The bottleneck link connects the two switches with the bandwidth and
// propagation delay specified by the test case.
- bottleneck_link_ = QuicMakeUnique<simulator::SymmetricLink>(
+ bottleneck_link_ = std::make_unique<simulator::SymmetricLink>(
client_switch_->port(2), server_switch_->port(2), bandwidth,
propagation_delay);
}
@@ -80,19 +82,19 @@
void SetupCompetingEndpoints(QuicBandwidth bandwidth,
QuicTime::Delta send_interval,
QuicByteCount bytes_per_interval) {
- competing_client_ = QuicMakeUnique<QuartcCompetingEndpoint>(
+ competing_client_ = std::make_unique<QuartcCompetingEndpoint>(
&simulator_, send_interval, bytes_per_interval, "competing_client",
"competing_server", quic::Perspective::IS_CLIENT,
quic::test::TestConnectionId(3));
- competing_server_ = QuicMakeUnique<QuartcCompetingEndpoint>(
+ competing_server_ = std::make_unique<QuartcCompetingEndpoint>(
&simulator_, send_interval, bytes_per_interval, "competing_server",
"competing_client", quic::Perspective::IS_SERVER,
quic::test::TestConnectionId(3));
- competing_client_link_ = QuicMakeUnique<quic::simulator::SymmetricLink>(
+ competing_client_link_ = std::make_unique<quic::simulator::SymmetricLink>(
competing_client_->endpoint(), client_switch_->port(3), 10 * bandwidth,
QuicTime::Delta::FromMicroseconds(1));
- competing_server_link_ = QuicMakeUnique<quic::simulator::SymmetricLink>(
+ competing_server_link_ = std::make_unique<quic::simulator::SymmetricLink>(
competing_server_->endpoint(), server_switch_->port(3), 10 * bandwidth,
QuicTime::Delta::FromMicroseconds(1));
}
diff --git a/quic/quartc/test/quartc_competing_endpoint.cc b/quic/quartc/test/quartc_competing_endpoint.cc
index fe35045..e729ad4 100644
--- a/quic/quartc/test/quartc_competing_endpoint.cc
+++ b/quic/quartc/test/quartc_competing_endpoint.cc
@@ -20,11 +20,11 @@
: Actor(simulator, QuicStrCat(name, " actor")),
send_interval_(send_interval),
bytes_per_interval_(bytes_per_interval),
- endpoint_(QuicMakeUnique<simulator::QuicEndpoint>(simulator,
- name,
- peer_name,
- perspective,
- connection_id)) {
+ endpoint_(std::make_unique<simulator::QuicEndpoint>(simulator,
+ name,
+ peer_name,
+ perspective,
+ connection_id)) {
// Schedule the first send for one send interval into the test.
Schedule(simulator_->GetClock()->Now() + send_interval_);
last_send_time_ = simulator_->GetClock()->Now();
diff --git a/quic/quartc/test/quartc_data_source_test.cc b/quic/quartc/test/quartc_data_source_test.cc
index 3617162..af95091 100644
--- a/quic/quartc/test/quartc_data_source_test.cc
+++ b/quic/quartc/test/quartc_data_source_test.cc
@@ -47,7 +47,7 @@
TEST_F(QuartcDataSourceTest, ProducesFrameEveryInterval) {
QuartcDataSource::Config config;
config.frame_interval = QuicTime::Delta::FromMilliseconds(20);
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -66,7 +66,7 @@
TEST_F(QuartcDataSourceTest, DoesNotProduceFramesUntilEnabled) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -84,7 +84,7 @@
TEST_F(QuartcDataSourceTest, DisableAndEnable) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -121,7 +121,7 @@
QuartcDataSource::Config config;
config.frame_interval = QuicTime::Delta::FromMilliseconds(20);
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -149,7 +149,7 @@
TEST_F(QuartcDataSourceTest, ProducesFramesWithConfiguredSourceId) {
QuartcDataSource::Config config;
config.id = 7;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -163,7 +163,7 @@
TEST_F(QuartcDataSourceTest, ProducesFramesAtAllocatedBandwidth) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -181,7 +181,7 @@
TEST_F(QuartcDataSourceTest, ProducesParseableHeaderWhenNotEnoughBandwidth) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -205,7 +205,7 @@
TEST_F(QuartcDataSourceTest, ProducesSequenceNumbers) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -222,7 +222,7 @@
TEST_F(QuartcDataSourceTest, ProducesSendTimes) {
QuartcDataSource::Config config;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
source_->AllocateBandwidth(
@@ -243,7 +243,7 @@
QuartcDataSource::Config config;
config.min_bandwidth = QuicBandwidth::FromBitsPerSecond(8000);
config.frame_interval = QuicTime::Delta::FromMilliseconds(100);
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -267,7 +267,7 @@
QuartcDataSource::Config config;
config.max_bandwidth = QuicBandwidth::FromBitsPerSecond(8000);
config.frame_interval = QuicTime::Delta::FromMilliseconds(100);
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -291,7 +291,7 @@
constexpr QuicByteCount bytes_per_frame = 1000;
QuartcDataSource::Config config;
config.max_frame_size = bytes_per_frame;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -323,7 +323,7 @@
TEST_F(QuartcDataSourceTest, ProducesParseableHeaderWhenMaxFrameSizeTooSmall) {
QuartcDataSource::Config config;
config.max_frame_size = kDataFrameHeaderSize - 1;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
@@ -347,7 +347,7 @@
TEST_F(QuartcDataSourceTest, ProducesParseableHeaderWhenLeftoverSizeTooSmall) {
QuartcDataSource::Config config;
config.max_frame_size = 200;
- source_ = QuicMakeUnique<QuartcDataSource>(
+ source_ = std::make_unique<QuartcDataSource>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(), config, &delegate_);
diff --git a/quic/quartc/test/quartc_peer.cc b/quic/quartc/test/quartc_peer.cc
index d5e0d90..42eeea1 100644
--- a/quic/quartc/test/quartc_peer.cc
+++ b/quic/quartc/test/quartc_peer.cc
@@ -59,7 +59,7 @@
: largest_message_payload;
QUIC_LOG(INFO) << "Set max frame size for source " << config.id << " to "
<< config.max_frame_size;
- data_sources_.push_back(QuicMakeUnique<QuartcDataSource>(
+ data_sources_.push_back(std::make_unique<QuartcDataSource>(
clock_, alarm_factory_, random_, config, this));
}
}
diff --git a/quic/quartc/test/quartc_peer_test.cc b/quic/quartc/test/quartc_peer_test.cc
index fe76acf..b423cd7 100644
--- a/quic/quartc/test/quartc_peer_test.cc
+++ b/quic/quartc/test/quartc_peer_test.cc
@@ -38,11 +38,11 @@
}
void CreatePeers(const std::vector<QuartcDataSource::Config>& configs) {
- client_peer_ = QuicMakeUnique<QuartcPeer>(
+ client_peer_ = std::make_unique<QuartcPeer>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(),
simulator_.GetStreamSendBufferAllocator(), configs);
- server_peer_ = QuicMakeUnique<QuartcPeer>(
+ server_peer_ = std::make_unique<QuartcPeer>(
simulator_.GetClock(), simulator_.GetAlarmFactory(),
simulator_.GetRandomGenerator(),
simulator_.GetStreamSendBufferAllocator(), configs);
@@ -52,11 +52,11 @@
DCHECK(client_peer_);
DCHECK(server_peer_);
- server_endpoint_ = QuicMakeUnique<QuartcServerEndpoint>(
+ server_endpoint_ = std::make_unique<QuartcServerEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), server_peer_.get(),
QuartcSessionConfig());
- client_endpoint_ = QuicMakeUnique<QuartcClientEndpoint>(
+ client_endpoint_ = std::make_unique<QuartcClientEndpoint>(
simulator_.GetAlarmFactory(), simulator_.GetClock(),
simulator_.GetRandomGenerator(), client_peer_.get(),
QuartcSessionConfig(), server_endpoint_->server_crypto_config());
diff --git a/quic/quartc/test/quic_trace_interceptor.cc b/quic/quartc/test/quic_trace_interceptor.cc
index 9a9c638..e28fa2e 100644
--- a/quic/quartc/test/quic_trace_interceptor.cc
+++ b/quic/quartc/test/quic_trace_interceptor.cc
@@ -27,7 +27,7 @@
}
void QuicTraceInterceptor::OnSessionCreated(QuartcSession* session) {
- trace_visitor_ = QuicMakeUnique<QuicTraceVisitor>(session->connection());
+ trace_visitor_ = std::make_unique<QuicTraceVisitor>(session->connection());
session->connection()->set_debug_visitor(trace_visitor_.get());
delegate_->OnSessionCreated(session);