| OLD | NEW |
| 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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 600 } |
| 601 } | 601 } |
| 602 | 602 |
| 603 if (distanceSquared) | 603 if (distanceSquared) |
| 604 *distanceSquared = nearestDistanceSquared; | 604 *distanceSquared = nearestDistanceSquared; |
| 605 | 605 |
| 606 return nearest; | 606 return nearest; |
| 607 } | 607 } |
| 608 | 608 |
| 609 int TextFinder::selectFindMatch(unsigned index, WebRect* selectionRect) { | 609 int TextFinder::selectFindMatch(unsigned index, WebRect* selectionRect) { |
| 610 ASSERT_WITH_SECURITY_IMPLICATION(index < m_findMatchesCache.size()); | 610 SECURITY_DCHECK(index < m_findMatchesCache.size()); |
| 611 | 611 |
| 612 Range* range = m_findMatchesCache[index].m_range; | 612 Range* range = m_findMatchesCache[index].m_range; |
| 613 if (!range->boundaryPointsValid() || !range->startContainer()->isConnected()) | 613 if (!range->boundaryPointsValid() || !range->startContainer()->isConnected()) |
| 614 return -1; | 614 return -1; |
| 615 | 615 |
| 616 // Check if the match is already selected. | 616 // Check if the match is already selected. |
| 617 if (!m_currentActiveMatchFrame || !m_activeMatch || | 617 if (!m_currentActiveMatchFrame || !m_activeMatch || |
| 618 !areRangesEqual(m_activeMatch.get(), range)) { | 618 !areRangesEqual(m_activeMatch.get(), range)) { |
| 619 m_activeMatchIndex = m_findMatchesCache[index].m_ordinal - 1; | 619 m_activeMatchIndex = m_findMatchesCache[index].m_ordinal - 1; |
| 620 | 620 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 | 773 |
| 774 DEFINE_TRACE(TextFinder) { | 774 DEFINE_TRACE(TextFinder) { |
| 775 visitor->trace(m_ownerFrame); | 775 visitor->trace(m_ownerFrame); |
| 776 visitor->trace(m_activeMatch); | 776 visitor->trace(m_activeMatch); |
| 777 visitor->trace(m_resumeScopingFromRange); | 777 visitor->trace(m_resumeScopingFromRange); |
| 778 visitor->trace(m_deferredScopingWork); | 778 visitor->trace(m_deferredScopingWork); |
| 779 visitor->trace(m_findMatchesCache); | 779 visitor->trace(m_findMatchesCache); |
| 780 } | 780 } |
| 781 | 781 |
| 782 } // namespace blink | 782 } // namespace blink |
| OLD | NEW |