diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /ipc/chromium/src/chrome/common/mach_ipc_mac.h | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | ipc/chromium/src/chrome/common/mach_ipc_mac.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ipc/chromium/src/chrome/common/mach_ipc_mac.h b/ipc/chromium/src/chrome/common/mach_ipc_mac.h new file mode 100644 index 0000000000..c9af70c0c6 --- /dev/null +++ b/ipc/chromium/src/chrome/common/mach_ipc_mac.h @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef BASE_MACH_IPC_MAC_H_ +#define BASE_MACH_IPC_MAC_H_ + +#include <mach/mach.h> +#include <mach/message.h> +#include <servers/bootstrap.h> +#include <sys/types.h> + +#include "mozilla/Maybe.h" +#include "mozilla/Result.h" +#include "mozilla/UniquePtrExtensions.h" + +//============================================================================== +// Helper function for sending a minimal mach IPC messages with a single send +// right attached. The endpoint will not be consumed unless the +// `endpoint_disposition` argument is set to a consuming disposition, and +// `KERN_SUCCESS` is returned. +kern_return_t MachSendPortSendRight( + mach_port_t endpoint, mach_port_t attachment, + mozilla::Maybe<mach_msg_timeout_t> opt_timeout, + mach_msg_type_name_t endpoint_disposition = MACH_MSG_TYPE_COPY_SEND); + +//============================================================================== +// Helper function for receiving a minimal mach IPC message with a single send +// right attached. +// If the `audit_token` parameter is provided, it will be populated with the +// sender's audit token, which can be used to verify the identity of the sender. +kern_return_t MachReceivePortSendRight( + const mozilla::UniqueMachReceiveRight& endpoint, + mozilla::Maybe<mach_msg_timeout_t> opt_timeout, + mozilla::UniqueMachSendRight* attachment, + audit_token_t* audit_token = nullptr); + +#endif // BASE_MACH_IPC_MAC_H_ |