Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: base/mac/foundation_util.mm

Issue 1928233002: Remove calls to NSClassFromString while casting NSFont via foundation_util (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/foundation_util.mm
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 6ae5df3389977a2268567f062d540d5d11418434..d872fc35d3abf7db40baf700aa1367320f4910fb 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -18,6 +18,10 @@
#include "build/build_config.h"
#if !defined(OS_IOS)
+#import <AppKit/AppKit.h>
+#endif
+
+#if !defined(OS_IOS)
extern "C" {
CFTypeID SecACLGetTypeID();
CFTypeID SecTrustedApplicationGetTypeID();
@@ -316,7 +320,7 @@ NSFont* CFToNSCast(CTFontRef cf_val) {
DCHECK(!cf_val ||
CTFontGetTypeID() == CFGetTypeID(cf_val) ||
(_CFIsObjC(CTFontGetTypeID(), cf_val) &&
- [ns_val isKindOfClass:NSClassFromString(@"NSFont")]));
+ [ns_val isKindOfClass:[NSFont class]]));
return ns_val;
}
@@ -324,7 +328,7 @@ CTFontRef NSToCFCast(NSFont* ns_val) {
CTFontRef cf_val = reinterpret_cast<CTFontRef>(ns_val);
DCHECK(!cf_val ||
CTFontGetTypeID() == CFGetTypeID(cf_val) ||
- [ns_val isKindOfClass:NSClassFromString(@"NSFont")]);
+ [ns_val isKindOfClass:[NSFont class]]);
return cf_val;
}
#endif
@@ -388,7 +392,7 @@ CFCast<CTFontRef>(const CFTypeRef& cf_val) {
return NULL;
id<NSObject> ns_val = reinterpret_cast<id>(const_cast<void*>(cf_val));
- if ([ns_val isKindOfClass:NSClassFromString(@"NSFont")]) {
+ if ([ns_val isKindOfClass:[NSFont class]]) {
return (CTFontRef)(cf_val);
}
return NULL;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698