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

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

Issue 2679783003: Deprecate FLAGS_quic_reloadable_flag_enable_async_get_proof (Closed)
Patch Set: Address gredner's comments. Created 3 years, 10 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/quartc/quartc_session_test.cc ('k') | net/quic/test_tools/failing_proof_source.h » ('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.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;
}
« no previous file with comments | « net/quic/quartc/quartc_session_test.cc ('k') | net/quic/test_tools/failing_proof_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698