From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Thu, 20 Sep 2018 17:49:20 -0700 Subject: mas-cfisobjc.patch Removes usage of the _CFIsObjC private API. diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm index f37884f6f70e230555e1e0eb7585e108fd8015d6..4c7726c2cb1afbfd43518159d126a58fa1515c1e 100644 --- a/base/mac/foundation_util.mm +++ b/base/mac/foundation_util.mm @@ -27,12 +27,6 @@ CFTypeID SecKeyGetTypeID(); #if !defined(OS_IOS) CFTypeID SecACLGetTypeID(); CFTypeID SecTrustedApplicationGetTypeID(); -// The NSFont/CTFont toll-free bridging is broken before 10.15. -// http://www.openradar.me/15341349 rdar://15341349 -// -// TODO(https://crbug.com/1076527): This is fixed in 10.15. When 10.15 is the -// minimum OS for Chromium, remove this SPI declaration. -Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj); #endif } // extern "C" @@ -325,8 +319,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) { const_cast(reinterpret_cast(cf_val)); DCHECK(!cf_val || CTFontGetTypeID() == CFGetTypeID(cf_val) || - (_CFIsObjC(CTFontGetTypeID(), cf_val) && - [ns_val isKindOfClass:[NSFont class]])); + ([ns_val isKindOfClass:[NSFont class]])); return ns_val; } @@ -397,9 +390,6 @@ CFCast(const CFTypeRef& cf_val) { return (CTFontRef)(cf_val); } - if (!_CFIsObjC(CTFontGetTypeID(), cf_val)) - return NULL; - id ns_val = reinterpret_cast(const_cast(cf_val)); if ([ns_val isKindOfClass:[NSFont class]]) { return (CTFontRef)(cf_val);