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

Unified Diff: remoting/jingle_glue/javascript_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/javascript_iq_request.h ('k') | remoting/jingle_glue/jingle_info_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/javascript_iq_request.cc
diff --git a/remoting/jingle_glue/javascript_iq_request.cc b/remoting/jingle_glue/javascript_iq_request.cc
index ec83365e4ec0849148bc2ba630f5c63d079276a9..0b75c71a51244790a45ed78becd5d36efcb72c61 100644
--- a/remoting/jingle_glue/javascript_iq_request.cc
+++ b/remoting/jingle_glue/javascript_iq_request.cc
@@ -57,8 +57,9 @@ void JavascriptIqRegistry::OnIncomingStanza(const buzz::XmlElement* stanza) {
// JavascriptIqRequest::SendIq(), but remove in
// JavascriptIqRegistry::OnIq(). We should try to keep the
// registration/deregistration in one spot.
- if (it->second->callback_.get()) {
- it->second->callback_->Run(stanza);
+ if (it->second->callback_.is_null()) {
+ it->second->callback_.Run(stanza);
+ it->second->callback_.Reset();
} else {
VLOG(1) << "No callback, so dropping: " << stanza->Str();
}
@@ -90,8 +91,8 @@ void JavascriptIqRequest::SendIq(const std::string& type,
signal_strategy_->SendStanza(MakeIqStanza(type, addressee, iq_body, id));
}
-void JavascriptIqRequest::set_callback(ReplyCallback* callback) {
- callback_.reset(callback);
+void JavascriptIqRequest::set_callback(const ReplyCallback& callback) {
+ callback_ = callback;
}
} // namespace remoting
« no previous file with comments | « remoting/jingle_glue/javascript_iq_request.h ('k') | remoting/jingle_glue/jingle_info_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698