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

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

Issue 2338013004: Simplify lifetime management of ValidateClientHelloResultCallback::Result objects (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
« no previous file with comments | « net/quic/core/quic_crypto_server_stream.h ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8de966b02e20823b25787a52c991f12e6fd52327..780e5627e8a818039bf63fd2f552792515e90af2 100644
--- a/net/quic/core/quic_crypto_server_stream.cc
+++ b/net/quic/core/quic_crypto_server_stream.cc
@@ -124,9 +124,10 @@ void QuicCryptoServerStream::OnHandshakeMessage(
}
void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
- const CryptoHandshakeMessage& message,
const ValidateClientHelloResultCallback::Result& result,
std::unique_ptr<ProofSource::Details> details) {
+ const CryptoHandshakeMessage& message = result.client_hello;
+
// Clear the callback that got us here.
DCHECK(validate_client_hello_cb_ != nullptr);
validate_client_hello_cb_ = nullptr;
@@ -139,7 +140,7 @@ void QuicCryptoServerStream::FinishProcessingHandshakeMessage(
DiversificationNonce diversification_nonce;
string error_details;
QuicErrorCode error =
- ProcessClientHello(message, result, std::move(details), &reply,
+ ProcessClientHello(result, std::move(details), &reply,
&diversification_nonce, &error_details);
if (error != QUIC_NO_ERROR) {
@@ -379,12 +380,12 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID(
}
QuicErrorCode QuicCryptoServerStream::ProcessClientHello(
- const CryptoHandshakeMessage& message,
const ValidateClientHelloResultCallback::Result& result,
std::unique_ptr<ProofSource::Details> proof_source_details,
CryptoHandshakeMessage* reply,
DiversificationNonce* out_diversification_nonce,
string* error_details) {
+ const CryptoHandshakeMessage& message = result.client_hello;
if (!helper_->CanAcceptClientHello(
message, session()->connection()->self_address(), error_details)) {
return QUIC_HANDSHAKE_FAILED;
@@ -428,12 +429,10 @@ void QuicCryptoServerStream::ValidateCallback::Cancel() {
}
void QuicCryptoServerStream::ValidateCallback::RunImpl(
- const CryptoHandshakeMessage& client_hello,
- const Result& result,
+ std::unique_ptr<Result> result,
std::unique_ptr<ProofSource::Details> details) {
if (parent_ != nullptr) {
- parent_->FinishProcessingHandshakeMessage(client_hello, result,
- std::move(details));
+ parent_->FinishProcessingHandshakeMessage(*result, std::move(details));
}
}
« no previous file with comments | « net/quic/core/quic_crypto_server_stream.h ('k') | net/quic/test_tools/crypto_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698