mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: Add an Internals method to dump the GC graph
This commit is contained in:
parent
ab00a4dc1f
commit
74940726d0
Notes:
github-actions[bot]
2025-11-04 09:35:39 +00:00
Author: https://github.com/tcl3
Commit: 74940726d0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6689
4 changed files with 12 additions and 0 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <LibWeb/ARIA/StateAndProperties.h>
|
||||
#include <LibWeb/Bindings/InternalsPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/MainThreadVM.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
|
|
@ -342,6 +343,11 @@ String Internals::dump_display_list()
|
|||
return window().associated_document().dump_display_list();
|
||||
}
|
||||
|
||||
String Internals::dump_gc_graph()
|
||||
{
|
||||
return Bindings::main_thread_vm().heap().dump_graph().serialized();
|
||||
}
|
||||
|
||||
GC::Ptr<DOM::ShadowRoot> Internals::get_shadow_root(GC::Ref<DOM::Element> element)
|
||||
{
|
||||
return element->shadow_root();
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public:
|
|||
bool headless();
|
||||
|
||||
String dump_display_list();
|
||||
String dump_gc_graph();
|
||||
|
||||
GC::Ptr<DOM::ShadowRoot> get_shadow_root(GC::Ref<DOM::Element>);
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ interface Internals {
|
|||
readonly attribute boolean headless;
|
||||
|
||||
DOMString dumpDisplayList();
|
||||
DOMString dumpGCGraph();
|
||||
|
||||
// Returns the shadow root of the element, if it has one, even if it's not normally accessible to JS.
|
||||
ShadowRoot? getShadowRoot(Element element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue