MarshallOfSound

#50513: chore: remove dead C++ code from shell/

Merged
Created: Mar 26, 2026, 3:49:39 AM
Merged: Mar 30, 2026, 12:36:01 PM
3 comments
Target: main

Removes unreferenced C++ code found via codebase sweep (+7 / −222 across 21 files).

⚠️ Review ask: Several of these may indicate missing functionality rather than truly-unused code. I've flagged the ones that look suspicious below — please confirm whether these were intentionally left unwired or if there's a latent bug.

Possibly a bug, not just dead code

  • ElectronNavigationUIData (deleted class) — Added in #17440 for extensions support but never instantiated. ElectronBrowserClient doesn't override GetNavigationUIData() to return it; code uses upstream ExtensionNavigationUIData directly. If this was meant to carry Electron-specific navigation data for extensions, it never did. cc @samuelmaddock

  • InspectableWebContents::synced_setting_names_ — Added in #33120 "fix: settings not persisting across devtools loads" but the member is never populated or read. If DevTools synced-settings registration was meant to use this, it's not wired up. cc @codebytere

  • friend class NativeWindowsViews in frameless_view.h — typo for NativeWindowViews (no extra 's'), added in #29600. Code compiles because the friendship was never exercised, but if NativeWindowViews was meant to access private members here, it currently can't. cc @mlaurencin

  • BuildMenuItemWithImage(..., GtkWidget*) header signature — the implementation actually takes const gfx::Image&. The header declared a function that never existed. Corrected the signature to match the impl.

Straightforward dead code

  • CertificateManagerModel: removed ImportUserCert, ImportCACerts, ImportServerCert, Delete, and is_user_db_available_ — forked from Chrome's cert manager UI, but only the PKCS12 import path is used by app.importCertificate()
  • gtk_util::GetOpenLabel / GetSaveLabel — orphaned by #42045 when Linux file dialogs moved to //ui/shell_dialogs (cc @codebytere)
  • WinFrameView::GetReadableFeatureColor — implementation removed in #48568, header declaration left behind (cc @codebytere)
  • AutofillDriverFactory::AddDriverForFrame + CreationCallbackDriverForFrame() creates on demand, explicit-add path never invoked
  • ZoomLevelDelegate::SetDefaultZoomLevelPref — only the getter is used
  • AutofillPopup::selected_index_ — declared, never read or written
  • Forward decls: WebDialogHelper (class removed in #30663), ChromeContentRendererClient, ElectronNativeWindowObserver, ValueStoreFactory (redundant with existing include)

Not in this PR

ProxyingWebSocket::additional_headers_ is also dead (iterated but never populated) — same bug exists in upstream Chromium. Handling separately.

Notes: none

Backports

No Backports Requested

This pull request doesn't have any backports requested or created for older release branches.

What are backports?

Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron