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_FOUNDATION_UTIL_H_ | 5 #ifndef BASE_MAC_FOUNDATION_UTIL_H_ |
6 #define BASE_MAC_FOUNDATION_UTIL_H_ | 6 #define BASE_MAC_FOUNDATION_UTIL_H_ |
7 | 7 |
8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); | 134 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); |
135 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); | 135 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); |
136 TYPE_NAME_FOR_CF_TYPE_DECL(CFURL); | 136 TYPE_NAME_FOR_CF_TYPE_DECL(CFURL); |
137 TYPE_NAME_FOR_CF_TYPE_DECL(CFUUID); | 137 TYPE_NAME_FOR_CF_TYPE_DECL(CFUUID); |
138 | 138 |
139 TYPE_NAME_FOR_CF_TYPE_DECL(CGColor); | 139 TYPE_NAME_FOR_CF_TYPE_DECL(CGColor); |
140 | 140 |
141 TYPE_NAME_FOR_CF_TYPE_DECL(CTFont); | 141 TYPE_NAME_FOR_CF_TYPE_DECL(CTFont); |
142 TYPE_NAME_FOR_CF_TYPE_DECL(CTRun); | 142 TYPE_NAME_FOR_CF_TYPE_DECL(CTRun); |
143 | 143 |
| 144 TYPE_NAME_FOR_CF_TYPE_DECL(SecPolicy); |
| 145 |
144 #undef TYPE_NAME_FOR_CF_TYPE_DECL | 146 #undef TYPE_NAME_FOR_CF_TYPE_DECL |
145 | 147 |
146 // Retain/release calls for memory management in C++. | 148 // Retain/release calls for memory management in C++. |
147 BASE_EXPORT void NSObjectRetain(void* obj); | 149 BASE_EXPORT void NSObjectRetain(void* obj); |
148 BASE_EXPORT void NSObjectRelease(void* obj); | 150 BASE_EXPORT void NSObjectRelease(void* obj); |
149 | 151 |
150 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation | 152 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation |
151 // object (one derived from CFTypeRef) to the Foundation memory management | 153 // object (one derived from CFTypeRef) to the Foundation memory management |
152 // system. In a traditional managed-memory environment, cf_object is | 154 // system. In a traditional managed-memory environment, cf_object is |
153 // autoreleased and returned as an NSObject. In a garbage-collected | 155 // autoreleased and returned as an NSObject. In a garbage-collected |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 CF_CAST_DECL(CFURL); | 296 CF_CAST_DECL(CFURL); |
295 CF_CAST_DECL(CFUUID); | 297 CF_CAST_DECL(CFUUID); |
296 | 298 |
297 CF_CAST_DECL(CGColor); | 299 CF_CAST_DECL(CGColor); |
298 | 300 |
299 CF_CAST_DECL(CTFont); | 301 CF_CAST_DECL(CTFont); |
300 CF_CAST_DECL(CTFontDescriptor); | 302 CF_CAST_DECL(CTFontDescriptor); |
301 CF_CAST_DECL(CTRun); | 303 CF_CAST_DECL(CTRun); |
302 | 304 |
303 CF_CAST_DECL(SecACL); | 305 CF_CAST_DECL(SecACL); |
| 306 CF_CAST_DECL(SecPolicy); |
304 CF_CAST_DECL(SecTrustedApplication); | 307 CF_CAST_DECL(SecTrustedApplication); |
305 | 308 |
306 #undef CF_CAST_DECL | 309 #undef CF_CAST_DECL |
307 | 310 |
308 #if defined(__OBJC__) | 311 #if defined(__OBJC__) |
309 | 312 |
310 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more | 313 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more |
311 // specific (NSObject-derived) type. The compatibility of the passed | 314 // specific (NSObject-derived) type. The compatibility of the passed |
312 // object is found by checking if it's a kind of the requested type | 315 // object is found by checking if it's a kind of the requested type |
313 // identifier. If the supplied object is not compatible with the | 316 // identifier. If the supplied object is not compatible with the |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // by using the NSToCFCast methods above. | 392 // by using the NSToCFCast methods above. |
390 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); | 393 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); |
391 // Operator << can not be overloaded for ObjectiveC types as the compiler | 394 // Operator << can not be overloaded for ObjectiveC types as the compiler |
392 // can not distinguish between overloads for id with overloads for void*. | 395 // can not distinguish between overloads for id with overloads for void*. |
393 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 396 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
394 const CFErrorRef err); | 397 const CFErrorRef err); |
395 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 398 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
396 const CFStringRef str); | 399 const CFStringRef str); |
397 | 400 |
398 #endif // BASE_MAC_FOUNDATION_UTIL_H_ | 401 #endif // BASE_MAC_FOUNDATION_UTIL_H_ |
OLD | NEW |