Chromium Code Reviews| Index: ipc/ipc_message_utils.cc |
| diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc |
| index 8377712e9f45f7be43caed0d285da18ae2a6a733..c2b2a74d7400d93a1b108ba8c47c38b3ef833291 100644 |
| --- a/ipc/ipc_message_utils.cc |
| +++ b/ipc/ipc_message_utils.cc |
| @@ -25,6 +25,7 @@ |
| #endif // (defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_WIN) |
| #if defined(OS_MACOSX) && !defined(OS_IOS) |
| +#include "base/mac/scoped_mach_port.h" |
| #include "ipc/mach_port_mac.h" |
| #endif |
| @@ -1044,4 +1045,31 @@ void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| #endif // OS_WIN |
| +#if defined(OS_MACOSX) && !defined(OS_IOS) |
| +void ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Write( |
| + Message* m, |
| + const param_type p) { |
| + MachPortMac mach_port_mac(p.get()); |
| + ParamTraits<MachPortMac>::Write(m, mach_port_mac); |
| +} |
| + |
| +bool ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Read( |
|
erikchen
2015/12/21 20:02:57
The Chrome IPC stack doesn't have the right semant
Robert Sesek
2015/12/21 20:33:54
The issue here is that GpuMemoryBufferHandle is bo
|
| + const Message* m, |
| + base::PickleIterator* iter, |
| + param_type* r) { |
| + MachPortMac mach_port_mac; |
| + if (!ParamTraits<MachPortMac>::Read(m, iter, &mach_port_mac)) |
| + return false; |
| + r->reset(mach_port_mac.get_mach_port()); |
| + return true; |
| +} |
| + |
| +void ParamTraits<base::mac::ScopedRefCountedMachSendRight>::Log( |
| + const param_type& p, |
| + std::string* l) { |
| + l->append("Mach send right: "); |
| + LogParam(p.get(), l); |
| +} |
| +#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| + |
| } // namespace IPC |