mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Ladybird, WebContent: Add option in debug menu to output GC graph dump
This commit is contained in:
parent
0ff29349e6
commit
24edb7c97f
Notes:
sideshowbarker
2024-07-16 20:39:14 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/24edb7c97f Pull-request: https://github.com/SerenityOS/serenity/pull/20614
2 changed files with 10 additions and 0 deletions
|
@ -278,6 +278,12 @@ BrowserWindow::BrowserWindow(Optional<URL> const& initial_url, Browser::CookieJa
|
||||||
debug_request("collect-garbage");
|
debug_request("collect-garbage");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
auto* dump_gc_graph_action = new QAction("Dump GC graph", this);
|
||||||
|
debug_menu->addAction(dump_gc_graph_action);
|
||||||
|
QObject::connect(dump_gc_graph_action, &QAction::triggered, this, [this] {
|
||||||
|
debug_request("dump-gc-graph");
|
||||||
|
});
|
||||||
|
|
||||||
auto* clear_cache_action = new QAction("Clear &Cache", this);
|
auto* clear_cache_action = new QAction("Clear &Cache", this);
|
||||||
clear_cache_action->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C));
|
clear_cache_action->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C));
|
||||||
clear_cache_action->setIcon(QIcon(QString("%1/res/icons/browser/clear-cache.png").arg(s_serenity_resource_root.characters())));
|
clear_cache_action->setIcon(QIcon(QString("%1/res/icons/browser/clear-cache.png").arg(s_serenity_resource_root.characters())));
|
||||||
|
|
|
@ -410,6 +410,10 @@ void ConnectionFromClient::debug_request(DeprecatedString const& request, Deprec
|
||||||
Web::Bindings::main_thread_vm().heap().collect_garbage(JS::Heap::CollectionType::CollectGarbage, true);
|
Web::Bindings::main_thread_vm().heap().collect_garbage(JS::Heap::CollectionType::CollectGarbage, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request == "dump-gc-graph") {
|
||||||
|
Web::Bindings::main_thread_vm().heap().dump_graph();
|
||||||
|
}
|
||||||
|
|
||||||
if (request == "set-line-box-borders") {
|
if (request == "set-line-box-borders") {
|
||||||
bool state = argument == "on";
|
bool state = argument == "on";
|
||||||
m_page_host->set_should_show_line_box_borders(state);
|
m_page_host->set_should_show_line_box_borders(state);
|
||||||
|
|
Loading…
Reference in a new issue