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

Unified Diff: third_party/WebKit/Source/core/page/FrameTree.cpp

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: Created 3 years, 8 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
Index: third_party/WebKit/Source/core/page/FrameTree.cpp
diff --git a/third_party/WebKit/Source/core/page/FrameTree.cpp b/third_party/WebKit/Source/core/page/FrameTree.cpp
index a6e5e4861457e422295d263518b75c8b2e9492b8..8edafc960d441a877eefb63149f1152523c599c4 100644
--- a/third_party/WebKit/Source/core/page/FrameTree.cpp
+++ b/third_party/WebKit/Source/core/page/FrameTree.cpp
@@ -75,14 +75,14 @@ Frame* FrameTree::Parent() const {
return this_frame_->Client()->Parent();
}
-Frame* FrameTree::Top() const {
+Frame& FrameTree::Top() const {
// FIXME: top() should never return null, so here are some hacks to deal
// with EmptyLocalFrameClient and cases where the frame is detached
// already...
if (!this_frame_->Client())
- return this_frame_;
+ return *this_frame_;
Frame* candidate = this_frame_->Client()->Top();
- return candidate ? candidate : this_frame_.Get();
+ return candidate ? *candidate : *this_frame_;
}
Frame* FrameTree::NextSibling() const {
@@ -154,7 +154,7 @@ Frame* FrameTree::Find(const AtomicString& name) const {
return this_frame_;
if (EqualIgnoringASCIICase(name, "_top"))
- return Top();
+ return &Top();
if (EqualIgnoringASCIICase(name, "_parent"))
return Parent() ? Parent() : this_frame_.Get();

Powered by Google App Engine
This is Rietveld 408576698