Repository navigation
fix: enable blink gc plugin - #50465
Conversation
bf3dd16 to
2ccfc95
Compare
|
|
change has landed upstream, now need to wait for the next clang roll (since the plugin is built into clang) which happens approx every 2 weeks per https://chromium.googlesource.com/chromium/src/+/main/docs/clang.md#using-plugins. |
|
We have a subrevision change landed before the actual roll https://chromium-review.googlesource.com/c/chromium/src/+/7722698, this is sufficient. Its available from |
2ccfc95 to
a681df2
Compare
26ec7ef to
9170874
Compare
01edb47 to
8760029
Compare
|
The changes need backport but without the clang plugin stuff, better to do a manual backport to relevant branches once merged. |
ckerr
left a comment
There was a problem hiding this comment.
This is pretty impressive stuff. ❤️
I want to give this review proper attention, I will review this first thing tomorrow morning
|
@deepak1556 seems like some of the changes to |
|
I was planning to backport necessary changes into respective branches manually after merge but I think I can split them up now. |
|
Extracted the powermonitor crash and menu spec changes, I will leave the rest in this PR and manually backport post merge. |
ckerr
left a comment
There was a problem hiding this comment.
I love this. Thanks for adding this.
One remaining chore to sync patches/ but otherwise LVGTM
dc24fde to
c1bd070
Compare
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
c1bd070 to
53a9b34
Compare
|
No Release Notes |
|
@deepak1556 has manually backported this PR to "42-x-y", please check out #50914 |
|
@deepak1556 has manually backported this PR to "41-x-y", please check out #50915 |
Description of Change
Enables GC plugin built into upstream clang to capture cppgc issues at compile time. The goal is to prevent issues like 19f4f38
Currently the plugin is built with restricted set of namespaces and directories so whatever changes made in this PR were from https://source.chromium.org/chromium/chromium/src/+/main:tools/clang/blink_gc_plugin/BadPatternFinder.cpp that is always available.
Since we don't build our own clang, having custom directories supported as a plugin argument in upstream would be the next best step to get the full benefits of the plugin for
ginandelectrondirectories. I will followup on that.Release Notes
Notes: none