Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: base/mac/authorization_util.mm

Issue 988113002: Revert of base: Remove operator& from ScopedAuthorizationRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/mac/authorization_util.h" 5 #include "base/mac/authorization_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <sys/wait.h> 8 #include <sys/wait.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 10 matching lines...) Expand all
21 21
22 namespace base { 22 namespace base {
23 namespace mac { 23 namespace mac {
24 24
25 AuthorizationRef GetAuthorizationRightsWithPrompt( 25 AuthorizationRef GetAuthorizationRightsWithPrompt(
26 AuthorizationRights* rights, 26 AuthorizationRights* rights,
27 CFStringRef prompt, 27 CFStringRef prompt,
28 AuthorizationFlags extraFlags) { 28 AuthorizationFlags extraFlags) {
29 // Create an empty AuthorizationRef. 29 // Create an empty AuthorizationRef.
30 ScopedAuthorizationRef authorization; 30 ScopedAuthorizationRef authorization;
31 OSStatus status = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, 31 OSStatus status = AuthorizationCreate(NULL,
32 kAuthorizationEmptyEnvironment,
32 kAuthorizationFlagDefaults, 33 kAuthorizationFlagDefaults,
33 authorization.get_pointer()); 34 &authorization);
34 if (status != errAuthorizationSuccess) { 35 if (status != errAuthorizationSuccess) {
35 OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate"; 36 OSSTATUS_LOG(ERROR, status) << "AuthorizationCreate";
36 return NULL; 37 return NULL;
37 } 38 }
38 39
39 AuthorizationFlags flags = kAuthorizationFlagDefaults | 40 AuthorizationFlags flags = kAuthorizationFlagDefaults |
40 kAuthorizationFlagInteractionAllowed | 41 kAuthorizationFlagInteractionAllowed |
41 kAuthorizationFlagExtendRights | 42 kAuthorizationFlagExtendRights |
42 kAuthorizationFlagPreAuthorize | 43 kAuthorizationFlagPreAuthorize |
43 extraFlags; 44 extraFlags;
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 187 }
187 } else { 188 } else {
188 *exit_status_pointer = -1; 189 *exit_status_pointer = -1;
189 } 190 }
190 191
191 return status; 192 return status;
192 } 193 }
193 194
194 } // namespace mac 195 } // namespace mac
195 } // namespace base 196 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/mac/scoped_authorizationref.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698