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

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

Issue 2681793002: Landing Recent QUIC changes until 5:30 PM, Feb 3, 2017 UTC-5 (Closed)
Patch Set: sync and rebase 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/test_tools/fake_proof_source.h ('k') | net/quic/test_tools/quic_crypto_server_config_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e4360195b8393b36c0e33fc24417ce7df8606c14..0eea145bc1d10024abb762dda06f1c09a024111c 100644
--- a/net/quic/test_tools/fake_proof_source.cc
+++ b/net/quic/test_tools/fake_proof_source.cc
@@ -12,7 +12,7 @@ namespace net {
namespace test {
FakeProofSource::FakeProofSource()
- : delegate_(CryptoTestUtils::ProofSourceForTesting()) {}
+ : delegate_(crypto_test_utils::ProofSourceForTesting()) {}
FakeProofSource::~FakeProofSource() {}
@@ -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);
}
« no previous file with comments | « net/quic/test_tools/fake_proof_source.h ('k') | net/quic/test_tools/quic_crypto_server_config_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698