OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 if (channel_.get()) | 203 if (channel_.get()) |
204 new_filters[i]->OnFilterAdded(channel_.get()); | 204 new_filters[i]->OnFilterAdded(channel_.get()); |
205 // Ditto for if the channel has been connected. | 205 // Ditto for if the channel has been connected. |
206 if (peer_pid_) | 206 if (peer_pid_) |
207 new_filters[i]->OnChannelConnected(peer_pid_); | 207 new_filters[i]->OnChannelConnected(peer_pid_); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 // Called on the IPC::Channel thread | 211 // Called on the IPC::Channel thread |
212 void ChannelProxy::Context::OnRemoveFilter(MessageFilter* filter) { | 212 void ChannelProxy::Context::OnRemoveFilter(MessageFilter* filter) { |
| 213 if (!channel_.get()) |
| 214 return; // The filters have already been deleted. |
| 215 |
213 for (size_t i = 0; i < filters_.size(); ++i) { | 216 for (size_t i = 0; i < filters_.size(); ++i) { |
214 if (filters_[i].get() == filter) { | 217 if (filters_[i].get() == filter) { |
215 filter->OnFilterRemoved(); | 218 filter->OnFilterRemoved(); |
216 filters_.erase(filters_.begin() + i); | 219 filters_.erase(filters_.begin() + i); |
217 return; | 220 return; |
218 } | 221 } |
219 } | 222 } |
220 | 223 |
221 NOTREACHED() << "filter to be removed not found"; | 224 NOTREACHED() << "filter to be removed not found"; |
222 } | 225 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 Channel* channel = context_.get()->channel_.get(); | 423 Channel* channel = context_.get()->channel_.get(); |
421 // Channel must have been created first. | 424 // Channel must have been created first. |
422 DCHECK(channel) << context_.get()->channel_id_; | 425 DCHECK(channel) << context_.get()->channel_id_; |
423 return channel->GetPeerEuid(peer_euid); | 426 return channel->GetPeerEuid(peer_euid); |
424 } | 427 } |
425 #endif | 428 #endif |
426 | 429 |
427 //----------------------------------------------------------------------------- | 430 //----------------------------------------------------------------------------- |
428 | 431 |
429 } // namespace IPC | 432 } // namespace IPC |
OLD | NEW |