mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
Move MachPortServer from LibWebView into LibIPC as MachBootstrapListener and move the Mach message structs from MachMessageTypes.h into LibIPC. These types are IPC infrastructure, not UI or platform concerns. Consolidating them in LibIPC keeps the Mach bootstrap handshake self-contained in a single library and removes LibWebView's dependency on LibThreading.
57 lines
1.3 KiB
C++
57 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Platform.h>
|
|
#include <AK/Types.h>
|
|
|
|
#if !defined(AK_OS_MACH)
|
|
# error "This file is only available on Mach platforms"
|
|
#endif
|
|
|
|
#include <mach/mach.h>
|
|
|
|
namespace IPC {
|
|
|
|
struct MessageBodyWithSelfTaskPort {
|
|
mach_msg_body_t body;
|
|
mach_msg_port_descriptor_t port_descriptor;
|
|
mach_msg_audit_trailer_t trailer;
|
|
};
|
|
|
|
struct MessageWithSelfTaskPort {
|
|
mach_msg_header_t header;
|
|
mach_msg_body_t body;
|
|
mach_msg_port_descriptor_t port_descriptor;
|
|
};
|
|
|
|
struct ReceivedMachMessage {
|
|
mach_msg_header_t header;
|
|
MessageBodyWithSelfTaskPort body;
|
|
};
|
|
|
|
struct MessageWithIPCChannelPorts {
|
|
mach_msg_header_t header;
|
|
mach_msg_body_t body;
|
|
mach_msg_port_descriptor_t receive_port;
|
|
mach_msg_port_descriptor_t send_port;
|
|
};
|
|
|
|
struct ReceivedIPCChannelPortsMessage {
|
|
mach_msg_header_t header;
|
|
mach_msg_body_t body;
|
|
mach_msg_port_descriptor_t receive_port;
|
|
mach_msg_port_descriptor_t send_port;
|
|
mach_msg_trailer_t trailer;
|
|
};
|
|
|
|
static constexpr mach_msg_id_t SELF_TASK_PORT_MESSAGE_ID = 0x1234CAFE;
|
|
static constexpr mach_msg_id_t IPC_CHANNEL_PORTS_MESSAGE_ID = 0x4950C002;
|
|
|
|
}
|