DescriptionDon'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
Committed: https://crrev.com/807e4955fa017715970d456d17bcc3a0730c72a0
Cr-Commit-Position: refs/heads/master@{#308219}
Patch Set 1 #Patch Set 2 : Self-review fixes #
Total comments: 14
Patch Set 3 : Nasko's fixes #Patch Set 4 : Rebase of patch set 3 #Patch Set 5 : Fix compile after rebase #
Total comments: 2
Patch Set 6 : Undo inline of DiscardUnusedFrame #
Total comments: 1
Patch Set 7 : size_t unsigned compile fix #
Messages
Total messages: 12 (2 generated)
|