Index: net/quic/test_tools/crypto_test_utils.cc |
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc |
index 5b22e1ed9ebaf9a266b880e0099f8df6a96955a9..92c563187c1fa6b10b22320151085da7e951b430 100644 |
--- a/net/quic/test_tools/crypto_test_utils.cc |
+++ b/net/quic/test_tools/crypto_test_utils.cc |
@@ -564,10 +564,32 @@ uint64_t LeafCertHashForTesting() { |
QuicSocketAddress server_address; |
QuicCryptoProof proof; |
std::unique_ptr<ProofSource> proof_source(ProofSourceForTesting()); |
- if (!proof_source->GetProof(server_address, "", "", |
- AllSupportedVersions().front(), "", |
- QuicTagVector(), &chain, &proof) || |
- chain->certs.empty()) { |
+ |
+ class Callback : public ProofSource::Callback { |
+ public: |
+ Callback(bool* ok, QuicReferenceCountedPointer<ProofSource::Chain>* chain) |
+ : ok_(ok), chain_(chain) {} |
+ |
+ void Run(bool ok, |
+ const QuicReferenceCountedPointer<ProofSource::Chain>& chain, |
+ const QuicCryptoProof& /* proof */, |
+ std::unique_ptr<ProofSource::Details> /* details */) override { |
+ *ok_ = ok; |
+ *chain_ = chain; |
+ } |
+ |
+ private: |
+ bool* ok_; |
+ QuicReferenceCountedPointer<ProofSource::Chain>* chain_; |
+ }; |
+ |
+ // Note: relies on the callback being invoked synchronously |
+ bool ok = false; |
+ proof_source->GetProof( |
+ server_address, "", "", AllSupportedVersions().front(), "", |
+ QuicTagVector(), |
+ std::unique_ptr<ProofSource::Callback>(new Callback(&ok, &chain))); |
+ if (!ok || chain->certs.empty()) { |
DCHECK(false) << "Proof generation failed"; |
return 0; |
} |