diff options
author | danakj <danakj@chromium.org> | 2015-03-09 10:17:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-09 17:19:09 +0000 |
commit | 318afca092085cc5375a6b5547383d78baee3778 (patch) | |
tree | 540380bacb0d7c983168fbd5f3228cdaadd9bab6 /base/mac | |
parent | be592667bdf919fb8292c88c1b59767add856ba4 (diff) | |
download | chromium_src-318afca092085cc5375a6b5547383d78baee3778.zip chromium_src-318afca092085cc5375a6b5547383d78baee3778.tar.gz chromium_src-318afca092085cc5375a6b5547383d78baee3778.tar.bz2 |
base: Remove operator& from ScopedAuthorizationRef.
The operator& is dangerous and makes it unclear what you are doing.
Replace it with a get_pointer() method.
R=Nico
TBR=garykac@chromium.org
BUG=464816
Committed: https://crrev.com/845755856c54aabac7022ee373618468b92f2e61
Cr-Commit-Position: refs/heads/master@{#319565}
Review URL: https://codereview.chromium.org/986563003
Cr-Commit-Position: refs/heads/master@{#319663}
Diffstat (limited to 'base/mac')
-rw-r--r-- | base/mac/authorization_util.mm | 5 | ||||
-rw-r--r-- | base/mac/scoped_authorizationref.h | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/base/mac/authorization_util.mm b/base/mac/authorization_util.mm index 003c26d..1dfd5a0 100644 --- a/base/mac/authorization_util.mm +++ b/base/mac/authorization_util.mm @@ -28,10 +28,9 @@ AuthorizationRef GetAuthorizationRightsWithPrompt( AuthorizationFlags extraFlags) { // Create an empty AuthorizationRef. ScopedAuthorizationRef authorization; - OSStatus status = AuthorizationCreate(NULL, - kAuthorizationEmptyEnvironment, + OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, - &authorization); + authorization.get_pointer()); if (status != errAuthorizationSuccess) { OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate"; return NULL; diff --git a/base/mac/scoped_authorizationref.h b/base/mac/scoped_authorizationref.h index 6413f2e..1811488 100644 --- a/base/mac/scoped_authorizationref.h +++ b/base/mac/scoped_authorizationref.h @@ -49,9 +49,7 @@ class ScopedAuthorizationRef { return authorization_; } - AuthorizationRef* operator&() { - return &authorization_; - } + AuthorizationRef* get_pointer() { return &authorization_; } AuthorizationRef get() const { return authorization_; |