| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <CoreFoundation/CoreFoundation.h> | 9 #include <CoreFoundation/CoreFoundation.h> |
| 10 | 10 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 TYPE_NAME_FOR_CF_TYPE_DECL(CFArray); | 92 TYPE_NAME_FOR_CF_TYPE_DECL(CFArray); |
| 93 TYPE_NAME_FOR_CF_TYPE_DECL(CFBag); | 93 TYPE_NAME_FOR_CF_TYPE_DECL(CFBag); |
| 94 TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean); | 94 TYPE_NAME_FOR_CF_TYPE_DECL(CFBoolean); |
| 95 TYPE_NAME_FOR_CF_TYPE_DECL(CFData); | 95 TYPE_NAME_FOR_CF_TYPE_DECL(CFData); |
| 96 TYPE_NAME_FOR_CF_TYPE_DECL(CFDate); | 96 TYPE_NAME_FOR_CF_TYPE_DECL(CFDate); |
| 97 TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary); | 97 TYPE_NAME_FOR_CF_TYPE_DECL(CFDictionary); |
| 98 TYPE_NAME_FOR_CF_TYPE_DECL(CFNull); | 98 TYPE_NAME_FOR_CF_TYPE_DECL(CFNull); |
| 99 TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber); | 99 TYPE_NAME_FOR_CF_TYPE_DECL(CFNumber); |
| 100 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); | 100 TYPE_NAME_FOR_CF_TYPE_DECL(CFSet); |
| 101 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); | 101 TYPE_NAME_FOR_CF_TYPE_DECL(CFString); |
| 102 TYPE_NAME_FOR_CF_TYPE_DECL(CFURL); |
| 102 | 103 |
| 103 #undef TYPE_NAME_FOR_CF_TYPE_DECL | 104 #undef TYPE_NAME_FOR_CF_TYPE_DECL |
| 104 | 105 |
| 105 // Retain/release calls for memory management in C++. | 106 // Retain/release calls for memory management in C++. |
| 106 BASE_EXPORT void NSObjectRetain(void* obj); | 107 BASE_EXPORT void NSObjectRetain(void* obj); |
| 107 BASE_EXPORT void NSObjectRelease(void* obj); | 108 BASE_EXPORT void NSObjectRelease(void* obj); |
| 108 | 109 |
| 109 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation | 110 // CFTypeRefToNSObjectAutorelease transfers ownership of a Core Foundation |
| 110 // object (one derived from CFTypeRef) to the Foundation memory management | 111 // object (one derived from CFTypeRef) to the Foundation memory management |
| 111 // system. In a traditional managed-memory environment, cf_object is | 112 // system. In a traditional managed-memory environment, cf_object is |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 CF_CAST_DECL(CFArray); | 238 CF_CAST_DECL(CFArray); |
| 238 CF_CAST_DECL(CFBag); | 239 CF_CAST_DECL(CFBag); |
| 239 CF_CAST_DECL(CFBoolean); | 240 CF_CAST_DECL(CFBoolean); |
| 240 CF_CAST_DECL(CFData); | 241 CF_CAST_DECL(CFData); |
| 241 CF_CAST_DECL(CFDate); | 242 CF_CAST_DECL(CFDate); |
| 242 CF_CAST_DECL(CFDictionary); | 243 CF_CAST_DECL(CFDictionary); |
| 243 CF_CAST_DECL(CFNull); | 244 CF_CAST_DECL(CFNull); |
| 244 CF_CAST_DECL(CFNumber); | 245 CF_CAST_DECL(CFNumber); |
| 245 CF_CAST_DECL(CFSet); | 246 CF_CAST_DECL(CFSet); |
| 246 CF_CAST_DECL(CFString); | 247 CF_CAST_DECL(CFString); |
| 248 CF_CAST_DECL(CFURL); |
| 247 | 249 |
| 248 #undef CF_CAST_DEFN | 250 #undef CF_CAST_DEFN |
| 249 | 251 |
| 250 #if defined(__OBJC__) | 252 #if defined(__OBJC__) |
| 251 | 253 |
| 252 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more | 254 // ObjCCast<>() and ObjCCastStrict<>() cast a basic id to a more |
| 253 // specific (NSObject-derived) type. The compatibility of the passed | 255 // specific (NSObject-derived) type. The compatibility of the passed |
| 254 // object is found by checking if it's a kind of the requested type | 256 // object is found by checking if it's a kind of the requested type |
| 255 // identifier. If the supplied object is not compatible with the | 257 // identifier. If the supplied object is not compatible with the |
| 256 // requested return type, ObjCCast<>() returns nil and | 258 // requested return type, ObjCCast<>() returns nil and |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 // by using the NSToCFCast methods above. | 325 // by using the NSToCFCast methods above. |
| 324 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); | 326 // e.g. LOG(INFO) << base::mac::NSToCFCast(@"foo"); |
| 325 // Operator << can not be overloaded for ObjectiveC types as the compiler | 327 // Operator << can not be overloaded for ObjectiveC types as the compiler |
| 326 // can not distinguish between overloads for id with overloads for void*. | 328 // can not distinguish between overloads for id with overloads for void*. |
| 327 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 329 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
| 328 const CFErrorRef err); | 330 const CFErrorRef err); |
| 329 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, | 331 BASE_EXPORT extern std::ostream& operator<<(std::ostream& o, |
| 330 const CFStringRef str); | 332 const CFStringRef str); |
| 331 | 333 |
| 332 #endif // BASE_MAC_FOUNDATION_UTIL_H_ | 334 #endif // BASE_MAC_FOUNDATION_UTIL_H_ |
| OLD | NEW |