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

Unified Diff: net/quic/core/crypto/crypto_server_test.cc

Issue 2353763002: Use refcounted ownership for ValidateClientHelloResultCallback::Result (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/crypto/crypto_server_test.cc
diff --git a/net/quic/core/crypto/crypto_server_test.cc b/net/quic/core/crypto/crypto_server_test.cc
index 8dc07d5c4bf284c00ba22b548c79030ead2a6910..c148e9bccabd619fc82052255afd57018ae526a2 100644
--- a/net/quic/core/crypto/crypto_server_test.cc
+++ b/net/quic/core/crypto/crypto_server_test.cc
@@ -201,7 +201,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
*called_ = false;
}
- void Run(std::unique_ptr<Result> result,
+ void Run(scoped_refptr<Result> result,
std::unique_ptr<ProofSource::Details> /* details */) override {
{
// Ensure that the strike register client lock is not held.
@@ -213,14 +213,15 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
base::AutoLock lock(*m);
}
ASSERT_FALSE(*called_);
- test_->ProcessValidationResult(*result, should_succeed_, error_substr_);
+ test_->ProcessValidationResult(std::move(result), should_succeed_,
Ryan Hamilton 2016/09/19 22:35:48 do we need std::move on a scoped_refptr? (Does the
Jana 2016/09/20 21:28:52 Yeah, I wondered about this too -- I didn't realiz
+ error_substr_);
*called_ = true;
}
private:
CryptoServerTest* test_;
- bool should_succeed_;
- const char* error_substr_;
+ const bool should_succeed_;
+ const char* const error_substr_;
bool* called_;
};
@@ -270,7 +271,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
new ValidateCallback(this, false, error_substr, called)));
}
- void ProcessValidationResult(const ValidateCallback::Result& result,
+ void ProcessValidationResult(scoped_refptr<ValidateCallback::Result> result,
bool should_succeed,
const char* error_substr) {
IPAddress server_ip;
@@ -289,10 +290,10 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
if (should_succeed) {
ASSERT_EQ(error, QUIC_NO_ERROR) << "Message failed with error "
<< error_details << ": "
- << result.client_hello.DebugString();
+ << result->client_hello.DebugString();
} else {
ASSERT_NE(error, QUIC_NO_ERROR) << "Message didn't fail: "
- << result.client_hello.DebugString();
+ << result->client_hello.DebugString();
EXPECT_TRUE(error_details.find(error_substr) != string::npos)
<< error_substr << " not in " << error_details;
« no previous file with comments | « no previous file | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | net/quic/core/crypto/quic_crypto_server_config.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698