mas-cfisobjc.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 be12912dcd0ef0cf046ee2d4033a18ecfdf1e992..d2af322a9d5751105e2c8fe023aad9a91027bf05 100644
  8. --- a/base/mac/foundation_util.mm
  9. +++ b/base/mac/foundation_util.mm
  10. @@ -28,12 +28,6 @@ CFTypeID SecKeyGetTypeID();
  11. #if !defined(OS_IOS)
  12. CFTypeID SecACLGetTypeID();
  13. CFTypeID SecTrustedApplicationGetTypeID();
  14. -// The NSFont/CTFont toll-free bridging is broken before 10.15.
  15. -// http://www.openradar.me/15341349 rdar://15341349
  16. -//
  17. -// TODO(https://crbug.com/1076527): This is fixed in 10.15. When 10.15 is the
  18. -// minimum OS for Chromium, remove this SPI declaration.
  19. -Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
  20. #endif
  21. } // extern "C"
  22. @@ -326,8 +320,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
  23. const_cast<NSFont*>(reinterpret_cast<const NSFont*>(cf_val));
  24. DCHECK(!cf_val ||
  25. CTFontGetTypeID() == CFGetTypeID(cf_val) ||
  26. - (_CFIsObjC(CTFontGetTypeID(), cf_val) &&
  27. - [ns_val isKindOfClass:[NSFont class]]));
  28. + ([ns_val isKindOfClass:[NSFont class]]));
  29. return ns_val;
  30. }
  31. @@ -398,9 +391,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
  32. return (CTFontRef)(cf_val);
  33. }
  34. - if (!_CFIsObjC(CTFontGetTypeID(), cf_val))
  35. - return NULL;
  36. -
  37. id<NSObject> ns_val = reinterpret_cast<id>(const_cast<void*>(cf_val));
  38. if ([ns_val isKindOfClass:[NSFont class]]) {
  39. return (CTFontRef)(cf_val);