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

Unified Diff: util/mach/child_port_handshake.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 | « no previous file | util/mach/mach_extensions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/child_port_handshake.cc
diff --git a/util/mach/child_port_handshake.cc b/util/mach/child_port_handshake.cc
index 27e0cf3c78feca59c3bd64ba5bca467d0d24ecbc..4369da98ed2d09f3a0dd8845edaf55f558521c7b 100644
--- a/util/mach/child_port_handshake.cc
+++ b/util/mach/child_port_handshake.cc
@@ -126,11 +126,9 @@ mach_port_t ChildPortHandshake::RunServer() {
// A kqueue cannot monitor a raw Mach receive right with EVFILT_MACHPORT. It
// requires a port set. Create a new port set and add the receive right to it.
- mach_port_t server_port_set;
- kr = mach_port_allocate(
- mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &server_port_set);
- MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_allocate";
- base::mac::ScopedMachPortSet server_port_set_owner(server_port_set);
+ base::mac::ScopedMachPortSet server_port_set(
+ NewMachPort(MACH_PORT_RIGHT_PORT_SET));
+ CHECK_NE(server_port_set, kMachPortNull);
kr = mach_port_insert_member(mach_task_self(), server_port, server_port_set);
MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_port_insert_member";
« no previous file with comments | « no previous file | util/mach/mach_extensions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698