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

Unified Diff: net/quic/test_tools/crypto_test_utils_test.cc

Issue 2453113002: Fix object-lifetime issues in async GetProof callpaths (Closed)
Patch Set: Updated patchset dependency Created 4 years, 2 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 | « net/quic/test_tools/crypto_test_utils.cc ('k') | net/quic/test_tools/mock_crypto_client_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils_test.cc
diff --git a/net/quic/test_tools/crypto_test_utils_test.cc b/net/quic/test_tools/crypto_test_utils_test.cc
index 7af5fd4a081d8c6f1bc3abc3d7ad43f62006040e..02d687929ecb5c685d8edb87d6ccd0c75e741702 100644
--- a/net/quic/test_tools/crypto_test_utils_test.cc
+++ b/net/quic/test_tools/crypto_test_utils_test.cc
@@ -22,14 +22,15 @@ class ShloVerifier {
IPAddress server_ip,
IPEndPoint client_addr,
const QuicClock* clock,
- QuicCryptoProof* proof,
+ scoped_refptr<QuicCryptoProof> proof,
QuicCompressedCertsCache* compressed_certs_cache)
: crypto_config_(crypto_config),
server_ip_(server_ip),
client_addr_(client_addr),
clock_(clock),
proof_(proof),
- compressed_certs_cache_(compressed_certs_cache) {}
+ compressed_certs_cache_(compressed_certs_cache),
+ params_(new QuicCryptoNegotiatedParameters) {}
class ValidateClientHelloCallback : public ValidateClientHelloResultCallback {
public:
@@ -58,7 +59,7 @@ class ShloVerifier {
result_, /*reject_only=*/false, /*connection_id=*/1, server_ip_,
client_addr_, AllSupportedVersions().front(), AllSupportedVersions(),
/*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0,
- clock_, QuicRandom::GetInstance(), compressed_certs_cache_, &params_,
+ clock_, QuicRandom::GetInstance(), compressed_certs_cache_, params_,
proof_, /*total_framing_overhead=*/50, kDefaultMaxPacketSize,
GetProcessClientHelloCallback());
}
@@ -94,10 +95,10 @@ class ShloVerifier {
IPAddress server_ip_;
IPEndPoint client_addr_;
const QuicClock* clock_;
- QuicCryptoProof* proof_;
+ scoped_refptr<QuicCryptoProof> proof_;
QuicCompressedCertsCache* compressed_certs_cache_;
- QuicCryptoNegotiatedParameters params_;
+ scoped_refptr<QuicCryptoNegotiatedParameters> params_;
scoped_refptr<ValidateClientHelloResultCallback::Result> result_;
};
@@ -108,7 +109,7 @@ TEST(CryptoTestUtilsTest, TestGenerateFullCHLO) {
CryptoTestUtils::ProofSourceForTesting());
IPAddress server_ip;
IPEndPoint client_addr(IPAddress::IPv4Localhost(), 1);
- QuicCryptoProof proof;
+ scoped_refptr<QuicCryptoProof> proof(new QuicCryptoProof);
QuicCompressedCertsCache compressed_certs_cache(
QuicCompressedCertsCache::kQuicCompressedCertsCacheSize);
CryptoHandshakeMessage full_chlo;
@@ -155,13 +156,13 @@ TEST(CryptoTestUtilsTest, TestGenerateFullCHLO) {
// clang-format on
CryptoTestUtils::GenerateFullCHLO(inchoate_chlo, &crypto_config, server_ip,
- client_addr, version, &clock, &proof,
+ client_addr, version, &clock, proof,
&compressed_certs_cache, &full_chlo);
// Verify that full_chlo can pass crypto_config's verification.
ShloVerifier shlo_verifier(&crypto_config, server_ip, client_addr, &clock,
- &proof, &compressed_certs_cache);
+ proof, &compressed_certs_cache);
crypto_config.ValidateClientHello(
- full_chlo, client_addr.address(), server_ip, version, &clock, &proof,
+ full_chlo, client_addr.address(), server_ip, version, &clock, proof,
shlo_verifier.GetValidateClientHelloCallback());
}
« no previous file with comments | « net/quic/test_tools/crypto_test_utils.cc ('k') | net/quic/test_tools/mock_crypto_client_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698