summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-11-28 14:55:41 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-28 22:56:17 +0000
commit1fd6e95c46a7e43e308725bbb2d80f86ebefcdbf (patch)
treecfc5897032291b391e32b3c1e568d58053c0c6c1 /ipc
parent9ee8f5070fea5d8df890010a17f99deb21384732 (diff)
downloadchromium_src-1fd6e95c46a7e43e308725bbb2d80f86ebefcdbf.zip
chromium_src-1fd6e95c46a7e43e308725bbb2d80f86ebefcdbf.tar.gz
chromium_src-1fd6e95c46a7e43e308725bbb2d80f86ebefcdbf.tar.bz2
ipc: Minor clean up to AttachmentBrokerPrivilegedMac.
Passing MACH_MSG_TYPE_MOVE_SEND to mach_port_extract_right() is a slight simplification to the existing logic. BUG=561105 Review URL: https://codereview.chromium.org/1481433003 Cr-Commit-Position: refs/heads/master@{#362061}
Diffstat (limited to 'ipc')
-rw-r--r--ipc/attachment_broker_privileged_mac.cc10
1 files changed, 1 insertions, 9 deletions
diff --git a/ipc/attachment_broker_privileged_mac.cc b/ipc/attachment_broker_privileged_mac.cc
index 7ec9e1ad..f19f072 100644
--- a/ipc/attachment_broker_privileged_mac.cc
+++ b/ipc/attachment_broker_privileged_mac.cc
@@ -282,7 +282,7 @@ base::mac::ScopedMachSendRight AttachmentBrokerPrivilegedMac::ExtractNamedRight(
mach_port_t extracted_right = MACH_PORT_NULL;
mach_msg_type_name_t extracted_right_type;
kern_return_t kr =
- mach_port_extract_right(task_port, named_right, MACH_MSG_TYPE_COPY_SEND,
+ mach_port_extract_right(task_port, named_right, MACH_MSG_TYPE_MOVE_SEND,
&extracted_right, &extracted_right_type);
if (kr != KERN_SUCCESS) {
LogError(ERROR_EXTRACT_SOURCE_RIGHT);
@@ -292,14 +292,6 @@ base::mac::ScopedMachSendRight AttachmentBrokerPrivilegedMac::ExtractNamedRight(
DCHECK_EQ(static_cast<mach_msg_type_name_t>(MACH_MSG_TYPE_PORT_SEND),
extracted_right_type);
- // Decrement the reference count of the send right from the source process.
- kr = mach_port_mod_refs(task_port, named_right, MACH_PORT_RIGHT_SEND, -1);
- if (kr != KERN_SUCCESS) {
- LogError(ERROR_DECREASE_REF);
- // Failure does not actually affect attachment brokering, so there's no need
- // to return |MACH_PORT_NULL|.
- }
-
return base::mac::ScopedMachSendRight(extracted_right);
}