mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00: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:
committed by
Andreas Kling
parent
ce23efc5f6
commit
f87041bf3a
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS_DEFINE_ALLOCATOR(DocumentObserver);
|
||||
GC_DEFINE_ALLOCATOR(DocumentObserver);
|
||||
|
||||
DocumentObserver::DocumentObserver(JS::Realm& realm, DOM::Document& document)
|
||||
: Bindings::PlatformObject(realm)
|
||||
@@ -39,7 +39,7 @@ void DocumentObserver::finalize()
|
||||
void DocumentObserver::set_document_became_inactive(Function<void()> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_document_became_inactive = JS::create_heap_function(vm().heap(), move(callback));
|
||||
m_document_became_inactive = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_document_became_inactive = nullptr;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ void DocumentObserver::set_document_became_inactive(Function<void()> callback)
|
||||
void DocumentObserver::set_document_completely_loaded(Function<void()> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_document_completely_loaded = JS::create_heap_function(vm().heap(), move(callback));
|
||||
m_document_completely_loaded = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_document_completely_loaded = nullptr;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ void DocumentObserver::set_document_completely_loaded(Function<void()> callback)
|
||||
void DocumentObserver::set_document_readiness_observer(Function<void(HTML::DocumentReadyState)> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_document_readiness_observer = JS::create_heap_function(vm().heap(), move(callback));
|
||||
m_document_readiness_observer = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_document_readiness_observer = nullptr;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ void DocumentObserver::set_document_readiness_observer(Function<void(HTML::Docum
|
||||
void DocumentObserver::set_document_visibility_state_observer(Function<void(HTML::VisibilityState)> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_document_visibility_state_observer = JS::create_heap_function(vm().heap(), move(callback));
|
||||
m_document_visibility_state_observer = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_document_visibility_state_observer = nullptr;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ void DocumentObserver::set_document_visibility_state_observer(Function<void(HTML
|
||||
void DocumentObserver::set_document_page_showing_observer(Function<void(bool)> callback)
|
||||
{
|
||||
if (callback)
|
||||
m_document_page_showing_observer = JS::create_heap_function(vm().heap(), move(callback));
|
||||
m_document_page_showing_observer = GC::create_function(vm().heap(), move(callback));
|
||||
else
|
||||
m_document_page_showing_observer = nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user