mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 07:20:46 +00:00
LibIPC: Address a couple of clangd warnings in IPC::TransportSocket
* We need the full definition of IPC::File in the header. * We need(ed) Core::System in the header. Move AutoCloseFileDescriptor's ctor and dtor out-of-line to avoid this.
This commit is contained in:
parent
356727f294
commit
8b3355ed0d
Notes:
github-actions[bot]
2025-05-21 10:56:27 +00:00
Author: https://github.com/trflynn89
Commit: 8b3355ed0d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4828
Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 14 additions and 11 deletions
|
@ -8,11 +8,21 @@
|
||||||
#include <AK/NonnullOwnPtr.h>
|
#include <AK/NonnullOwnPtr.h>
|
||||||
#include <LibCore/Socket.h>
|
#include <LibCore/Socket.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <LibIPC/File.h>
|
|
||||||
#include <LibIPC/TransportSocket.h>
|
#include <LibIPC/TransportSocket.h>
|
||||||
|
|
||||||
namespace IPC {
|
namespace IPC {
|
||||||
|
|
||||||
|
AutoCloseFileDescriptor::AutoCloseFileDescriptor(int fd)
|
||||||
|
: m_fd(fd)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
AutoCloseFileDescriptor::~AutoCloseFileDescriptor()
|
||||||
|
{
|
||||||
|
if (m_fd != -1)
|
||||||
|
(void)Core::System::close(m_fd);
|
||||||
|
}
|
||||||
|
|
||||||
void SendQueue::enqueue_message(Vector<u8>&& bytes, Vector<int>&& fds)
|
void SendQueue::enqueue_message(Vector<u8>&& bytes, Vector<int>&& fds)
|
||||||
{
|
{
|
||||||
Threading::MutexLocker locker(m_mutex);
|
Threading::MutexLocker locker(m_mutex);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <AK/MemoryStream.h>
|
#include <AK/MemoryStream.h>
|
||||||
#include <AK/Queue.h>
|
#include <AK/Queue.h>
|
||||||
#include <LibCore/Socket.h>
|
#include <LibCore/Socket.h>
|
||||||
|
#include <LibIPC/File.h>
|
||||||
#include <LibThreading/ConditionVariable.h>
|
#include <LibThreading/ConditionVariable.h>
|
||||||
#include <LibThreading/MutexProtected.h>
|
#include <LibThreading/MutexProtected.h>
|
||||||
#include <LibThreading/RWLock.h>
|
#include <LibThreading/RWLock.h>
|
||||||
|
@ -19,16 +20,8 @@ namespace IPC {
|
||||||
|
|
||||||
class AutoCloseFileDescriptor : public RefCounted<AutoCloseFileDescriptor> {
|
class AutoCloseFileDescriptor : public RefCounted<AutoCloseFileDescriptor> {
|
||||||
public:
|
public:
|
||||||
AutoCloseFileDescriptor(int fd)
|
AutoCloseFileDescriptor(int fd);
|
||||||
: m_fd(fd)
|
~AutoCloseFileDescriptor();
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~AutoCloseFileDescriptor()
|
|
||||||
{
|
|
||||||
if (m_fd != -1)
|
|
||||||
(void)Core::System::close(m_fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
int value() const { return m_fd; }
|
int value() const { return m_fd; }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue