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

Unified Diff: Source/core/page/Frame.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 | « Source/core/page/FocusController.cpp ('k') | Source/core/page/FrameView.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/Frame.cpp
diff --git a/Source/core/page/Frame.cpp b/Source/core/page/Frame.cpp
index e350bbc60d0ff4d18d2cf893844e13cb85db2145..217a5fd9e3bcac298c43158177a11d950eb042ce 100644
--- a/Source/core/page/Frame.cpp
+++ b/Source/core/page/Frame.cpp
@@ -78,7 +78,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
{
if (!ownerElement)
return 0;
- return ownerElement->document()->frame();
+ return ownerElement->document().frame();
}
static inline float parentPageZoomFactor(Frame* frame)
@@ -303,9 +303,10 @@ Frame* Frame::frameForWidget(const Widget* widget)
{
ASSERT_ARG(widget, widget);
- if (RenderWidget* renderer = RenderWidget::find(widget))
+ if (RenderWidget* renderer = RenderWidget::find(widget)) {
if (Node* node = renderer->node())
- return node->document()->frame();
+ return node->document().frame();
+ }
// Assume all widgets are either a FrameView or owned by a RenderWidget.
// FIXME: That assumption is not right for scroll bars!
@@ -433,7 +434,7 @@ Document* Frame::documentAtPoint(const IntPoint& point)
if (contentRenderer())
result = eventHandler()->hitTestResultAtPoint(pt, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
- return result.innerNode() ? result.innerNode()->document() : 0;
+ return result.innerNode() ? &result.innerNode()->document() : 0;
}
PassRefPtr<Range> Frame::rangeForPoint(const IntPoint& framePoint)
« no previous file with comments | « Source/core/page/FocusController.cpp ('k') | Source/core/page/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698