RESOLVED FIXED 196822
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
Summary Extract UTI mapping and allow for additions
Dean Jackson
Reported 2019-04-11 12:08:02 PDT
Extract UTI mapping and allow for additions
Attachments
Patch (16.33 KB, patch)
2019-04-11 12:13 PDT, Dean Jackson
no flags
Patch (7.68 KB, patch)
2019-04-11 15:04 PDT, Dean Jackson
thorton: review+
Radar WebKit Bug Importer
Comment 1 2019-04-11 12:08:32 PDT
Dean Jackson
Comment 2 2019-04-11 12:13:17 PDT
Tim Horton
Comment 3 2019-04-11 12:15:35 PDT
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
Dean Jackson
Comment 4 2019-04-11 15:04:39 PDT
Tim Horton
Comment 5 2019-04-11 15:20:00 PDT
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?
Dean Jackson
Comment 6 2019-04-11 16:13:55 PDT
Darin Adler
Comment 7 2019-04-12 09:12:21 PDT
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.
Dean Jackson
Comment 8 2019-04-14 13:14:28 PDT
Dean Jackson
Comment 9 2019-04-14 13:14:54 PDT
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.
Note You need to log in before you can comment on or make changes to this bug.