| Index: net/quic/test_tools/fake_proof_source.cc
|
| diff --git a/net/quic/test_tools/fake_proof_source.cc b/net/quic/test_tools/fake_proof_source.cc
|
| index 135baeebb3b9111db520c19c02ddd09d3a715b9a..0eea145bc1d10024abb762dda06f1c09a024111c 100644
|
| --- a/net/quic/test_tools/fake_proof_source.cc
|
| +++ b/net/quic/test_tools/fake_proof_source.cc
|
| @@ -42,21 +42,6 @@ void FakeProofSource::Activate() {
|
| active_ = true;
|
| }
|
|
|
| -bool FakeProofSource::GetProof(
|
| - const QuicSocketAddress& server_address,
|
| - const string& hostname,
|
| - const string& server_config,
|
| - QuicVersion quic_version,
|
| - StringPiece chlo_hash,
|
| - const QuicTagVector& connection_options,
|
| - QuicReferenceCountedPointer<ProofSource::Chain>* out_chain,
|
| - QuicCryptoProof* out_proof) {
|
| - QUIC_LOG(WARNING) << "Synchronous GetProof called";
|
| - return delegate_->GetProof(server_address, hostname, server_config,
|
| - quic_version, chlo_hash, connection_options,
|
| - out_chain, out_proof);
|
| -}
|
| -
|
| void FakeProofSource::GetProof(
|
| const QuicSocketAddress& server_address,
|
| const string& hostname,
|
| @@ -66,16 +51,11 @@ void FakeProofSource::GetProof(
|
| const QuicTagVector& connection_options,
|
| std::unique_ptr<ProofSource::Callback> callback) {
|
| if (!active_) {
|
| - QuicReferenceCountedPointer<Chain> chain;
|
| - QuicCryptoProof proof;
|
| - const bool ok =
|
| - GetProof(server_address, hostname, server_config, quic_version,
|
| - chlo_hash, connection_options, &chain, &proof);
|
| - callback->Run(ok, chain, proof, /* details = */ nullptr);
|
| + delegate_->GetProof(server_address, hostname, server_config, quic_version,
|
| + chlo_hash, connection_options, std::move(callback));
|
| return;
|
| }
|
|
|
| - QUIC_LOG(WARNING) << "Asynchronous GetProof called";
|
| params_.push_back(Params{server_address, hostname, server_config,
|
| quic_version, chlo_hash.as_string(),
|
| connection_options, std::move(callback)});
|
| @@ -88,16 +68,14 @@ int FakeProofSource::NumPendingCallbacks() const {
|
| void FakeProofSource::InvokePendingCallback(int n) {
|
| CHECK(NumPendingCallbacks() > n);
|
|
|
| - const Params& params = params_[n];
|
| + Params& params = params_[n];
|
|
|
| - QuicReferenceCountedPointer<ProofSource::Chain> chain;
|
| - QuicCryptoProof proof;
|
| - const bool ok = delegate_->GetProof(
|
| - params.server_address, params.hostname, params.server_config,
|
| - params.quic_version, params.chlo_hash, params.connection_options, &chain,
|
| - &proof);
|
| + // Note: relies on the callback being invoked synchronously
|
| + delegate_->GetProof(params.server_address, params.hostname,
|
| + params.server_config, params.quic_version,
|
| + params.chlo_hash, params.connection_options,
|
| + std::move(params.callback));
|
|
|
| - params.callback->Run(ok, chain, proof, /* details = */ nullptr);
|
| auto it = params_.begin() + n;
|
| params_.erase(it);
|
| }
|
|
|