diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 23:14:04 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 23:14:04 +0000 |
commit | d5a38a18812f174f11a448862f552cac6fb44682 (patch) | |
tree | e68f8cdfe9817262c0e0b2073b3940b2cc7f0e9e /remoting/jingle_glue | |
parent | 1c1a0b351c1a6b347672db08d697ae2db6a4c404 (diff) | |
download | chromium_src-d5a38a18812f174f11a448862f552cac6fb44682.zip chromium_src-d5a38a18812f174f11a448862f552cac6fb44682.tar.gz chromium_src-d5a38a18812f174f11a448862f552cac6fb44682.tar.bz2 |
Fix leak in IqSenderTest.
BUG=102983
TEST=No leak
Review URL: http://codereview.chromium.org/8481011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/jingle_glue')
-rw-r--r-- | remoting/jingle_glue/iq_sender.h | 5 | ||||
-rw-r--r-- | remoting/jingle_glue/iq_sender_unittest.cc | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/remoting/jingle_glue/iq_sender.h b/remoting/jingle_glue/iq_sender.h index 77b48ee..2696b80 100644 --- a/remoting/jingle_glue/iq_sender.h +++ b/remoting/jingle_glue/iq_sender.h @@ -37,14 +37,15 @@ class IqSender : public SignalStrategy::Listener { // received. Destroy the returned IqRequest to cancel the callback. // Takes ownership of |stanza|. Caller must take ownership of the // result. Result must be destroyed before sender is destroyed. - IqRequest* SendIq(buzz::XmlElement* stanza, const ReplyCallback& callback); + IqRequest* SendIq(buzz::XmlElement* stanza, + const ReplyCallback& callback) WARN_UNUSED_RESULT; // Same as above, but also formats the message. Takes ownership of // |iq_body|. IqRequest* SendIq(const std::string& type, const std::string& addressee, buzz::XmlElement* iq_body, - const ReplyCallback& callback); + const ReplyCallback& callback) WARN_UNUSED_RESULT; // SignalStrategy::Listener implementation. virtual bool OnIncomingStanza(const buzz::XmlElement* stanza) OVERRIDE; diff --git a/remoting/jingle_glue/iq_sender_unittest.cc b/remoting/jingle_glue/iq_sender_unittest.cc index 733a084..f9dc8af 100644 --- a/remoting/jingle_glue/iq_sender_unittest.cc +++ b/remoting/jingle_glue/iq_sender_unittest.cc @@ -62,8 +62,9 @@ TEST_F(IqSenderTest, SendIq) { .WillOnce(Return(kStanzaId)); EXPECT_CALL(signal_strategy_, SendStanza(_)) .WillOnce(DoAll(SaveArg<0>(&sent_stanza), Return(true))); - sender_->SendIq(kType, kTo, iq_body, base::Bind( - &MockCallback::OnReply, base::Unretained(&callback_))); + scoped_ptr<IqRequest> request( + sender_->SendIq(kType, kTo, iq_body, base::Bind( + &MockCallback::OnReply, base::Unretained(&callback_)))); std::string expected_xml_string = base::StringPrintf( |