mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCore: Stop parenting notifiers
There's no need to participate in the ancient EventReceiver parent/child ownership scheme here. Notifiers are already owned by RefPtrs anyway.
This commit is contained in:
parent
34709cc796
commit
ecf0395c27
|
|
@ -45,7 +45,7 @@ ErrorOr<void> LocalServer::take_over_fd(int socket_fd)
|
|||
|
||||
void LocalServer::setup_notifier()
|
||||
{
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_accept) {
|
||||
auto maybe_client_socket = accept();
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ ErrorOr<void> LocalServer::take_over_fd(int socket_fd)
|
|||
|
||||
void LocalServer::setup_notifier()
|
||||
{
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_accept) {
|
||||
auto maybe_client_socket = accept();
|
||||
|
|
|
|||
|
|
@ -10,9 +10,8 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
Notifier::Notifier(int fd, Type type, EventReceiver* parent)
|
||||
: EventReceiver(parent)
|
||||
, m_fd(fd)
|
||||
Notifier::Notifier(int fd, Type type)
|
||||
: m_fd(fd)
|
||||
, m_type(type)
|
||||
{
|
||||
set_enabled(true);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public:
|
|||
pthread_t owner_thread() const { return m_owner_thread; }
|
||||
|
||||
private:
|
||||
Notifier(int fd, Type type, EventReceiver* parent = nullptr);
|
||||
Notifier(int fd, Type type);
|
||||
|
||||
int m_fd { -1 };
|
||||
bool m_is_enabled { false };
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ ErrorOr<void> TCPServer::listen(IPv4Address const& address, u16 port, AllowAddre
|
|||
TRY(Core::System::listen(m_fd, 5));
|
||||
m_listening = true;
|
||||
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_ready_to_accept)
|
||||
on_ready_to_accept();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ ErrorOr<void> TCPServer::listen(IPv4Address const& address, u16 port, AllowAddre
|
|||
TRY(Core::System::listen(m_fd, 5));
|
||||
m_listening = true;
|
||||
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_ready_to_accept)
|
||||
on_ready_to_accept();
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ bool UDPServer::bind(IPv4Address const& address, u16 port)
|
|||
|
||||
m_bound = true;
|
||||
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_ready_to_receive)
|
||||
on_ready_to_receive();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ bool UDPServer::bind(IPv4Address const& address, u16 port)
|
|||
|
||||
m_bound = true;
|
||||
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read, this);
|
||||
m_notifier = Notifier::construct(m_fd, Notifier::Type::Read);
|
||||
m_notifier->on_activation = [this] {
|
||||
if (on_ready_to_receive)
|
||||
on_ready_to_receive();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user