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

Side by Side Diff: base/mac/scoped_authorizationref.h

Issue 9764013: Move authorization_util files into base/mac. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix license headers Created 8 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 | « base/mac/authorization_util.mm ('k') | chrome/browser/mac/authorization_util.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) 2011 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 #ifndef CHROME_BROWSER_MAC_SCOPED_AUTHORIZATIONREF_H_ 5 #ifndef BASE_MAC_SCOPED_AUTHORIZATIONREF_H_
6 #define CHROME_BROWSER_MAC_SCOPED_AUTHORIZATIONREF_H_ 6 #define BASE_MAC_SCOPED_AUTHORIZATIONREF_H_
7 #pragma once 7 #pragma once
8 8
9 #include <Security/Authorization.h> 9 #include <Security/Authorization.h>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 13
14 // ScopedAuthorizationRef maintains ownership of an AuthorizationRef. It is 14 // ScopedAuthorizationRef maintains ownership of an AuthorizationRef. It is
15 // patterned after the scoped_ptr interface. 15 // patterned after the scoped_ptr interface.
16 16
17 namespace base {
18 namespace mac {
19
17 class ScopedAuthorizationRef { 20 class ScopedAuthorizationRef {
18 public: 21 public:
19 explicit ScopedAuthorizationRef(AuthorizationRef authorization = NULL) 22 explicit ScopedAuthorizationRef(AuthorizationRef authorization = NULL)
20 : authorization_(authorization) { 23 : authorization_(authorization) {
21 } 24 }
22 25
23 ~ScopedAuthorizationRef() { 26 ~ScopedAuthorizationRef() {
24 if (authorization_) { 27 if (authorization_) {
25 AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights); 28 AuthorizationFree(authorization_, kAuthorizationFlagDestroyRights);
26 } 29 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 authorization_ = NULL; 73 authorization_ = NULL;
71 return temp; 74 return temp;
72 } 75 }
73 76
74 private: 77 private:
75 AuthorizationRef authorization_; 78 AuthorizationRef authorization_;
76 79
77 DISALLOW_COPY_AND_ASSIGN(ScopedAuthorizationRef); 80 DISALLOW_COPY_AND_ASSIGN(ScopedAuthorizationRef);
78 }; 81 };
79 82
80 #endif // CHROME_BROWSER_MAC_SCOPED_AUTHORIZATIONREF_H_ 83 } // namespace mac
84 } // namespace base
85
86 #endif // BASE_MAC_SCOPED_AUTHORIZATIONREF_H_
OLDNEW
« no previous file with comments | « base/mac/authorization_util.mm ('k') | chrome/browser/mac/authorization_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698