electron/patches/common/chromium/mas-cfisobjc.patch
Jeremy Apthorp 76c5f5cc8a
build: move libcc patches to electron repo (#14104)
In the GN build, libchromiumcontent is no longer a distinct library, but
merely a container for a set of scripts and patches. Maintaining those
patches in a separate repository is tedious and error-prone, so merge
them into the main repo.

Once this is merged and GN is the default way to build Electron, the
libchromiumcontent repository can be archived.
2018-09-13 22:02:16 -07:00

44 lines
1.3 KiB
Diff

From 9fb1ac04b1a3e7ec53e27cf1f413469d04360d1e Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <jeremya@chromium.org>
Date: Mon, 6 Aug 2018 17:11:14 -0700
Subject: fix: [mas] remove usage of _CFIsObjC
---
base/mac/foundation_util.mm | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index aec8c0f6398c..6a6dfc272d45 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -25,7 +25,6 @@
extern "C" {
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
-Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
} // extern "C"
#endif
@@ -323,8 +322,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;
}
@@ -392,9 +390,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);
--
2.17.0