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

Unified Diff: remoting/protocol/third_party_authenticator_unittest.cc

Issue 1064863004: Use base::ResetAndReturn() in remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/signaling/iq_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/third_party_authenticator_unittest.cc
diff --git a/remoting/protocol/third_party_authenticator_unittest.cc b/remoting/protocol/third_party_authenticator_unittest.cc
index 770907dbfdab88acdd3d1b15df7c971ec497b402..9f6dde1dee4a98ba3670b6ae3d604c88d916ddcd 100644
--- a/remoting/protocol/third_party_authenticator_unittest.cc
+++ b/remoting/protocol/third_party_authenticator_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/callback_helpers.h"
#include "net/base/net_errors.h"
#include "remoting/base/rsa_key_pair.h"
#include "remoting/protocol/authenticator_test_base.h"
@@ -53,9 +54,7 @@ class ThirdPartyAuthenticatorTest : public AuthenticatorTestBase {
void OnTokenFetched(const std::string& token,
const std::string& shared_secret) {
ASSERT_FALSE(on_token_fetched_.is_null());
- TokenFetchedCallback on_token_fetched = on_token_fetched_;
- on_token_fetched_.Reset();
- on_token_fetched.Run(token, shared_secret);
+ base::ResetAndReturn(&on_token_fetched_).Run(token, shared_secret);
}
private:
@@ -79,9 +78,7 @@ class ThirdPartyAuthenticatorTest : public AuthenticatorTestBase {
void OnTokenValidated(const std::string& shared_secret) {
ASSERT_FALSE(on_token_validated_.is_null());
- TokenValidatedCallback on_token_validated = on_token_validated_;
- on_token_validated_.Reset();
- on_token_validated.Run(shared_secret);
+ base::ResetAndReturn(&on_token_validated_).Run(shared_secret);
}
const GURL& token_url() const override { return token_url_; }
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/signaling/iq_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698