summaryrefslogtreecommitdiffstats
path: root/base/mac
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2015-03-07 18:36:45 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-08 02:37:17 +0000
commit40ef92499a1c5983d755ca23dd0cfaf7529d0fc2 (patch)
treeae89595d101917be17f370289d416126487bab6c /base/mac
parent4c4b7dc670f508469a0c23349e4978cbc30262c9 (diff)
downloadchromium_src-40ef92499a1c5983d755ca23dd0cfaf7529d0fc2.zip
chromium_src-40ef92499a1c5983d755ca23dd0cfaf7529d0fc2.tar.gz
chromium_src-40ef92499a1c5983d755ca23dd0cfaf7529d0fc2.tar.bz2
Revert of base: Remove operator& from ScopedAuthorizationRef. (patchset #1 id:1 of https://codereview.chromium.org/986563003/)
Reason for revert: Breaks the official Mac bot: ../../remoting/host/installer/mac/uninstaller/remoting_uninstaller.mm:155:21:error: no matching function for call to 'AuthorizationCreate' OSStatus status = AuthorizationCreate(nullptr, kAuthorizationEmptyEnvironment, ^~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:253:10: note: candidate function not viable: no known conversion from 'base::mac::ScopedAuthorizationRef *' to 'AuthorizationRef *' (aka 'const AuthorizationOpaqueRef **') for 4th argument OSStatus AuthorizationCreate(const AuthorizationRights *rights, Original issue's description: > 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 > BUG=464816 > > Committed: https://crrev.com/845755856c54aabac7022ee373618468b92f2e61 > Cr-Commit-Position: refs/heads/master@{#319565} TBR=thakis@chromium.org,danakj@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=464816 Review URL: https://codereview.chromium.org/988113002 Cr-Commit-Position: refs/heads/master@{#319570}
Diffstat (limited to 'base/mac')
-rw-r--r--base/mac/authorization_util.mm5
-rw-r--r--base/mac/scoped_authorizationref.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/base/mac/authorization_util.mm b/base/mac/authorization_util.mm
index 1dfd5a0..003c26d 100644
--- a/base/mac/authorization_util.mm
+++ b/base/mac/authorization_util.mm
@@ -28,9 +28,10 @@ AuthorizationRef GetAuthorizationRightsWithPrompt(
AuthorizationFlags extraFlags) {
// Create an empty AuthorizationRef.
ScopedAuthorizationRef authorization;
- OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
+ OSStatus status = AuthorizationCreate(NULL,
+ kAuthorizationEmptyEnvironment,
kAuthorizationFlagDefaults,
- authorization.get_pointer());
+ &authorization);
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 1811488..6413f2e 100644
--- a/base/mac/scoped_authorizationref.h
+++ b/base/mac/scoped_authorizationref.h
@@ -49,7 +49,9 @@ class ScopedAuthorizationRef {
return authorization_;
}
- AuthorizationRef* get_pointer() { return &authorization_; }
+ AuthorizationRef* operator&() {
+ return &authorization_;
+ }
AuthorizationRef get() const {
return authorization_;