mas-cfisobjc.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Jeremy Apthorp <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:49:20 -0700
  4. Subject: mas-cfisobjc.patch
  5. Removes usage of the _CFIsObjC private API.
  6. diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
  7. index 8b20ebc678c39b722bd5b03930ce89847e8cc73a..dca8c939e757003aafc1528ec7bbb739bf971fa6 100644
  8. --- a/base/mac/foundation_util.mm
  9. +++ b/base/mac/foundation_util.mm
  10. @@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID();
  11. #if !defined(OS_IOS)
  12. CFTypeID SecACLGetTypeID();
  13. CFTypeID SecTrustedApplicationGetTypeID();
  14. -Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
  15. #endif
  16. } // extern "C"
  17. @@ -315,8 +314,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
  18. const_cast<NSFont*>(reinterpret_cast<const NSFont*>(cf_val));
  19. DCHECK(!cf_val ||
  20. CTFontGetTypeID() == CFGetTypeID(cf_val) ||
  21. - (_CFIsObjC(CTFontGetTypeID(), cf_val) &&
  22. - [ns_val isKindOfClass:[NSFont class]]));
  23. + ([ns_val isKindOfClass:[NSFont class]]));
  24. return ns_val;
  25. }
  26. @@ -384,9 +382,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
  27. return (CTFontRef)(cf_val);
  28. }
  29. - if (!_CFIsObjC(CTFontGetTypeID(), cf_val))
  30. - return NULL;
  31. -
  32. id<NSObject> ns_val = reinterpret_cast<id>(const_cast<void*>(cf_val));
  33. if ([ns_val isKindOfClass:[NSFont class]]) {
  34. return (CTFontRef)(cf_val);