[go: nahoru, domu]

blob: 2a0cfa44bc82985c6ad4e095c4e72d31472cc0ac [file] [log] [blame]
erikchen1c1e6652015-10-01 18:51:321// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ipc/mach_port_attachment_mac.h"
6
7namespace IPC {
8namespace internal {
9
10MachPortAttachmentMac::MachPortAttachmentMac(mach_port_t mach_port)
11 : mach_port_(mach_port) {}
12
13MachPortAttachmentMac::MachPortAttachmentMac(const WireFormat& wire_format)
14 : BrokerableAttachment(wire_format.attachment_id),
15 mach_port_(static_cast<mach_port_t>(wire_format.mach_port)) {}
16
17MachPortAttachmentMac::MachPortAttachmentMac(
18 const BrokerableAttachment::AttachmentId& id)
19 : BrokerableAttachment(id), mach_port_(MACH_PORT_NULL) {}
20
21MachPortAttachmentMac::~MachPortAttachmentMac() {}
22
23MachPortAttachmentMac::BrokerableType MachPortAttachmentMac::GetBrokerableType()
24 const {
25 return MACH_PORT;
26}
27
28MachPortAttachmentMac::WireFormat MachPortAttachmentMac::GetWireFormat(
29 const base::ProcessId& destination) const {
30 return WireFormat(static_cast<uint32_t>(mach_port_), destination,
31 GetIdentifier());
32}
33
34} // namespace internal
35} // namespace IPC