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/core/chlo_extractor_test.cc b/quic/core/chlo_extractor_test.cc index cc9a1d2..0aacb18 100644 --- a/quic/core/chlo_extractor_test.cc +++ b/quic/core/chlo_extractor_test.cc
@@ -99,7 +99,7 @@ framer.EncryptPayload(ENCRYPTION_INITIAL, header_.packet_number, *packet, buffer_, QUIC_ARRAYSIZE(buffer_)); ASSERT_NE(0u, encrypted_length); - packet_ = QuicMakeUnique<QuicEncryptedPacket>(buffer_, encrypted_length); + packet_ = std::make_unique<QuicEncryptedPacket>(buffer_, encrypted_length); EXPECT_TRUE(packet_ != nullptr); DeleteFrames(&frames); }
diff --git a/quic/core/congestion_control/bbr2_simulator_test.cc b/quic/core/congestion_control/bbr2_simulator_test.cc index ab4b67b..d941476 100644 --- a/quic/core/congestion_control/bbr2_simulator_test.cc +++ b/quic/core/congestion_control/bbr2_simulator_test.cc
@@ -145,20 +145,20 @@ void CreateNetwork(const DefaultTopologyParams& params) { QUIC_LOG(INFO) << "CreateNetwork with parameters: " << params.ToString(); - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", - params.switch_port_count, - params.SwitchQueueCapacity()); + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", + params.switch_port_count, + params.SwitchQueueCapacity()); // WARNING: The order to add links to network_links_ matters, because some // tests adjusts the link bandwidth on the fly. // Local link connects sender and port 1. - network_links_.push_back(QuicMakeUnique<simulator::SymmetricLink>( + network_links_.push_back(std::make_unique<simulator::SymmetricLink>( &sender_endpoint_, switch_->port(1), params.local_link.bandwidth, params.local_link.delay)); // Test link connects receiver and port 2. - network_links_.push_back(QuicMakeUnique<simulator::SymmetricLink>( + network_links_.push_back(std::make_unique<simulator::SymmetricLink>( &receiver_endpoint_, switch_->port(2), params.test_link.bandwidth, params.test_link.delay)); } @@ -702,16 +702,17 @@ for (size_t i = 0; i < MultiSenderTopologyParams::kNumLocalLinks; ++i) { std::string sender_name = QuicStrCat("Sender", i + 1); std::string receiver_name = QuicStrCat("Receiver", i + 1); - sender_endpoints_.push_back(QuicMakeUnique<simulator::QuicEndpoint>( + sender_endpoints_.push_back(std::make_unique<simulator::QuicEndpoint>( &simulator_, sender_name, receiver_name, Perspective::IS_CLIENT, TestConnectionId(first_connection_id + i))); - receiver_endpoints_.push_back(QuicMakeUnique<simulator::QuicEndpoint>( + receiver_endpoints_.push_back(std::make_unique<simulator::QuicEndpoint>( &simulator_, receiver_name, sender_name, Perspective::IS_SERVER, TestConnectionId(first_connection_id + i))); receiver_endpoint_pointers.push_back(receiver_endpoints_.back().get()); } - receiver_multiplexer_ = QuicMakeUnique<simulator::QuicEndpointMultiplexer>( - "Receiver multiplexer", receiver_endpoint_pointers); + receiver_multiplexer_ = + std::make_unique<simulator::QuicEndpointMultiplexer>( + "Receiver multiplexer", receiver_endpoint_pointers); sender_1_ = SetupBbr2Sender(sender_endpoints_[0].get()); uint64_t seed = QuicRandom::GetInstance()->RandUint64(); @@ -773,16 +774,16 @@ void CreateNetwork(const MultiSenderTopologyParams& params) { QUIC_LOG(INFO) << "CreateNetwork with parameters: " << params.ToString(); - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", - params.switch_port_count, - params.SwitchQueueCapacity()); + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", + params.switch_port_count, + params.SwitchQueueCapacity()); - network_links_.push_back(QuicMakeUnique<simulator::SymmetricLink>( + network_links_.push_back(std::make_unique<simulator::SymmetricLink>( receiver_multiplexer_.get(), switch_->port(1), params.test_link.bandwidth, params.test_link.delay)); for (size_t i = 0; i < MultiSenderTopologyParams::kNumLocalLinks; ++i) { simulator::SwitchPortNumber port_number = i + 2; - network_links_.push_back(QuicMakeUnique<simulator::SymmetricLink>( + network_links_.push_back(std::make_unique<simulator::SymmetricLink>( sender_endpoints_[i].get(), switch_->port(port_number), params.local_links[i].bandwidth, params.local_links[i].delay)); }
diff --git a/quic/core/congestion_control/bbr_sender_test.cc b/quic/core/congestion_control/bbr_sender_test.cc index d175bdf..909107b 100644 --- a/quic/core/congestion_control/bbr_sender_test.cc +++ b/quic/core/congestion_control/bbr_sender_test.cc
@@ -146,24 +146,24 @@ // receiver and the switch. The switch has the buffers four times larger than // the bottleneck BDP, which should guarantee a lack of losses. void CreateDefaultSetup() { - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", 8, - 2 * kTestBdp); - bbr_sender_link_ = QuicMakeUnique<simulator::SymmetricLink>( + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, + 2 * kTestBdp); + bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); - receiver_link_ = QuicMakeUnique<simulator::SymmetricLink>( + receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); } // Same as the default setup, except the buffer now is half of the BDP. void CreateSmallBufferSetup() { - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", 8, - 0.5 * kTestBdp); - bbr_sender_link_ = QuicMakeUnique<simulator::SymmetricLink>( + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, + 0.5 * kTestBdp); + bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); - receiver_link_ = QuicMakeUnique<simulator::SymmetricLink>( + receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); } @@ -171,19 +171,19 @@ // Creates the variation of the default setup in which there is another sender // that competes for the same bottleneck link. void CreateCompetitionSetup() { - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", 8, - 2 * kTestBdp); + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, + 2 * kTestBdp); // Add a small offset to the competing link in order to avoid // synchronization effects. const QuicTime::Delta small_offset = QuicTime::Delta::FromMicroseconds(3); - bbr_sender_link_ = QuicMakeUnique<simulator::SymmetricLink>( + bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); - competing_sender_link_ = QuicMakeUnique<simulator::SymmetricLink>( + competing_sender_link_ = std::make_unique<simulator::SymmetricLink>( &competing_sender_, switch_->port(3), kLocalLinkBandwidth, kLocalPropagationDelay + small_offset); - receiver_link_ = QuicMakeUnique<simulator::SymmetricLink>( + receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_multiplexer_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); }
diff --git a/quic/core/congestion_control/hybrid_slow_start_test.cc b/quic/core/congestion_control/hybrid_slow_start_test.cc index aa2f849..d17c7cc 100644 --- a/quic/core/congestion_control/hybrid_slow_start_test.cc +++ b/quic/core/congestion_control/hybrid_slow_start_test.cc
@@ -17,7 +17,7 @@ HybridSlowStartTest() : one_ms_(QuicTime::Delta::FromMilliseconds(1)), rtt_(QuicTime::Delta::FromMilliseconds(60)) {} - void SetUp() override { slow_start_ = QuicMakeUnique<HybridSlowStart>(); } + void SetUp() override { slow_start_ = std::make_unique<HybridSlowStart>(); } const QuicTime::Delta one_ms_; const QuicTime::Delta rtt_; std::unique_ptr<HybridSlowStart> slow_start_;
diff --git a/quic/core/congestion_control/pacing_sender_test.cc b/quic/core/congestion_control/pacing_sender_test.cc index 066a3b5..e54cbae 100644 --- a/quic/core/congestion_control/pacing_sender_test.cc +++ b/quic/core/congestion_control/pacing_sender_test.cc
@@ -43,8 +43,8 @@ ~PacingSenderTest() override {} void InitPacingRate(QuicPacketCount burst_size, QuicBandwidth bandwidth) { - mock_sender_ = QuicMakeUnique<StrictMock<MockSendAlgorithm>>(); - pacing_sender_ = QuicMakeUnique<PacingSender>(); + mock_sender_ = std::make_unique<StrictMock<MockSendAlgorithm>>(); + pacing_sender_ = std::make_unique<PacingSender>(); pacing_sender_->set_sender(mock_sender_.get()); EXPECT_CALL(*mock_sender_, PacingRate(_)).WillRepeatedly(Return(bandwidth)); EXPECT_CALL(*mock_sender_, BandwidthEstimate())
diff --git a/quic/core/congestion_control/send_algorithm_test.cc b/quic/core/congestion_control/send_algorithm_test.cc index c07508c..b676899 100644 --- a/quic/core/congestion_control/send_algorithm_test.cc +++ b/quic/core/congestion_control/send_algorithm_test.cc
@@ -189,12 +189,12 @@ void CreateSetup(const QuicBandwidth& test_bandwidth, const QuicTime::Delta& test_link_delay, QuicByteCount bottleneck_queue_length) { - switch_ = QuicMakeUnique<simulator::Switch>(&simulator_, "Switch", 8, - bottleneck_queue_length); - quic_sender_link_ = QuicMakeUnique<simulator::SymmetricLink>( + switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, + bottleneck_queue_length); + quic_sender_link_ = std::make_unique<simulator::SymmetricLink>( &quic_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); - receiver_link_ = QuicMakeUnique<simulator::SymmetricLink>( + receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_, switch_->port(2), test_bandwidth, test_link_delay); }
diff --git a/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc b/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc index 2d27896..11b9660 100644 --- a/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc +++ b/quic/core/congestion_control/tcp_cubic_sender_bytes_test.cc
@@ -794,7 +794,7 @@ TEST_F(TcpCubicSenderBytesTest, LimitCwndIncreaseInCongestionAvoidance) { // Enable Cubic. - sender_ = QuicMakeUnique<TcpCubicSenderBytesPeer>(&clock_, false); + sender_ = std::make_unique<TcpCubicSenderBytesPeer>(&clock_, false); int num_sent = SendAvailableSendWindow();
diff --git a/quic/core/congestion_control/uber_loss_algorithm_test.cc b/quic/core/congestion_control/uber_loss_algorithm_test.cc index 84b9c99..a63c3f7 100644 --- a/quic/core/congestion_control/uber_loss_algorithm_test.cc +++ b/quic/core/congestion_control/uber_loss_algorithm_test.cc
@@ -22,7 +22,7 @@ protected: UberLossAlgorithmTest() { unacked_packets_ = - QuicMakeUnique<QuicUnackedPacketMap>(Perspective::IS_CLIENT); + std::make_unique<QuicUnackedPacketMap>(Perspective::IS_CLIENT); rtt_stats_.UpdateRtt(QuicTime::Delta::FromMilliseconds(100), QuicTime::Delta::Zero(), clock_.Now()); EXPECT_LT(0, rtt_stats_.smoothed_rtt().ToMicroseconds());
diff --git a/quic/core/crypto/cert_compressor.cc b/quic/core/crypto/cert_compressor.cc index 9ad2fc8..09973dd 100644 --- a/quic/core/crypto/cert_compressor.cc +++ b/quic/core/crypto/cert_compressor.cc
@@ -577,7 +577,7 @@ return false; } - uncompressed_data = QuicMakeUnique<uint8_t[]>(uncompressed_size); + uncompressed_data = std::make_unique<uint8_t[]>(uncompressed_size); z_stream z; ScopedZLib scoped_z(ScopedZLib::INFLATE);
diff --git a/quic/core/crypto/crypto_framer.cc b/quic/core/crypto/crypto_framer.cc index 931ac99..ffddb81 100644 --- a/quic/core/crypto/crypto_framer.cc +++ b/quic/core/crypto/crypto_framer.cc
@@ -32,7 +32,7 @@ void OnError(CryptoFramer* /*framer*/) override { error_ = true; } void OnHandshakeMessage(const CryptoHandshakeMessage& message) override { - out_ = QuicMakeUnique<CryptoHandshakeMessage>(message); + out_ = std::make_unique<CryptoHandshakeMessage>(message); } bool error() const { return error_; } @@ -230,7 +230,7 @@ } } - return QuicMakeUnique<QuicData>(buffer.release(), len, true); + return std::make_unique<QuicData>(buffer.release(), len, true); } void CryptoFramer::Clear() {
diff --git a/quic/core/crypto/crypto_server_test.cc b/quic/core/crypto/crypto_server_test.cc index 3216ea8..c3ca92c 100644 --- a/quic/core/crypto/crypto_server_test.cc +++ b/quic/core/crypto/crypto_server_test.cc
@@ -218,7 +218,7 @@ config_.ValidateClientHello( message, client_address_.host(), server_address, supported_versions_.front().transport_version, &clock_, signed_config_, - QuicMakeUnique<ValidateCallback>(this, true, "", &called)); + std::make_unique<ValidateCallback>(this, true, "", &called)); EXPECT_TRUE(called); } @@ -236,7 +236,7 @@ config_.ValidateClientHello( message, client_address_.host(), server_address, supported_versions_.front().transport_version, &clock_, signed_config_, - QuicMakeUnique<ValidateCallback>(this, false, error_substr, called)); + std::make_unique<ValidateCallback>(this, false, error_substr, called)); } class ProcessCallback : public ProcessClientHelloResultCallback { @@ -297,8 +297,8 @@ supported_versions_.front(), supported_versions_, &clock_, rand_, &compressed_certs_cache_, params_, signed_config_, /*total_framing_overhead=*/50, chlo_packet_size_, - QuicMakeUnique<ProcessCallback>(result, should_succeed, error_substr, - &called, &out_)); + std::make_unique<ProcessCallback>(result, should_succeed, error_substr, + &called, &out_)); EXPECT_TRUE(called); }
diff --git a/quic/core/crypto/crypto_utils.cc b/quic/core/crypto/crypto_utils.cc index 642799e..89d5379 100644 --- a/quic/core/crypto/crypto_utils.cc +++ b/quic/core/crypto/crypto_utils.cc
@@ -134,12 +134,12 @@ encryption_label = server_label; decryption_label = client_label; } - crypters->encrypter = QuicMakeUnique<Aes128GcmEncrypter>(); + crypters->encrypter = std::make_unique<Aes128GcmEncrypter>(); std::vector<uint8_t> encryption_secret = HkdfExpandLabel( hash, handshake_secret, encryption_label, EVP_MD_size(hash)); SetKeyAndIV(hash, encryption_secret, crypters->encrypter.get()); - crypters->decrypter = QuicMakeUnique<Aes128GcmDecrypter>(); + crypters->decrypter = std::make_unique<Aes128GcmDecrypter>(); std::vector<uint8_t> decryption_secret = HkdfExpandLabel( hash, handshake_secret, decryption_label, EVP_MD_size(hash)); SetKeyAndIV(hash, decryption_secret, crypters->decrypter.get()); @@ -191,7 +191,7 @@ pre_shared_key.size() + 8 + premaster_secret.size() + 8; - psk_premaster_secret = QuicMakeUnique<char[]>(psk_premaster_secret_size); + psk_premaster_secret = std::make_unique<char[]>(psk_premaster_secret_size); QuicDataWriter writer(psk_premaster_secret_size, psk_premaster_secret.get(), HOST_BYTE_ORDER);
diff --git a/quic/core/crypto/curve25519_key_exchange_test.cc b/quic/core/crypto/curve25519_key_exchange_test.cc index 93aa298..aeaf52f 100644 --- a/quic/core/crypto/curve25519_key_exchange_test.cc +++ b/quic/core/crypto/curve25519_key_exchange_test.cc
@@ -84,13 +84,14 @@ std::string alice_shared, bob_shared; TestCallbackResult alice_result; ASSERT_FALSE(alice_result.ok()); - alice->CalculateSharedKeyAsync(bob_public, &alice_shared, - QuicMakeUnique<TestCallback>(&alice_result)); + alice->CalculateSharedKeyAsync( + bob_public, &alice_shared, + std::make_unique<TestCallback>(&alice_result)); ASSERT_TRUE(alice_result.ok()); TestCallbackResult bob_result; ASSERT_FALSE(bob_result.ok()); bob->CalculateSharedKeyAsync(alice_public, &bob_shared, - QuicMakeUnique<TestCallback>(&bob_result)); + std::make_unique<TestCallback>(&bob_result)); ASSERT_TRUE(bob_result.ok()); ASSERT_EQ(alice_shared, bob_shared); ASSERT_NE(0u, alice_shared.length());
diff --git a/quic/core/crypto/p256_key_exchange_test.cc b/quic/core/crypto/p256_key_exchange_test.cc index 34a4993..694fb62 100644 --- a/quic/core/crypto/p256_key_exchange_test.cc +++ b/quic/core/crypto/p256_key_exchange_test.cc
@@ -89,13 +89,14 @@ std::string alice_shared, bob_shared; TestCallbackResult alice_result; ASSERT_FALSE(alice_result.ok()); - alice->CalculateSharedKeyAsync(bob_public, &alice_shared, - QuicMakeUnique<TestCallback>(&alice_result)); + alice->CalculateSharedKeyAsync( + bob_public, &alice_shared, + std::make_unique<TestCallback>(&alice_result)); ASSERT_TRUE(alice_result.ok()); TestCallbackResult bob_result; ASSERT_FALSE(bob_result.ok()); bob->CalculateSharedKeyAsync(alice_public, &bob_shared, - QuicMakeUnique<TestCallback>(&bob_result)); + std::make_unique<TestCallback>(&bob_result)); ASSERT_TRUE(bob_result.ok()); ASSERT_EQ(alice_shared, bob_shared); ASSERT_NE(0u, alice_shared.length());
diff --git a/quic/core/crypto/quic_crypto_server_config.cc b/quic/core/crypto/quic_crypto_server_config.cc index 862dc62..95705e5 100644 --- a/quic/core/crypto/quic_crypto_server_config.cc +++ b/quic/core/crypto/quic_crypto_server_config.cc
@@ -118,7 +118,7 @@ // static std::unique_ptr<KeyExchangeSource> KeyExchangeSource::Default() { - return QuicMakeUnique<DefaultKeyExchangeSource>(); + return std::make_unique<DefaultKeyExchangeSource>(); } class ValidateClientHelloHelper { @@ -665,7 +665,7 @@ QuicByteCount chlo_packet_size, std::unique_ptr<ProcessClientHelloResultCallback> done_cb) const { DCHECK(done_cb); - auto context = QuicMakeUnique<ProcessClientHelloContext>( + auto context = std::make_unique<ProcessClientHelloContext>( validate_chlo_result, reject_only, connection_id, server_address, client_address, version, supported_versions, clock, rand, compressed_certs_cache, params, signed_config, total_framing_overhead, @@ -709,7 +709,7 @@ const std::string sni = std::string(context->info().sni); const QuicTransportVersion transport_version = context->transport_version(); - auto cb = QuicMakeUnique<ProcessClientHelloCallback>( + auto cb = std::make_unique<ProcessClientHelloCallback>( this, std::move(context), configs); DCHECK(proof_source_.get()); @@ -739,7 +739,7 @@ return; } - auto out_diversification_nonce = QuicMakeUnique<DiversificationNonce>(); + auto out_diversification_nonce = std::make_unique<DiversificationNonce>(); QuicStringPiece cert_sct; if (context->client_hello().GetStringPiece(kCertificateSCTTag, &cert_sct) && @@ -747,7 +747,7 @@ context->params()->sct_supported_by_client = true; } - auto out = QuicMakeUnique<CryptoHandshakeMessage>(); + auto out = std::make_unique<CryptoHandshakeMessage>(); if (!context->info().reject_reasons.empty() || !configs.requested) { BuildRejectionAndRecordStats(*context, *configs.primary, context->info().reject_reasons, out.get()); @@ -795,7 +795,7 @@ configs.requested->key_exchanges[key_exchange_index].get(); std::string* initial_premaster_secret = &context->params()->initial_premaster_secret; - auto cb = QuicMakeUnique<ProcessClientHelloAfterGetProofCallback>( + auto cb = std::make_unique<ProcessClientHelloAfterGetProofCallback>( this, std::move(proof_source_details), key_exchange->type(), std::move(out), public_value, std::move(context), configs); key_exchange->CalculateSharedKeyAsync(public_value, initial_premaster_secret, @@ -920,7 +920,7 @@ hkdf_input.append(QuicCryptoConfig::kInitialLabel, label_len); hkdf_input.append(hkdf_suffix); - auto out_diversification_nonce = QuicMakeUnique<DiversificationNonce>(); + auto out_diversification_nonce = std::make_unique<DiversificationNonce>(); context->rand()->RandBytes(out_diversification_nonce->data(), out_diversification_nonce->size()); CryptoUtils::Diversification diversification = @@ -1009,7 +1009,7 @@ const std::string sni(context->info().sni); const QuicTransportVersion transport_version = context->transport_version(); - auto cb = QuicMakeUnique<SendRejectWithFallbackConfigCallback>( + auto cb = std::make_unique<SendRejectWithFallbackConfigCallback>( this, std::move(context), fallback_config); proof_source_->GetProof(server_address, sni, fallback_config->serialized, transport_version, chlo_hash, std::move(cb)); @@ -1025,12 +1025,12 @@ return; } - auto out = QuicMakeUnique<CryptoHandshakeMessage>(); + auto out = std::make_unique<CryptoHandshakeMessage>(); BuildRejectionAndRecordStats(*context, *fallback_config, {SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE}, out.get()); - context->Succeed(std::move(out), QuicMakeUnique<DiversificationNonce>(), + context->Succeed(std::move(out), std::make_unique<DiversificationNonce>(), std::move(proof_source_details)); } @@ -1320,7 +1320,7 @@ message.SetStringPiece(kSourceAddressTokenTag, source_address_token); auto proof_source_cb = - QuicMakeUnique<BuildServerConfigUpdateMessageProofSourceCallback>( + std::make_unique<BuildServerConfigUpdateMessageProofSourceCallback>( this, compressed_certs_cache, common_cert_sets, params, std::move(message), std::move(cb));
diff --git a/quic/core/crypto/quic_decrypter.cc b/quic/core/crypto/quic_decrypter.cc index 79369f0..2fb1deb 100644 --- a/quic/core/crypto/quic_decrypter.cc +++ b/quic/core/crypto/quic_decrypter.cc
@@ -25,9 +25,9 @@ std::unique_ptr<QuicDecrypter> QuicDecrypter::Create(QuicTag algorithm) { switch (algorithm) { case kAESG: - return QuicMakeUnique<Aes128Gcm12Decrypter>(); + return std::make_unique<Aes128Gcm12Decrypter>(); case kCC20: - return QuicMakeUnique<ChaCha20Poly1305Decrypter>(); + return std::make_unique<ChaCha20Poly1305Decrypter>(); default: QUIC_LOG(FATAL) << "Unsupported algorithm: " << algorithm; return nullptr; @@ -39,11 +39,11 @@ uint32_t cipher_suite) { switch (cipher_suite) { case TLS1_CK_AES_128_GCM_SHA256: - return QuicMakeUnique<Aes128GcmDecrypter>(); + return std::make_unique<Aes128GcmDecrypter>(); case TLS1_CK_AES_256_GCM_SHA384: - return QuicMakeUnique<Aes256GcmDecrypter>(); + return std::make_unique<Aes256GcmDecrypter>(); case TLS1_CK_CHACHA20_POLY1305_SHA256: - return QuicMakeUnique<ChaCha20Poly1305TlsDecrypter>(); + return std::make_unique<ChaCha20Poly1305TlsDecrypter>(); default: QUIC_BUG << "TLS cipher suite is unknown to QUIC"; return nullptr;
diff --git a/quic/core/crypto/quic_encrypter.cc b/quic/core/crypto/quic_encrypter.cc index f264bfd..f6b2490 100644 --- a/quic/core/crypto/quic_encrypter.cc +++ b/quic/core/crypto/quic_encrypter.cc
@@ -22,9 +22,9 @@ std::unique_ptr<QuicEncrypter> QuicEncrypter::Create(QuicTag algorithm) { switch (algorithm) { case kAESG: - return QuicMakeUnique<Aes128Gcm12Encrypter>(); + return std::make_unique<Aes128Gcm12Encrypter>(); case kCC20: - return QuicMakeUnique<ChaCha20Poly1305Encrypter>(); + return std::make_unique<ChaCha20Poly1305Encrypter>(); default: QUIC_LOG(FATAL) << "Unsupported algorithm: " << algorithm; return nullptr; @@ -36,11 +36,11 @@ uint32_t cipher_suite) { switch (cipher_suite) { case TLS1_CK_AES_128_GCM_SHA256: - return QuicMakeUnique<Aes128GcmEncrypter>(); + return std::make_unique<Aes128GcmEncrypter>(); case TLS1_CK_AES_256_GCM_SHA384: - return QuicMakeUnique<Aes256GcmEncrypter>(); + return std::make_unique<Aes256GcmEncrypter>(); case TLS1_CK_CHACHA20_POLY1305_SHA256: - return QuicMakeUnique<ChaCha20Poly1305TlsEncrypter>(); + return std::make_unique<ChaCha20Poly1305TlsEncrypter>(); default: QUIC_BUG << "TLS cipher suite is unknown to QUIC"; return nullptr;
diff --git a/quic/core/crypto/transport_parameters.cc b/quic/core/crypto/transport_parameters.cc index 8f2349c..8e4fa40 100644 --- a/quic/core/crypto/transport_parameters.cc +++ b/quic/core/crypto/transport_parameters.cc
@@ -706,7 +706,7 @@ preferred_address.stateless_reset_token.assign( CBS_data(&value), CBS_data(&value) + CBS_len(&value)); out->preferred_address = - QuicMakeUnique<TransportParameters::PreferredAddress>( + std::make_unique<TransportParameters::PreferredAddress>( preferred_address); } break; case TransportParameters::kActiveConnectionIdLimit:
diff --git a/quic/core/crypto/transport_parameters_test.cc b/quic/core/crypto/transport_parameters_test.cc index 7379224..e782c38 100644 --- a/quic/core/crypto/transport_parameters_test.cc +++ b/quic/core/crypto/transport_parameters_test.cc
@@ -73,7 +73,7 @@ preferred_address.ipv6_socket_address = CreateFakeV6SocketAddress(); preferred_address.connection_id = kFakePreferredConnectionId; preferred_address.stateless_reset_token = kFakePreferredStatelessResetToken; - return QuicMakeUnique<TransportParameters::PreferredAddress>( + return std::make_unique<TransportParameters::PreferredAddress>( preferred_address); } @@ -594,7 +594,7 @@ orig_params.version = kFakeVersionLabel; orig_params.max_packet_size.set_value(kFakeMaxPacketSize); - orig_params.google_quic_params = QuicMakeUnique<CryptoHandshakeMessage>(); + orig_params.google_quic_params = std::make_unique<CryptoHandshakeMessage>(); const std::string kTestString = "test string"; orig_params.google_quic_params->SetStringPiece(42, kTestString); const uint32_t kTestValue = 12;
diff --git a/quic/core/http/end_to_end_test.cc b/quic/core/http/end_to_end_test.cc index 3a6d514..a59100a 100644 --- a/quic/core/http/end_to_end_test.cc +++ b/quic/core/http/end_to_end_test.cc
@@ -385,7 +385,7 @@ client_writer_->Initialize( QuicConnectionPeer::GetHelper(GetClientConnection()), QuicConnectionPeer::GetAlarmFactory(GetClientConnection()), - QuicMakeUnique<ClientDelegate>(client_->client())); + std::make_unique<ClientDelegate>(client_->client())); } initialized_ = true; return client_->client()->connected(); @@ -409,7 +409,8 @@ crypto_test_utils::ProofSourceForTesting(), server_config_, server_supported_versions_, &memory_cache_backend_, expected_server_connection_id_length_); - server_thread_ = QuicMakeUnique<ServerThread>(test_server, server_address_); + server_thread_ = + std::make_unique<ServerThread>(test_server, server_address_); if (chlo_multiplier_ != 0) { server_thread_->server()->SetChloMultiplier(chlo_multiplier_); } @@ -425,7 +426,7 @@ server_writer_->Initialize(QuicDispatcherPeer::GetHelper(dispatcher), QuicDispatcherPeer::GetAlarmFactory(dispatcher), - QuicMakeUnique<ServerDelegate>(dispatcher)); + std::make_unique<ServerDelegate>(dispatcher)); if (stream_factory_ != nullptr) { static_cast<QuicTestServer*>(server_thread_->server()) ->SetSpdyStreamFactory(stream_factory_); @@ -3406,7 +3407,7 @@ client_writer_->Initialize( QuicConnectionPeer::GetHelper(GetClientConnection()), QuicConnectionPeer::GetAlarmFactory(GetClientConnection()), - QuicMakeUnique<ClientDelegate>(client_->client())); + std::make_unique<ClientDelegate>(client_->client())); initialized_ = true; ASSERT_TRUE(client_->client()->connected());
diff --git a/quic/core/http/http_decoder_test.cc b/quic/core/http/http_decoder_test.cc index 6090cad..0323319 100644 --- a/quic/core/http/http_decoder_test.cc +++ b/quic/core/http/http_decoder_test.cc
@@ -148,7 +148,7 @@ const QuicByteCount total_length = QuicDataWriter::GetVarInt62Len(frame_type) + QuicDataWriter::GetVarInt62Len(payload_length) + payload_length; - input = QuicMakeUnique<char[]>(total_length); + input = std::make_unique<char[]>(total_length); QuicDataWriter writer(total_length, input.get()); writer.WriteVarInt62(frame_type); @@ -615,7 +615,7 @@ QuicDataWriter::GetVarInt62Len(frame_type) + QuicDataWriter::GetVarInt62Len(payload_length); - auto input = QuicMakeUnique<char[]>(header_length); + auto input = std::make_unique<char[]>(header_length); QuicDataWriter writer(header_length, input.get()); writer.WriteVarInt62(frame_type); writer.WriteVarInt62(payload_length);
diff --git a/quic/core/http/quic_client_promised_info.cc b/quic/core/http/quic_client_promised_info.cc index 6af35d5..34ea5fd 100644 --- a/quic/core/http/quic_client_promised_info.cc +++ b/quic/core/http/quic_client_promised_info.cc
@@ -72,7 +72,7 @@ } void QuicClientPromisedInfo::OnResponseHeaders(const SpdyHeaderBlock& headers) { - response_headers_ = QuicMakeUnique<SpdyHeaderBlock>(headers.Clone()); + response_headers_ = std::make_unique<SpdyHeaderBlock>(headers.Clone()); if (client_request_delegate_) { // We already have a client request waiting. FinalValidation();
diff --git a/quic/core/http/quic_client_promised_info_test.cc b/quic/core/http/quic_client_promised_info_test.cc index cd54dde..83c4988 100644 --- a/quic/core/http/quic_client_promised_info_test.cc +++ b/quic/core/http/quic_client_promised_info_test.cc
@@ -80,11 +80,11 @@ headers_[":status"] = "200"; headers_["content-length"] = "11"; - stream_ = QuicMakeUnique<QuicSpdyClientStream>( + stream_ = std::make_unique<QuicSpdyClientStream>( GetNthClientInitiatedBidirectionalStreamId( connection_->transport_version(), 0), &session_, BIDIRECTIONAL); - stream_visitor_ = QuicMakeUnique<StreamVisitor>(); + stream_visitor_ = std::make_unique<StreamVisitor>(); stream_->set_visitor(stream_visitor_.get()); push_promise_[":path"] = "/bar";
diff --git a/quic/core/http/quic_headers_stream_test.cc b/quic/core/http/quic_headers_stream_test.cc index cfc5381..b5385b7 100644 --- a/quic/core/http/quic_headers_stream_test.cc +++ b/quic/core/http/quic_headers_stream_test.cc
@@ -258,7 +258,7 @@ } void SaveToHandler(size_t size, const QuicHeaderList& header_list) { - headers_handler_ = QuicMakeUnique<TestHeadersHandler>(); + headers_handler_ = std::make_unique<TestHeadersHandler>(); headers_handler_->OnHeaderBlockStart(); for (const auto& p : header_list) { headers_handler_->OnHeader(p.first, p.second); @@ -304,7 +304,7 @@ /*parent_stream_id=*/0, /*exclusive=*/false, fin, kFrameComplete)); } - headers_handler_ = QuicMakeUnique<TestHeadersHandler>(); + headers_handler_ = std::make_unique<TestHeadersHandler>(); EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id)) .WillOnce(Return(headers_handler_.get())); EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1); @@ -415,7 +415,7 @@ // Parse the outgoing data and check that it matches was was written. EXPECT_CALL(visitor_, OnPushPromise(stream_id, promised_stream_id, kFrameComplete)); - headers_handler_ = QuicMakeUnique<TestHeadersHandler>(); + headers_handler_ = std::make_unique<TestHeadersHandler>(); EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id)) .WillOnce(Return(headers_handler_.get())); EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1); @@ -734,7 +734,7 @@ TEST_P(QuicHeadersStreamTest, HpackDecoderDebugVisitor) { auto hpack_decoder_visitor = - QuicMakeUnique<StrictMock<MockQuicHpackDebugVisitor>>(); + std::make_unique<StrictMock<MockQuicHpackDebugVisitor>>(); { InSequence seq; // Number of indexed representations generated in headers below. @@ -787,7 +787,7 @@ TEST_P(QuicHeadersStreamTest, HpackEncoderDebugVisitor) { auto hpack_encoder_visitor = - QuicMakeUnique<StrictMock<MockQuicHpackDebugVisitor>>(); + std::make_unique<StrictMock<MockQuicHpackDebugVisitor>>(); if (perspective() == Perspective::IS_SERVER) { InSequence seq; for (int i = 1; i < 4; i++) {
diff --git a/quic/core/http/quic_receive_control_stream.cc b/quic/core/http/quic_receive_control_stream.cc index 0ff9e38..746efdb 100644 --- a/quic/core/http/quic_receive_control_stream.cc +++ b/quic/core/http/quic_receive_control_stream.cc
@@ -159,7 +159,7 @@ QuicReceiveControlStream::QuicReceiveControlStream(PendingStream* pending) : QuicStream(pending, READ_UNIDIRECTIONAL, /*is_static=*/true), settings_frame_received_(false), - http_decoder_visitor_(QuicMakeUnique<HttpDecoderVisitor>(this)), + http_decoder_visitor_(std::make_unique<HttpDecoderVisitor>(this)), decoder_(http_decoder_visitor_.get()) { sequencer()->set_level_triggered(true); }
diff --git a/quic/core/http/quic_send_control_stream_test.cc b/quic/core/http/quic_send_control_stream_test.cc index 49cc0ed..6ee06bd 100644 --- a/quic/core/http/quic_send_control_stream_test.cc +++ b/quic/core/http/quic_send_control_stream_test.cc
@@ -100,7 +100,7 @@ "06" // SETTINGS_MAX_HEADER_LIST_SIZE "4400"); // 1024 - auto buffer = QuicMakeUnique<char[]>(expected_write_data.size()); + auto buffer = std::make_unique<char[]>(expected_write_data.size()); QuicDataWriter writer(expected_write_data.size(), buffer.get()); // A lambda to save and consume stream data when QuicSession::WritevData() is
diff --git a/quic/core/http/quic_server_session_base_test.cc b/quic/core/http/quic_server_session_base_test.cc index 2236d42..616da68 100644 --- a/quic/core/http/quic_server_session_base_test.cc +++ b/quic/core/http/quic_server_session_base_test.cc
@@ -142,7 +142,7 @@ connection_ = new StrictMock<MockQuicConnection>( &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions); connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<TestServerSession>( + session_ = std::make_unique<TestServerSession>( config_, connection_, &owner_, &stream_helper_, &crypto_config_, &compressed_certs_cache_, &memory_cache_backend_); MockClock clock;
diff --git a/quic/core/http/quic_spdy_client_session.cc b/quic/core/http/quic_spdy_client_session.cc index ef9f2e2..ac4f041 100644 --- a/quic/core/http/quic_spdy_client_session.cc +++ b/quic/core/http/quic_spdy_client_session.cc
@@ -100,7 +100,7 @@ std::unique_ptr<QuicSpdyClientStream> QuicSpdyClientSession::CreateClientStream() { - return QuicMakeUnique<QuicSpdyClientStream>( + return std::make_unique<QuicSpdyClientStream>( GetNextOutgoingBidirectionalStreamId(), this, BIDIRECTIONAL); } @@ -169,7 +169,7 @@ std::unique_ptr<QuicCryptoClientStreamBase> QuicSpdyClientSession::CreateQuicCryptoStream() { - return QuicMakeUnique<QuicCryptoClientStream>( + return std::make_unique<QuicCryptoClientStream>( server_id_, this, crypto_config_->proof_verifier()->CreateDefaultContext(), crypto_config_, this);
diff --git a/quic/core/http/quic_spdy_client_session_test.cc b/quic/core/http/quic_spdy_client_session_test.cc index 3601873..4291763 100644 --- a/quic/core/http/quic_spdy_client_session_test.cc +++ b/quic/core/http/quic_spdy_client_session_test.cc
@@ -59,7 +59,7 @@ push_promise_index) {} std::unique_ptr<QuicSpdyClientStream> CreateClientStream() override { - return QuicMakeUnique<MockQuicSpdyClientStream>( + return std::make_unique<MockQuicSpdyClientStream>( GetNextOutgoingBidirectionalStreamId(), this, BIDIRECTIONAL); } @@ -98,7 +98,7 @@ connection_ = new PacketSavingConnection(&helper_, &alarm_factory_, Perspective::IS_CLIENT, SupportedVersions(GetParam())); - session_ = QuicMakeUnique<TestQuicSpdyClientSession>( + session_ = std::make_unique<TestQuicSpdyClientSession>( DefaultQuicConfig(), SupportedVersions(GetParam()), connection_, QuicServerId(kServerHostname, kPort, false), &crypto_config_, &push_promise_index_); @@ -539,11 +539,11 @@ if (GetParam().KnowsWhichDecrypterToUse()) { connection_->InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); } else { connection_->SetDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); } EXPECT_CALL(*connection_, ProcessUdpPacket(server_address, client_address, _)) @@ -596,7 +596,7 @@ QuicStreamId stream_id = QuicSessionPeer::GetNextOutgoingBidirectionalStreamId(session_.get()); QuicSessionPeer::ActivateStream( - session_.get(), QuicMakeUnique<QuicSpdyClientStream>( + session_.get(), std::make_unique<QuicSpdyClientStream>( stream_id, session_.get(), BIDIRECTIONAL)); session_->set_max_allowed_push_id(GetNthServerInitiatedUnidirectionalStreamId( @@ -906,7 +906,7 @@ QuicStreamId stream_id = QuicSessionPeer::GetNextOutgoingBidirectionalStreamId(session_.get()); QuicSessionPeer::ActivateStream( - session_.get(), QuicMakeUnique<QuicSpdyClientStream>( + session_.get(), std::make_unique<QuicSpdyClientStream>( stream_id, session_.get(), BIDIRECTIONAL)); session_->set_max_allowed_push_id(kMaxQuicStreamId);
diff --git a/quic/core/http/quic_spdy_client_stream_test.cc b/quic/core/http/quic_spdy_client_stream_test.cc index 4354a2f..0397bdb 100644 --- a/quic/core/http/quic_spdy_client_stream_test.cc +++ b/quic/core/http/quic_spdy_client_stream_test.cc
@@ -72,11 +72,11 @@ headers_[":status"] = "200"; headers_["content-length"] = "11"; - stream_ = QuicMakeUnique<QuicSpdyClientStream>( + stream_ = std::make_unique<QuicSpdyClientStream>( GetNthClientInitiatedBidirectionalStreamId( connection_->transport_version(), 0), &session_, BIDIRECTIONAL); - stream_visitor_ = QuicMakeUnique<StreamVisitor>(); + stream_visitor_ = std::make_unique<StreamVisitor>(); stream_->set_visitor(stream_visitor_.get()); }
diff --git a/quic/core/http/quic_spdy_session.cc b/quic/core/http/quic_spdy_session.cc index b789857..32984ca 100644 --- a/quic/core/http/quic_spdy_session.cc +++ b/quic/core/http/quic_spdy_session.cc
@@ -377,7 +377,7 @@ DCHECK_EQ(headers_stream_id, QuicUtils::GetHeadersStreamId(transport_version())); } - auto headers_stream = QuicMakeUnique<QuicHeadersStream>((this)); + auto headers_stream = std::make_unique<QuicHeadersStream>((this)); DCHECK_EQ(QuicUtils::GetHeadersStreamId(transport_version()), headers_stream->id()); @@ -386,10 +386,10 @@ } else { ConfigureMaxIncomingDynamicStreamsToSend( config()->GetMaxIncomingUnidirectionalStreamsToSend()); - qpack_encoder_ = QuicMakeUnique<QpackEncoder>(this); + qpack_encoder_ = std::make_unique<QpackEncoder>(this); qpack_decoder_ = - QuicMakeUnique<QpackDecoder>(qpack_maximum_dynamic_table_capacity_, - qpack_maximum_blocked_streams_, this); + std::make_unique<QpackDecoder>(qpack_maximum_dynamic_table_capacity_, + qpack_maximum_blocked_streams_, this); MaybeInitializeHttp3UnidirectionalStreams(); // TODO(b/112770235): Send SETTINGS_QPACK_BLOCKED_STREAMS with value // qpack_maximum_blocked_streams_. @@ -862,7 +862,7 @@ void QuicSpdySession::SetHpackDecoderDebugVisitor( std::unique_ptr<QuicHpackDebugVisitor> visitor) { h2_deframer_.SetDecoderHeaderTableDebugVisitor( - QuicMakeUnique<HeaderTableDebugVisitor>( + std::make_unique<HeaderTableDebugVisitor>( connection()->helper()->GetClock(), std::move(visitor))); } @@ -919,7 +919,7 @@ CloseConnectionOnDuplicateHttp3UnidirectionalStreams("Control"); return false; } - auto receive_stream = QuicMakeUnique<QuicReceiveControlStream>(pending); + auto receive_stream = std::make_unique<QuicReceiveControlStream>(pending); receive_control_stream_ = receive_stream.get(); ActivateStream(std::move(receive_stream)); receive_control_stream_->SetUnblocked(); @@ -936,7 +936,7 @@ CloseConnectionOnDuplicateHttp3UnidirectionalStreams("QPACK encoder"); return false; } - auto encoder_receive = QuicMakeUnique<QpackReceiveStream>( + auto encoder_receive = std::make_unique<QpackReceiveStream>( pending, qpack_decoder_->encoder_stream_receiver()); qpack_encoder_receive_stream_ = encoder_receive.get(); ActivateStream(std::move(encoder_receive)); @@ -949,7 +949,7 @@ CloseConnectionOnDuplicateHttp3UnidirectionalStreams("QPACK decoder"); return false; } - auto decoder_receive = QuicMakeUnique<QpackReceiveStream>( + auto decoder_receive = std::make_unique<QpackReceiveStream>( pending, qpack_encoder_->decoder_stream_receiver()); qpack_decoder_receive_stream_ = decoder_receive.get(); ActivateStream(std::move(decoder_receive)); @@ -967,7 +967,7 @@ void QuicSpdySession::MaybeInitializeHttp3UnidirectionalStreams() { DCHECK(VersionHasStreamType(transport_version())); if (!send_control_stream_ && CanOpenNextOutgoingUnidirectionalStream()) { - auto send_control = QuicMakeUnique<QuicSendControlStream>( + auto send_control = std::make_unique<QuicSendControlStream>( GetNextOutgoingUnidirectionalStreamId(), this, qpack_maximum_dynamic_table_capacity_, max_inbound_header_list_size_); send_control_stream_ = send_control.get(); @@ -976,7 +976,7 @@ if (!qpack_decoder_send_stream_ && CanOpenNextOutgoingUnidirectionalStream()) { - auto decoder_send = QuicMakeUnique<QpackSendStream>( + auto decoder_send = std::make_unique<QpackSendStream>( GetNextOutgoingUnidirectionalStreamId(), this, kQpackDecoderStream); qpack_decoder_send_stream_ = decoder_send.get(); ActivateStream(std::move(decoder_send)); @@ -986,7 +986,7 @@ if (!qpack_encoder_send_stream_ && CanOpenNextOutgoingUnidirectionalStream()) { - auto encoder_send = QuicMakeUnique<QpackSendStream>( + auto encoder_send = std::make_unique<QpackSendStream>( GetNextOutgoingUnidirectionalStreamId(), this, kQpackEncoderStream); qpack_encoder_send_stream_ = encoder_send.get(); ActivateStream(std::move(encoder_send));
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc index 4b14600..e5d50b2 100644 --- a/quic/core/http/quic_spdy_session_test.cc +++ b/quic/core/http/quic_spdy_session_test.cc
@@ -158,7 +158,7 @@ Initialize(); this->connection()->SetEncrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(connection->perspective())); + std::make_unique<NullEncrypter>(connection->perspective())); } ~TestSession() override { delete connection(); }
diff --git a/quic/core/http/quic_spdy_stream.cc b/quic/core/http/quic_spdy_stream.cc index d77cfef..223442c 100644 --- a/quic/core/http/quic_spdy_stream.cc +++ b/quic/core/http/quic_spdy_stream.cc
@@ -193,7 +193,7 @@ trailers_decompressed_(false), trailers_consumed_(false), priority_sent_(false), - http_decoder_visitor_(QuicMakeUnique<HttpDecoderVisitor>(this)), + http_decoder_visitor_(std::make_unique<HttpDecoderVisitor>(this)), decoder_(http_decoder_visitor_.get()), sequencer_offset_(0), is_decoder_processing_input_(false), @@ -227,7 +227,7 @@ trailers_decompressed_(false), trailers_consumed_(false), priority_sent_(false), - http_decoder_visitor_(QuicMakeUnique<HttpDecoderVisitor>(this)), + http_decoder_visitor_(std::make_unique<HttpDecoderVisitor>(this)), decoder_(http_decoder_visitor_.get()), sequencer_offset_(sequencer()->NumBytesConsumed()), is_decoder_processing_input_(false), @@ -871,7 +871,7 @@ sequencer()->MarkConsumed(body_manager_.OnNonBody(header_length)); qpack_decoded_headers_accumulator_ = - QuicMakeUnique<QpackDecodedHeadersAccumulator>( + std::make_unique<QpackDecodedHeadersAccumulator>( id(), spdy_session_->qpack_decoder(), this, spdy_session_->max_inbound_header_list_size()); @@ -939,7 +939,7 @@ body_manager_.OnNonBody(header_length + push_id_length)); qpack_decoded_headers_accumulator_ = - QuicMakeUnique<QpackDecodedHeadersAccumulator>( + std::make_unique<QpackDecodedHeadersAccumulator>( id(), spdy_session_->qpack_decoder(), this, spdy_session_->max_inbound_header_list_size());
diff --git a/quic/core/http/quic_spdy_stream_test.cc b/quic/core/http/quic_spdy_stream_test.cc index 572ba5c..3fcf853 100644 --- a/quic/core/http/quic_spdy_stream_test.cc +++ b/quic/core/http/quic_spdy_stream_test.cc
@@ -179,7 +179,7 @@ // Return QPACK-encoded header block without using the dynamic table. std::string EncodeQpackHeaders(const SpdyHeaderBlock& header) { NoopQpackStreamSenderDelegate encoder_stream_sender_delegate; - auto qpack_encoder = QuicMakeUnique<QpackEncoder>(session_.get()); + auto qpack_encoder = std::make_unique<QpackEncoder>(session_.get()); qpack_encoder->set_qpack_stream_sender_delegate( &encoder_stream_sender_delegate); // QpackEncoder does not use the dynamic table by default, @@ -196,7 +196,7 @@ Perspective perspective) { connection_ = new StrictMock<MockQuicConnection>( &helper_, &alarm_factory_, perspective, SupportedVersions(GetParam())); - session_ = QuicMakeUnique<StrictMock<MockQuicSpdySession>>(connection_); + session_ = std::make_unique<StrictMock<MockQuicSpdySession>>(connection_); session_->Initialize(); ON_CALL(*session_, WritevData(_, _, _, _, _)) .WillByDefault(Invoke(MockQuicSession::ConsumeData));
diff --git a/quic/core/legacy_quic_stream_id_manager_test.cc b/quic/core/legacy_quic_stream_id_manager_test.cc index ca4491a..9b73519 100644 --- a/quic/core/legacy_quic_stream_id_manager_test.cc +++ b/quic/core/legacy_quic_stream_id_manager_test.cc
@@ -22,7 +22,7 @@ connection_ = new MockQuicConnection( &helper_, &alarm_factory_, perspective, ParsedVersionOfIndex(CurrentSupportedVersions(), 0)); - session_ = QuicMakeUnique<StrictMock<MockQuicSession>>(connection_); + session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_); manager_ = QuicSessionPeer::GetStreamIdManager(session_.get()); session_->Initialize(); }
diff --git a/quic/core/qpack/fuzzer/qpack_round_trip_fuzzer.cc b/quic/core/qpack/fuzzer/qpack_round_trip_fuzzer.cc index a26a6c3..8527483 100644 --- a/quic/core/qpack/fuzzer/qpack_round_trip_fuzzer.cc +++ b/quic/core/qpack/fuzzer/qpack_round_trip_fuzzer.cc
@@ -369,7 +369,7 @@ expected_header_lists_.erase(it); } - auto verifying_decoder = QuicMakeUnique<VerifyingDecoder>( + auto verifying_decoder = std::make_unique<VerifyingDecoder>( stream_id, this, &decoder_, std::move(expected_header_list)); auto result = verifying_decoders_.insert({stream_id, std::move(verifying_decoder)});
diff --git a/quic/core/qpack/offline/qpack_offline_decoder.cc b/quic/core/qpack/offline/qpack_offline_decoder.cc index dc2d864..c958725 100644 --- a/quic/core/qpack/offline/qpack_offline_decoder.cc +++ b/quic/core/qpack/offline/qpack_offline_decoder.cc
@@ -19,8 +19,7 @@ namespace quic { QpackOfflineDecoder::QpackOfflineDecoder() - : encoder_stream_error_detected_(false), - max_blocked_streams_(0) {} + : encoder_stream_error_detected_(false), max_blocked_streams_(0) {} bool QpackOfflineDecoder::DecodeAndVerifyOfflineData( QuicStringPiece input_filename, @@ -92,8 +91,8 @@ << "\" as an integer."; return false; } - qpack_decoder_ = QuicMakeUnique<QpackDecoder>(maximum_dynamic_table_capacity, - max_blocked_streams_, this); + qpack_decoder_ = std::make_unique<QpackDecoder>( + maximum_dynamic_table_capacity, max_blocked_streams_, this); qpack_decoder_->set_qpack_stream_sender_delegate( &decoder_stream_sender_delegate_); @@ -141,7 +140,7 @@ return false; } } else { - auto headers_handler = QuicMakeUnique<test::TestHeadersHandler>(); + auto headers_handler = std::make_unique<test::TestHeadersHandler>(); auto progressive_decoder = qpack_decoder_->CreateProgressiveDecoder( stream_id, headers_handler.get());
diff --git a/quic/core/qpack/qpack_decoder.cc b/quic/core/qpack/qpack_decoder.cc index b20cbdf..e2e9d28 100644 --- a/quic/core/qpack/qpack_decoder.cc +++ b/quic/core/qpack/qpack_decoder.cc
@@ -128,7 +128,7 @@ std::unique_ptr<QpackProgressiveDecoder> QpackDecoder::CreateProgressiveDecoder( QuicStreamId stream_id, QpackProgressiveDecoder::HeadersHandlerInterface* handler) { - return QuicMakeUnique<QpackProgressiveDecoder>( + return std::make_unique<QpackProgressiveDecoder>( stream_id, this, &header_table_, &decoder_stream_sender_, handler); }
diff --git a/quic/core/qpack/qpack_progressive_decoder.cc b/quic/core/qpack/qpack_progressive_decoder.cc index 51d98ff..5ce0612 100644 --- a/quic/core/qpack/qpack_progressive_decoder.cc +++ b/quic/core/qpack/qpack_progressive_decoder.cc
@@ -23,7 +23,8 @@ HeadersHandlerInterface* handler) : stream_id_(stream_id), prefix_decoder_( - QuicMakeUnique<QpackInstructionDecoder>(QpackPrefixLanguage(), this)), + std::make_unique<QpackInstructionDecoder>(QpackPrefixLanguage(), + this)), instruction_decoder_(QpackRequestStreamLanguage(), this), enforcer_(enforcer), header_table_(header_table),
diff --git a/quic/core/quic_config.cc b/quic/core/quic_config.cc index 22aef80..c62a00a 100644 --- a/quic/core/quic_config.cc +++ b/quic/core/quic_config.cc
@@ -875,12 +875,12 @@ preferred_address.ipv4_socket_address = socket_address; } params->preferred_address = - QuicMakeUnique<TransportParameters::PreferredAddress>( + std::make_unique<TransportParameters::PreferredAddress>( preferred_address); } if (!params->google_quic_params) { - params->google_quic_params = QuicMakeUnique<CryptoHandshakeMessage>(); + params->google_quic_params = std::make_unique<CryptoHandshakeMessage>(); } silent_close_.ToHandshakeMessage(params->google_quic_params.get()); initial_round_trip_time_us_.ToHandshakeMessage(
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc index 52b5f70..fce6b42 100644 --- a/quic/core/quic_connection.cc +++ b/quic/core/quic_connection.cc
@@ -3322,7 +3322,7 @@ } else { // Request using IETF QUIC PATH_CHALLENGE frame transmitted_connectivity_probe_payload_ = - QuicMakeUnique<QuicPathFrameBuffer>(); + std::make_unique<QuicPathFrameBuffer>(); probing_packet = packet_generator_.SerializePathChallengeConnectivityProbingPacket( transmitted_connectivity_probe_payload_.get());
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc index 6df0f7d..31986f0 100644 --- a/quic/core/quic_connection_test.cc +++ b/quic/core/quic_connection_test.cc
@@ -365,20 +365,20 @@ if (use_tagging_decrypter_) { if (framer_.framer()->version().KnowsWhichDecrypterToUse()) { - framer_.framer()->InstallDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingDecrypter>()); - framer_.framer()->InstallDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingDecrypter>()); - framer_.framer()->InstallDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingDecrypter>()); + framer_.framer()->InstallDecrypter( + ENCRYPTION_INITIAL, std::make_unique<TaggingDecrypter>()); + framer_.framer()->InstallDecrypter( + ENCRYPTION_ZERO_RTT, std::make_unique<TaggingDecrypter>()); + framer_.framer()->InstallDecrypter( + ENCRYPTION_FORWARD_SECURE, std::make_unique<TaggingDecrypter>()); } else { framer_.framer()->SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingDecrypter>()); + std::make_unique<TaggingDecrypter>()); } } else if (framer_.framer()->version().KnowsWhichDecrypterToUse()) { framer_.framer()->InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_SERVER)); + std::make_unique<NullDecrypter>(Perspective::IS_SERVER)); } EXPECT_TRUE(framer_.ProcessPacket(packet)); if (block_on_next_write_) { @@ -610,7 +610,7 @@ notifier_(nullptr) { writer->set_perspective(perspective); SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(perspective)); + std::make_unique<NullEncrypter>(perspective)); SetDataProducer(&producer_); } TestConnection(const TestConnection&) = delete; @@ -686,7 +686,7 @@ StreamSendingState state) { ScopedPacketFlusher flusher(this); DCHECK(encryption_level >= ENCRYPTION_ZERO_RTT); - SetEncrypter(encryption_level, QuicMakeUnique<TaggingEncrypter>(0x01)); + SetEncrypter(encryption_level, std::make_unique<TaggingEncrypter>(0x01)); SetDefaultEncryptionLevel(encryption_level); struct iovec iov; MakeIOVector(data, &iov); @@ -826,7 +826,7 @@ void set_notifier(SimpleSessionNotifier* notifier) { notifier_ = notifier; } void ReturnEffectivePeerAddressForNextPacket(const QuicSocketAddress& addr) { - next_effective_peer_addr_ = QuicMakeUnique<QuicSocketAddress>(addr); + next_effective_peer_addr_ = std::make_unique<QuicSocketAddress>(addr); } bool PtoEnabled() { @@ -968,15 +968,15 @@ for (EncryptionLevel level : {ENCRYPTION_ZERO_RTT, ENCRYPTION_FORWARD_SECURE}) { peer_creator_.SetEncrypter( - level, QuicMakeUnique<NullEncrypter>(peer_framer_.perspective())); + level, std::make_unique<NullEncrypter>(peer_framer_.perspective())); } if (version().handshake_protocol == PROTOCOL_TLS1_3) { connection_.SetEncrypter( ENCRYPTION_INITIAL, - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT)); connection_.InstallDecrypter( ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); } QuicFramerPeer::SetLastSerializedServerConnectionId( QuicConnectionPeer::GetFramer(&connection_), connection_id_); @@ -1040,7 +1040,7 @@ if (connection_.version().KnowsWhichDecrypterToUse()) { connection_.InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); } } @@ -1179,17 +1179,17 @@ ENCRYPTION_INITIAL) { peer_framer_.SetEncrypter( QuicPacketCreatorPeer::GetEncryptionLevel(&peer_creator_), - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); // Set the corresponding decrypter. if (connection_.version().KnowsWhichDecrypterToUse()) { connection_.InstallDecrypter( QuicPacketCreatorPeer::GetEncryptionLevel(&peer_creator_), - QuicMakeUnique<StrictTaggingDecrypter>(0x01)); + std::make_unique<StrictTaggingDecrypter>(0x01)); connection_.RemoveDecrypter(ENCRYPTION_INITIAL); } else { connection_.SetDecrypter( QuicPacketCreatorPeer::GetEncryptionLevel(&peer_creator_), - QuicMakeUnique<StrictTaggingDecrypter>(0x01)); + std::make_unique<StrictTaggingDecrypter>(0x01)); } } @@ -1315,7 +1315,7 @@ return; } std::unique_ptr<QuicRstStreamFrame> rst_stream = - QuicMakeUnique<QuicRstStreamFrame>(1, id, error, bytes_written); + std::make_unique<QuicRstStreamFrame>(1, id, error, bytes_written); if (connection_.SendControlFrame(QuicFrame(rst_stream.get()))) { rst_stream.release(); } @@ -3111,9 +3111,9 @@ // Process a data packet to cause the visitor's OnCanWrite to be invoked. EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1); peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); SetDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<StrictTaggingDecrypter>(0x01)); + std::make_unique<StrictTaggingDecrypter>(0x01)); ProcessDataPacket(2); EXPECT_EQ(0u, connection_.NumQueuedPackets()); @@ -4210,7 +4210,7 @@ // A TaggingEncrypter puts kTagSize copies of the given byte (0x01 here) at // the end of the packet. We can test this to check which encrypter was used. connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); QuicByteCount packet_size; EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)) .WillOnce(SaveArg<3>(&packet_size)); @@ -4219,7 +4219,7 @@ EXPECT_EQ(0x01010101u, writer_->final_bytes_of_last_packet()); connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); SendStreamDataToPeer(3, "foo", 0, NO_FIN, nullptr); EXPECT_EQ(0x02020202u, writer_->final_bytes_of_last_packet()); @@ -4247,7 +4247,7 @@ // A TaggingEncrypter puts kTagSize copies of the given byte (0x01 here) at // the end of the packet. We can test this to check which encrypter was used. connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); // Attempt to send a handshake message and have the socket block. EXPECT_CALL(*send_algorithm_, CanSend(_)).WillRepeatedly(Return(true)); @@ -4258,7 +4258,7 @@ // Switch to the new encrypter. connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); // Now become writeable and flush the packets. @@ -4275,7 +4275,7 @@ DropRetransmitsForNullEncryptedPacketAfterForwardSecure) { use_tagging_decrypter(); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); QuicPacketNumber packet_number; connection_.SendCryptoStreamData(); @@ -4286,7 +4286,7 @@ // Go forward secure. connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); notifier_.NeuterUnencryptedData(); connection_.NeuterUnencryptedPackets(); @@ -4301,13 +4301,13 @@ TEST_P(QuicConnectionTest, RetransmitPacketsWithInitialEncryption) { use_tagging_decrypter(); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); connection_.SendCryptoDataWithString("foo", 0); connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); SendStreamDataToPeer(2, "bar", 0, NO_FIN, nullptr); @@ -4329,7 +4329,7 @@ const uint8_t tag = 0x07; peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process an encrypted packet which can not yet be decrypted which should // result in the packet being buffered. @@ -4338,10 +4338,10 @@ // Transition to the new encryption state and process another encrypted packet // which should result in the original packet being processed. SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(2); ProcessDataPacketAtLevel(2, !kHasStopWaiting, ENCRYPTION_ZERO_RTT); @@ -4400,7 +4400,7 @@ const uint8_t tag = 0x07; peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process an encrypted packet which can not yet be decrypted which should // result in the packet being buffered. @@ -4412,11 +4412,11 @@ // which should result in the original packets being processed. EXPECT_FALSE(connection_.GetProcessUndecryptablePacketsAlarm()->IsSet()); SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); EXPECT_TRUE(connection_.GetProcessUndecryptablePacketsAlarm()->IsSet()); connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(100); connection_.GetProcessUndecryptablePacketsAlarm()->Fire(); @@ -5676,9 +5676,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -5716,9 +5716,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -5796,9 +5796,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -5855,9 +5855,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -5992,9 +5992,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6045,9 +6045,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6103,9 +6103,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6167,9 +6167,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6251,9 +6251,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6319,9 +6319,9 @@ EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); const uint8_t tag = 0x07; SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(tag)); + std::make_unique<StrictTaggingDecrypter>(tag)); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(tag)); + std::make_unique<TaggingEncrypter>(tag)); // Process a packet from the non-crypto stream. frame1_.stream_id = 3; @@ -6460,9 +6460,9 @@ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); EXPECT_CALL(visitor_, OnStreamFrame(_)); peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); SetDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<StrictTaggingDecrypter>(0x01)); + std::make_unique<StrictTaggingDecrypter>(0x01)); ProcessDataPacket(1); connection_.SendStreamDataWithString( GetNthClientInitiatedStreamId(1, connection_.transport_version()), "foo", @@ -8409,7 +8409,7 @@ } use_tagging_decrypter(); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); connection_.SendCryptoStreamData(); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); @@ -8447,7 +8447,7 @@ } use_tagging_decrypter(); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x01)); + std::make_unique<TaggingEncrypter>(0x01)); connection_.SendCryptoStreamData(); EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); @@ -8488,11 +8488,11 @@ ProcessCryptoPacketAtLevel(1000, ENCRYPTION_INITIAL); EXPECT_TRUE(connection_.GetAckAlarm()->IsSet()); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(0x02)); + std::make_unique<StrictTaggingDecrypter>(0x02)); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); // Receives packet 1000 in application data. ProcessDataPacketAtLevel(1000, false, ENCRYPTION_ZERO_RTT); EXPECT_TRUE(connection_.GetAckAlarm()->IsSet()); @@ -8508,7 +8508,7 @@ // Simulates ACK alarm fires and verify two ACKs are flushed. EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(2); connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.GetAckAlarm()->Fire(); EXPECT_FALSE(connection_.GetAckAlarm()->IsSet()); // Receives more packets in application data. @@ -8516,9 +8516,9 @@ EXPECT_TRUE(connection_.GetAckAlarm()->IsSet()); peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); SetDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<StrictTaggingDecrypter>(0x02)); + std::make_unique<StrictTaggingDecrypter>(0x02)); // Verify zero rtt and forward secure packets get acked in the same packet. EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1); ProcessDataPacket(1003); @@ -8539,11 +8539,11 @@ ProcessCryptoPacketAtLevel(1000, ENCRYPTION_INITIAL); EXPECT_TRUE(connection_.GetAckAlarm()->IsSet()); peer_framer_.SetEncrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); SetDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<StrictTaggingDecrypter>(0x02)); + std::make_unique<StrictTaggingDecrypter>(0x02)); connection_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); // Receives packet 1000 in application data. ProcessDataPacketAtLevel(1000, false, ENCRYPTION_ZERO_RTT); EXPECT_TRUE(connection_.GetAckAlarm()->IsSet()); @@ -8555,7 +8555,7 @@ clock_.AdvanceTime(DefaultDelayedAckTime()); EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TaggingEncrypter>(0x02)); + std::make_unique<TaggingEncrypter>(0x02)); connection_.GetAckAlarm()->Fire(); // Verify ACK alarm is not set. EXPECT_FALSE(connection_.GetAckAlarm()->IsSet());
diff --git a/quic/core/quic_control_frame_manager_test.cc b/quic/core/quic_control_frame_manager_test.cc index 8059ff6..5fe5de6 100644 --- a/quic/core/quic_control_frame_manager_test.cc +++ b/quic/core/quic_control_frame_manager_test.cc
@@ -50,8 +50,8 @@ void Initialize() { connection_ = new MockQuicConnection(&helper_, &alarm_factory_, Perspective::IS_SERVER); - session_ = QuicMakeUnique<StrictMock<MockQuicSession>>(connection_); - manager_ = QuicMakeUnique<QuicControlFrameManager>(session_.get()); + session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_); + manager_ = std::make_unique<QuicControlFrameManager>(session_.get()); EXPECT_EQ(0u, QuicControlFrameManagerPeer::QueueSize(manager_.get())); EXPECT_FALSE(manager_->HasPendingRetransmission()); EXPECT_FALSE(manager_->WillingToWrite());
diff --git a/quic/core/quic_crypto_client_handshaker_test.cc b/quic/core/quic_crypto_client_handshaker_test.cc index db6b181..b70ccb6 100644 --- a/quic/core/quic_crypto_client_handshaker_test.cc +++ b/quic/core/quic_crypto_client_handshaker_test.cc
@@ -131,7 +131,7 @@ &alarm_factory_, Perspective::IS_CLIENT)), session_(connection_, false), - crypto_client_config_(QuicMakeUnique<InsecureProofVerifier>()), + crypto_client_config_(std::make_unique<InsecureProofVerifier>()), client_stream_(new QuicCryptoClientStream(server_id_, &session_, nullptr,
diff --git a/quic/core/quic_crypto_client_stream.cc b/quic/core/quic_crypto_client_stream.cc index 8f89e9a..a05caee 100644 --- a/quic/core/quic_crypto_client_stream.cc +++ b/quic/core/quic_crypto_client_stream.cc
@@ -37,12 +37,12 @@ DCHECK_EQ(Perspective::IS_CLIENT, session->connection()->perspective()); switch (session->connection()->version().handshake_protocol) { case PROTOCOL_QUIC_CRYPTO: - handshaker_ = QuicMakeUnique<QuicCryptoClientHandshaker>( + handshaker_ = std::make_unique<QuicCryptoClientHandshaker>( server_id, this, session, std::move(verify_context), crypto_config, proof_handler); break; case PROTOCOL_TLS1_3: - handshaker_ = QuicMakeUnique<TlsClientHandshaker>( + handshaker_ = std::make_unique<TlsClientHandshaker>( this, session, server_id, crypto_config->proof_verifier(), crypto_config->ssl_ctx(), std::move(verify_context), crypto_config->user_agent_id());
diff --git a/quic/core/quic_crypto_client_stream_test.cc b/quic/core/quic_crypto_client_stream_test.cc index e9d0267..10b121a 100644 --- a/quic/core/quic_crypto_client_stream_test.cc +++ b/quic/core/quic_crypto_client_stream_test.cc
@@ -48,7 +48,7 @@ // Advance the time, because timers do not like uninitialized times. connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<TestQuicSpdyClientSession>( + session_ = std::make_unique<TestQuicSpdyClientSession>( connection_, DefaultQuicConfig(), supported_versions_, server_id_, &crypto_config_); } @@ -323,7 +323,7 @@ ParsedVersionOfIndex(supported_versions_, 1)); connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<TestQuicSpdyClientSession>( + session_ = std::make_unique<TestQuicSpdyClientSession>( connection_, DefaultQuicConfig(), supported_versions_, server_id_, &crypto_config_); CompleteCryptoHandshake();
diff --git a/quic/core/quic_crypto_server_stream.cc b/quic/core/quic_crypto_server_stream.cc index 353de98..266bb90 100644 --- a/quic/core/quic_crypto_server_stream.cc +++ b/quic/core/quic_crypto_server_stream.cc
@@ -122,11 +122,11 @@ CHECK(!handshaker_); switch (session()->connection()->version().handshake_protocol) { case PROTOCOL_QUIC_CRYPTO: - handshaker_ = QuicMakeUnique<QuicCryptoServerHandshaker>( + handshaker_ = std::make_unique<QuicCryptoServerHandshaker>( crypto_config_, this, compressed_certs_cache_, session(), helper_); break; case PROTOCOL_TLS1_3: - handshaker_ = QuicMakeUnique<TlsServerHandshaker>( + handshaker_ = std::make_unique<TlsServerHandshaker>( this, session(), crypto_config_->ssl_ctx(), crypto_config_->proof_source()); break;
diff --git a/quic/core/quic_crypto_server_stream_test.cc b/quic/core/quic_crypto_server_stream_test.cc index b58d987..a4cc69e 100644 --- a/quic/core/quic_crypto_server_stream_test.cc +++ b/quic/core/quic_crypto_server_stream_test.cc
@@ -79,8 +79,8 @@ // called multiple times. void InitializeServer() { TestQuicSpdyServerSession* server_session = nullptr; - helpers_.push_back(QuicMakeUnique<NiceMock<MockQuicConnectionHelper>>()); - alarm_factories_.push_back(QuicMakeUnique<MockAlarmFactory>()); + helpers_.push_back(std::make_unique<NiceMock<MockQuicConnectionHelper>>()); + alarm_factories_.push_back(std::make_unique<MockAlarmFactory>()); CreateServerSessionForTest( server_id_, QuicTime::Delta::FromSeconds(100000), supported_versions_, helpers_.back().get(), alarm_factories_.back().get(), @@ -109,8 +109,8 @@ // testing. May be called multiple times. void InitializeFakeClient() { TestQuicSpdyClientSession* client_session = nullptr; - helpers_.push_back(QuicMakeUnique<NiceMock<MockQuicConnectionHelper>>()); - alarm_factories_.push_back(QuicMakeUnique<MockAlarmFactory>()); + helpers_.push_back(std::make_unique<NiceMock<MockQuicConnectionHelper>>()); + alarm_factories_.push_back(std::make_unique<MockAlarmFactory>()); CreateClientSessionForTest( server_id_, QuicTime::Delta::FromSeconds(100000), supported_versions_, helpers_.back().get(), alarm_factories_.back().get(),
diff --git a/quic/core/quic_crypto_stream_test.cc b/quic/core/quic_crypto_stream_test.cc index af5a8cc..0661c19 100644 --- a/quic/core/quic_crypto_stream_test.cc +++ b/quic/core/quic_crypto_stream_test.cc
@@ -217,7 +217,7 @@ // Send [1350, 2700) in ENCRYPTION_ZERO_RTT. connection_->SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); std::unique_ptr<NullEncrypter> encrypter = - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT); connection_->SetEncrypter(ENCRYPTION_ZERO_RTT, std::move(encrypter)); EXPECT_EQ(ENCRYPTION_ZERO_RTT, connection_->encryption_level()); EXPECT_CALL(*connection_, SendCryptoData(ENCRYPTION_ZERO_RTT, 1350, 0)) @@ -309,7 +309,7 @@ // Send [1350, 2700) in ENCRYPTION_ZERO_RTT. connection_->SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); std::unique_ptr<NullEncrypter> encrypter = - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT); connection_->SetEncrypter(ENCRYPTION_ZERO_RTT, std::move(encrypter)); EXPECT_EQ(ENCRYPTION_ZERO_RTT, connection_->encryption_level()); EXPECT_CALL(*connection_, SendCryptoData(_, _, _)).Times(0); @@ -426,7 +426,7 @@ // Send [1350, 2700) in ENCRYPTION_ZERO_RTT. connection_->SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); std::unique_ptr<NullEncrypter> encrypter = - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT); connection_->SetEncrypter(ENCRYPTION_ZERO_RTT, std::move(encrypter)); EXPECT_EQ(ENCRYPTION_ZERO_RTT, connection_->encryption_level()); EXPECT_CALL(*connection_, SendCryptoData(ENCRYPTION_ZERO_RTT, 1350, 0))
diff --git a/quic/core/quic_dispatcher_test.cc b/quic/core/quic_dispatcher_test.cc index d0e5092..144bffb 100644 --- a/quic/core/quic_dispatcher_test.cc +++ b/quic/core/quic_dispatcher_test.cc
@@ -116,10 +116,10 @@ : QuicDispatcher(config, crypto_config, version_manager, - QuicMakeUnique<MockQuicConnectionHelper>(), + std::make_unique<MockQuicConnectionHelper>(), std::unique_ptr<QuicCryptoServerStream::Helper>( new QuicSimpleCryptoServerStreamHelper()), - QuicMakeUnique<MockAlarmFactory>(), + std::make_unique<MockAlarmFactory>(), kQuicDefaultConnectionIdLength), random_(random) {} @@ -137,7 +137,7 @@ }; std::unique_ptr<QuicPerPacketContext> GetPerPacketContext() const override { - auto test_context = QuicMakeUnique<TestQuicPerPacketContext>(); + auto test_context = std::make_unique<TestQuicPerPacketContext>(); test_context->custom_packet_context = custom_packet_context_; return std::move(test_context); }
diff --git a/quic/core/quic_flow_controller_test.cc b/quic/core/quic_flow_controller_test.cc index 299f922..0908246 100644 --- a/quic/core/quic_flow_controller_test.cc +++ b/quic/core/quic_flow_controller_test.cc
@@ -39,8 +39,8 @@ void Initialize() { connection_ = new MockQuicConnection(&helper_, &alarm_factory_, Perspective::IS_CLIENT); - session_ = QuicMakeUnique<MockQuicSession>(connection_); - flow_controller_ = QuicMakeUnique<QuicFlowController>( + session_ = std::make_unique<MockQuicSession>(connection_); + flow_controller_ = std::make_unique<QuicFlowController>( session_.get(), stream_id_, /*is_connection_flow_controller*/ false, send_window_, receive_window_, kStreamReceiveWindowLimit, should_auto_tune_receive_window_, &session_flow_controller_);
diff --git a/quic/core/quic_framer.cc b/quic/core/quic_framer.cc index 3a1be5e..727917b 100644 --- a/quic/core/quic_framer.cc +++ b/quic/core/quic_framer.cc
@@ -430,8 +430,8 @@ current_received_frame_type_(0) { DCHECK(!supported_versions.empty()); version_ = supported_versions_[0]; - decrypter_[ENCRYPTION_INITIAL] = QuicMakeUnique<NullDecrypter>(perspective); - encrypter_[ENCRYPTION_INITIAL] = QuicMakeUnique<NullEncrypter>(perspective); + decrypter_[ENCRYPTION_INITIAL] = std::make_unique<NullDecrypter>(perspective); + encrypter_[ENCRYPTION_INITIAL] = std::make_unique<NullEncrypter>(perspective); } QuicFramer::~QuicFramer() {} @@ -1239,7 +1239,7 @@ for (const QuicPathFrameBuffer& payload : payloads) { // Note that the control frame ID can be 0 since this is not retransmitted. path_response_frames.push_back( - QuicMakeUnique<QuicPathResponseFrame>(0, payload)); + std::make_unique<QuicPathResponseFrame>(0, payload)); } QuicFrames frames; @@ -1300,7 +1300,7 @@ return nullptr; } - return QuicMakeUnique<QuicEncryptedPacket>(buffer.release(), len, true); + return std::make_unique<QuicEncryptedPacket>(buffer.release(), len, true); } // static @@ -1334,7 +1334,7 @@ sizeof(stateless_reset_token))) { return nullptr; } - return QuicMakeUnique<QuicEncryptedPacket>(buffer.release(), len, true); + return std::make_unique<QuicEncryptedPacket>(buffer.release(), len, true); } // static @@ -1408,7 +1408,7 @@ } } - return QuicMakeUnique<QuicEncryptedPacket>(buffer.release(), len, true); + return std::make_unique<QuicEncryptedPacket>(buffer.release(), len, true); } // static @@ -1457,7 +1457,7 @@ } } - return QuicMakeUnique<QuicEncryptedPacket>(buffer.release(), len, true); + return std::make_unique<QuicEncryptedPacket>(buffer.release(), len, true); } bool QuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) {
diff --git a/quic/core/quic_framer_test.cc b/quic/core/quic_framer_test.cc index bcb717f..f288441 100644 --- a/quic/core/quic_framer_test.cc +++ b/quic/core/quic_framer_test.cc
@@ -196,14 +196,14 @@ void OnPacket() override {} void OnPublicResetPacket(const QuicPublicResetPacket& packet) override { - public_reset_packet_ = QuicMakeUnique<QuicPublicResetPacket>((packet)); + public_reset_packet_ = std::make_unique<QuicPublicResetPacket>((packet)); EXPECT_EQ(0u, framer_->current_received_frame_type()); } void OnVersionNegotiationPacket( const QuicVersionNegotiationPacket& packet) override { version_negotiation_packet_ = - QuicMakeUnique<QuicVersionNegotiationPacket>((packet)); + std::make_unique<QuicVersionNegotiationPacket>((packet)); EXPECT_EQ(0u, framer_->current_received_frame_type()); } @@ -211,10 +211,10 @@ QuicConnectionId new_connection_id, QuicStringPiece retry_token) override { retry_original_connection_id_ = - QuicMakeUnique<QuicConnectionId>(original_connection_id); + std::make_unique<QuicConnectionId>(original_connection_id); retry_new_connection_id_ = - QuicMakeUnique<QuicConnectionId>(new_connection_id); - retry_token_ = QuicMakeUnique<std::string>(std::string(retry_token)); + std::make_unique<QuicConnectionId>(new_connection_id); + retry_token_ = std::make_unique<std::string>(std::string(retry_token)); EXPECT_EQ(0u, framer_->current_received_frame_type()); } @@ -227,7 +227,7 @@ } bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override { - header_ = QuicMakeUnique<QuicPacketHeader>((header)); + header_ = std::make_unique<QuicPacketHeader>((header)); EXPECT_EQ(0u, framer_->current_received_frame_type()); return accept_public_header_; } @@ -243,7 +243,7 @@ bool OnPacketHeader(const QuicPacketHeader& header) override { ++packet_count_; - header_ = QuicMakeUnique<QuicPacketHeader>((header)); + header_ = std::make_unique<QuicPacketHeader>((header)); EXPECT_EQ(0u, framer_->current_received_frame_type()); return accept_packet_; } @@ -266,7 +266,7 @@ std::string* string_data = new std::string(frame.data_buffer, frame.data_length); stream_data_.push_back(QuicWrapUnique(string_data)); - stream_frames_.push_back(QuicMakeUnique<QuicStreamFrame>( + stream_frames_.push_back(std::make_unique<QuicStreamFrame>( frame.stream_id, frame.fin, frame.offset, *string_data)); if (VersionHasIetfQuicFrames(transport_version_)) { // Low order bits of type encode flags, ignore them for this test. @@ -283,7 +283,7 @@ std::string* string_data = new std::string(frame.data_buffer, frame.data_length); crypto_data_.push_back(QuicWrapUnique(string_data)); - crypto_frames_.push_back(QuicMakeUnique<QuicCryptoFrame>( + crypto_frames_.push_back(std::make_unique<QuicCryptoFrame>( ENCRYPTION_INITIAL, frame.offset, *string_data)); if (VersionHasIetfQuicFrames(transport_version_)) { EXPECT_EQ(IETF_CRYPTO, framer_->current_received_frame_type()); @@ -299,7 +299,7 @@ QuicAckFrame ack_frame; ack_frame.largest_acked = largest_acked; ack_frame.ack_delay_time = ack_delay_time; - ack_frames_.push_back(QuicMakeUnique<QuicAckFrame>(ack_frame)); + ack_frames_.push_back(std::make_unique<QuicAckFrame>(ack_frame)); if (VersionHasIetfQuicFrames(transport_version_)) { EXPECT_EQ(IETF_ACK, framer_->current_received_frame_type()); } else { @@ -331,13 +331,14 @@ bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override { ++frame_count_; - stop_waiting_frames_.push_back(QuicMakeUnique<QuicStopWaitingFrame>(frame)); + stop_waiting_frames_.push_back( + std::make_unique<QuicStopWaitingFrame>(frame)); EXPECT_EQ(0u, framer_->current_received_frame_type()); return true; } bool OnPaddingFrame(const QuicPaddingFrame& frame) override { - padding_frames_.push_back(QuicMakeUnique<QuicPaddingFrame>(frame)); + padding_frames_.push_back(std::make_unique<QuicPaddingFrame>(frame)); if (VersionHasIetfQuicFrames(transport_version_)) { EXPECT_EQ(IETF_PADDING, framer_->current_received_frame_type()); } else { @@ -348,7 +349,7 @@ bool OnPingFrame(const QuicPingFrame& frame) override { ++frame_count_; - ping_frames_.push_back(QuicMakeUnique<QuicPingFrame>(frame)); + ping_frames_.push_back(std::make_unique<QuicPingFrame>(frame)); if (VersionHasIetfQuicFrames(transport_version_)) { EXPECT_EQ(IETF_PING, framer_->current_received_frame_type()); } else { @@ -360,7 +361,7 @@ bool OnMessageFrame(const QuicMessageFrame& frame) override { ++frame_count_; message_frames_.push_back( - QuicMakeUnique<QuicMessageFrame>(frame.data, frame.message_length)); + std::make_unique<QuicMessageFrame>(frame.data, frame.message_length)); if (VersionHasIetfQuicFrames(transport_version_)) { EXPECT_TRUE(IETF_EXTENSION_MESSAGE_NO_LENGTH == framer_->current_received_frame_type() || @@ -504,7 +505,7 @@ void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override { stateless_reset_packet_ = - QuicMakeUnique<QuicIetfStatelessResetPacket>(packet); + std::make_unique<QuicIetfStatelessResetPacket>(packet); EXPECT_EQ(0u, framer_->current_received_frame_type()); } @@ -703,7 +704,7 @@ memcpy(buffer + len, fragment.fragment.data(), fragment.fragment.size()); len += fragment.fragment.size(); } - return QuicMakeUnique<QuicEncryptedPacket>(buffer, len, true); + return std::make_unique<QuicEncryptedPacket>(buffer, len, true); } void CheckFramingBoundaries(const PacketFragments& fragments, @@ -2213,13 +2214,14 @@ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT); decrypter_ = new test::TestDecrypter(); if (framer_.version().KnowsWhichDecrypterToUse()) { - framer_.InstallDecrypter(ENCRYPTION_INITIAL, QuicMakeUnique<NullDecrypter>( - Perspective::IS_CLIENT)); + framer_.InstallDecrypter( + ENCRYPTION_INITIAL, + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); framer_.InstallDecrypter(ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_)); } else { - framer_.SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + framer_.SetDecrypter(ENCRYPTION_INITIAL, std::make_unique<NullDecrypter>( + Perspective::IS_CLIENT)); framer_.SetAlternativeDecrypter( ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_), false); } @@ -5230,13 +5232,14 @@ TestConnectionId(0x33)); decrypter_ = new test::TestDecrypter(); if (framer_.version().KnowsWhichDecrypterToUse()) { - framer_.InstallDecrypter(ENCRYPTION_INITIAL, QuicMakeUnique<NullDecrypter>( - Perspective::IS_CLIENT)); + framer_.InstallDecrypter( + ENCRYPTION_INITIAL, + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); framer_.InstallDecrypter(ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_)); } else { - framer_.SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + framer_.SetDecrypter(ENCRYPTION_INITIAL, std::make_unique<NullDecrypter>( + Perspective::IS_CLIENT)); framer_.SetAlternativeDecrypter( ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_), false); } @@ -5272,13 +5275,14 @@ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT); decrypter_ = new test::TestDecrypter(); if (framer_.version().KnowsWhichDecrypterToUse()) { - framer_.InstallDecrypter(ENCRYPTION_INITIAL, QuicMakeUnique<NullDecrypter>( - Perspective::IS_CLIENT)); + framer_.InstallDecrypter( + ENCRYPTION_INITIAL, + std::make_unique<NullDecrypter>(Perspective::IS_CLIENT)); framer_.InstallDecrypter(ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_)); } else { - framer_.SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(Perspective::IS_CLIENT)); + framer_.SetDecrypter(ENCRYPTION_INITIAL, std::make_unique<NullDecrypter>( + Perspective::IS_CLIENT)); framer_.SetAlternativeDecrypter( ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_), false); } @@ -9394,10 +9398,10 @@ if (framer_.version().KnowsWhichDecrypterToUse()) { framer_.InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(framer_.perspective())); + std::make_unique<NullDecrypter>(framer_.perspective())); } else { - framer_.SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(framer_.perspective())); + framer_.SetDecrypter(ENCRYPTION_INITIAL, std::make_unique<NullDecrypter>( + framer_.perspective())); } ParsedQuicVersionVector versions; versions.push_back(framer_.version()); @@ -9438,13 +9442,13 @@ if (framer_.version().KnowsWhichDecrypterToUse()) { framer_.InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(framer_.perspective())); + std::make_unique<NullDecrypter>(framer_.perspective())); } else { - framer_.SetDecrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullDecrypter>(framer_.perspective())); + framer_.SetDecrypter(ENCRYPTION_INITIAL, std::make_unique<NullDecrypter>( + framer_.perspective())); } framer_.SetEncrypter(ENCRYPTION_INITIAL, - QuicMakeUnique<NullEncrypter>(framer_.perspective())); + std::make_unique<NullEncrypter>(framer_.perspective())); ParsedQuicVersionVector versions; versions.push_back(framer_.version()); std::unique_ptr<QuicEncryptedPacket> packet(ConstructMisFramedEncryptedPacket( @@ -12891,10 +12895,11 @@ if (framer_.version().KnowsWhichDecrypterToUse()) { framer_.InstallDecrypter(ENCRYPTION_ZERO_RTT, - QuicMakeUnique<TestDecrypter>()); + std::make_unique<TestDecrypter>()); framer_.RemoveDecrypter(ENCRYPTION_INITIAL); } else { - framer_.SetDecrypter(ENCRYPTION_ZERO_RTT, QuicMakeUnique<TestDecrypter>()); + framer_.SetDecrypter(ENCRYPTION_ZERO_RTT, + std::make_unique<TestDecrypter>()); } if (!QuicVersionHasLongHeaderLengths(framer_.transport_version())) { EXPECT_TRUE(framer_.ProcessPacket( @@ -12933,11 +12938,11 @@ AsChars(short_header_packet), QUIC_ARRAYSIZE(short_header_packet), false); if (framer_.version().KnowsWhichDecrypterToUse()) { framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TestDecrypter>()); + std::make_unique<TestDecrypter>()); framer_.RemoveDecrypter(ENCRYPTION_ZERO_RTT); } else { framer_.SetDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<TestDecrypter>()); + std::make_unique<TestDecrypter>()); } EXPECT_TRUE(framer_.ProcessPacket(short_header_encrypted));
diff --git a/quic/core/quic_packet_creator_test.cc b/quic/core/quic_packet_creator_test.cc index 1da89ba..5b58b5f 100644 --- a/quic/core/quic_packet_creator_test.cc +++ b/quic/core/quic_packet_creator_test.cc
@@ -156,26 +156,26 @@ serialized_packet_(creator_.NoPacket()) { QuicPacketCreatorPeer::EnableGetPacketHeaderSizeBugFix(&creator_); EXPECT_CALL(delegate_, GetPacketBuffer()).WillRepeatedly(Return(nullptr)); - creator_.SetEncrypter(ENCRYPTION_HANDSHAKE, QuicMakeUnique<NullEncrypter>( + creator_.SetEncrypter(ENCRYPTION_HANDSHAKE, std::make_unique<NullEncrypter>( Perspective::IS_CLIENT)); - creator_.SetEncrypter(ENCRYPTION_ZERO_RTT, QuicMakeUnique<NullEncrypter>( + creator_.SetEncrypter(ENCRYPTION_ZERO_RTT, std::make_unique<NullEncrypter>( Perspective::IS_CLIENT)); creator_.SetEncrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT)); client_framer_.set_visitor(&framer_visitor_); server_framer_.set_visitor(&framer_visitor_); client_framer_.set_data_producer(&producer_); if (server_framer_.version().KnowsWhichDecrypterToUse()) { server_framer_.InstallDecrypter( ENCRYPTION_ZERO_RTT, - QuicMakeUnique<NullDecrypter>(Perspective::IS_SERVER)); + std::make_unique<NullDecrypter>(Perspective::IS_SERVER)); server_framer_.InstallDecrypter( ENCRYPTION_HANDSHAKE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_SERVER)); + std::make_unique<NullDecrypter>(Perspective::IS_SERVER)); server_framer_.InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_SERVER)); + std::make_unique<NullDecrypter>(Perspective::IS_SERVER)); } }
diff --git a/quic/core/quic_packet_generator_test.cc b/quic/core/quic_packet_generator_test.cc index c60bac2..d1edfcb 100644 --- a/quic/core/quic_packet_generator_test.cc +++ b/quic/core/quic_packet_generator_test.cc
@@ -207,13 +207,13 @@ EXPECT_CALL(delegate_, GetPacketBuffer()).WillRepeatedly(Return(nullptr)); creator_->SetEncrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(Perspective::IS_CLIENT)); + std::make_unique<NullEncrypter>(Perspective::IS_CLIENT)); creator_->set_encryption_level(ENCRYPTION_FORWARD_SECURE); framer_.set_data_producer(&producer_); if (simple_framer_.framer()->version().KnowsWhichDecrypterToUse()) { simple_framer_.framer()->InstallDecrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(Perspective::IS_SERVER)); + std::make_unique<NullDecrypter>(Perspective::IS_SERVER)); } generator_.AttachPacketFlusher(); }
diff --git a/quic/core/quic_packets.cc b/quic/core/quic_packets.cc index 2d6d0c9..c4ef81a 100644 --- a/quic/core/quic_packets.cc +++ b/quic/core/quic_packets.cc
@@ -339,7 +339,7 @@ std::unique_ptr<QuicEncryptedPacket> QuicEncryptedPacket::Clone() const { char* buffer = new char[this->length()]; memcpy(buffer, this->data(), this->length()); - return QuicMakeUnique<QuicEncryptedPacket>(buffer, this->length(), true); + return std::make_unique<QuicEncryptedPacket>(buffer, this->length(), true); } std::ostream& operator<<(std::ostream& os, const QuicEncryptedPacket& s) { @@ -410,12 +410,12 @@ if (this->packet_headers()) { char* headers_buffer = new char[this->headers_length()]; memcpy(headers_buffer, this->packet_headers(), this->headers_length()); - return QuicMakeUnique<QuicReceivedPacket>( + return std::make_unique<QuicReceivedPacket>( buffer, this->length(), receipt_time(), true, ttl(), ttl() >= 0, headers_buffer, this->headers_length(), true); } - return QuicMakeUnique<QuicReceivedPacket>( + return std::make_unique<QuicReceivedPacket>( buffer, this->length(), receipt_time(), true, ttl(), ttl() >= 0); }
diff --git a/quic/core/quic_sent_packet_manager_test.cc b/quic/core/quic_sent_packet_manager_test.cc index 50ecd9d..8fe02a7 100644 --- a/quic/core/quic_sent_packet_manager_test.cc +++ b/quic/core/quic_sent_packet_manager_test.cc
@@ -734,7 +734,7 @@ } TEST_P(QuicSentPacketManagerTest, AckOriginalTransmission) { - auto loss_algorithm = QuicMakeUnique<MockLossAlgorithm>(); + auto loss_algorithm = std::make_unique<MockLossAlgorithm>(); QuicSentPacketManagerPeer::SetLossAlgorithm(&manager_, loss_algorithm.get()); SendDataPacket(1); @@ -2108,7 +2108,7 @@ } TEST_P(QuicSentPacketManagerTest, GetLossDelay) { - auto loss_algorithm = QuicMakeUnique<MockLossAlgorithm>(); + auto loss_algorithm = std::make_unique<MockLossAlgorithm>(); QuicSentPacketManagerPeer::SetLossAlgorithm(&manager_, loss_algorithm.get()); EXPECT_CALL(*loss_algorithm, GetLossTimeout())
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc index b342e3d..619840b 100644 --- a/quic/core/quic_session.cc +++ b/quic/core/quic_session.cc
@@ -1327,7 +1327,7 @@ return nullptr; } - auto pending = QuicMakeUnique<PendingStream>(stream_id, this); + auto pending = std::make_unique<PendingStream>(stream_id, this); PendingStream* unowned_pending = pending.get(); pending_stream_map_[stream_id] = std::move(pending); return unowned_pending;
diff --git a/quic/core/quic_session_test.cc b/quic/core/quic_session_test.cc index 4e419da..a75d948 100644 --- a/quic/core/quic_session_test.cc +++ b/quic/core/quic_session_test.cc
@@ -151,7 +151,7 @@ Initialize(); this->connection()->SetEncrypter( ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(connection->perspective())); + std::make_unique<NullEncrypter>(connection->perspective())); } ~TestSession() override { @@ -1386,8 +1386,9 @@ } QuicStreamId headers_stream_id = QuicUtils::GetHeadersStreamId(connection_->transport_version()); - std::unique_ptr<TestStream> fake_headers_stream = QuicMakeUnique<TestStream>( - headers_stream_id, &session_, /*is_static*/ true, BIDIRECTIONAL); + std::unique_ptr<TestStream> fake_headers_stream = + std::make_unique<TestStream>(headers_stream_id, &session_, + /*is_static*/ true, BIDIRECTIONAL); QuicSessionPeer::ActivateStream(&session_, std::move(fake_headers_stream)); // Send two bytes of payload. QuicStreamFrame data1(headers_stream_id, true, 0, QuicStringPiece("HT")); @@ -1404,8 +1405,9 @@ } QuicStreamId headers_stream_id = QuicUtils::GetHeadersStreamId(connection_->transport_version()); - std::unique_ptr<TestStream> fake_headers_stream = QuicMakeUnique<TestStream>( - headers_stream_id, &session_, /*is_static*/ true, BIDIRECTIONAL); + std::unique_ptr<TestStream> fake_headers_stream = + std::make_unique<TestStream>(headers_stream_id, &session_, + /*is_static*/ true, BIDIRECTIONAL); QuicSessionPeer::ActivateStream(&session_, std::move(fake_headers_stream)); // Send two bytes of payload. QuicRstStreamFrame rst1(kInvalidControlFrameId, headers_stream_id, @@ -2612,7 +2614,7 @@ return; } QuicStreamId stream_id = 0; - std::unique_ptr<TestStream> fake_static_stream = QuicMakeUnique<TestStream>( + std::unique_ptr<TestStream> fake_static_stream = std::make_unique<TestStream>( stream_id, &session_, /*is_static*/ true, BIDIRECTIONAL); QuicSessionPeer::ActivateStream(&session_, std::move(fake_static_stream)); // Check that a stream id in the static stream map is ignored.
diff --git a/quic/core/quic_stream_id_manager_test.cc b/quic/core/quic_stream_id_manager_test.cc index d8e1b78..06eb141 100644 --- a/quic/core/quic_stream_id_manager_test.cc +++ b/quic/core/quic_stream_id_manager_test.cc
@@ -110,7 +110,7 @@ ParsedQuicVersionVector( {{PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_99}}))) { connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<TestQuicSession>(connection_); + session_ = std::make_unique<TestQuicSession>(connection_); stream_id_manager_ = IsBidi() ? QuicSessionPeer::v99_bidirectional_stream_id_manager( session_.get())
diff --git a/quic/core/quic_stream_sequencer_buffer_test.cc b/quic/core/quic_stream_sequencer_buffer_test.cc index a7872dd..80d6309 100644 --- a/quic/core/quic_stream_sequencer_buffer_test.cc +++ b/quic/core/quic_stream_sequencer_buffer_test.cc
@@ -67,8 +67,9 @@ protected: void Initialize() { - buffer_ = QuicMakeUnique<QuicStreamSequencerBuffer>((max_capacity_bytes_)); - helper_ = QuicMakeUnique<QuicStreamSequencerBufferPeer>((buffer_.get())); + buffer_ = + std::make_unique<QuicStreamSequencerBuffer>((max_capacity_bytes_)); + helper_ = std::make_unique<QuicStreamSequencerBufferPeer>((buffer_.get())); } // Use 2.5 here to make sure the buffer has more than one block and its end
diff --git a/quic/core/quic_stream_test.cc b/quic/core/quic_stream_test.cc index d371866..ff65db3 100644 --- a/quic/core/quic_stream_test.cc +++ b/quic/core/quic_stream_test.cc
@@ -82,7 +82,7 @@ connection_ = new StrictMock<MockQuicConnection>( &helper_, &alarm_factory_, Perspective::IS_SERVER, version_vector); connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<StrictMock<MockQuicSession>>(connection_); + session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_); // New streams rely on having the peer's flow control receive window // negotiated in the config.
diff --git a/quic/core/quic_time_wait_list_manager.cc b/quic/core/quic_time_wait_list_manager.cc index f4a4f89..b163185 100644 --- a/quic/core/quic_time_wait_list_manager.cc +++ b/quic/core/quic_time_wait_list_manager.cc
@@ -184,7 +184,7 @@ } for (const auto& packet : connection_data->termination_packets) { - SendOrQueuePacket(QuicMakeUnique<QueuedPacket>( + SendOrQueuePacket(std::make_unique<QueuedPacket>( self_address, peer_address, packet->Clone()), packet_context.get()); } @@ -222,8 +222,8 @@ << "use_length_prefix:" << std::endl << QuicTextUtils::HexDump(QuicStringPiece( version_packet->data(), version_packet->length())); - SendOrQueuePacket(QuicMakeUnique<QueuedPacket>(self_address, peer_address, - std::move(version_packet)), + SendOrQueuePacket(std::make_unique<QueuedPacket>(self_address, peer_address, + std::move(version_packet)), packet_context.get()); } @@ -248,8 +248,8 @@ QuicStringPiece(ietf_reset_packet->data(), ietf_reset_packet->length())); SendOrQueuePacket( - QuicMakeUnique<QueuedPacket>(self_address, peer_address, - std::move(ietf_reset_packet)), + std::make_unique<QueuedPacket>(self_address, peer_address, + std::move(ietf_reset_packet)), packet_context.get()); return; } @@ -266,8 +266,8 @@ << std::endl << QuicTextUtils::HexDump(QuicStringPiece( reset_packet->data(), reset_packet->length())); - SendOrQueuePacket(QuicMakeUnique<QueuedPacket>(self_address, peer_address, - std::move(reset_packet)), + SendOrQueuePacket(std::make_unique<QueuedPacket>(self_address, peer_address, + std::move(reset_packet)), packet_context.get()); }
diff --git a/quic/core/quic_time_wait_list_manager_test.cc b/quic/core/quic_time_wait_list_manager_test.cc index 4caae88..57541ee 100644 --- a/quic/core/quic_time_wait_list_manager_test.cc +++ b/quic/core/quic_time_wait_list_manager_test.cc
@@ -174,7 +174,7 @@ void ProcessPacket(QuicConnectionId connection_id) { time_wait_list_manager_.ProcessPacket( self_address_, peer_address_, connection_id, GOOGLE_QUIC_PACKET, - QuicMakeUnique<QuicPerPacketContext>()); + std::make_unique<QuicPerPacketContext>()); } QuicEncryptedPacket* ConstructEncryptedPacket( @@ -261,7 +261,7 @@ time_wait_list_manager_.SendVersionNegotiationPacket( connection_id_, EmptyQuicConnectionId(), /*ietf_quic=*/false, /*use_length_prefix=*/false, AllSupportedVersions(), self_address_, - peer_address_, QuicMakeUnique<QuicPerPacketContext>()); + peer_address_, std::make_unique<QuicPerPacketContext>()); EXPECT_EQ(0u, time_wait_list_manager_.num_connections()); } @@ -278,7 +278,7 @@ time_wait_list_manager_.SendVersionNegotiationPacket( connection_id_, EmptyQuicConnectionId(), /*ietf_quic=*/true, /*use_length_prefix=*/false, AllSupportedVersions(), self_address_, - peer_address_, QuicMakeUnique<QuicPerPacketContext>()); + peer_address_, std::make_unique<QuicPerPacketContext>()); EXPECT_EQ(0u, time_wait_list_manager_.num_connections()); } @@ -294,7 +294,7 @@ time_wait_list_manager_.SendVersionNegotiationPacket( connection_id_, EmptyQuicConnectionId(), /*ietf_quic=*/true, /*use_length_prefix=*/true, AllSupportedVersions(), self_address_, - peer_address_, QuicMakeUnique<QuicPerPacketContext>()); + peer_address_, std::make_unique<QuicPerPacketContext>()); EXPECT_EQ(0u, time_wait_list_manager_.num_connections()); } @@ -311,7 +311,7 @@ time_wait_list_manager_.SendVersionNegotiationPacket( connection_id_, TestConnectionId(0x33), /*ietf_quic=*/true, /*use_length_prefix=*/true, AllSupportedVersions(), self_address_, - peer_address_, QuicMakeUnique<QuicPerPacketContext>()); + peer_address_, std::make_unique<QuicPerPacketContext>()); EXPECT_EQ(0u, time_wait_list_manager_.num_connections()); } @@ -643,7 +643,7 @@ // Processes IETF short header packet. time_wait_list_manager_.ProcessPacket( self_address_, peer_address_, connection_id_, - IETF_QUIC_SHORT_HEADER_PACKET, QuicMakeUnique<QuicPerPacketContext>()); + IETF_QUIC_SHORT_HEADER_PACKET, std::make_unique<QuicPerPacketContext>()); } } // namespace
diff --git a/quic/core/quic_write_blocked_list.cc b/quic/core/quic_write_blocked_list.cc index 8e4bcf1..123a963 100644 --- a/quic/core/quic_write_blocked_list.cc +++ b/quic/core/quic_write_blocked_list.cc
@@ -11,7 +11,7 @@ QuicWriteBlockedList::QuicWriteBlockedList(QuicTransportVersion version) : priority_write_scheduler_( - QuicMakeUnique<spdy::PriorityWriteScheduler<QuicStreamId>>( + std::make_unique<spdy::PriorityWriteScheduler<QuicStreamId>>( QuicVersionUsesCryptoFrames(version) ? std::numeric_limits<QuicStreamId>::max() : 0)),
diff --git a/quic/core/tls_handshaker_test.cc b/quic/core/tls_handshaker_test.cc index a298089..6b7633f 100644 --- a/quic/core/tls_handshaker_test.cc +++ b/quic/core/tls_handshaker_test.cc
@@ -63,7 +63,7 @@ cert_sct, context, error_details, details, std::move(callback)); } - pending_ops_.push_back(QuicMakeUnique<VerifyChainPendingOp>( + pending_ops_.push_back(std::make_unique<VerifyChainPendingOp>( hostname, certs, ocsp_response, cert_sct, context, error_details, details, std::move(callback), verifier_.get())); return QUIC_PENDING; @@ -125,7 +125,7 @@ QuicAsyncStatus status = delegate_->VerifyCertChain( hostname_, certs_, ocsp_response_, cert_sct_, context_, error_details_, details_, - QuicMakeUnique<FailingProofVerifierCallback>()); + std::make_unique<FailingProofVerifierCallback>()); ASSERT_NE(status, QUIC_PENDING); callback_->Run(status == QUIC_SUCCESS, *error_details_, details_); }
diff --git a/quic/core/uber_quic_stream_id_manager_test.cc b/quic/core/uber_quic_stream_id_manager_test.cc index 6f5d34e..6d4990e 100644 --- a/quic/core/uber_quic_stream_id_manager_test.cc +++ b/quic/core/uber_quic_stream_id_manager_test.cc
@@ -32,7 +32,7 @@ GetParam(), ParsedQuicVersionVector( {{PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_99}}))) { - session_ = QuicMakeUnique<StrictMock<MockQuicSession>>(connection_); + session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_); manager_ = QuicSessionPeer::v99_streamid_manager(session_.get()); }
diff --git a/quic/core/uber_received_packet_manager_test.cc b/quic/core/uber_received_packet_manager_test.cc index 9372da8..eecc98b 100644 --- a/quic/core/uber_received_packet_manager_test.cc +++ b/quic/core/uber_received_packet_manager_test.cc
@@ -49,7 +49,7 @@ class UberReceivedPacketManagerTest : public QuicTest { protected: UberReceivedPacketManagerTest() { - manager_ = QuicMakeUnique<UberReceivedPacketManager>(&stats_); + manager_ = std::make_unique<UberReceivedPacketManager>(&stats_); clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1)); rtt_stats_.UpdateRtt(kMinRttMs, QuicTime::Delta::Zero(), QuicTime::Zero()); manager_->set_save_timestamps(true);
diff --git a/quic/qbone/bonnet/tun_device_packet_exchanger.cc b/quic/qbone/bonnet/tun_device_packet_exchanger.cc index 1d246a2..94aeba1 100644 --- a/quic/qbone/bonnet/tun_device_packet_exchanger.cc +++ b/quic/qbone/bonnet/tun_device_packet_exchanger.cc
@@ -14,7 +14,8 @@ size_t mtu, KernelInterface* kernel, QbonePacketExchanger::Visitor* visitor, - size_t max_pending_packets, StatsInterface* stats) + size_t max_pending_packets, + StatsInterface* stats) : QbonePacketExchanger(visitor, max_pending_packets), fd_(fd), mtu_(mtu), @@ -59,7 +60,7 @@ } // Reading on a TUN device returns a packet at a time. If the packet is longer // than the buffer, it's truncated. - auto read_buffer = QuicMakeUnique<char[]>(mtu_); + auto read_buffer = std::make_unique<char[]>(mtu_); int result = kernel_->read(fd_, read_buffer.get(), mtu_); // Note that 0 means end of file, but we're talking about a TUN device - there // is no end of file. Therefore 0 also indicates error. @@ -72,7 +73,7 @@ return nullptr; } stats_->OnPacketRead(); - return QuicMakeUnique<QuicData>(read_buffer.release(), result, true); + return std::make_unique<QuicData>(read_buffer.release(), result, true); } int TunDevicePacketExchanger::file_descriptor() const {
diff --git a/quic/qbone/platform/netlink.cc b/quic/qbone/platform/netlink.cc index 1a4270e..6553417 100644 --- a/quic/qbone/platform/netlink.cc +++ b/quic/qbone/platform/netlink.cc
@@ -27,7 +27,7 @@ void Netlink::ResetRecvBuf(size_t size) { if (size != 0) { - recvbuf_ = QuicMakeUnique<char[]>(size); + recvbuf_ = std::make_unique<char[]>(size); } else { recvbuf_ = nullptr; }
diff --git a/quic/qbone/platform/netlink_test.cc b/quic/qbone/platform/netlink_test.cc index 024e0fb..144e5d5 100644 --- a/quic/qbone/platform/netlink_test.cc +++ b/quic/qbone/platform/netlink_test.cc
@@ -243,7 +243,7 @@ } TEST_F(NetlinkTest, GetLinkInfoWorks) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); uint8_t hwaddr[] = {'a', 'b', 'c', 'd', 'e', 'f'}; uint8_t bcaddr[] = {'c', 'b', 'a', 'f', 'e', 'd'}; @@ -283,7 +283,7 @@ } TEST_F(NetlinkTest, GetAddressesWorks) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicUnorderedSet<std::string> addresses = {QuicIpAddress::Any4().ToString(), QuicIpAddress::Any6().ToString()}; @@ -350,7 +350,7 @@ } TEST_F(NetlinkTest, ChangeLocalAddressAdd) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress ip = QuicIpAddress::Any6(); ExpectNetlinkPacket( @@ -427,7 +427,7 @@ } TEST_F(NetlinkTest, ChangeLocalAddressRemove) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress ip = QuicIpAddress::Any4(); ExpectNetlinkPacket( @@ -480,7 +480,7 @@ } TEST_F(NetlinkTest, GetRouteInfoWorks) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress destination; ASSERT_TRUE(destination.FromString("f800::2")); @@ -514,7 +514,7 @@ } TEST_F(NetlinkTest, ChangeRouteAdd) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress preferred_ip; preferred_ip.FromString("ff80:dead:beef::1"); @@ -596,7 +596,7 @@ } TEST_F(NetlinkTest, ChangeRouteRemove) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress preferred_ip; preferred_ip.FromString("ff80:dead:beef::1"); @@ -678,7 +678,7 @@ } TEST_F(NetlinkTest, ChangeRouteReplace) { - auto netlink = QuicMakeUnique<Netlink>(&mock_kernel_); + auto netlink = std::make_unique<Netlink>(&mock_kernel_); QuicIpAddress preferred_ip; preferred_ip.FromString("ff80:dead:beef::1");
diff --git a/quic/qbone/platform/rtnetlink_message.cc b/quic/qbone/platform/rtnetlink_message.cc index f35628a..5febbd7 100644 --- a/quic/qbone/platform/rtnetlink_message.cc +++ b/quic/qbone/platform/rtnetlink_message.cc
@@ -57,7 +57,7 @@ } std::unique_ptr<struct iovec[]> RtnetlinkMessage::BuildIoVec() const { - auto message = QuicMakeUnique<struct iovec[]>(message_.size()); + auto message = std::make_unique<struct iovec[]>(message_.size()); int idx = 0; for (const auto& vec : message_) { message[idx++] = vec;
diff --git a/quic/qbone/qbone_client.cc b/quic/qbone/qbone_client.cc index f062d3f..86bd477 100644 --- a/quic/qbone/qbone_client.cc +++ b/quic/qbone/qbone_client.cc
@@ -17,7 +17,7 @@ QuicEpollServer* epoll_server, QboneClient* client) { std::unique_ptr<QuicClientBase::NetworkHelper> helper = - QuicMakeUnique<QuicClientEpollNetworkHelper>(epoll_server, client); + std::make_unique<QuicClientEpollNetworkHelper>(epoll_server, client); testing::testvalue::Adjust("QboneClient/network_helper", &helper); return helper; } @@ -90,7 +90,7 @@ std::unique_ptr<QuicSession> QboneClient::CreateQuicClientSession( const ParsedQuicVersionVector& supported_versions, QuicConnection* connection) { - return QuicMakeUnique<QboneClientSessionWithConnection>( + return std::make_unique<QboneClientSessionWithConnection>( connection, crypto_config(), session_owner(), *config(), supported_versions, server_id(), qbone_writer_, qbone_handler_); }
diff --git a/quic/qbone/qbone_client_session.cc b/quic/qbone/qbone_client_session.cc index c07bdf6..5f82570 100644 --- a/quic/qbone/qbone_client_session.cc +++ b/quic/qbone/qbone_client_session.cc
@@ -27,7 +27,7 @@ QboneClientSession::~QboneClientSession() {} std::unique_ptr<QuicCryptoStream> QboneClientSession::CreateCryptoStream() { - return QuicMakeUnique<QuicCryptoClientStream>( + return std::make_unique<QuicCryptoClientStream>( server_id_, this, nullptr, quic_crypto_client_config_, this); } @@ -41,7 +41,7 @@ QuicStreamId next_id = GetNextOutgoingBidirectionalStreamId(); DCHECK_EQ(next_id, QboneConstants::GetControlStreamId(transport_version())); auto control_stream = - QuicMakeUnique<QboneClientControlStream>(this, handler_); + std::make_unique<QboneClientControlStream>(this, handler_); control_stream_ = control_stream.get(); ActivateStream(std::move(control_stream)); }
diff --git a/quic/qbone/qbone_packet_exchanger.cc b/quic/qbone/qbone_packet_exchanger.cc index 3f3a5f9..c8dcffa 100644 --- a/quic/qbone/qbone_packet_exchanger.cc +++ b/quic/qbone/qbone_packet_exchanger.cc
@@ -46,7 +46,7 @@ auto data_copy = new char[size]; memcpy(data_copy, packet, size); packet_queue_.push_back( - QuicMakeUnique<QuicData>(data_copy, size, /* owns_buffer = */ true)); + std::make_unique<QuicData>(data_copy, size, /* owns_buffer = */ true)); } void QbonePacketExchanger::SetWritable() {
diff --git a/quic/qbone/qbone_packet_exchanger_test.cc b/quic/qbone/qbone_packet_exchanger_test.cc index 4e63b99..e507a1d 100644 --- a/quic/qbone/qbone_packet_exchanger_test.cc +++ b/quic/qbone/qbone_packet_exchanger_test.cc
@@ -99,7 +99,7 @@ string packet = "data"; exchanger.AddPacketToBeRead( - QuicMakeUnique<QuicData>(packet.data(), packet.length())); + std::make_unique<QuicData>(packet.data(), packet.length())); EXPECT_CALL(client, ProcessPacketFromNetwork(StrEq("data"))); EXPECT_TRUE(exchanger.ReadAndDeliverPacket(&client));
diff --git a/quic/qbone/qbone_packet_processor_test.cc b/quic/qbone/qbone_packet_processor_test.cc index 256f5b0..2e1b4de 100644 --- a/quic/qbone/qbone_packet_processor_test.cc +++ b/quic/qbone/qbone_packet_processor_test.cc
@@ -138,7 +138,7 @@ CHECK(self_ip_.FromString("fd00:0:0:4::1")); CHECK(network_ip_.FromString("fd00:0:0:5::1")); - processor_ = QuicMakeUnique<QbonePacketProcessor>( + processor_ = std::make_unique<QbonePacketProcessor>( self_ip_, client_ip_, /*client_ip_subnet_length=*/62, &output_, &stats_); } @@ -231,7 +231,7 @@ } TEST_F(QbonePacketProcessorTest, FilterFromClient) { - auto filter = QuicMakeUnique<MockPacketFilter>(); + auto filter = std::make_unique<MockPacketFilter>(); EXPECT_CALL(*filter, FilterPacket(_, _, _, _, _)) .WillRepeatedly(Return(ProcessingResult::SILENT_DROP)); processor_->set_filter(std::move(filter)); @@ -270,7 +270,7 @@ // Verify that the parameters are passed correctly into the filter, and that the // helper functions of the filter class work. TEST_F(QbonePacketProcessorTest, FilterHelperFunctions) { - auto filter_owned = QuicMakeUnique<TestFilter>(client_ip_, network_ip_); + auto filter_owned = std::make_unique<TestFilter>(client_ip_, network_ip_); TestFilter* filter = filter_owned.get(); processor_->set_filter(std::move(filter_owned));
diff --git a/quic/qbone/qbone_server_session.cc b/quic/qbone/qbone_server_session.cc index 49f84eb..e9515c2 100644 --- a/quic/qbone/qbone_server_session.cc +++ b/quic/qbone/qbone_server_session.cc
@@ -48,16 +48,16 @@ QboneServerSession::~QboneServerSession() {} std::unique_ptr<QuicCryptoStream> QboneServerSession::CreateCryptoStream() { - return QuicMakeUnique<QuicCryptoServerStream>(quic_crypto_server_config_, - compressed_certs_cache_, this, - &stream_helper_); + return std::make_unique<QuicCryptoServerStream>(quic_crypto_server_config_, + compressed_certs_cache_, this, + &stream_helper_); } void QboneServerSession::Initialize() { QboneSessionBase::Initialize(); // Register the reserved control stream. auto control_stream = - QuicMakeUnique<QboneServerControlStream>(this, handler_); + std::make_unique<QboneServerControlStream>(this, handler_); control_stream_ = control_stream.get(); ActivateStream(std::move(control_stream)); }
diff --git a/quic/qbone/qbone_session_base.cc b/quic/qbone/qbone_session_base.cc index d881975..23b29d2 100644 --- a/quic/qbone/qbone_session_base.cc +++ b/quic/qbone/qbone_session_base.cc
@@ -104,10 +104,10 @@ if (IsIncomingStream(id)) { ++num_streamed_packets_; - return QuicMakeUnique<QboneReadOnlyStream>(id, this); + return std::make_unique<QboneReadOnlyStream>(id, this); } - return QuicMakeUnique<QboneWriteOnlyStream>(id, this); + return std::make_unique<QboneWriteOnlyStream>(id, this); } QuicStream* QboneSessionBase::ActivateDataStream(
diff --git a/quic/qbone/qbone_session_test.cc b/quic/qbone/qbone_session_test.cc index be598a9..016b2f3 100644 --- a/quic/qbone/qbone_session_test.cc +++ b/quic/qbone/qbone_session_test.cc
@@ -244,13 +244,13 @@ bool send_qbone_alpn = true) { // Quic crashes if packets are sent at time 0, and the clock defaults to 0. helper_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1000)); - alarm_factory_ = QuicMakeUnique<QuicEpollAlarmFactory>(&epoll_server_); - client_writer_ = QuicMakeUnique<DataSavingQbonePacketWriter>(); - server_writer_ = QuicMakeUnique<DataSavingQbonePacketWriter>(); + alarm_factory_ = std::make_unique<QuicEpollAlarmFactory>(&epoll_server_); + client_writer_ = std::make_unique<DataSavingQbonePacketWriter>(); + server_writer_ = std::make_unique<DataSavingQbonePacketWriter>(); client_handler_ = - QuicMakeUnique<DataSavingQboneControlHandler<QboneClientRequest>>(); + std::make_unique<DataSavingQboneControlHandler<QboneClientRequest>>(); server_handler_ = - QuicMakeUnique<DataSavingQboneControlHandler<QboneServerRequest>>(); + std::make_unique<DataSavingQboneControlHandler<QboneServerRequest>>(); QuicSocketAddress server_address(TestLoopback(), QuicPickServerPortForTestsOrDie()); QuicSocketAddress client_address; @@ -267,12 +267,12 @@ ParsedVersionOfIndex(AllSupportedVersions(), 0)); client_connection_->SetSelfAddress(client_address); QuicConfig config; - client_crypto_config_ = QuicMakeUnique<QuicCryptoClientConfig>( - QuicMakeUnique<FakeProofVerifier>(client_handshake_success)); + client_crypto_config_ = std::make_unique<QuicCryptoClientConfig>( + std::make_unique<FakeProofVerifier>(client_handshake_success)); if (send_qbone_alpn) { client_crypto_config_->set_alpn("qbone"); } - client_peer_ = QuicMakeUnique<QboneClientSession>( + client_peer_ = std::make_unique<QboneClientSession>( client_connection_, client_crypto_config_.get(), /*owner=*/nullptr, config, ParsedVersionOfIndex(AllSupportedVersions(), 0), @@ -287,7 +287,7 @@ ParsedVersionOfIndex(AllSupportedVersions(), 0)); server_connection_->SetSelfAddress(server_address); QuicConfig config; - server_crypto_config_ = QuicMakeUnique<QuicCryptoServerConfig>( + server_crypto_config_ = std::make_unique<QuicCryptoServerConfig>( "TESTING", QuicRandom::GetInstance(), std::unique_ptr<FakeProofSource>( new FakeProofSource(server_handshake_success)), @@ -300,7 +300,7 @@ server_crypto_config_->AddConfig(std::move(primary_config), GetClock()->WallNow())); - server_peer_ = QuicMakeUnique<QboneServerSession>( + server_peer_ = std::make_unique<QboneServerSession>( AllSupportedVersions(), server_connection_, nullptr, config, server_crypto_config_.get(), &compressed_certs_cache_, server_writer_.get(), TestLoopback6(), TestLoopback6(), 64,
diff --git a/quic/qbone/qbone_stream_test.cc b/quic/qbone/qbone_stream_test.cc index 1920aa5..344387f 100644 --- a/quic/qbone/qbone_stream_test.cc +++ b/quic/qbone/qbone_stream_test.cc
@@ -135,7 +135,7 @@ Perspective perspective = Perspective::IS_SERVER; bool owns_writer = true; - alarm_factory_ = QuicMakeUnique<test::MockAlarmFactory>(); + alarm_factory_ = std::make_unique<test::MockAlarmFactory>(); connection_.reset(new QuicConnection( test::TestConnectionId(0), QuicSocketAddress(TestLoopback(), 0), @@ -143,8 +143,8 @@ new DummyPacketWriter(), owns_writer, perspective, ParsedVersionOfIndex(CurrentSupportedVersions(), 0))); clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<StrictMock<MockQuicSession>>(connection_.get(), - QuicConfig()); + session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_.get(), + QuicConfig()); stream_ = new QboneReadOnlyStream(kStreamId, session_.get()); session_->ActivateReliableStream( std::unique_ptr<QboneReadOnlyStream>(stream_));
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);
diff --git a/quic/test_tools/crypto_test_utils.cc b/quic/test_tools/crypto_test_utils.cc index e2a8b8b..ce0cb6e 100644 --- a/quic/test_tools/crypto_test_utils.cc +++ b/quic/test_tools/crypto_test_utils.cc
@@ -130,7 +130,7 @@ std::unique_ptr<ValidateClientHelloCallback> GetValidateClientHelloCallback() { - return QuicMakeUnique<ValidateClientHelloCallback>(this); + return std::make_unique<ValidateClientHelloCallback>(this); } private: @@ -164,7 +164,7 @@ }; std::unique_ptr<ProcessClientHelloCallback> GetProcessClientHelloCallback() { - return QuicMakeUnique<ProcessClientHelloCallback>(this); + return std::make_unique<ProcessClientHelloCallback>(this); } void ProcessClientHelloDone(std::unique_ptr<CryptoHandshakeMessage> rej) {
diff --git a/quic/test_tools/crypto_test_utils_test.cc b/quic/test_tools/crypto_test_utils_test.cc index 62eafb9..3c9f18f 100644 --- a/quic/test_tools/crypto_test_utils_test.cc +++ b/quic/test_tools/crypto_test_utils_test.cc
@@ -47,7 +47,7 @@ std::unique_ptr<ValidateClientHelloCallback> GetValidateClientHelloCallback() { - return QuicMakeUnique<ValidateClientHelloCallback>(this); + return std::make_unique<ValidateClientHelloCallback>(this); } private: @@ -82,7 +82,7 @@ }; std::unique_ptr<ProcessClientHelloCallback> GetProcessClientHelloCallback() { - return QuicMakeUnique<ProcessClientHelloCallback>(this); + return std::make_unique<ProcessClientHelloCallback>(this); } void ProcessClientHelloDone(std::unique_ptr<CryptoHandshakeMessage> message) {
diff --git a/quic/test_tools/fake_proof_source.cc b/quic/test_tools/fake_proof_source.cc index 8f1cd37..c47208f 100644 --- a/quic/test_tools/fake_proof_source.cc +++ b/quic/test_tools/fake_proof_source.cc
@@ -80,7 +80,7 @@ return; } - pending_ops_.push_back(QuicMakeUnique<GetProofOp>( + pending_ops_.push_back(std::make_unique<GetProofOp>( server_address, hostname, server_config, transport_version, std::string(chlo_hash), std::move(callback), delegate_.get())); } @@ -106,7 +106,7 @@ } QUIC_LOG(INFO) << "Adding pending op"; - pending_ops_.push_back(QuicMakeUnique<ComputeSignatureOp>( + pending_ops_.push_back(std::make_unique<ComputeSignatureOp>( server_address, hostname, signature_algorithm, in, std::move(callback), delegate_.get())); }
diff --git a/quic/test_tools/quic_test_client.cc b/quic/test_tools/quic_test_client.cc index 9d4cb03..3531318 100644 --- a/quic/test_tools/quic_test_client.cc +++ b/quic/test_tools/quic_test_client.cc
@@ -205,8 +205,8 @@ supported_versions, config, epoll_server, - QuicMakeUnique<MockableQuicClientEpollNetworkHelper>(epoll_server, - this), + std::make_unique<MockableQuicClientEpollNetworkHelper>(epoll_server, + this), QuicWrapUnique( new RecordingProofVerifier(std::move(proof_verifier)))), override_server_connection_id_(EmptyQuicConnectionId()), @@ -406,7 +406,7 @@ // May need to retry request if asynchronous rendezvous fails. std::unique_ptr<spdy::SpdyHeaderBlock> new_headers( new spdy::SpdyHeaderBlock(headers->Clone())); - push_promise_data_to_resend_ = QuicMakeUnique<TestClientDataToResend>( + push_promise_data_to_resend_ = std::make_unique<TestClientDataToResend>( std::move(new_headers), body, fin, this, std::move(ack_listener)); return 1; }
diff --git a/quic/test_tools/quic_test_server.cc b/quic/test_tools/quic_test_server.cc index 19b986e..9eee97a 100644 --- a/quic/test_tools/quic_test_server.cc +++ b/quic/test_tools/quic_test_server.cc
@@ -181,11 +181,11 @@ QuicDispatcher* QuicTestServer::CreateQuicDispatcher() { return new QuicTestDispatcher( &config(), &crypto_config(), version_manager(), - QuicMakeUnique<QuicEpollConnectionHelper>(epoll_server(), - QuicAllocator::BUFFER_POOL), + std::make_unique<QuicEpollConnectionHelper>(epoll_server(), + QuicAllocator::BUFFER_POOL), std::unique_ptr<QuicCryptoServerStream::Helper>( new QuicSimpleCryptoServerStreamHelper()), - QuicMakeUnique<QuicEpollAlarmFactory>(epoll_server()), server_backend(), + std::make_unique<QuicEpollAlarmFactory>(epoll_server()), server_backend(), expected_server_connection_id_length()); }
diff --git a/quic/test_tools/quic_test_utils.cc b/quic/test_tools/quic_test_utils.cc index 5ff5e05..9afbf98 100644 --- a/quic/test_tools/quic_test_utils.cc +++ b/quic/test_tools/quic_test_utils.cc
@@ -137,7 +137,7 @@ ENCRYPTION_INITIAL); DCHECK_NE(0u, length); // Re-construct the data packet with data ownership. - return QuicMakeUnique<QuicPacket>( + return std::make_unique<QuicPacket>( buffer, length, /* owns_buffer */ true, GetIncludedDestinationConnectionIdLength(header), GetIncludedSourceConnectionIdLength(header), header.version_flag, @@ -511,7 +511,7 @@ PacketSavingConnection::~PacketSavingConnection() {} void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { - encrypted_packets_.push_back(QuicMakeUnique<QuicEncryptedPacket>( + encrypted_packets_.push_back(std::make_unique<QuicEncryptedPacket>( CopyBuffer(*packet), packet->encrypted_length, true)); clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(10)); // Transfer ownership of the packet to the SentPacketManager and the @@ -532,7 +532,7 @@ connection->supported_versions(), /*num_expected_unidirectional_static_streams = */ 0) { if (create_mock_crypto_stream) { - crypto_stream_ = QuicMakeUnique<MockQuicCryptoStream>(this); + crypto_stream_ = std::make_unique<MockQuicCryptoStream>(this); } ON_CALL(*this, WritevData(_, _, _, _, _)) .WillByDefault(testing::Return(QuicConsumedData(0, false))); @@ -561,7 +561,7 @@ QuicStreamOffset offset, StreamSendingState state) { if (write_length > 0) { - auto buf = QuicMakeUnique<char[]>(write_length); + auto buf = std::make_unique<char[]>(write_length); QuicDataWriter writer(write_length, buf.get(), HOST_BYTE_ORDER); stream->WriteStreamData(offset, write_length, &writer); } else { @@ -602,7 +602,7 @@ DefaultQuicConfig(), connection->supported_versions()) { if (create_mock_crypto_stream) { - crypto_stream_ = QuicMakeUnique<MockQuicCryptoStream>(this); + crypto_stream_ = std::make_unique<MockQuicCryptoStream>(this); } ON_CALL(*this, WritevData(_, _, _, _, _)) @@ -681,7 +681,7 @@ &push_promise_index_, config, supported_versions) { - crypto_stream_ = QuicMakeUnique<QuicCryptoClientStream>( + crypto_stream_ = std::make_unique<QuicCryptoClientStream>( server_id, this, crypto_test_utils::ProofVerifyContextForTesting(), crypto_config, this); Initialize();
diff --git a/quic/test_tools/simple_data_producer.cc b/quic/test_tools/simple_data_producer.cc index 89bf5b9..e9dab7b 100644 --- a/quic/test_tools/simple_data_producer.cc +++ b/quic/test_tools/simple_data_producer.cc
@@ -27,7 +27,7 @@ return; } if (!QuicContainsKey(send_buffer_map_, id)) { - send_buffer_map_[id] = QuicMakeUnique<QuicStreamSendBuffer>(&allocator_); + send_buffer_map_[id] = std::make_unique<QuicStreamSendBuffer>(&allocator_); } send_buffer_map_[id]->SaveStreamData(iov, iov_count, iov_offset, data_length); }
diff --git a/quic/test_tools/simple_quic_framer.cc b/quic/test_tools/simple_quic_framer.cc index ad7e7bb..68e4878 100644 --- a/quic/test_tools/simple_quic_framer.cc +++ b/quic/test_tools/simple_quic_framer.cc
@@ -30,12 +30,12 @@ void OnPacket() override {} void OnPublicResetPacket(const QuicPublicResetPacket& packet) override { - public_reset_packet_ = QuicMakeUnique<QuicPublicResetPacket>((packet)); + public_reset_packet_ = std::make_unique<QuicPublicResetPacket>((packet)); } void OnVersionNegotiationPacket( const QuicVersionNegotiationPacket& packet) override { version_negotiation_packet_ = - QuicMakeUnique<QuicVersionNegotiationPacket>((packet)); + std::make_unique<QuicVersionNegotiationPacket>((packet)); } void OnRetryPacket(QuicConnectionId /*original_connection_id*/, @@ -70,7 +70,7 @@ new std::string(frame.data_buffer, frame.data_length); stream_data_.push_back(QuicWrapUnique(string_data)); // TODO(ianswett): A pointer isn't necessary with emplace_back. - stream_frames_.push_back(QuicMakeUnique<QuicStreamFrame>( + stream_frames_.push_back(std::make_unique<QuicStreamFrame>( frame.stream_id, frame.fin, frame.offset, QuicStringPiece(*string_data))); return true; @@ -81,7 +81,7 @@ std::string* string_data = new std::string(frame.data_buffer, frame.data_length); crypto_data_.push_back(QuicWrapUnique(string_data)); - crypto_frames_.push_back(QuicMakeUnique<QuicCryptoFrame>( + crypto_frames_.push_back(std::make_unique<QuicCryptoFrame>( frame.level, frame.offset, QuicStringPiece(*string_data))); return true; } @@ -202,7 +202,7 @@ void OnAuthenticatedIetfStatelessResetPacket( const QuicIetfStatelessResetPacket& packet) override { stateless_reset_packet_ = - QuicMakeUnique<QuicIetfStatelessResetPacket>(packet); + std::make_unique<QuicIetfStatelessResetPacket>(packet); } const QuicPacketHeader& header() const { return header_; } @@ -309,13 +309,13 @@ SimpleQuicFramer::~SimpleQuicFramer() {} bool SimpleQuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) { - visitor_ = QuicMakeUnique<SimpleFramerVisitor>(); + visitor_ = std::make_unique<SimpleFramerVisitor>(); framer_.set_visitor(visitor_.get()); return framer_.ProcessPacket(packet); } void SimpleQuicFramer::Reset() { - visitor_ = QuicMakeUnique<SimpleFramerVisitor>(); + visitor_ = std::make_unique<SimpleFramerVisitor>(); } const QuicPacketHeader& SimpleQuicFramer::header() const {
diff --git a/quic/test_tools/simple_session_notifier_test.cc b/quic/test_tools/simple_session_notifier_test.cc index 63da639..eea1608 100644 --- a/quic/test_tools/simple_session_notifier_test.cc +++ b/quic/test_tools/simple_session_notifier_test.cc
@@ -258,7 +258,7 @@ notifier_.WriteCryptoData(ENCRYPTION_INITIAL, 1024, 0); // Send crypto data [1024, 2048) in ENCRYPTION_ZERO_RTT. connection_.SetDefaultEncryptionLevel(ENCRYPTION_ZERO_RTT); - connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, QuicMakeUnique<NullEncrypter>( + connection_.SetEncrypter(ENCRYPTION_ZERO_RTT, std::make_unique<NullEncrypter>( Perspective::IS_CLIENT)); EXPECT_CALL(connection_, SendCryptoData(ENCRYPTION_ZERO_RTT, 1024, 0)) .WillOnce(Invoke(&connection_,
diff --git a/quic/test_tools/simulator/quic_endpoint.cc b/quic/test_tools/simulator/quic_endpoint.cc index 28df15f..3048534 100644 --- a/quic/test_tools/simulator/quic_endpoint.cc +++ b/quic/test_tools/simulator/quic_endpoint.cc
@@ -85,14 +85,14 @@ connection_.SetSelfAddress(GetAddressFromName(name)); connection_.set_visitor(this); connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullEncrypter>(perspective)); + std::make_unique<NullEncrypter>(perspective)); if (connection_.version().KnowsWhichDecrypterToUse()) { connection_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(perspective)); + std::make_unique<NullDecrypter>(perspective)); connection_.RemoveDecrypter(ENCRYPTION_INITIAL); } else { connection_.SetDecrypter(ENCRYPTION_FORWARD_SECURE, - QuicMakeUnique<NullDecrypter>(perspective)); + std::make_unique<NullDecrypter>(perspective)); } connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); if (perspective == Perspective::IS_SERVER) { @@ -102,7 +102,7 @@ connection_.SetDataProducer(&producer_); connection_.SetSessionNotifier(this); if (connection_.session_decides_what_to_write()) { - notifier_ = QuicMakeUnique<test::SimpleSessionNotifier>(&connection_); + notifier_ = std::make_unique<test::SimpleSessionNotifier>(&connection_); } // Configure the connection as if it received a handshake. This is important @@ -179,7 +179,7 @@ } void QuicEndpoint::RecordTrace() { - trace_visitor_ = QuicMakeUnique<QuicTraceVisitor>(&connection_); + trace_visitor_ = std::make_unique<QuicTraceVisitor>(&connection_); connection_.set_debug_visitor(trace_visitor_.get()); } @@ -323,7 +323,7 @@ return WriteResult(WRITE_STATUS_BLOCKED, 0); } - auto packet = QuicMakeUnique<Packet>(); + auto packet = std::make_unique<Packet>(); packet->source = endpoint_->name(); packet->destination = endpoint_->peer_name_; packet->tx_timestamp = endpoint_->clock_->Now();
diff --git a/quic/test_tools/simulator/quic_endpoint_test.cc b/quic/test_tools/simulator/quic_endpoint_test.cc index 74b48ba..11a00fa 100644 --- a/quic/test_tools/simulator/quic_endpoint_test.cc +++ b/quic/test_tools/simulator/quic_endpoint_test.cc
@@ -37,14 +37,14 @@ Switch switch_; std::unique_ptr<SymmetricLink> Link(Endpoint* a, Endpoint* b) { - return QuicMakeUnique<SymmetricLink>(a, b, kDefaultBandwidth, - kDefaultPropagationDelay); + return std::make_unique<SymmetricLink>(a, b, kDefaultBandwidth, + kDefaultPropagationDelay); } std::unique_ptr<SymmetricLink> CustomLink(Endpoint* a, Endpoint* b, uint64_t extra_rtt_ms) { - return QuicMakeUnique<SymmetricLink>( + return std::make_unique<SymmetricLink>( a, b, kDefaultBandwidth, kDefaultPropagationDelay + QuicTime::Delta::FromMilliseconds(extra_rtt_ms)); @@ -156,22 +156,22 @@ TEST_F(QuicEndpointTest, Competition) { // TODO(63765788): Turn back on this flag when the issue if fixed. SetQuicReloadableFlag(quic_bbr_one_mss_conservation, false); - auto endpoint_a = QuicMakeUnique<QuicEndpoint>( + auto endpoint_a = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint A", "Endpoint D (A)", Perspective::IS_CLIENT, test::TestConnectionId(42)); - auto endpoint_b = QuicMakeUnique<QuicEndpoint>( + auto endpoint_b = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint B", "Endpoint D (B)", Perspective::IS_CLIENT, test::TestConnectionId(43)); - auto endpoint_c = QuicMakeUnique<QuicEndpoint>( + auto endpoint_c = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint C", "Endpoint D (C)", Perspective::IS_CLIENT, test::TestConnectionId(44)); - auto endpoint_d_a = QuicMakeUnique<QuicEndpoint>( + auto endpoint_d_a = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint D (A)", "Endpoint A", Perspective::IS_SERVER, test::TestConnectionId(42)); - auto endpoint_d_b = QuicMakeUnique<QuicEndpoint>( + auto endpoint_d_b = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint D (B)", "Endpoint B", Perspective::IS_SERVER, test::TestConnectionId(43)); - auto endpoint_d_c = QuicMakeUnique<QuicEndpoint>( + auto endpoint_d_c = std::make_unique<QuicEndpoint>( &simulator_, "Endpoint D (C)", "Endpoint C", Perspective::IS_SERVER, test::TestConnectionId(44)); QuicEndpointMultiplexer endpoint_d(
diff --git a/quic/test_tools/simulator/simulator_test.cc b/quic/test_tools/simulator/simulator_test.cc index 1e7a8ce..369825d 100644 --- a/quic/test_tools/simulator/simulator_test.cc +++ b/quic/test_tools/simulator/simulator_test.cc
@@ -123,7 +123,7 @@ void Act() override { if (tx_port_->TimeUntilAvailable().IsZero()) { - auto packet = QuicMakeUnique<Packet>(); + auto packet = std::make_unique<Packet>(); packet->source = name_; packet->destination = destination_; packet->tx_timestamp = clock_->Now(); @@ -255,7 +255,7 @@ EXPECT_EQ(0u, queue.packets_queued()); EXPECT_EQ(0u, acceptor.packets()->size()); - auto first_packet = QuicMakeUnique<Packet>(); + auto first_packet = std::make_unique<Packet>(); first_packet->size = 600; queue.AcceptPacket(std::move(first_packet)); EXPECT_EQ(600u, queue.bytes_queued()); @@ -263,14 +263,14 @@ EXPECT_EQ(0u, acceptor.packets()->size()); // The second packet does not fit and is dropped. - auto second_packet = QuicMakeUnique<Packet>(); + auto second_packet = std::make_unique<Packet>(); second_packet->size = 500; queue.AcceptPacket(std::move(second_packet)); EXPECT_EQ(600u, queue.bytes_queued()); EXPECT_EQ(1u, queue.packets_queued()); EXPECT_EQ(0u, acceptor.packets()->size()); - auto third_packet = QuicMakeUnique<Packet>(); + auto third_packet = std::make_unique<Packet>(); third_packet->size = 400; queue.AcceptPacket(std::move(third_packet)); EXPECT_EQ(1000u, queue.bytes_queued());
diff --git a/quic/test_tools/simulator/switch.cc b/quic/test_tools/simulator/switch.cc index 809c7f8..9247490 100644 --- a/quic/test_tools/simulator/switch.cc +++ b/quic/test_tools/simulator/switch.cc
@@ -77,7 +77,7 @@ if (!egress_port.connected()) { continue; } - egress_port.EnqueuePacket(QuicMakeUnique<Packet>(*packet)); + egress_port.EnqueuePacket(std::make_unique<Packet>(*packet)); } }
diff --git a/quic/tools/quic_client.cc b/quic/tools/quic_client.cc index 123cf1e..01964f6 100644 --- a/quic/tools/quic_client.cc +++ b/quic/tools/quic_client.cc
@@ -109,7 +109,7 @@ std::unique_ptr<QuicSession> QuicClient::CreateQuicClientSession( const ParsedQuicVersionVector& supported_versions, QuicConnection* connection) { - return QuicMakeUnique<QuicSimpleClientSession>( + return std::make_unique<QuicSimpleClientSession>( *config(), supported_versions, connection, server_id(), crypto_config(), push_promise_index(), drop_response_body()); }
diff --git a/quic/tools/quic_client_interop_test_bin.cc b/quic/tools/quic_client_interop_test_bin.cc index 39f8ff9..a99f66a 100644 --- a/quic/tools/quic_client_interop_test_bin.cc +++ b/quic/tools/quic_client_interop_test_bin.cc
@@ -55,9 +55,9 @@ QuicServerId server_id, ParsedQuicVersionVector versions) { std::set<Feature> features; - auto proof_verifier = QuicMakeUnique<FakeProofVerifier>(); + auto proof_verifier = std::make_unique<FakeProofVerifier>(); QuicEpollServer epoll_server; - auto client = QuicMakeUnique<QuicClient>( + auto client = std::make_unique<QuicClient>( addr, server_id, versions, &epoll_server, std::move(proof_verifier)); if (!client->Initialize()) { return features;
diff --git a/quic/tools/quic_client_test.cc b/quic/tools/quic_client_test.cc index e2d7f14..6b99d02 100644 --- a/quic/tools/quic_client_test.cc +++ b/quic/tools/quic_client_test.cc
@@ -69,7 +69,7 @@ QuicSocketAddress server_address(QuicSocketAddress(TestLoopback(), port)); QuicServerId server_id("hostname", server_address.port(), false); ParsedQuicVersionVector versions = AllSupportedVersions(); - auto client = QuicMakeUnique<QuicClient>( + auto client = std::make_unique<QuicClient>( server_address, server_id, versions, &epoll_server_, crypto_test_utils::ProofVerifierForTesting()); EXPECT_TRUE(client->Initialize());
diff --git a/quic/tools/quic_epoll_client_factory.cc b/quic/tools/quic_epoll_client_factory.cc index 7cfb00a..bad090d 100644 --- a/quic/tools/quic_epoll_client_factory.cc +++ b/quic/tools/quic_epoll_client_factory.cc
@@ -27,8 +27,8 @@ return nullptr; } QuicServerId server_id(host_for_handshake, port, false); - return QuicMakeUnique<QuicClient>(addr, server_id, versions, &epoll_server_, - std::move(verifier)); + return std::make_unique<QuicClient>(addr, server_id, versions, &epoll_server_, + std::move(verifier)); } } // namespace quic
diff --git a/quic/tools/quic_epoll_server_factory.cc b/quic/tools/quic_epoll_server_factory.cc index f0c206a..9662658 100644 --- a/quic/tools/quic_epoll_server_factory.cc +++ b/quic/tools/quic_epoll_server_factory.cc
@@ -11,8 +11,7 @@ std::unique_ptr<quic::QuicSpdyServerBase> QuicEpollServerFactory::CreateServer( quic::QuicSimpleServerBackend* backend, std::unique_ptr<quic::ProofSource> proof_source) { - return quic::QuicMakeUnique<quic::QuicServer>(std::move(proof_source), - backend); + return std::make_unique<quic::QuicServer>(std::move(proof_source), backend); } } // namespace quic
diff --git a/quic/tools/quic_memory_cache_backend.cc b/quic/tools/quic_memory_cache_backend.cc index 5943380..aa0d273 100644 --- a/quic/tools/quic_memory_cache_backend.cc +++ b/quic/tools/quic_memory_cache_backend.cc
@@ -341,7 +341,7 @@ QUIC_BUG << "Response for '" << key << "' already exists!"; return; } - auto new_response = QuicMakeUnique<QuicBackendResponse>(); + auto new_response = std::make_unique<QuicBackendResponse>(); new_response->set_response_type(response_type); new_response->set_headers(std::move(response_headers)); new_response->set_body(response_body);
diff --git a/quic/tools/quic_simple_client_session.cc b/quic/tools/quic_simple_client_session.cc index 7cc875b..b7743f8 100644 --- a/quic/tools/quic_simple_client_session.cc +++ b/quic/tools/quic_simple_client_session.cc
@@ -10,7 +10,7 @@ std::unique_ptr<QuicSpdyClientStream> QuicSimpleClientSession::CreateClientStream() { - return QuicMakeUnique<QuicSimpleClientStream>( + return std::make_unique<QuicSimpleClientStream>( GetNextOutgoingBidirectionalStreamId(), this, BIDIRECTIONAL, drop_response_body_); }
diff --git a/quic/tools/quic_simple_server_session_test.cc b/quic/tools/quic_simple_server_session_test.cc index 6cc97ed..b21d9fa 100644 --- a/quic/tools/quic_simple_server_session_test.cc +++ b/quic/tools/quic_simple_server_session_test.cc
@@ -82,11 +82,10 @@ QuicCompressedCertsCache* compressed_certs_cache, QuicServerSessionBase* session, QuicCryptoServerStream::Helper* helper) - : QuicCryptoServerStream( - crypto_config, - compressed_certs_cache, - session, - helper) {} + : QuicCryptoServerStream(crypto_config, + compressed_certs_cache, + session, + helper) {} MockQuicCryptoServerStream(const MockQuicCryptoServerStream&) = delete; MockQuicCryptoServerStream& operator=(const MockQuicCryptoServerStream&) = delete; @@ -215,7 +214,7 @@ connection_ = new StrictMock<MockQuicConnectionWithSendStreamData>( &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions); connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); - session_ = QuicMakeUnique<MockQuicSimpleServerSession>( + session_ = std::make_unique<MockQuicSimpleServerSession>( config_, connection_, &owner_, &stream_helper_, &crypto_config_, &compressed_certs_cache_, &memory_cache_backend_); MockClock clock; @@ -567,7 +566,7 @@ ParsedQuicVersionVector supported_versions = SupportedVersions(GetParam()); connection_ = new StrictMock<MockQuicConnectionWithSendStreamData>( &helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions); - session_ = QuicMakeUnique<MockQuicSimpleServerSession>( + session_ = std::make_unique<MockQuicSimpleServerSession>( config_, connection_, &owner_, &stream_helper_, &crypto_config_, &compressed_certs_cache_, &memory_cache_backend_); session_->Initialize();
diff --git a/quic/tools/quic_spdy_client_base.cc b/quic/tools/quic_spdy_client_base.cc index 09a1998..492091c 100644 --- a/quic/tools/quic_spdy_client_base.cc +++ b/quic/tools/quic_spdy_client_base.cc
@@ -99,7 +99,7 @@ std::unique_ptr<QuicSession> QuicSpdyClientBase::CreateQuicClientSession( const quic::ParsedQuicVersionVector& supported_versions, QuicConnection* connection) { - return QuicMakeUnique<QuicSpdyClientSession>( + return std::make_unique<QuicSpdyClientSession>( *config(), supported_versions, connection, server_id(), crypto_config(), &push_promise_index_); }
diff --git a/quic/tools/quic_toy_client.cc b/quic/tools/quic_toy_client.cc index a55382a..b843221 100644 --- a/quic/tools/quic_toy_client.cc +++ b/quic/tools/quic_toy_client.cc
@@ -209,7 +209,7 @@ const int32_t num_requests(GetQuicFlag(FLAGS_num_requests)); std::unique_ptr<quic::ProofVerifier> proof_verifier; if (GetQuicFlag(FLAGS_disable_certificate_verification)) { - proof_verifier = quic::QuicMakeUnique<FakeProofVerifier>(); + proof_verifier = std::make_unique<FakeProofVerifier>(); } else { proof_verifier = quic::CreateDefaultProofVerifier(url.host()); }
diff --git a/quic/tools/quic_toy_server.cc b/quic/tools/quic_toy_server.cc index 9fb15eb..39f206f 100644 --- a/quic/tools/quic_toy_server.cc +++ b/quic/tools/quic_toy_server.cc
@@ -36,7 +36,7 @@ std::unique_ptr<quic::QuicSimpleServerBackend> QuicToyServer::MemoryCacheBackendFactory::CreateBackend() { - auto memory_cache_backend = QuicMakeUnique<QuicMemoryCacheBackend>(); + auto memory_cache_backend = std::make_unique<QuicMemoryCacheBackend>(); if (!GetQuicFlag(FLAGS_quic_response_cache_dir).empty()) { memory_cache_backend->InitializeBackend( GetQuicFlag(FLAGS_quic_response_cache_dir));