mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
* chore: backport cppgc cleanups Key fixes: - Replace `base::WeakPtrFactory` with `gin::WeakCellFactory` in MenuMac, MenuViews, and NetLog, since weak pointers to cppgc-managed objects must go through weak cells - Replace `v8::Global<v8::Value>` with `cppgc::Persistent<Menu>` for the menu reference in BaseWindow - Stop using `gin_helper::Handle<T>` with cppgc types; use raw `T*` and add a `static_assert` to prevent future misuse - Add proper `Trace()` overrides for Menu, MenuMac, MenuViews, and NetLog to ensure cppgc members are visited during garbage collection - Replace `SelfKeepAlive` prevent-GC mechanism in Menu with a `cppgc::Persistent` prevent-GC captured in `BindSelfToClosure` - Introduce `GC_PLUGIN_IGNORE` macro to suppress known-safe violations: mojo::Remote fields, ObjC bridging pointers, and intentional persistent self-references - Mark `ArgumentHolder` as `CPPGC_STACK_ALLOCATED()` in both Electron's and gin's function_template.h to silence raw-pointer-to-GC-type warnings * chore: fix build