mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix DCHECK during Find (issue #2050)
This commit is contained in:
@ -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;
|
||||
|
@ -637,6 +637,9 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
||||
// Observers that want to be notified of changes to this object.
|
||||
base::ObserverList<Observer> observers_;
|
||||
|
||||
// Used to provide unique incremental IDs for each find request.
|
||||
int find_request_id_counter_ = 0;
|
||||
|
||||
IMPLEMENT_REFCOUNTING(CefBrowserHostImpl);
|
||||
DISALLOW_COPY_AND_ASSIGN(CefBrowserHostImpl);
|
||||
};
|
||||
|
Reference in New Issue
Block a user