diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 91176114f235..b1f07632eab0 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2627,7 +2627,7 @@ uint32_t WebContents::FindInPage(gin::Arguments* args) { return 0; } - uint32_t request_id = GetNextRequestId(); + uint32_t request_id = ++find_in_page_request_id_; gin_helper::Dictionary dict; auto options = blink::mojom::FindOptions::New(); if (args->GetNext(&dict)) { diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index c4bd1e1f819d..5f840b8cfe6a 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -598,8 +598,6 @@ class WebContents : public gin::Wrappable, content::RenderFrameHost* render_frame_host); void OnElectronBrowserConnectionError(); - uint32_t GetNextRequestId() { return ++request_id_; } - #if BUILDFLAG(ENABLE_OSR) OffScreenWebContentsView* GetOffScreenWebContentsView() const; OffScreenRenderWidgetHostView* GetOffScreenRenderWidgetHostView() const; @@ -735,7 +733,7 @@ class WebContents : public gin::Wrappable, int32_t id_; // Request id used for findInPage request. - uint32_t request_id_ = 0; + uint32_t find_in_page_request_id_ = 0; // Whether background throttling is disabled. bool background_throttling_ = true;