Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1116)

Unified Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1987643003: Fix to prevent hitting NOTREACHED in FrameTreeNode::PreviousSibling(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dff90f0df332e626be7456a7c34a16a435b21974..8b1983d1d1b9a90c5d4a10e20a1a151aed291e7d 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -121,7 +121,7 @@ FrameTreeNode::FrameTreeNode(
}
FrameTreeNode::~FrameTreeNode() {
- children_.clear();
+ std::vector<std::unique_ptr<FrameTreeNode>>().swap(children_);
frame_tree_->FrameRemoved(this);
FOR_EACH_OBSERVER(Observer, observers_, OnFrameTreeNodeDestroyed(this));
@@ -490,7 +490,7 @@ void FrameTreeNode::TraceSnapshot() const {
}
FrameTreeNode* FrameTreeNode::GetSibling(int relative_offset) const {
- if (!parent_)
+ if (!parent_ || !parent_->child_count())
return nullptr;
for (size_t i = 0; i < parent_->child_count(); ++i) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698