| Index: trunk/src/content/browser/frame_host/frame_tree.cc
|
| ===================================================================
|
| --- trunk/src/content/browser/frame_host/frame_tree.cc (revision 251109)
|
| +++ trunk/src/content/browser/frame_host/frame_tree.cc (working copy)
|
| @@ -43,6 +43,15 @@
|
| return true;
|
| }
|
|
|
| +// Iterate over the FrameTree to reset any node affected by the loss of the
|
| +// given RenderViewHost's process.
|
| +bool ResetNodesForNewProcess(RenderViewHost* render_view_host,
|
| + FrameTreeNode* node) {
|
| + if (render_view_host == node->current_frame_host()->render_view_host())
|
| + node->ResetForNewProcess();
|
| + return true;
|
| +}
|
| +
|
| } // namespace
|
|
|
| FrameTree::FrameTree(Navigator* navigator,
|
| @@ -153,9 +162,19 @@
|
| }
|
|
|
| void FrameTree::ResetForMainFrameSwap() {
|
| - return root_->ResetForMainFrameSwap();
|
| + root_->ResetForNewProcess();
|
| }
|
|
|
| +void FrameTree::RenderProcessGone(RenderViewHost* render_view_host) {
|
| + // Walk the full tree looking for nodes that may be affected. Once a frame
|
| + // crashes, all of its child FrameTreeNodes go away.
|
| + // Note that the helper function may call ResetForNewProcess on a node, which
|
| + // clears its children before we iterate over them. That's ok, because
|
| + // ForEach does not add a node's children to the queue until after visiting
|
| + // the node itself.
|
| + ForEach(base::Bind(&ResetNodesForNewProcess, render_view_host));
|
| +}
|
| +
|
| RenderFrameHostImpl* FrameTree::GetMainFrame() const {
|
| return root_->current_frame_host();
|
| }
|
|
|