Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: util/test/mac/mach_multiprocess.cc

Issue 809103002: Add NewMachPort() and its test, and switch call sites to use it (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/notify_server_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/test/mac/mach_multiprocess.cc
diff --git a/util/test/mac/mach_multiprocess.cc b/util/test/mac/mach_multiprocess.cc
index fe9df9539594a533da9e16cecccceb9ad976ceaf..0b2da0d0e9aeb227e73adf98cf0690e779fe9eb8 100644
--- a/util/test/mac/mach_multiprocess.cc
+++ b/util/test/mac/mach_multiprocess.cc
@@ -215,15 +215,12 @@ void MachMultiprocess::MultiprocessChild() {
// local_port is not valid in the forked child process.
ignore_result(info_->local_port.release());
- mach_port_t local_port;
- kern_return_t kr = mach_port_allocate(
- mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &local_port);
- ASSERT_EQ(KERN_SUCCESS, kr) << MachErrorMessage(kr, "mach_port_allocate");
- info_->local_port.reset(local_port);
+ info_->local_port.reset(NewMachPort(MACH_PORT_RIGHT_RECEIVE));
+ ASSERT_NE(kMachPortNull, info_->local_port);
// The remote port can be obtained from the bootstrap server.
mach_port_t remote_port;
- kr = bootstrap_look_up(
+ kern_return_t kr = bootstrap_look_up(
bootstrap_port, info_->service_name.c_str(), &remote_port);
ASSERT_EQ(BOOTSTRAP_SUCCESS, kr)
<< BootstrapErrorMessage(kr, "bootstrap_look_up");
« no previous file with comments | « util/mach/notify_server_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698