1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
- From: Jeremy Apthorp <[email protected]>
- Date: Thu, 20 Sep 2018 17:49:20 -0700
- Subject: mas: avoid usage of _CFIsObjC
- Removes usage of the _CFIsObjC private API.
- diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
- index 11fa4bb6714518b98321d5e10919de3e01403efd..c9232593c08be04cb62fe7163a240cbed4f6e464 100644
- --- a/base/mac/foundation_util.mm
- +++ b/base/mac/foundation_util.mm
- @@ -31,12 +31,6 @@
- #if !BUILDFLAG(IS_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"
-
- @@ -328,8 +322,7 @@ void SetBaseBundleID(const char* new_base_bundle_id) {
- 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;
- }
-
- @@ -400,9 +393,6 @@ CTFontRef NSToCFCast(NSFont* ns_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);
|