electron/patches/common/chromium/mas-cfisobjc.patch
2019-03-08 15:04:32 -08:00

39 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
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 26a40417ae92c2e12c3901c50e1f101d9b0f57e9..810fbeae866a1507762703296fdd836dd3c9e4ba 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -26,7 +26,6 @@ CFTypeID SecKeyGetTypeID();
#if !defined(OS_IOS)
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
-Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
#endif
} // extern "C"
@@ -326,8 +325,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
const_cast<NSFont*>(reinterpret_cast<const NSFont*>(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;
}
@@ -395,9 +393,6 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
return (CTFontRef)(cf_val);
}
- if (!_CFIsObjC(CTFontGetTypeID(), cf_val))
- return NULL;
-
id<NSObject> ns_val = reinterpret_cast<id>(const_cast<void*>(cf_val));
if ([ns_val isKindOfClass:[NSFont class]]) {
return (CTFontRef)(cf_val);