Migrate to OS_MAC and OS_APPLE in ipc
Bug: 1105907 Change-Id: I0ace11a629d0347041f7233476a8e4d9a12174d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2325093 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#793006}
This commit is contained in:
@@ -1474,7 +1474,7 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT_WITH_CUSTOM_FIXTURE(DropAssociatedRequest,
|
|||||||
DestroyProxy();
|
DestroyProxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_APPLE)
|
||||||
// TODO(wez): On Mac we need to set up a MachPortBroker before we can transfer
|
// TODO(wez): On Mac we need to set up a MachPortBroker before we can transfer
|
||||||
// Mach ports (which underpin Sharedmemory on Mac) across IPC.
|
// Mach ports (which underpin Sharedmemory on Mac) across IPC.
|
||||||
|
|
||||||
@@ -1598,7 +1598,7 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(
|
|||||||
|
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
#endif // !defined(OS_MACOSX)
|
#endif // !defined(OS_APPLE)
|
||||||
|
|
||||||
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
|
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
#include "ipc/ipc_platform_file_attachment_posix.h"
|
#include "ipc/ipc_platform_file_attachment_posix.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
#if defined(OS_MAC)
|
||||||
#include "ipc/mach_port_attachment_mac.h"
|
#include "ipc/mach_port_attachment_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ mojo::ScopedHandle MessageAttachment::TakeMojoHandle() {
|
|||||||
}
|
}
|
||||||
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
|
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||||
|
|
||||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
#if defined(OS_MAC)
|
||||||
case Type::MACH_PORT: {
|
case Type::MACH_PORT: {
|
||||||
auto* attachment = static_cast<internal::MachPortAttachmentMac*>(this);
|
auto* attachment = static_cast<internal::MachPortAttachmentMac*>(this);
|
||||||
MojoPlatformHandle platform_handle = {
|
MojoPlatformHandle platform_handle = {
|
||||||
@@ -126,7 +126,7 @@ scoped_refptr<MessageAttachment> MessageAttachment::CreateFromMojoHandle(
|
|||||||
}
|
}
|
||||||
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
|
#endif // defined(OS_POSIX) || defined(OS_FUCHSIA)
|
||||||
|
|
||||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
#if defined(OS_MAC)
|
||||||
if (type == Type::MACH_PORT) {
|
if (type == Type::MACH_PORT) {
|
||||||
mach_port_t mach_port = MACH_PORT_NULL;
|
mach_port_t mach_port = MACH_PORT_NULL;
|
||||||
if (platform_handle.type == MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT)
|
if (platform_handle.type == MOJO_PLATFORM_HANDLE_TYPE_MACH_PORT)
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
#include "ipc/ipc_message_attachment_set.h"
|
#include "ipc/ipc_message_attachment_set.h"
|
||||||
#include "ipc/ipc_mojo_param_traits.h"
|
#include "ipc/ipc_mojo_param_traits.h"
|
||||||
|
|
||||||
#if defined(OS_MACOSX) && !defined(OS_IOS)
|
#if defined(OS_MAC)
|
||||||
#include "ipc/mach_port_mac.h"
|
#include "ipc/mach_port_mac.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -931,7 +931,7 @@ void ParamTraits<base::subtle::PlatformSharedMemoryRegion>::Write(
|
|||||||
#elif defined(OS_FUCHSIA)
|
#elif defined(OS_FUCHSIA)
|
||||||
zx::vmo vmo = const_cast<param_type&>(p).PassPlatformHandle();
|
zx::vmo vmo = const_cast<param_type&>(p).PassPlatformHandle();
|
||||||
WriteParam(m, vmo);
|
WriteParam(m, vmo);
|
||||||
#elif defined(OS_MACOSX) && !defined(OS_IOS)
|
#elif defined(OS_MAC)
|
||||||
base::mac::ScopedMachSendRight h =
|
base::mac::ScopedMachSendRight h =
|
||||||
const_cast<param_type&>(p).PassPlatformHandle();
|
const_cast<param_type&>(p).PassPlatformHandle();
|
||||||
MachPortMac mach_port_mac(h.get());
|
MachPortMac mach_port_mac(h.get());
|
||||||
@@ -985,7 +985,7 @@ bool ParamTraits<base::subtle::PlatformSharedMemoryRegion>::Read(
|
|||||||
return false;
|
return false;
|
||||||
*r = base::subtle::PlatformSharedMemoryRegion::Take(std::move(vmo), mode,
|
*r = base::subtle::PlatformSharedMemoryRegion::Take(std::move(vmo), mode,
|
||||||
size, guid);
|
size, guid);
|
||||||
#elif defined(OS_MACOSX) && !defined(OS_IOS)
|
#elif defined(OS_MAC)
|
||||||
MachPortMac mach_port_mac;
|
MachPortMac mach_port_mac;
|
||||||
if (!ReadParam(m, iter, &mach_port_mac))
|
if (!ReadParam(m, iter, &mach_port_mac))
|
||||||
return false;
|
return false;
|
||||||
@@ -1045,7 +1045,7 @@ void ParamTraits<base::subtle::PlatformSharedMemoryRegion>::Log(
|
|||||||
#elif defined(OS_WIN)
|
#elif defined(OS_WIN)
|
||||||
l->append("Handle: ");
|
l->append("Handle: ");
|
||||||
LogParam(p.GetPlatformHandle(), l);
|
LogParam(p.GetPlatformHandle(), l);
|
||||||
#elif defined(OS_MACOSX) && !defined(OS_IOS)
|
#elif defined(OS_MAC)
|
||||||
l->append("Mach port: ");
|
l->append("Mach port: ");
|
||||||
LogParam(p.GetPlatformHandle(), l);
|
LogParam(p.GetPlatformHandle(), l);
|
||||||
#elif defined(OS_ANDROID)
|
#elif defined(OS_ANDROID)
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
#if defined(OS_POSIX)
|
#if defined(OS_POSIX)
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_APPLE)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <sandbox.h>
|
#include <sandbox.h>
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ extern "C" {
|
|||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_APPLE)
|
||||||
#include "sandbox/mac/seatbelt.h"
|
#include "sandbox/mac/seatbelt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT_WITH_CUSTOM_FIXTURE(
|
|||||||
SendFdsClientCommon("SendFdsClient", st.st_ino);
|
SendFdsClientCommon("SendFdsClient", st.st_ino);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_APPLE)
|
||||||
// Test that FDs are correctly sent to a sandboxed process.
|
// Test that FDs are correctly sent to a sandboxed process.
|
||||||
// TODO(port): Make this test cross-platform.
|
// TODO(port): Make this test cross-platform.
|
||||||
TEST_F(IPCSendFdsTest, DescriptorTestSandboxed) {
|
TEST_F(IPCSendFdsTest, DescriptorTestSandboxed) {
|
||||||
@@ -211,7 +211,7 @@ DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT_WITH_CUSTOM_FIXTURE(
|
|||||||
// See if we can receive a file descriptor.
|
// See if we can receive a file descriptor.
|
||||||
SendFdsClientCommon("SendFdsSandboxedClient", st.st_ino);
|
SendFdsClientCommon("SendFdsSandboxedClient", st.st_ino);
|
||||||
}
|
}
|
||||||
#endif // defined(OS_MACOSX)
|
#endif // defined(OS_APPLE)
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user