Skip to content

Commit 29211a5

Browse files
authored
refactor: inline and rename findInPage request id (electron#26524)
1 parent 784172b commit 29211a5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

shell/browser/api/electron_api_web_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2627,7 +2627,7 @@ uint32_t WebContents::FindInPage(gin::Arguments* args) {
26272627
return 0;
26282628
}
26292629

2630-
uint32_t request_id = GetNextRequestId();
2630+
uint32_t request_id = ++find_in_page_request_id_;
26312631
gin_helper::Dictionary dict;
26322632
auto options = blink::mojom::FindOptions::New();
26332633
if (args->GetNext(&dict)) {

shell/browser/api/electron_api_web_contents.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,6 @@ class WebContents : public gin::Wrappable<WebContents>,
598598
content::RenderFrameHost* render_frame_host);
599599
void OnElectronBrowserConnectionError();
600600

601-
uint32_t GetNextRequestId() { return ++request_id_; }
602-
603601
#if BUILDFLAG(ENABLE_OSR)
604602
OffScreenWebContentsView* GetOffScreenWebContentsView() const;
605603
OffScreenRenderWidgetHostView* GetOffScreenRenderWidgetHostView() const;
@@ -735,7 +733,7 @@ class WebContents : public gin::Wrappable<WebContents>,
735733
int32_t id_;
736734

737735
// Request id used for findInPage request.
738-
uint32_t request_id_ = 0;
736+
uint32_t find_in_page_request_id_ = 0;
739737

740738
// Whether background throttling is disabled.
741739
bool background_throttling_ = true;

0 commit comments

Comments
 (0)