summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 23:48:38 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-19 23:48:38 +0000
commit8bbc466e17e93268b724bae1732e33a0b34c28c8 (patch)
treeeb1389bd90331a618f762b296bb9a021e6dc007c /ipc
parent706e8fa0b6f0392c2fe206cb605f6b738a64cc6b (diff)
downloadchromium_src-8bbc466e17e93268b724bae1732e33a0b34c28c8.zip
chromium_src-8bbc466e17e93268b724bae1732e33a0b34c28c8.tar.gz
chromium_src-8bbc466e17e93268b724bae1732e33a0b34c28c8.tar.bz2
Use make_scoped_refptr() instead of manual AddRef()/Release() in ipc.
BUG=28083 TEST=builds Review URL: http://codereview.chromium.org/3869002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63136 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_channel_proxy.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 9785216..feca4eb 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -196,9 +196,6 @@ void ChannelProxy::Context::OnAddFilter(MessageFilter* filter) {
// so that the filter gets access to the Channel.
if (channel_)
filter->OnFilterAdded(channel_);
-
- // Balances the AddRef in ChannelProxy::AddFilter.
- filter->Release();
}
// Called on the IPC::Channel thread
@@ -317,16 +314,20 @@ bool ChannelProxy::Send(Message* message) {
}
void ChannelProxy::AddFilter(MessageFilter* filter) {
- // We want to addref the filter to prevent it from
- // being destroyed before the OnAddFilter call is invoked.
- filter->AddRef();
- context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- context_.get(), &Context::OnAddFilter, filter));
+ context_->ipc_message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(
+ context_.get(),
+ &Context::OnAddFilter,
+ make_scoped_refptr(filter)));
}
void ChannelProxy::RemoveFilter(MessageFilter* filter) {
- context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- context_.get(), &Context::OnRemoveFilter, filter));
+ context_->ipc_message_loop()->PostTask(
+ FROM_HERE, NewRunnableMethod(
+ context_.get(),
+ &Context::OnRemoveFilter,
+ make_scoped_refptr(filter)));
}
void ChannelProxy::ClearIPCMessageLoop() {