Fix DCHECK during Find (issue #2050)

This commit is contained in:
Marshall Greenblatt
2017-05-05 15:34:20 -04:00
parent 86c329e790
commit e5ad5a8fcd
4 changed files with 29 additions and 12 deletions

View File

@ -784,6 +784,14 @@ void CefBrowserHostImpl::Find(int identifier, const CefString& searchText,
if (!web_contents_)
return;
// Every find request must have a unique ID and these IDs must strictly
// increase so that newer requests always have greater IDs than older
// requests.
if (identifier <= find_request_id_counter_)
identifier = ++find_request_id_counter_;
else
find_request_id_counter_ = identifier;
blink::WebFindOptions options;
options.forward = forward;
options.match_case = matchCase;