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

Unified Diff: ipc/mach_port_mac.cc

Issue 2504063002: Revert of Remove IPC::BrokerableAttachment. (Closed)
Patch Set: Created 4 years, 1 month 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 | « ipc/mach_port_attachment_mac.cc ('k') | ppapi/proxy/nacl_message_scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ipc/mach_port_attachment_mac.cc ('k') | ppapi/proxy/nacl_message_scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698