| OLD | NEW |
| 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 #ifndef BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ | 5 #ifndef BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ |
| 6 #define BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ | 6 #define BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ |
| 7 | 7 |
| 8 #include <Security/Authorization.h> | 8 #include <Security/Authorization.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 } | 42 } |
| 43 | 43 |
| 44 bool operator!=(AuthorizationRef that) const { | 44 bool operator!=(AuthorizationRef that) const { |
| 45 return authorization_ != that; | 45 return authorization_ != that; |
| 46 } | 46 } |
| 47 | 47 |
| 48 operator AuthorizationRef() const { | 48 operator AuthorizationRef() const { |
| 49 return authorization_; | 49 return authorization_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 AuthorizationRef* operator&() { | 52 AuthorizationRef* get_pointer() { return &authorization_; } |
| 53 return &authorization_; | |
| 54 } | |
| 55 | 53 |
| 56 AuthorizationRef get() const { | 54 AuthorizationRef get() const { |
| 57 return authorization_; | 55 return authorization_; |
| 58 } | 56 } |
| 59 | 57 |
| 60 void swap(ScopedAuthorizationRef& that) { | 58 void swap(ScopedAuthorizationRef& that) { |
| 61 AuthorizationRef temp = that.authorization_; | 59 AuthorizationRef temp = that.authorization_; |
| 62 that.authorization_ = authorization_; | 60 that.authorization_ = authorization_; |
| 63 authorization_ = temp; | 61 authorization_ = temp; |
| 64 } | 62 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 76 private: | 74 private: |
| 77 AuthorizationRef authorization_; | 75 AuthorizationRef authorization_; |
| 78 | 76 |
| 79 DISALLOW_COPY_AND_ASSIGN(ScopedAuthorizationRef); | 77 DISALLOW_COPY_AND_ASSIGN(ScopedAuthorizationRef); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 } // namespace mac | 80 } // namespace mac |
| 83 } // namespace base | 81 } // namespace base |
| 84 | 82 |
| 85 #endif // BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ | 83 #endif // BASE_MAC_SCOPED_AUTHORIZATIONREF_H_ |
| OLD | NEW |