MarshallOfSound

#53873: refactor: add gin_helper and BaseWindow/WebContents helpers for native menus

Merged
Created: Sep 12, 2026, 11:41:25 PM
Merged: Sep 14, 2026, 11:57:47 AM
2 comments
Target: main

Description of Change

Helpers for implementing Menu/MenuItem natively; no behaviour change on their own.

  • gin_helper::ConvertedValue<T>: property store for cppgc wrappables that keeps the assigned JS value (identity on read) plus its native conversion, converted once at assignment.
  • gin_helper::Constructible::FillInstanceTemplate() hook for own (instance) properties.
  • gin_helper::TrackableObject::GetAllNative().
  • BaseWindow::GetFocusedWindow() (also backs BaseWindow.getFocusedWindow()), FromValue(), IsLive(), SetMenuNatively(); WebContents::GetFocusedWebContents(), session().

Perf: none by itself.

Checklist

Release Notes

Notes: none

Backports

45-x-y
Merged
PR Number
#53912
Merged At
Released In
Not yet
Release Date
Not yet

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