| Index: ipc/mach_port_mac.cc
|
| diff --git a/ipc/mach_port_mac.cc b/ipc/mach_port_mac.cc
|
| index 6d3045a560660f139a611da4d85ede2addb99bd1..a482d24d7f03ee1d4de77b773bbf89fe43f00b9a 100644
|
| --- a/ipc/mach_port_mac.cc
|
| +++ b/ipc/mach_port_mac.cc
|
| @@ -34,10 +34,16 @@
|
| return false;
|
| MessageAttachment* attachment =
|
| static_cast<MessageAttachment*>(base_attachment.get());
|
| - if (attachment->GetType() != MessageAttachment::Type::MACH_PORT)
|
| + if (attachment->GetType() != MessageAttachment::TYPE_BROKERABLE_ATTACHMENT)
|
| return false;
|
| + BrokerableAttachment* brokerable_attachment =
|
| + static_cast<BrokerableAttachment*>(attachment);
|
| + if (brokerable_attachment->GetBrokerableType() !=
|
| + BrokerableAttachment::MACH_PORT) {
|
| + return false;
|
| + }
|
| IPC::internal::MachPortAttachmentMac* mach_port_attachment =
|
| - static_cast<IPC::internal::MachPortAttachmentMac*>(attachment);
|
| + static_cast<IPC::internal::MachPortAttachmentMac*>(brokerable_attachment);
|
| r->set_mach_port(mach_port_attachment->get_mach_port());
|
| mach_port_attachment->reset_mach_port_ownership();
|
| return true;
|
|
|