diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 12:58:46 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 12:58:46 +0000 |
commit | 13c0466a567a9e3cdf436aaf6b52e03a8f16c69e (patch) | |
tree | e74d08135aa572ea72f31ea5ee6be96fd24939eb /base/mac | |
parent | ab068cea95f218e33deac25bb948c2be7501093b (diff) | |
download | chromium_src-13c0466a567a9e3cdf436aaf6b52e03a8f16c69e.zip chromium_src-13c0466a567a9e3cdf436aaf6b52e03a8f16c69e.tar.gz chromium_src-13c0466a567a9e3cdf436aaf6b52e03a8f16c69e.tar.bz2 |
Add base::mac::ScopedMachPort::release().
Most of our other existing scopers have this method. It allows the scoper to
"give up" its ownership claim.
R=thakis@chromium.org, thakis
Review URL: https://codereview.chromium.org/295933017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272956 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/scoped_mach_port.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/mac/scoped_mach_port.h b/base/mac/scoped_mach_port.h index 0b2ac7f..a98ca5e 100644 --- a/base/mac/scoped_mach_port.h +++ b/base/mac/scoped_mach_port.h @@ -9,6 +9,7 @@ #include "base/base_export.h" #include "base/basictypes.h" +#include "base/compiler_specific.h" namespace base { namespace mac { @@ -32,6 +33,12 @@ class BASE_EXPORT ScopedMachPort { return port_; } + mach_port_t release() WARN_UNUSED_RESULT { + mach_port_t temp = port_; + port_ = MACH_PORT_NULL; + return temp; + } + private: mach_port_t port_; |