refactor: remove unused internal method contents.canGoToIndex() (#50606)

refactor: remove unused internal method contents.canGoToIndex()

refactor: make WebContents::CanGoToIndex() private

The JS binding has been unused since 2021-04-27 #28839 0a1b26b1
This commit is contained in:
Charles Kerr
2026-04-01 15:37:41 -05:00
committed by GitHub
parent 343d6e5f3f
commit 81f8fc1880
3 changed files with 2 additions and 3 deletions

View File

@@ -4605,7 +4605,6 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate,
.SetMethod("_goForward", &WebContents::GoForward)
.SetMethod("_canGoToOffset", &WebContents::CanGoToOffset)
.SetMethod("_goToOffset", &WebContents::GoToOffset)
.SetMethod("canGoToIndex", &WebContents::CanGoToIndex)
.SetMethod("_goToIndex", &WebContents::GoToIndex)
.SetMethod("_getActiveIndex", &WebContents::GetActiveIndex)
.SetMethod("_getNavigationEntryAtIndex",

View File

@@ -212,7 +212,6 @@ class WebContents final : public ExclusiveAccessContext,
void GoForward();
bool CanGoToOffset(int offset) const;
void GoToOffset(int offset);
bool CanGoToIndex(int index) const;
void GoToIndex(int index);
int GetActiveIndex() const;
content::NavigationEntry* GetNavigationEntryAtIndex(int index) const;
@@ -784,6 +783,8 @@ class WebContents final : public ExclusiveAccessContext,
content::GlobalRenderFrameHostId render_frame_host_id,
std::vector<std::u16string> types);
[[nodiscard]] bool CanGoToIndex(int index) const;
cppgc::Persistent<api::Session> session_;
v8::Global<v8::Value> devtools_web_contents_;
cppgc::Persistent<api::Debugger> debugger_;

View File

@@ -118,7 +118,6 @@ declare namespace Electron {
_getHistory(): Electron.NavigationEntry[];
_restoreHistory(index: number, entries: Electron.NavigationEntry[]): void
_clearHistory():void
canGoToIndex(index: number): boolean;
destroy(): void;
// <webview>
attachToIframe(embedderWebContents: Electron.WebContents, embedderFrameToken: string): void;