Index: remoting/host/register_support_host_request.cc |
diff --git a/remoting/host/register_support_host_request.cc b/remoting/host/register_support_host_request.cc |
index d9e2166c3fb23b6f1a11d280a7c647dd43666847..6da2efb4f30ac5230f707da0f38bb494f3050737 100644 |
--- a/remoting/host/register_support_host_request.cc |
+++ b/remoting/host/register_support_host_request.cc |
@@ -11,7 +11,7 @@ |
#include "base/time.h" |
#include "remoting/base/constants.h" |
#include "remoting/host/host_config.h" |
-#include "remoting/jingle_glue/iq_request.h" |
+#include "remoting/jingle_glue/iq_sender.h" |
#include "remoting/jingle_glue/jingle_thread.h" |
#include "remoting/jingle_glue/signal_strategy.h" |
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h" |
@@ -59,12 +59,12 @@ void RegisterSupportHostRequest::OnSignallingConnected( |
message_loop_ = MessageLoop::current(); |
- request_.reset(signal_strategy->CreateIqRequest()); |
- request_->set_callback(base::Bind( |
- &RegisterSupportHostRequest::ProcessResponse, base::Unretained(this))); |
- |
- request_->SendIq(IqRequest::MakeIqStanza( |
- buzz::STR_SET, kChromotingBotJid, CreateRegistrationRequest(jid))); |
+ iq_sender_.reset(new IqSender(signal_strategy)); |
+ request_.reset(iq_sender_->SendIq( |
+ IqSender::MakeIqStanza(buzz::STR_SET, kChromotingBotJid, |
+ CreateRegistrationRequest(jid)), |
+ base::Bind(&RegisterSupportHostRequest::ProcessResponse, |
+ base::Unretained(this)))); |
} |
void RegisterSupportHostRequest::OnSignallingDisconnected() { |
@@ -78,6 +78,7 @@ void RegisterSupportHostRequest::OnSignallingDisconnected() { |
} |
DCHECK_EQ(message_loop_, MessageLoop::current()); |
request_.reset(); |
+ iq_sender_.reset(); |
} |
// Ignore any notifications other than signalling |
@@ -129,7 +130,10 @@ bool RegisterSupportHostRequest::ParseResponse(const XmlElement* response, |
} |
// This method must only be called for error or result stanzas. |
- DCHECK_EQ(buzz::STR_RESULT, type); |
+ if (type != buzz::STR_RESULT) { |
+ LOG(ERROR) << "Received unexpect stanza of type \"" << type << "\""; |
+ return false; |
+ } |
const XmlElement* result_element = response->FirstNamed(QName( |
kChromotingXmlNamespace, kRegisterQueryResultTag)); |