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

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 229043004: Fixed crash in WebFrameImpl::resetMatchCount function. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Clear JS code Created 6 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
Index: Source/web/WebLocalFrameImpl.cpp
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
index 0f7d09def92a947eb0c685d170f8c73e68a76815..7db88cd691f54a6078610b3579ec3b0629e8dff6 100644
--- a/Source/web/WebLocalFrameImpl.cpp
+++ b/Source/web/WebLocalFrameImpl.cpp
@@ -1438,14 +1438,12 @@ void WebLocalFrameImpl::increaseMatchCount(int count, int identifier)
{
// This function should only be called on the mainframe.
ASSERT(!parent());
- ASSERT(m_textFinder);
- m_textFinder->increaseMatchCount(identifier, count);
+ ensureTextFinder().increaseMatchCount(identifier, count);
}
void WebLocalFrameImpl::resetMatchCount()
{
- ASSERT(m_textFinder);
- m_textFinder->resetMatchCount();
+ ensureTextFinder().resetMatchCount();
}
void WebLocalFrameImpl::sendOrientationChangeEvent()
@@ -1472,8 +1470,7 @@ int WebLocalFrameImpl::findMatchMarkersVersion() const
int WebLocalFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRect* selectionRect)
{
ASSERT(!parent());
- ASSERT(m_textFinder);
- return m_textFinder->selectNearestFindMatch(point, selectionRect);
+ return ensureTextFinder().selectNearestFindMatch(point, selectionRect);
}
WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
@@ -1488,8 +1485,7 @@ WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
void WebLocalFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects)
{
ASSERT(!parent());
- ASSERT(m_textFinder);
- m_textFinder->findMatchRects(outputRects);
+ ensureTextFinder().findMatchRects(outputRects);
}
void WebLocalFrameImpl::setTickmarks(const WebVector<WebRect>& tickmarks)
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/data/find_in_generated_frame.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698