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

Unified Diff: remoting/jingle_glue/xmpp_iq_request.cc

Issue 7744041: Use new callbacks in the IqRequest interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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/jingle_glue/xmpp_iq_request.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/xmpp_iq_request.cc
diff --git a/remoting/jingle_glue/xmpp_iq_request.cc b/remoting/jingle_glue/xmpp_iq_request.cc
index ee55536fec836063b21e2a6fdd18c1119efc3cab..e48120bc5b1cba53d4dc94dc1a7eb571b92a7d80 100644
--- a/remoting/jingle_glue/xmpp_iq_request.cc
+++ b/remoting/jingle_glue/xmpp_iq_request.cc
@@ -41,8 +41,8 @@ void XmppIqRequest::SendIq(const std::string& type,
xmpp_client_->engine()->SendIq(stanza.get(), this, &cookie_);
}
-void XmppIqRequest::set_callback(ReplyCallback* callback) {
- callback_.reset(callback);
+void XmppIqRequest::set_callback(const ReplyCallback& callback) {
+ callback_ = callback;
}
void XmppIqRequest::Unregister() {
@@ -57,8 +57,9 @@ void XmppIqRequest::Unregister() {
void XmppIqRequest::IqResponse(buzz::XmppIqCookie cookie,
const buzz::XmlElement* stanza) {
- if (callback_.get() != NULL) {
- callback_->Run(stanza);
+ if (callback_.is_null()) {
+ callback_.Run(stanza);
+ callback_.Reset();
}
}
« no previous file with comments | « remoting/jingle_glue/xmpp_iq_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698