Commit 13c0466a authored by mark@chromium.org's avatar mark@chromium.org

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
parent ab068cea
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/base_export.h" #include "base/base_export.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/compiler_specific.h"
namespace base { namespace base {
namespace mac { namespace mac {
...@@ -32,6 +33,12 @@ class BASE_EXPORT ScopedMachPort { ...@@ -32,6 +33,12 @@ class BASE_EXPORT ScopedMachPort {
return port_; return port_;
} }
mach_port_t release() WARN_UNUSED_RESULT {
mach_port_t temp = port_;
port_ = MACH_PORT_NULL;
return temp;
}
private: private:
mach_port_t port_; mach_port_t port_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment