2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
|
|
Date: Thu, 20 Sep 2018 17:49:20 -0700
|
2021-05-19 18:20:12 +00:00
|
|
|
Subject: mas: avoid usage of _CFIsObjC
|
2018-09-21 00:30:26 +00:00
|
|
|
|
|
|
|
Removes usage of the _CFIsObjC private API.
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
|
2020-10-16 01:30:41 +00:00
|
|
|
index e63f0ec0e2e618a4b280a08d14a619e1186e0466..225c6b83515c7b530ac59b1af7ac2194483f0311 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/base/mac/foundation_util.mm
|
|
|
|
+++ b/base/mac/foundation_util.mm
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -29,12 +29,6 @@
|
2018-09-14 18:03:43 +00:00
|
|
|
#if !defined(OS_IOS)
|
2018-09-14 05:02:16 +00:00
|
|
|
CFTypeID SecACLGetTypeID();
|
|
|
|
CFTypeID SecTrustedApplicationGetTypeID();
|
2020-05-26 20:06:26 +00:00
|
|
|
-// 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.
|
2018-09-14 05:02:16 +00:00
|
|
|
-Boolean _CFIsObjC(CFTypeID typeID, CFTypeRef obj);
|
|
|
|
#endif
|
2018-09-14 18:03:43 +00:00
|
|
|
} // extern "C"
|
2018-09-14 05:02:16 +00:00
|
|
|
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -327,8 +321,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) {
|
2018-09-14 05:02:16 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-10-16 01:30:41 +00:00
|
|
|
@@ -399,9 +392,6 @@ CTFontRef NSToCFCast(NSFont* ns_val) {
|
2018-09-14 05:02:16 +00:00
|
|
|
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);
|