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

Issue 2428613002: Removed limitation on searching frames for the same string prefix.

Created:
4 years, 2 months ago by paulmeyer
Modified:
4 years, 2 months ago
Reviewers:
dcheng
CC:
chromium-reviews, blink-reviews, kinuko+watch
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove limitation on searching frames for the same string prefix. An optimization has existed in TextFinder:shouldScopeMatches() for a long time that prevents a frame from being searched (via find-in-page) for a string with the same prefix as a search that previously returned no matches. For example, if a frame is searched for the string "dog" with no results, then this function would never allow a search for "dogs", even after content in the frame has changed (so "dogs" could be in there). This optimization has been causing various bugs that I've had to address for quite a while, and there are still new bugs coming up because of it now, so I'd like to just remove it. It does occasionally prevent starting a search when there are no matches, but these searches would exit early anyways when no active match is found, so I don't think there is much savings from it. On the other hand, when content in the frame changes, and there are new matches to be found, this optimization causes find-in-page to fail when it shouldn't. It is possible that something more complicated could be implemented in order to keep the optimization but detect content changes so that it does the right thing in that case, but the extra overhead of this may cancel out any savings had by avoiding a few searches here and there anyways, so I don't think that is worthwhile. BUG=2220, 655282, 652267, 657709

Patch Set 1 #

Total comments: 1

Patch Set 2 : Removed m_lastSearchString. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -43 lines) Patch
M third_party/WebKit/Source/web/TextFinder.h View 1 2 chunks +1 line, -13 lines 0 comments Download
M third_party/WebKit/Source/web/TextFinder.cpp View 1 5 chunks +1 line, -30 lines 0 comments Download

Messages

Total messages: 8 (6 generated)
paulmeyer
+dcheng@ for review
4 years, 2 months ago (2016-10-17 16:41:25 UTC) #6
dcheng
4 years, 2 months ago (2016-10-17 18:17:41 UTC) #7
Incidentally, do we have any metrics that measure this? It would be at least
somewhat useful to know how much this affects perf.

https://codereview.chromium.org/2428613002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/web/TextFinder.h (right):

https://codereview.chromium.org/2428613002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/web/TextFinder.h:233: WTF::String m_lastSearchString;
Can we get rid of this (and maybe m_lastMatchCount)? It's not clear to me what
parts of this accounting are important.

Powered by Google App Engine
This is Rietveld 408576698