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

Unified Diff: net/quic/core/quic_crypto_server_stream.cc

Issue 2339433004: Use unique_ptrs to manage callback lifetimes in some QUIC code (Closed)
Patch Set: Created 4 years, 3 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
Index: net/quic/core/quic_crypto_server_stream.cc
diff --git a/net/quic/core/quic_crypto_server_stream.cc b/net/quic/core/quic_crypto_server_stream.cc
index 780e5627e8a818039bf63fd2f552792515e90af2..6f434184f4e58f90f5f038134728962ad13b9353 100644
--- a/net/quic/core/quic_crypto_server_stream.cc
+++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -115,12 +115,12 @@ void QuicCryptoServerStream::OnHandshakeMessage(
CryptoUtils::HashHandshakeMessage(message, &chlo_hash_);
- validate_client_hello_cb_ = new ValidateCallback(this);
+ std::unique_ptr<ValidateCallback> cb(new ValidateCallback(this));
+ validate_client_hello_cb_ = cb.get();
crypto_config_->ValidateClientHello(
message, session()->connection()->peer_address().address(),
session()->connection()->self_address().address(), version(),
- session()->connection()->clock(), &crypto_proof_,
- validate_client_hello_cb_);
+ session()->connection()->clock(), &crypto_proof_, std::move(cb));
}
void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
@@ -428,7 +428,7 @@ void QuicCryptoServerStream::ValidateCallback::Cancel() {
parent_ = nullptr;
}
-void QuicCryptoServerStream::ValidateCallback::RunImpl(
+void QuicCryptoServerStream::ValidateCallback::Run(
std::unique_ptr<Result> result,
std::unique_ptr<ProofSource::Details> details) {
if (parent_ != nullptr) {

Powered by Google App Engine
This is Rietveld 408576698