#54410: refactor: add a native peer helper for cppgc wrappers
Description of Change
Refs #47922
cppgc wrapper destructors run during sweeping, where they must not touch other GC objects, run JavaScript, or tear down native registrations. Debugger, Notification and WebContents each hand rolled an off-heap peer for this. Add NativePeer<Wrapper>, which owns native registrations, resources, and independent V8 roots for a wrapper.
Currently adopted for Debugger and Notification, will be used by WebContents, Views, BaseWindow in followup.
Release Notes
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
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