1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 02:13:56 +09:00

LibGC+Everywhere: Factor out a LibGC from LibJS

Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:

 * JS::NonnullGCPtr -> GC::Ref
 * JS::GCPtr -> GC::Ptr
 * JS::HeapFunction -> GC::Function
 * JS::CellImpl -> GC::Cell
 * JS::Handle -> GC::Root
This commit is contained in:
Shannon Booth 2024-11-15 04:01:23 +13:00 committed by Andreas Kling
parent ce23efc5f6
commit f87041bf3a
Notes: github-actions[bot] 2024-11-15 13:50:17 +00:00
1722 changed files with 9939 additions and 9906 deletions

View file

@ -12,10 +12,10 @@
#include <AK/JsonObject.h>
#include <AK/QuickSort.h>
#include <LibCore/EventLoop.h>
#include <LibGC/Heap.h>
#include <LibGfx/Bitmap.h>
#include <LibGfx/Font/FontDatabase.h>
#include <LibGfx/SystemTheme.h>
#include <LibJS/Heap/Heap.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibJS/Runtime/Date.h>
#include <LibUnicode/TimeZone.h>
@ -55,12 +55,12 @@
namespace WebContent {
ConnectionFromClient::ConnectionFromClient(JS::Heap& heap, IPC::Transport transport)
ConnectionFromClient::ConnectionFromClient(GC::Heap& heap, IPC::Transport transport)
: IPC::ConnectionFromClient<WebContentClientEndpoint, WebContentServerEndpoint>(*this, move(transport), 1)
, m_heap(heap)
, m_page_host(PageHost::create(*this))
{
m_input_event_queue_timer = Web::Platform::Timer::create_single_shot(m_heap, 0, JS::create_heap_function(heap, [this] { process_next_input_event(); }));
m_input_event_queue_timer = Web::Platform::Timer::create_single_shot(m_heap, 0, GC::create_function(heap, [this] { process_next_input_event(); }));
}
ConnectionFromClient::~ConnectionFromClient() = default;
@ -366,7 +366,7 @@ void ConnectionFromClient::debug_request(u64 page_id, ByteString const& request,
if (request == "collect-garbage") {
// NOTE: We use deferred_invoke here to ensure that GC runs with as little on the stack as possible.
Core::deferred_invoke([] {
Web::Bindings::main_thread_vm().heap().collect_garbage(JS::Heap::CollectionType::CollectGarbage, true);
Web::Bindings::main_thread_vm().heap().collect_garbage(GC::Heap::CollectionType::CollectGarbage, true);
});
return;
}