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

Unified Diff: remoting/jingle_glue/jingle_info_request.cc

Issue 8432009: Refactor IqRequest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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/jingle_glue/jingle_info_request.cc
diff --git a/remoting/jingle_glue/jingle_info_request.cc b/remoting/jingle_glue/jingle_info_request.cc
index 148a65fa6b97fa294d03141e5871d653217fd15f..9098da6ef6dc1d0d833d0cf7d3027f47f0c7e1ba 100644
--- a/remoting/jingle_glue/jingle_info_request.cc
+++ b/remoting/jingle_glue/jingle_info_request.cc
@@ -10,18 +10,15 @@
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "net/base/net_util.h"
-#include "remoting/jingle_glue/iq_request.h"
+#include "remoting/jingle_glue/iq_sender.h"
#include "third_party/libjingle/source/talk/base/socketaddress.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
#include "third_party/libjingle/source/talk/xmpp/constants.h"
namespace remoting {
-
-JingleInfoRequest::JingleInfoRequest(IqRequest* request)
- : request_(request) {
- request_->set_callback(base::Bind(&JingleInfoRequest::OnResponse,
- base::Unretained(this)));
+JingleInfoRequest::JingleInfoRequest(SignalStrategy* signal_strategy)
+ : iq_sender_(signal_strategy) {
}
JingleInfoRequest::~JingleInfoRequest() {
@@ -29,9 +26,11 @@ JingleInfoRequest::~JingleInfoRequest() {
void JingleInfoRequest::Send(const OnJingleInfoCallback& callback) {
on_jingle_info_cb_ = callback;
- request_->SendIq(IqRequest::MakeIqStanza(
+ buzz::XmlElement* iq = IqSender::MakeIqStanza(
buzz::STR_GET, buzz::STR_EMPTY,
- new buzz::XmlElement(buzz::QN_JINGLE_INFO_QUERY, true)));
+ new buzz::XmlElement(buzz::QN_JINGLE_INFO_QUERY, true));
+ request_.reset(iq_sender_.SendIq(
+ iq, base::Bind(&JingleInfoRequest::OnResponse, base::Unretained(this))));
}
void JingleInfoRequest::OnResponse(const buzz::XmlElement* stanza) {

Powered by Google App Engine
This is Rietveld 408576698