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

Side by Side Diff: third_party/WebKit/Source/web/TextFinder.h

Issue 2428613002: Removed limitation on searching frames for the same string prefix.
Patch Set: Removed m_lastSearchString. Created 4 years, 2 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 | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // The index of the active match for the current frame. 219 // The index of the active match for the current frame.
220 int m_activeMatchIndex; 220 int m_activeMatchIndex;
221 221
222 // The scoping effort can time out and we need to keep track of where we 222 // The scoping effort can time out and we need to keep track of where we
223 // ended our last search so we can continue from where we left of. 223 // ended our last search so we can continue from where we left of.
224 // 224 //
225 // This range is collapsed to the end position of the last successful 225 // This range is collapsed to the end position of the last successful
226 // search; the new search should start from this position. 226 // search; the new search should start from this position.
227 Member<Range> m_resumeScopingFromRange; 227 Member<Range> m_resumeScopingFromRange;
228 228
229 // Keeps track of the last string this frame searched for. This is used for
230 // short-circuiting searches in the following scenarios: When a frame has
231 // been searched and returned 0 results, we don't need to search that frame
232 // again if the user is just adding to the search (making it more specific).
233 WTF::String m_lastSearchString;
234
235 // Keeps track of how many matches this frame has found so far, so that we 229 // Keeps track of how many matches this frame has found so far, so that we
236 // don't lose count between scoping efforts, and is also used (in conjunction 230 // don't lose count between scoping efforts.
237 // with m_lastSearchString) to figure out if we need to search the frame
238 // again.
239 int m_lastMatchCount; 231 int m_lastMatchCount;
240 232
241 // This variable keeps a cumulative total of matches found so far in this 233 // This variable keeps a cumulative total of matches found so far in this
242 // frame, and is only incremented by calling IncreaseMatchCount. 234 // frame, and is only incremented by calling IncreaseMatchCount.
243 int m_totalMatchCount; 235 int m_totalMatchCount;
244 236
245 // Keeps track of whether the frame is currently scoping (being searched for 237 // Keeps track of whether the frame is currently scoping (being searched for
246 // matches). 238 // matches).
247 bool m_frameScoping; 239 bool m_frameScoping;
248 240
(...skipping 20 matching lines...) Expand all
269 IntSize m_contentsSizeForCurrentFindMatchRects; 261 IntSize m_contentsSizeForCurrentFindMatchRects;
270 262
271 // This flag is used by the scoping effort to determine if we need to figure 263 // This flag is used by the scoping effort to determine if we need to figure
272 // out which rectangle is the active match. Once we find the active 264 // out which rectangle is the active match. Once we find the active
273 // rectangle we clear this flag. 265 // rectangle we clear this flag.
274 bool m_locatingActiveRect; 266 bool m_locatingActiveRect;
275 267
276 // Keeps track of whether there is an scoping effort ongoing in the frame. 268 // Keeps track of whether there is an scoping effort ongoing in the frame.
277 bool m_scopingInProgress; 269 bool m_scopingInProgress;
278 270
279 // Keeps track of whether the last find request completed its scoping effort
280 // without finding any matches in this frame.
281 bool m_lastFindRequestCompletedWithNoMatches;
282
283 // Determines if the rects in the find-in-page matches cache of this frame 271 // Determines if the rects in the find-in-page matches cache of this frame
284 // are invalid and should be recomputed. 272 // are invalid and should be recomputed.
285 bool m_findMatchRectsAreValid; 273 bool m_findMatchRectsAreValid;
286 }; 274 };
287 275
288 } // namespace blink 276 } // namespace blink
289 277
290 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch); 278 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TextFinder::FindMatch);
291 279
292 #endif // TextFinder_h 280 #endif // TextFinder_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/TextFinder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698