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

Unified Diff: net/quic/core/crypto/crypto_server_test.cc

Issue 2339433004: Use unique_ptrs to manage callback lifetimes in some QUIC code (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/crypto_server_test.cc
diff --git a/net/quic/core/crypto/crypto_server_test.cc b/net/quic/core/crypto/crypto_server_test.cc
index 564d05a11697c0d0f06fd5210145c66187b34726..fb279ccc627de0e632c57688207b4b8d95e75b4b 100644
--- a/net/quic/core/crypto/crypto_server_test.cc
+++ b/net/quic/core/crypto/crypto_server_test.cc
@@ -201,8 +201,8 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
*called_ = false;
}
- void RunImpl(std::unique_ptr<Result> result,
- std::unique_ptr<ProofSource::Details> /* details */) override {
+ void Run(std::unique_ptr<Result> result,
+ std::unique_ptr<ProofSource::Details> /* details */) override {
{
// Ensure that the strike register client lock is not held.
QuicCryptoServerConfigPeer peer(&test_->config_);
@@ -247,7 +247,8 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
config_.ValidateClientHello(message, client_address_.address(), server_ip,
supported_versions_.front(), &clock_,
&crypto_proof_,
- new ValidateCallback(this, true, "", &called));
+ std::unique_ptr<ValidateCallback>(
+ new ValidateCallback(this, true, "", &called)));
EXPECT_TRUE(called);
}
@@ -265,7 +266,8 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
config_.ValidateClientHello(
message, client_address_.address(), server_ip,
supported_versions_.front(), &clock_, &crypto_proof_,
- new ValidateCallback(this, false, error_substr, called));
+ std::unique_ptr<ValidateCallback>(
+ new ValidateCallback(this, false, error_substr, called)));
}
void ProcessValidationResult(const ValidateCallback::Result& result,
@@ -1181,7 +1183,8 @@ TEST_P(AsyncStrikeServerVerificationTest, AsyncReplayProtection) {
IPAddress server_ip;
config_.ValidateClientHello(msg, client_address_.address(), server_ip,
client_version_, &clock_, &crypto_proof_,
- new ValidateCallback(this, true, "", &called));
+ std::unique_ptr<ValidateCallback>(
+ new ValidateCallback(this, true, "", &called)));
// The verification request was queued.
ASSERT_FALSE(called);
EXPECT_EQ(0u, out_.tag());
@@ -1197,7 +1200,8 @@ TEST_P(AsyncStrikeServerVerificationTest, AsyncReplayProtection) {
// Rejected if replayed.
config_.ValidateClientHello(msg, client_address_.address(), server_ip,
client_version_, &clock_, &crypto_proof_,
- new ValidateCallback(this, true, "", &called));
+ std::unique_ptr<ValidateCallback>(
+ new ValidateCallback(this, true, "", &called)));
// The verification request was queued.
ASSERT_FALSE(called);
EXPECT_EQ(1, strike_register_client_->PendingVerifications());
« no previous file with comments | « no previous file | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698