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

Side by Side Diff: net/quic/test_tools/crypto_test_utils.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/test_tools/crypto_test_utils.h" 5 #include "net/quic/test_tools/crypto_test_utils.h"
6 6
7 #include <openssl/bn.h> 7 #include <openssl/bn.h>
8 #include <openssl/ec.h> 8 #include <openssl/ec.h>
9 #include <openssl/ecdsa.h> 9 #include <openssl/ecdsa.h>
10 #include <openssl/evp.h> 10 #include <openssl/evp.h>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 QuicCompressedCertsCache* compressed_certs_cache, 284 QuicCompressedCertsCache* compressed_certs_cache,
285 CryptoHandshakeMessage* out) 285 CryptoHandshakeMessage* out)
286 : crypto_config_(crypto_config), 286 : crypto_config_(crypto_config),
287 server_ip_(server_ip), 287 server_ip_(server_ip),
288 client_addr_(client_addr), 288 client_addr_(client_addr),
289 clock_(clock), 289 clock_(clock),
290 proof_(proof), 290 proof_(proof),
291 compressed_certs_cache_(compressed_certs_cache), 291 compressed_certs_cache_(compressed_certs_cache),
292 out_(out) {} 292 out_(out) {}
293 293
294 void RunImpl( 294 void Run(std::unique_ptr<ValidateClientHelloResultCallback::Result> result,
295 std::unique_ptr<ValidateClientHelloResultCallback::Result> result, 295 std::unique_ptr<ProofSource::Details> /* details */) override {
296 std::unique_ptr<ProofSource::Details> /* details */) override {
297 QuicCryptoNegotiatedParameters params; 296 QuicCryptoNegotiatedParameters params;
298 string error_details; 297 string error_details;
299 DiversificationNonce diversification_nonce; 298 DiversificationNonce diversification_nonce;
300 CryptoHandshakeMessage rej; 299 CryptoHandshakeMessage rej;
301 crypto_config_->ProcessClientHello( 300 crypto_config_->ProcessClientHello(
302 *result, /*reject_only=*/false, /*connection_id=*/1, server_ip_, 301 *result, /*reject_only=*/false, /*connection_id=*/1, server_ip_,
303 client_addr_, AllSupportedVersions().front(), AllSupportedVersions(), 302 client_addr_, AllSupportedVersions().front(), AllSupportedVersions(),
304 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0, 303 /*use_stateless_rejects=*/true, /*server_designated_connection_id=*/0,
305 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, &params, 304 clock_, QuicRandom::GetInstance(), compressed_certs_cache_, &params,
306 proof_, /*total_framing_overhead=*/50, kDefaultMaxPacketSize, &rej, 305 proof_, /*total_framing_overhead=*/50, kDefaultMaxPacketSize, &rej,
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 IPAddress server_ip, 958 IPAddress server_ip,
960 IPEndPoint client_addr, 959 IPEndPoint client_addr,
961 QuicVersion version, 960 QuicVersion version,
962 const QuicClock* clock, 961 const QuicClock* clock,
963 QuicCryptoProof* proof, 962 QuicCryptoProof* proof,
964 QuicCompressedCertsCache* compressed_certs_cache, 963 QuicCompressedCertsCache* compressed_certs_cache,
965 CryptoHandshakeMessage* out) { 964 CryptoHandshakeMessage* out) {
966 // Pass a inchoate CHLO. 965 // Pass a inchoate CHLO.
967 crypto_config->ValidateClientHello( 966 crypto_config->ValidateClientHello(
968 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof, 967 inchoate_chlo, client_addr.address(), server_ip, version, clock, proof,
969 new FullChloGenerator(crypto_config, server_ip, client_addr, clock, proof, 968 std::unique_ptr<FullChloGenerator>(
970 compressed_certs_cache, out)); 969 new FullChloGenerator(crypto_config, server_ip, client_addr, clock,
970 proof, compressed_certs_cache, out)));
971 } 971 }
972 972
973 } // namespace test 973 } // namespace test
974 } // namespace net 974 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698