mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1692663 - Replace LSCopyKindStringForMIMEType by UTTypeCopyDescription in nsOSHelperAppService.mm r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D105101
This commit is contained in:
parent
cb0b96820e
commit
d5d9dcef4c
@ -532,10 +532,9 @@ nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
||||
}
|
||||
}
|
||||
|
||||
CFStringRef cfType = ::CFStringCreateWithCString(NULL, mimeType.get(), kCFStringEncodingUTF8);
|
||||
if (cfType) {
|
||||
CFStringRef cfTypeDesc = NULL;
|
||||
if (::LSCopyKindStringForMIMEType(cfType, &cfTypeDesc) == noErr) {
|
||||
if (CFStringRef cfType =
|
||||
::CFStringCreateWithCString(NULL, mimeType.get(), kCFStringEncodingUTF8)) {
|
||||
if (CFStringRef cfTypeDesc = ::UTTypeCopyDescription(cfType)) {
|
||||
AutoTArray<UniChar, 255> buffer;
|
||||
CFIndex typeDescLength = ::CFStringGetLength(cfTypeDesc);
|
||||
buffer.SetLength(typeDescLength);
|
||||
@ -543,8 +542,6 @@ nsresult nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
|
||||
nsAutoString typeDesc;
|
||||
typeDesc.Assign(reinterpret_cast<char16_t*>(buffer.Elements()), typeDescLength);
|
||||
mimeInfoMac->SetDescription(typeDesc);
|
||||
}
|
||||
if (cfTypeDesc) {
|
||||
::CFRelease(cfTypeDesc);
|
||||
}
|
||||
::CFRelease(cfType);
|
||||
|
Loading…
x
Reference in New Issue
Block a user