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

Side by Side Diff: net/quic/crypto/proof_test.cc

Issue 2126023002: use std::unique_ptr for the callback argument of QUIC's ProofVerifier::Verify proof to make ownersh… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126327823
Patch Set: Created 4 years, 5 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <memory> 5 #include <memory>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 TestCompletionCallback comp_callback; 65 TestCompletionCallback comp_callback;
66 bool ok; 66 bool ok;
67 string error_details; 67 string error_details;
68 std::unique_ptr<ProofVerifyContext> verify_context( 68 std::unique_ptr<ProofVerifyContext> verify_context(
69 CryptoTestUtils::ProofVerifyContextForTesting()); 69 CryptoTestUtils::ProofVerifyContextForTesting());
70 TestProofVerifierCallback* callback = 70 TestProofVerifierCallback* callback =
71 new TestProofVerifierCallback(&comp_callback, &ok, &error_details); 71 new TestProofVerifierCallback(&comp_callback, &ok, &error_details);
72 72
73 QuicAsyncStatus status = verifier->VerifyProof( 73 QuicAsyncStatus status = verifier->VerifyProof(
74 hostname, port, server_config, quic_version, chlo_hash, certs, "", proof, 74 hostname, port, server_config, quic_version, chlo_hash, certs, "", proof,
75 verify_context.get(), &error_details, &details, callback); 75 verify_context.get(), &error_details, &details,
76 std::unique_ptr<ProofVerifierCallback>());
76 77
77 switch (status) { 78 switch (status) {
78 case QUIC_FAILURE: 79 case QUIC_FAILURE:
79 delete callback; 80 delete callback;
80 ASSERT_FALSE(expected_ok); 81 ASSERT_FALSE(expected_ok);
81 ASSERT_NE("", error_details); 82 ASSERT_NE("", error_details);
82 return; 83 return;
83 case QUIC_SUCCESS: 84 case QUIC_SUCCESS:
84 delete callback; 85 delete callback;
85 ASSERT_TRUE(expected_ok); 86 ASSERT_TRUE(expected_ok);
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 for (size_t i = 1; i < certs.size(); i++) { 410 for (size_t i = 1; i < certs.size(); i++) {
410 wrong_certs.push_back(certs[i]); 411 wrong_certs.push_back(certs[i]);
411 } 412 }
412 RunVerification(verifier.get(), hostname, port, server_config, quic_version, 413 RunVerification(verifier.get(), hostname, port, server_config, quic_version,
413 chlo_hash, wrong_certs, signature, false); 414 chlo_hash, wrong_certs, signature, false);
414 } 415 }
415 } 416 }
416 417
417 } // namespace test 418 } // namespace test
418 } // namespace net 419 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698