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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator.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
Index: remoting/protocol/ssl_hmac_channel_authenticator.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc
index 464aa1d994bae454383ee2eec87f68774e161f24..23158d2cf22af1ab87a3df9c67b150b46282a381 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "crypto/secure_util.h"
#include "net/base/host_port_pair.h"
@@ -313,20 +314,12 @@ void SslHmacChannelAuthenticator::CheckDone(bool* callback_called) {
if (callback_called)
*callback_called = true;
- CallDoneCallback(net::OK, socket_.Pass());
+ base::ResetAndReturn(&done_callback_).Run(net::OK, socket_.Pass());
}
}
void SslHmacChannelAuthenticator::NotifyError(int error) {
- CallDoneCallback(error, nullptr);
-}
-
-void SslHmacChannelAuthenticator::CallDoneCallback(
- int error,
- scoped_ptr<net::StreamSocket> socket) {
- DoneCallback callback = done_callback_;
- done_callback_.Reset();
- callback.Run(error, socket.Pass());
+ base::ResetAndReturn(&done_callback_).Run(error, nullptr);
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.h ('k') | remoting/protocol/third_party_authenticator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698