Don't crash while detaching a pending child frame under --site-per-process.
Fixes a null pointer dereference in RenderFrameProxyHost::RenderFrameProxyHost, when a RenderFrameProxyHost is created as a side effect of destroying the FrameTreeNode and RenderFrameHostManager. The crash occurs because of the operation below: if (!frame_tree_node_->IsMainFrame() && frame_tree_node_->parent() ->render_manager() ->current_frame_host() ->GetSiteInstance() == site_instance) { When a FrameTreeNode is being detached from the tree, it is not the main frame (because it is not equal to the root), but it also does not have a parent (because, for reasons explained in FrameTreeNode::RemoveChild, it is trimmed from the tree before destruction). So the parent() call above returns NULL, resulting in great misfortune. Add a test that failed without the fix. BUG=441357 Review URL: https://codereview.chromium.org/799593004 Cr-Commit-Position: refs/heads/master@{#308219}
Showing
Please register or sign in to comment