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

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

Issue 1131593003: Revert of Revert of OOPIF: Specify previous sibling frames when creating new RenderFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/frame_tree_unittest.cc » ('j') | 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 67a0da519d8eccc22deb30938279cb9b8a4684f7..7403ea3c9f0572fb51a8eb0605bda46449cd56e9 100644
--- a/content/browser/frame_host/frame_tree_node.cc
+++ b/content/browser/frame_host/frame_tree_node.cc
@@ -159,6 +159,19 @@
return false;
}
+FrameTreeNode* FrameTreeNode::PreviousSibling() const {
+ if (!parent_)
+ return nullptr;
+
+ for (size_t i = 0; i < parent_->child_count(); ++i) {
+ if (parent_->child_at(i) == this)
+ return (i == 0) ? nullptr : parent_->child_at(i - 1);
+ }
+
+ NOTREACHED() << "FrameTreeNode not found in its parent's children.";
+ return nullptr;
+}
+
bool FrameTreeNode::IsLoading() const {
RenderFrameHostImpl* current_frame_host =
render_manager_.current_frame_host();
« no previous file with comments | « content/browser/frame_host/frame_tree_node.h ('k') | content/browser/frame_host/frame_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698