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

Side by Side 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: Added test 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 void WebLocalFrameImpl::cancelPendingScopingEffort() 1493 void WebLocalFrameImpl::cancelPendingScopingEffort()
1494 { 1494 {
1495 if (m_textFinder) 1495 if (m_textFinder)
1496 m_textFinder->cancelPendingScopingEffort(); 1496 m_textFinder->cancelPendingScopingEffort();
1497 } 1497 }
1498 1498
1499 void WebLocalFrameImpl::increaseMatchCount(int count, int identifier) 1499 void WebLocalFrameImpl::increaseMatchCount(int count, int identifier)
1500 { 1500 {
1501 // This function should only be called on the mainframe. 1501 // This function should only be called on the mainframe.
1502 ASSERT(!parent()); 1502 ASSERT(!parent());
1503 ASSERT(m_textFinder); 1503 ensureTextFinder().increaseMatchCount(identifier, count);
1504 m_textFinder->increaseMatchCount(identifier, count);
1505 } 1504 }
1506 1505
1507 void WebLocalFrameImpl::resetMatchCount() 1506 void WebLocalFrameImpl::resetMatchCount()
1508 { 1507 {
1509 ASSERT(m_textFinder); 1508 ensureTextFinder().resetMatchCount();
1510 m_textFinder->resetMatchCount();
1511 } 1509 }
1512 1510
1513 void WebLocalFrameImpl::sendOrientationChangeEvent(int orientation) 1511 void WebLocalFrameImpl::sendOrientationChangeEvent(int orientation)
1514 { 1512 {
1515 if (frame()) 1513 if (frame())
1516 frame()->sendOrientationChangeEvent(orientation); 1514 frame()->sendOrientationChangeEvent(orientation);
1517 } 1515 }
1518 1516
1519 void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOri gin& intendedTargetOrigin, const WebDOMEvent& event) 1517 void WebLocalFrameImpl::dispatchMessageEventWithOriginCheck(const WebSecurityOri gin& intendedTargetOrigin, const WebDOMEvent& event)
1520 { 1518 {
1521 ASSERT(!event.isNull()); 1519 ASSERT(!event.isNull());
1522 frame()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrig in.get(), event, nullptr); 1520 frame()->domWindow()->dispatchMessageEventWithOriginCheck(intendedTargetOrig in.get(), event, nullptr);
1523 } 1521 }
1524 1522
1525 int WebLocalFrameImpl::findMatchMarkersVersion() const 1523 int WebLocalFrameImpl::findMatchMarkersVersion() const
1526 { 1524 {
1527 ASSERT(!parent()); 1525 ASSERT(!parent());
1528 1526
1529 if (m_textFinder) 1527 if (m_textFinder)
1530 return m_textFinder->findMatchMarkersVersion(); 1528 return m_textFinder->findMatchMarkersVersion();
1531 return 0; 1529 return 0;
1532 } 1530 }
1533 1531
1534 int WebLocalFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRec t* selectionRect) 1532 int WebLocalFrameImpl::selectNearestFindMatch(const WebFloatPoint& point, WebRec t* selectionRect)
1535 { 1533 {
1536 ASSERT(!parent()); 1534 ASSERT(!parent());
1537 ASSERT(m_textFinder); 1535 return ensureTextFinder().selectNearestFindMatch(point, selectionRect);
1538 return m_textFinder->selectNearestFindMatch(point, selectionRect);
1539 } 1536 }
1540 1537
1541 WebFloatRect WebLocalFrameImpl::activeFindMatchRect() 1538 WebFloatRect WebLocalFrameImpl::activeFindMatchRect()
1542 { 1539 {
1543 ASSERT(!parent()); 1540 ASSERT(!parent());
1544 1541
1545 if (m_textFinder) 1542 if (m_textFinder)
1546 return m_textFinder->activeFindMatchRect(); 1543 return m_textFinder->activeFindMatchRect();
1547 return WebFloatRect(); 1544 return WebFloatRect();
1548 } 1545 }
1549 1546
1550 void WebLocalFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects) 1547 void WebLocalFrameImpl::findMatchRects(WebVector<WebFloatRect>& outputRects)
1551 { 1548 {
1552 ASSERT(!parent()); 1549 ASSERT(!parent());
1553 ASSERT(m_textFinder); 1550 ensureTextFinder().findMatchRects(outputRects);
1554 m_textFinder->findMatchRects(outputRects);
1555 } 1551 }
1556 1552
1557 void WebLocalFrameImpl::setTickmarks(const WebVector<WebRect>& tickmarks) 1553 void WebLocalFrameImpl::setTickmarks(const WebVector<WebRect>& tickmarks)
1558 { 1554 {
1559 if (frameView()) { 1555 if (frameView()) {
1560 Vector<IntRect> tickmarksConverted(tickmarks.size()); 1556 Vector<IntRect> tickmarksConverted(tickmarks.size());
1561 for (size_t i = 0; i < tickmarks.size(); ++i) 1557 for (size_t i = 0; i < tickmarks.size(); ++i)
1562 tickmarksConverted[i] = tickmarks[i]; 1558 tickmarksConverted[i] = tickmarks[i];
1563 frameView()->setTickmarks(tickmarksConverted); 1559 frameView()->setTickmarks(tickmarksConverted);
1564 invalidateScrollbar(); 1560 invalidateScrollbar();
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 1976
1981 void WebLocalFrameImpl::invalidateAll() const 1977 void WebLocalFrameImpl::invalidateAll() const
1982 { 1978 {
1983 ASSERT(frame() && frame()->view()); 1979 ASSERT(frame() && frame()->view());
1984 FrameView* view = frame()->view(); 1980 FrameView* view = frame()->view();
1985 view->invalidateRect(view->frameRect()); 1981 view->invalidateRect(view->frameRect());
1986 invalidateScrollbar(); 1982 invalidateScrollbar();
1987 } 1983 }
1988 1984
1989 } // namespace blink 1985 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | Source/web/tests/WebFrameTest.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698