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

Unified Diff: Source/web/WebFrameImpl.cpp

Issue 23671002: Refactoring: Add toWebFrameImpl() interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Corrected as per review commments. 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/web/WebFrameImpl.h ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebFrameImpl.cpp
diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp
index dd8e742daacf91539b5284b041d8f3488aa61202..be589dae3eed0f3a89c53d7c6449aa18759db7c1 100644
--- a/Source/web/WebFrameImpl.cpp
+++ b/Source/web/WebFrameImpl.cpp
@@ -636,7 +636,7 @@ WebFrame* WebFrameImpl::opener() const
void WebFrameImpl::setOpener(const WebFrame* webFrame)
{
- frame()->loader()->setOpener(webFrame ? static_cast<const WebFrameImpl*>(webFrame)->frame() : 0);
+ frame()->loader()->setOpener(webFrame ? toWebFrameImpl(webFrame)->frame() : 0);
}
WebFrame* WebFrameImpl::parent() const
@@ -1885,7 +1885,7 @@ void WebFrameImpl::updateFindMatchRects()
// Invalidate the rects in child frames. Will be updated later during traversal.
if (!m_findMatchRectsAreValid)
for (WebFrame* child = firstChild(); child; child = child->nextSibling())
- static_cast<WebFrameImpl*>(child)->m_findMatchRectsAreValid = false;
+ toWebFrameImpl(child)->m_findMatchRectsAreValid = false;
m_findMatchRectsAreValid = true;
}
@@ -1905,7 +1905,7 @@ void WebFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects)
ASSERT(!parent());
Vector<WebFloatRect> matchRects;
- for (WebFrameImpl* frame = this; frame; frame = static_cast<WebFrameImpl*>(frame->traverseNext(false)))
+ for (WebFrameImpl* frame = this; frame; frame = toWebFrameImpl(frame->traverseNext(false)))
frame->appendFindMatchRects(matchRects);
outputRects = matchRects;
@@ -1929,7 +1929,7 @@ int WebFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRect* se
int indexInBestFrame = -1;
float distanceInBestFrame = FLT_MAX;
- for (WebFrameImpl* frame = this; frame; frame = static_cast<WebFrameImpl*>(frame->traverseNext(false))) {
+ for (WebFrameImpl* frame = this; frame; frame = toWebFrameImpl(frame->traverseNext(false))) {
float distanceInFrame;
int indexInFrame = frame->nearestFindMatch(point, distanceInFrame);
if (distanceInFrame < distanceInBestFrame) {
@@ -2376,7 +2376,7 @@ int WebFrameImpl::ordinalOfFirstMatchForFrame(WebFrameImpl* frame) const
WebFrameImpl* mainFrameImpl = viewImpl()->mainFrameImpl();
// Iterate from the main frame up to (but not including) |frame| and
// add up the number of matches found so far.
- for (WebFrameImpl* it = mainFrameImpl; it != frame; it = static_cast<WebFrameImpl*>(it->traverseNext(true))) {
+ for (WebFrameImpl* it = mainFrameImpl; it != frame; it = toWebFrameImpl(it->traverseNext(true))) {
if (it->m_lastMatchCount > 0)
ordinal += it->m_lastMatchCount;
}
« no previous file with comments | « Source/web/WebFrameImpl.h ('k') | Source/web/WebPageSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698