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

Unified Diff: remoting/signaling/iq_sender.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/signaling/iq_sender.cc
diff --git a/remoting/signaling/iq_sender.cc b/remoting/signaling/iq_sender.cc
index d3e7432ff33bafbd6f9a828a993492bf21e7f361..7fefc71e934049f131772faf2dffc33b6968b7d0 100644
--- a/remoting/signaling/iq_sender.cc
+++ b/remoting/signaling/iq_sender.cc
@@ -5,6 +5,7 @@
#include "remoting/signaling/iq_sender.h"
#include "base/bind.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
@@ -138,11 +139,8 @@ void IqRequest::SetTimeout(base::TimeDelta timeout) {
}
void IqRequest::CallCallback(const buzz::XmlElement* stanza) {
- if (!callback_.is_null()) {
- IqSender::ReplyCallback callback(callback_);
- callback_.Reset();
- callback.Run(this, stanza);
- }
+ if (!callback_.is_null())
+ base::ResetAndReturn(&callback_).Run(this, stanza);
}
void IqRequest::OnTimeout() {

Powered by Google App Engine
This is Rietveld 408576698