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

Unified Diff: remoting/protocol/fake_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/fake_authenticator.cc
diff --git a/remoting/protocol/fake_authenticator.cc b/remoting/protocol/fake_authenticator.cc
index c816cfa09492dd94ea8955d3d5372e62bcbb69cb..d597568b075773d7f908d32f54350b9c1b2f1433 100644
--- a/remoting/protocol/fake_authenticator.cc
+++ b/remoting/protocol/fake_authenticator.cc
@@ -4,6 +4,7 @@
#include "remoting/protocol/fake_authenticator.h"
+#include "base/callback_helpers.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "net/base/io_buffer.h"
@@ -82,11 +83,9 @@ void FakeChannelAuthenticator::OnAuthBytesRead(int result) {
}
void FakeChannelAuthenticator::CallDoneCallback() {
- DoneCallback callback = done_callback_;
- done_callback_.Reset();
if (result_ != net::OK)
socket_.reset();
- callback.Run(result_, socket_.Pass());
+ base::ResetAndReturn(&done_callback_).Run(result_, socket_.Pass());
}
FakeAuthenticator::FakeAuthenticator(

Powered by Google App Engine
This is Rietveld 408576698