4669995: Remove CFToNSCast and NSToCFCast

https://chromium-review.googlesource.com/c/chromium/src/+/4669995
This commit is contained in:
John Kleinschmidt 2023-07-10 18:51:33 -04:00
Родитель 30ecab32cb
Коммит 38e145f33d
Не найден ключ, соответствующий данной подписи
2 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -20,7 +20,9 @@ std::string ApplicationInfoDictionaryValue(NSString* key) {
}
std::string ApplicationInfoDictionaryValue(CFStringRef key) {
return ApplicationInfoDictionaryValue(base::mac::CFToNSCast(key));
NSString* key_ns =
const_cast<NSString*>(reinterpret_cast<const NSString*>(key));
return ApplicationInfoDictionaryValue(key_ns);
}
} // namespace

Просмотреть файл

@ -30,8 +30,9 @@ namespace {
// thread safe, including LSGetApplicationForURL (> 10.2) and
// NSWorkspace#openURLs.
std::string OpenURL(NSURL* ns_url, bool activate) {
CFURLRef ref = LSCopyDefaultApplicationURLForURL(
base::mac::NSToCFCast(ns_url), kLSRolesAll, nullptr);
CFURLRef cf_url = reinterpret_cast<CFURLRef>(ns_url);
CFURLRef ref =
LSCopyDefaultApplicationURLForURL(cf_url, kLSRolesAll, nullptr);
// If no application could be found, NULL is returned and outError
// (if not NULL) is populated with kLSApplicationNotFoundErr.