Commit 511c11f7 authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

mojo: Clean up old Mach PlatformHandle APIs.

Bug: 973882
Change-Id: I1c962217d3d37c6892d1e03c691496aedc6bf352
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1731291Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683195}
parent 41af9fcb
......@@ -54,7 +54,7 @@ CreateSharedMemoryRegionHandleFromPlatformHandles(
return zx::vmo(handle.TakeHandle());
#elif defined(OS_MACOSX) && !defined(OS_IOS)
DCHECK(!readonly_handle.is_valid());
return handle.TakeMachPort();
return handle.TakeMachSendRight();
#elif defined(OS_ANDROID)
DCHECK(!readonly_handle.is_valid());
return handle.TakeFD();
......
......@@ -46,8 +46,7 @@ class COMPONENT_EXPORT(MOJO_CPP_PLATFORM) PlatformHandle {
#if defined(OS_WIN) || defined(OS_FUCHSIA)
kHandle,
#elif defined(OS_MACOSX) && !defined(OS_IOS)
kMachPort,
kMachSend = kMachPort,
kMachSend,
kMachReceive,
#endif
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
......@@ -163,17 +162,6 @@ class COMPONENT_EXPORT(MOJO_CPP_PLATFORM) PlatformHandle {
mach_port_t ReleaseMachReceiveRight() WARN_UNUSED_RESULT {
return TakeMachReceiveRight().release();
}
// The following Mach port methods are deprecated. Use the ones above
// instead.
bool is_mach_port() const { return type_ == Type::kMachPort; }
const base::mac::ScopedMachSendRight& GetMachPort() const {
return GetMachSendRight();
}
base::mac::ScopedMachSendRight TakeMachPort() { return TakeMachSendRight(); }
mach_port_t ReleaseMachPort() WARN_UNUSED_RESULT {
return ReleaseMachSendRight();
}
#elif defined(OS_POSIX)
bool is_valid() const { return is_valid_fd(); }
#else
......
......@@ -164,7 +164,7 @@ class PlatformHandleTest : public testing::Test,
#if defined(OS_FUCHSIA)
handle.GetHandle().get()
#elif defined(OS_MACOSX) && !defined(OS_IOS)
handle.GetMachPort().get()
handle.GetMachSendRight().get()
#endif
);
auto generic_region = base::subtle::PlatformSharedMemoryRegion::Take(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment