Commit ce3176d2 authored by W. James MacLean's avatar W. James MacLean Committed by Commit Bot

Verify we don't traverse the frame tree during its construction.

We shouldn't be able to create a traversal iterator when there's
no current_frame_host(), as it will crash in NodeIterator::operator++
when that function tries to access child_count() via |current_node_|.

Change-Id: Ib9314b4189d9828fa5ff22a58b89b414426be590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867435
Commit-Queue: W. James MacLean <wjmaclean@google.com>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707245}
parent ca0abd4c
......@@ -78,6 +78,9 @@ FrameTree::NodeIterator::NodeIterator(FrameTreeNode* starting_node,
root_of_subtree_to_skip_(root_of_subtree_to_skip) {}
FrameTree::NodeIterator FrameTree::NodeRange::begin() {
// We shouldn't be attempting a frame tree traversal while the tree is
// being constructed.
DCHECK(root_->current_frame_host());
return NodeIterator(root_, root_of_subtree_to_skip_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment