mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
4669995: Remove CFToNSCast and NSToCFCast
https://chromium-review.googlesource.com/c/chromium/src/+/4669995
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user