mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb/LibJS: Avoid GC visit of raw pointers where possible
This is mostly motivated for aesthetics, but also helps avoid some null checks when we have a NonnullGCPtr<T> or in some cases a T&.
This commit is contained in:
committed by
Sam Atkins
parent
4e04f81626
commit
6a2a7cad61
Notes:
sideshowbarker
2024-07-17 07:20:49 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/6a2a7cad61 Pull-request: https://github.com/SerenityOS/serenity/pull/21984
@@ -46,10 +46,10 @@ void HTMLCanvasElement::visit_edges(Cell::Visitor& visitor)
|
||||
Base::visit_edges(visitor);
|
||||
m_context.visit(
|
||||
[&](JS::NonnullGCPtr<CanvasRenderingContext2D>& context) {
|
||||
visitor.visit(context.ptr());
|
||||
visitor.visit(context);
|
||||
},
|
||||
[&](JS::NonnullGCPtr<WebGL::WebGLRenderingContext>& context) {
|
||||
visitor.visit(context.ptr());
|
||||
visitor.visit(context);
|
||||
},
|
||||
[](Empty) {
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user