| Index: base/mac/scoped_mach_port.h
|
| diff --git a/base/mac/scoped_mach_port.h b/base/mac/scoped_mach_port.h
|
| index 67fed6bcfd87769ec639337c890e3654c76426ab..c462663acf722ba6df7792b5873ed9fb8c158a16 100644
|
| --- a/base/mac/scoped_mach_port.h
|
| +++ b/base/mac/scoped_mach_port.h
|
| @@ -8,6 +8,7 @@
|
| #include <mach/mach.h>
|
|
|
| #include "base/base_export.h"
|
| +#include "base/mac/scoped_typeref.h"
|
| #include "base/scoped_generic.h"
|
|
|
| namespace base {
|
| @@ -39,6 +40,11 @@ struct PortSetTraits {
|
| BASE_EXPORT static void Free(mach_port_t port);
|
| };
|
|
|
| +struct RefCountedSendRighTraits {
|
| + BASE_EXPORT static void Retain(mach_port_t);
|
| + BASE_EXPORT static void Release(mach_port_t);
|
| +};
|
| +
|
| } // namespace internal
|
|
|
| // A scoper for handling a Mach port that names a send right. Send rights are
|
| @@ -61,6 +67,13 @@ using ScopedMachReceiveRight =
|
| // the receive rights that are members of the port set.
|
| using ScopedMachPortSet = ScopedGeneric<mach_port_t, internal::PortSetTraits>;
|
|
|
| +// A scoper for handling Mach port names that are send rights. Unlike
|
| +// ScopedMachSendRight, this scoper is both copyable and assignable, which will
|
| +// increase the kernel reference count of the right. Otherwise, this behaves
|
| +// the same as ScopedMachSendRight.
|
| +using ScopedRefCountedMachSendRight =
|
| + ScopedTypeRef<mach_port_t, internal::RefCountedSendRighTraits>;
|
| +
|
| } // namespace mac
|
| } // namespace base
|
|
|
|
|