Chromium Code Reviews| Index: content/browser/frame_host/frame_tree_node.cc |
| diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc |
| index 6d654aaa9007b084411932f0176b241770ba63e4..2d2797d59405bcda753c2468c9910debb149641c 100644 |
| --- a/content/browser/frame_host/frame_tree_node.cc |
| +++ b/content/browser/frame_host/frame_tree_node.cc |
| @@ -92,6 +92,14 @@ void FrameTreeNode::ResetForNewProcess() { |
| // commits before the old process cleans everything up. Make sure the child |
| // nodes get deleted before swapping to a new process. |
| ScopedVector<FrameTreeNode> old_children = children_.Pass(); |
| + |
| + // Loop over all children removing them from the FrameTree. This will ensure |
| + // that nodes are properly remove from the tree and notifications are sent. |
|
Charlie Reis
2015/02/12 23:26:07
nit: removed
nasko
2015/02/12 23:30:51
Done.
|
| + // Note: since the |children_| vector is now empty, the calls into RemoveChild |
| + // will be a noop and will not result in traversing twice through the list. |
|
Charlie Reis
2015/02/12 23:26:07
nit: no-op
nit: s/traversing twice through/repeate
nasko
2015/02/12 23:30:51
Done.
|
| + for (const auto& child : old_children) { |
|
Charlie Reis
2015/02/12 23:26:07
nit: No braces needed.
nasko
2015/02/12 23:30:51
Done.
|
| + frame_tree_->RemoveFrame(child); |
| + } |
| old_children.clear(); // May notify observers. |
| } |