Commit 41388930 authored by evan@chromium.org's avatar evan@chromium.org

ipc: rename a variable to make code clearer

It took me a while to understand this function because filters_
and filters represented two very different things.

Review URL: http://codereview.chromium.org/7670006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97037 0039d316-1c4b-4281-b951-d872f2087c98
parent 1ac7bbfd
...@@ -194,22 +194,22 @@ void ChannelProxy::Context::OnSendMessage(Message* message) { ...@@ -194,22 +194,22 @@ void ChannelProxy::Context::OnSendMessage(Message* message) {
// Called on the IPC::Channel thread // Called on the IPC::Channel thread
void ChannelProxy::Context::OnAddFilter() { void ChannelProxy::Context::OnAddFilter() {
std::vector<scoped_refptr<MessageFilter> > filters; std::vector<scoped_refptr<MessageFilter> > new_filters;
{ {
base::AutoLock auto_lock(pending_filters_lock_); base::AutoLock auto_lock(pending_filters_lock_);
filters.swap(pending_filters_); new_filters.swap(pending_filters_);
} }
for (size_t i = 0; i < filters.size(); ++i) { for (size_t i = 0; i < new_filters.size(); ++i) {
filters_.push_back(filters[i]); filters_.push_back(new_filters[i]);
// If the channel has already been created, then we need to send this // If the channel has already been created, then we need to send this
// message so that the filter gets access to the Channel. // message so that the filter gets access to the Channel.
if (channel_.get()) if (channel_.get())
filters[i]->OnFilterAdded(channel_.get()); new_filters[i]->OnFilterAdded(channel_.get());
// Ditto for the peer process id. // Ditto for if the channel has been connected.
if (peer_pid_) if (peer_pid_)
filters[i]->OnChannelConnected(peer_pid_); new_filters[i]->OnChannelConnected(peer_pid_);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment