mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-27 04:37:22 +00:00
LibCore: Remove unused TCPServer constructor parameter
This commit is contained in:
parent
d13884e933
commit
036aa43a41
Notes:
github-actions[bot]
2025-08-11 14:58:02 +00:00
Author: https://github.com/awesomekling
Commit: 036aa43a41
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5817
Reviewed-by: https://github.com/gmta ✅
3 changed files with 10 additions and 12 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
|
||||
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create()
|
||||
{
|
||||
#ifdef SOCK_NONBLOCK
|
||||
int fd = TRY(Core::System::socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK | SOCK_CLOEXEC, 0));
|
||||
|
@ -25,12 +25,11 @@ ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
|
|||
TRY(Core::System::fcntl(fd, F_SETFD, FD_CLOEXEC));
|
||||
#endif
|
||||
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd, parent));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd));
|
||||
}
|
||||
|
||||
TCPServer::TCPServer(int fd, EventReceiver* parent)
|
||||
: EventReceiver(parent)
|
||||
, m_fd(fd)
|
||||
TCPServer::TCPServer(int fd)
|
||||
: m_fd(fd)
|
||||
{
|
||||
VERIFY(m_fd >= 0);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Core {
|
|||
class TCPServer : public EventReceiver {
|
||||
C_OBJECT_ABSTRACT(TCPServer)
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<TCPServer>> try_create(EventReceiver* parent = nullptr);
|
||||
static ErrorOr<NonnullRefPtr<TCPServer>> try_create();
|
||||
virtual ~TCPServer() override;
|
||||
|
||||
enum class AllowAddressReuse {
|
||||
|
@ -36,7 +36,7 @@ public:
|
|||
Function<void()> on_ready_to_accept;
|
||||
|
||||
private:
|
||||
explicit TCPServer(int fd, EventReceiver* parent = nullptr);
|
||||
explicit TCPServer(int fd);
|
||||
|
||||
int m_fd { -1 };
|
||||
bool m_listening { false };
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace Core {
|
||||
|
||||
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
|
||||
ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create()
|
||||
{
|
||||
int fd = TRY(Core::System::socket(AF_INET, SOCK_STREAM, 0));
|
||||
ArmedScopeGuard close_fd { [fd]() {
|
||||
|
@ -28,12 +28,11 @@ ErrorOr<NonnullRefPtr<TCPServer>> TCPServer::try_create(EventReceiver* parent)
|
|||
if (SetHandleInformation(to_handle(fd), HANDLE_FLAG_INHERIT, 0) == 0)
|
||||
return Error::from_windows_error();
|
||||
close_fd.disarm();
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd, parent));
|
||||
return adopt_nonnull_ref_or_enomem(new (nothrow) TCPServer(fd));
|
||||
}
|
||||
|
||||
TCPServer::TCPServer(int fd, EventReceiver* parent)
|
||||
: EventReceiver(parent)
|
||||
, m_fd(fd)
|
||||
TCPServer::TCPServer(int fd)
|
||||
: m_fd(fd)
|
||||
{
|
||||
VERIFY(m_fd >= 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue