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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 3654001: Revert 61899 for breaking cookes on file:// URLs.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « chrome/service/service_process.cc ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
===================================================================
--- ipc/ipc_channel_proxy.cc (revision 62042)
+++ ipc/ipc_channel_proxy.cc (working copy)
@@ -196,6 +196,9 @@
// 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
@@ -314,20 +317,16 @@
}
void ChannelProxy::AddFilter(MessageFilter* filter) {
- context_->ipc_message_loop()->PostTask(
- FROM_HERE,
- NewRunnableMethod(
- context_.get(),
- &Context::OnAddFilter,
- make_scoped_refptr(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));
}
void ChannelProxy::RemoveFilter(MessageFilter* filter) {
- context_->ipc_message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(
- context_.get(),
- &Context::OnRemoveFilter,
- make_scoped_refptr(filter)));
+ context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
+ context_.get(), &Context::OnRemoveFilter, filter));
}
void ChannelProxy::ClearIPCMessageLoop() {
« no previous file with comments | « chrome/service/service_process.cc ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698