| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ipc/mach_port_attachment_mac.h" | 5 #include "ipc/mach_port_attachment_mac.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/mac/mach_logging.h" | 9 #include "base/mac/mach_logging.h" |
| 8 | 10 |
| 9 namespace IPC { | 11 namespace IPC { |
| 10 namespace internal { | 12 namespace internal { |
| 11 | 13 |
| 12 MachPortAttachmentMac::MachPortAttachmentMac(mach_port_t mach_port) | 14 MachPortAttachmentMac::MachPortAttachmentMac(mach_port_t mach_port) |
| 13 : mach_port_(mach_port), owns_mach_port_(true) { | 15 : mach_port_(mach_port), owns_mach_port_(true) { |
| 14 if (mach_port != MACH_PORT_NULL) { | 16 if (mach_port != MACH_PORT_NULL) { |
| 15 kern_return_t kr = mach_port_mod_refs(mach_task_self(), mach_port, | 17 kern_return_t kr = mach_port_mod_refs(mach_task_self(), mach_port, |
| 16 MACH_PORT_RIGHT_SEND, 1); | 18 MACH_PORT_RIGHT_SEND, 1); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 45 } | 47 } |
| 46 | 48 |
| 47 MachPortAttachmentMac::WireFormat MachPortAttachmentMac::GetWireFormat( | 49 MachPortAttachmentMac::WireFormat MachPortAttachmentMac::GetWireFormat( |
| 48 const base::ProcessId& destination) const { | 50 const base::ProcessId& destination) const { |
| 49 return WireFormat(static_cast<uint32_t>(mach_port_), destination, | 51 return WireFormat(static_cast<uint32_t>(mach_port_), destination, |
| 50 GetIdentifier()); | 52 GetIdentifier()); |
| 51 } | 53 } |
| 52 | 54 |
| 53 } // namespace internal | 55 } // namespace internal |
| 54 } // namespace IPC | 56 } // namespace IPC |
| OLD | NEW |