Skip to content

Commit

Permalink
Fix leak in IqSenderTest.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sergeyu@chromium.org committed Nov 4, 2011
1 parent 1c1a0b3 commit d5a38a1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 19 deletions.
5 changes: 3 additions & 2 deletions remoting/jingle_glue/iq_sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions remoting/jingle_glue/iq_sender_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
7 changes: 0 additions & 7 deletions tools/heapcheck/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1667,13 +1667,6 @@
...
fun:PluginLoaderPosix::GetPluginsToLoad
}
{
bug_102983
Heapcheck:Leak
fun:remoting::IqSender::SendIq
fun:remoting::IqSender::SendIq
fun:remoting::IqSenderTest_SendIq_Test::TestBody
}
{
bug_102988_a
Heapcheck:Leak
Expand Down
8 changes: 0 additions & 8 deletions tools/valgrind/memcheck/suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5185,14 +5185,6 @@
fun:_ZN17PluginLoaderPosix19LoadPluginsInternalEv
fun:_ZN4base8internal8Invoker1ILb0ENS0_15InvokerStorage1IM17PluginLoaderPosixFvvE13scoped_refptrIS3_EEES5_E8DoInvokeEPNS0_18InvokerStorageBaseE
}
{
bug_102983
Memcheck:Leak
fun:_Znw*
fun:_ZN8remoting8IqSender6SendIqEPN4buzz10XmlElementERKN4base8CallbackIFvPKS2_EEE
fun:_ZN8remoting8IqSender6SendIqERKSsS2_PN4buzz10XmlElementERKN4base8CallbackIFvPKS4_EEE
fun:_ZN8remoting24IqSenderTest_SendIq_Test8TestBodyEv
}
{
bug_102988
Memcheck:Leak
Expand Down

0 comments on commit d5a38a1

Please sign in to comment.