mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-17 07:41:54 +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:
parent
ce23efc5f6
commit
f87041bf3a
Notes:
github-actions[bot]
2024-11-15 13:50:17 +00:00
Author: https://github.com/shannonbooth
Commit: f87041bf3a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2345
1722 changed files with 9939 additions and 9906 deletions
|
@ -13,13 +13,13 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
// Lazy-loaded elements should invoke this macro to inject overridden LazyLoadingElement methods.
|
||||
#define LAZY_LOADING_ELEMENT(ElementClass) \
|
||||
private: \
|
||||
virtual JS::GCPtr<JS::HeapFunction<void()>> take_lazy_load_resumption_steps(Badge<DOM::Document>) override \
|
||||
{ \
|
||||
return take_lazy_load_resumption_steps_internal(); \
|
||||
} \
|
||||
\
|
||||
#define LAZY_LOADING_ELEMENT(ElementClass) \
|
||||
private: \
|
||||
virtual GC::Ptr<GC::Function<void()>> take_lazy_load_resumption_steps(Badge<DOM::Document>) override \
|
||||
{ \
|
||||
return take_lazy_load_resumption_steps_internal(); \
|
||||
} \
|
||||
\
|
||||
virtual bool is_lazy_loading() const override { return true; }
|
||||
|
||||
enum class LazyLoading {
|
||||
|
@ -63,7 +63,7 @@ public:
|
|||
{
|
||||
auto& element = static_cast<T&>(*this);
|
||||
|
||||
m_lazy_load_resumption_steps = JS::create_heap_function(element.vm().heap(), move(steps));
|
||||
m_lazy_load_resumption_steps = GC::create_function(element.vm().heap(), move(steps));
|
||||
}
|
||||
|
||||
void visit_lazy_loading_element(JS::Cell::Visitor& visitor)
|
||||
|
@ -75,7 +75,7 @@ protected:
|
|||
LazyLoadingElement() = default;
|
||||
virtual ~LazyLoadingElement() = default;
|
||||
|
||||
JS::GCPtr<JS::HeapFunction<void()>> take_lazy_load_resumption_steps_internal()
|
||||
GC::Ptr<GC::Function<void()>> take_lazy_load_resumption_steps_internal()
|
||||
{
|
||||
auto lazy_load_resumption_steps = m_lazy_load_resumption_steps;
|
||||
m_lazy_load_resumption_steps = nullptr;
|
||||
|
@ -85,7 +85,7 @@ protected:
|
|||
private:
|
||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-load-resumption-steps
|
||||
// Each img and iframe element has associated lazy load resumption steps, initially null.
|
||||
JS::GCPtr<JS::HeapFunction<void()>> m_lazy_load_resumption_steps;
|
||||
GC::Ptr<GC::Function<void()>> m_lazy_load_resumption_steps;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue