mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 03:37:35 +00:00
LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects
This commit is contained in:
parent
98ed74087f
commit
82eeee2008
17 changed files with 20 additions and 15 deletions
|
@ -15,7 +15,7 @@ DOMEventListener::~DOMEventListener() = default;
|
|||
|
||||
void DOMEventListener::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Cell::visit_edges(visitor);
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(callback.ptr());
|
||||
visitor.visit(signal.ptr());
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@ namespace Web::DOM {
|
|||
// https://dom.spec.whatwg.org/#concept-event-listener
|
||||
// NOTE: The spec calls this "event listener", and it's *importantly* not the same as "EventListener"
|
||||
class DOMEventListener : public JS::Cell {
|
||||
JS_CELL(DOMEventListener, JS::Cell);
|
||||
|
||||
public:
|
||||
DOMEventListener();
|
||||
~DOMEventListener();
|
||||
|
@ -43,7 +45,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual StringView class_name() const override { return "DOMEventListener"sv; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ EventHandler::EventHandler(WebIDL::CallbackType& c)
|
|||
|
||||
void EventHandler::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Cell::visit_edges(visitor);
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(listener);
|
||||
|
||||
if (auto* callback = value.get_pointer<JS::GCPtr<WebIDL::CallbackType>>())
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
namespace Web::HTML {
|
||||
|
||||
class EventHandler final : public JS::Cell {
|
||||
JS_CELL(EventHandler, JS::Cell);
|
||||
|
||||
public:
|
||||
explicit EventHandler(DeprecatedString);
|
||||
explicit EventHandler(WebIDL::CallbackType&);
|
||||
|
@ -29,7 +31,6 @@ public:
|
|||
JS::GCPtr<DOM::DOMEventListener> listener;
|
||||
|
||||
private:
|
||||
virtual StringView class_name() const override { return "EventHandler"sv; }
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ WindowEnvironmentSettingsObject::~WindowEnvironmentSettingsObject() = default;
|
|||
|
||||
void WindowEnvironmentSettingsObject::visit_edges(JS::Cell::Visitor& visitor)
|
||||
{
|
||||
EnvironmentSettingsObject::visit_edges(visitor);
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_window.ptr());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,10 +17,9 @@ CallbackType::CallbackType(JS::Object& callback, HTML::EnvironmentSettingsObject
|
|||
{
|
||||
}
|
||||
|
||||
StringView CallbackType::class_name() const { return "CallbackType"sv; }
|
||||
void CallbackType::visit_edges(Cell::Visitor& visitor)
|
||||
{
|
||||
Cell::visit_edges(visitor);
|
||||
Base::visit_edges(visitor);
|
||||
visitor.visit(callback);
|
||||
visitor.visit(callback_context);
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ enum class OperationReturnsPromise {
|
|||
|
||||
// https://webidl.spec.whatwg.org/#idl-callback-interface
|
||||
class CallbackType final : public JS::Cell {
|
||||
JS_CELL(CallbackType, JS::Cell);
|
||||
|
||||
public:
|
||||
CallbackType(JS::Object& callback, HTML::EnvironmentSettingsObject& callback_context, OperationReturnsPromise = OperationReturnsPromise::No);
|
||||
|
||||
|
@ -31,7 +33,6 @@ public:
|
|||
OperationReturnsPromise operation_returns_promise;
|
||||
|
||||
private:
|
||||
virtual StringView class_name() const override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue