Extract UTI mapping and allow for additions
<rdar://problem/49822339>
Created attachment 367231 [details] Patch
Comment on attachment 367231 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367231&action=review > Source/WebKit/Shared/ios/UTIMappings.mm:42 > +NSString *UTIforMIMEType(const String& mimeType) Seems like this should fold into UTIUtilities
Created attachment 367247 [details] Patch
Comment on attachment 367247 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367247&action=review > Source/WebCore/platform/network/mac/UTIUtilities.mm:89 > + static const auto map = makeNeverDestroyed([] { Why not just go straight to UTI instead of using CoreServices, if you're already hardcoding?
Committed r244201: <https://trac.webkit.org/changeset/244201>
Comment on attachment 367247 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367247&action=review > Source/WebCore/platform/network/mac/UTIUtilities.mm:112 > + return String(adoptCF(UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, mapEntry->value.createCFString().get(), nil)).get()); I don’t think the explicit String constructor is needed here. > Source/WebCore/platform/network/mac/UTIUtilities.mm:121 > + return String(type.get()); I don’t think the explicit String constructor is needed here.
Committed r244247: <https://trac.webkit.org/changeset/244247>
Comment on attachment 367247 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367247&action=review >> Source/WebCore/platform/network/mac/UTIUtilities.mm:121 >> + return String(type.get()); > > I don’t think the explicit String constructor is needed here. Fixed.