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

Unified Diff: base/mac/scoped_mach_port.h

Issue 1411523006: mac: Make Mach port scopers better ScopedGenerics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 5 years, 2 months 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 | « no previous file | base/memory/shared_memory_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/scoped_mach_port.h
diff --git a/base/mac/scoped_mach_port.h b/base/mac/scoped_mach_port.h
index beb62b032137a879645477abfa9da95f9584549c..67fed6bcfd87769ec639337c890e3654c76426ab 100644
--- a/base/mac/scoped_mach_port.h
+++ b/base/mac/scoped_mach_port.h
@@ -45,40 +45,21 @@ struct PortSetTraits {
// reference counted, and this takes ownership of the right on construction
// and then removes a reference to the right on destruction. If the reference
// is the last one on the right, the right is deallocated.
-class BASE_EXPORT ScopedMachSendRight :
- public base::ScopedGeneric<mach_port_t, internal::SendRightTraits> {
- public:
- explicit ScopedMachSendRight(mach_port_t port = traits_type::InvalidValue())
- : ScopedGeneric(port) {}
-
- operator mach_port_t() const { return get(); }
-};
+using ScopedMachSendRight =
+ ScopedGeneric<mach_port_t, internal::SendRightTraits>;
// A scoper for handling a Mach port's receive right. There is only one
// receive right per port. This takes ownership of the receive right on
// construction and then destroys the right on destruction, turning all
// outstanding send rights into dead names.
-class BASE_EXPORT ScopedMachReceiveRight :
- public base::ScopedGeneric<mach_port_t, internal::ReceiveRightTraits> {
- public:
- explicit ScopedMachReceiveRight(
- mach_port_t port = traits_type::InvalidValue()) : ScopedGeneric(port) {}
-
- operator mach_port_t() const { return get(); }
-};
+using ScopedMachReceiveRight =
+ ScopedGeneric<mach_port_t, internal::ReceiveRightTraits>;
// A scoper for handling a Mach port set. A port set can have only one
// reference. This takes ownership of that single reference on construction and
// destroys the port set on destruction. Destroying a port set does not destroy
// the receive rights that are members of the port set.
-class BASE_EXPORT ScopedMachPortSet :
- public ScopedGeneric<mach_port_t, internal::PortSetTraits> {
- public:
- explicit ScopedMachPortSet(mach_port_t port = traits_type::InvalidValue())
- : ScopedGeneric(port) {}
-
- operator mach_port_t() const { return get(); }
-};
+using ScopedMachPortSet = ScopedGeneric<mach_port_t, internal::PortSetTraits>;
} // namespace mac
} // namespace base
« no previous file with comments | « no previous file | base/memory/shared_memory_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698