Chromium Code Reviews| 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 "ipc/ipc_channel_proxy.h" | 5 #include "ipc/ipc_channel_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 void ChannelProxy::Context::OnChannelClosed() { | 204 void ChannelProxy::Context::OnChannelClosed() { |
| 205 // TODO(pkasting): Remove ScopedTracker below once crbug.com/477117 is fixed. | 205 // TODO(pkasting): Remove ScopedTracker below once crbug.com/477117 is fixed. |
| 206 tracked_objects::ScopedTracker tracking_profile( | 206 tracked_objects::ScopedTracker tracking_profile( |
| 207 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 207 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 208 "477117 ChannelProxy::Context::OnChannelClosed")); | 208 "477117 ChannelProxy::Context::OnChannelClosed")); |
| 209 // It's okay for IPC::ChannelProxy::Close to be called more than once, which | 209 // It's okay for IPC::ChannelProxy::Close to be called more than once, which |
| 210 // would result in this branch being taken. | 210 // would result in this branch being taken. |
| 211 if (!channel_) | 211 if (!channel_) |
| 212 return; | 212 return; |
| 213 | 213 |
| 214 for (size_t i = 0; i < filters_.size(); ++i) { | 214 for (auto& filter : pending_filters_) { |
|
Ken Rockot(use gerrit already)
2016/11/03 05:17:12
Unlike filters_, pending_filters_ is accessed from
tzik
2016/11/04 07:13:56
So, is the comment around line 226 no longer valid
Ken Rockot(use gerrit already)
2016/11/04 20:05:30
Oops. Sorry, I was conflating OnChannelError and O
| |
| 215 filters_[i]->OnChannelClosing(); | 215 filter->OnChannelClosing(); |
| 216 filters_[i]->OnFilterRemoved(); | 216 filter->OnFilterRemoved(); |
|
boliu
2016/11/07 18:03:48
the bug is filters in pending_fitlers_ here have n
| |
| 217 } | |
| 218 for (auto& filter : filters_) { | |
| 219 filter->OnChannelClosing(); | |
| 220 filter->OnFilterRemoved(); | |
| 217 } | 221 } |
| 218 | 222 |
| 219 // We don't need the filters anymore. | 223 // We don't need the filters anymore. |
| 220 message_filter_router_->Clear(); | 224 message_filter_router_->Clear(); |
| 221 filters_.clear(); | 225 filters_.clear(); |
| 222 // We don't need the lock, because at this point, the listener thread can't | 226 // We don't need the lock, because at this point, the listener thread can't |
| 223 // access it any more. | 227 // access it any more. |
| 224 pending_filters_.clear(); | 228 pending_filters_.clear(); |
| 225 | 229 |
| 226 ClearChannel(); | 230 ClearChannel(); |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 646 return channel->TakeClientFileDescriptor(); | 650 return channel->TakeClientFileDescriptor(); |
| 647 } | 651 } |
| 648 #endif | 652 #endif |
| 649 | 653 |
| 650 void ChannelProxy::OnChannelInit() { | 654 void ChannelProxy::OnChannelInit() { |
| 651 } | 655 } |
| 652 | 656 |
| 653 //----------------------------------------------------------------------------- | 657 //----------------------------------------------------------------------------- |
| 654 | 658 |
| 655 } // namespace IPC | 659 } // namespace IPC |
| OLD | NEW |