Commit 84575585 authored by danakj's avatar danakj Committed by Commit bot

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

Review URL: https://codereview.chromium.org/986563003

Cr-Commit-Position: refs/heads/master@{#319565}
parent 971f184b
......@@ -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;
......
......@@ -49,9 +49,7 @@ class ScopedAuthorizationRef {
return authorization_;
}
AuthorizationRef* operator&() {
return &authorization_;
}
AuthorizationRef* get_pointer() { return &authorization_; }
AuthorizationRef get() const {
return authorization_;
......
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