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

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

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: fix compile and dchecks 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..29d2a49089d485622075f03d89e80fc5cb4d1aeb 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();
@@ -299,7 +299,7 @@ void showFrameTree(const blink::Frame* frame) {
return;
}
- printFrames(frame->Tree().Top(), frame, 0);
+ printFrames(&frame->Tree().Top(), frame, 0);
}
#endif
« no previous file with comments | « third_party/WebKit/Source/core/page/FrameTree.h ('k') | third_party/WebKit/Source/core/timing/Performance.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698