Bug 175350 - [QuickLook] Use case-insensitive comparison of preview MIME types
Summary: [QuickLook] Use case-insensitive comparison of preview MIME types
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-08 15:45 PDT by Andy Estes
Modified: 2017-09-03 23:33 PDT (History)
10 users (show)

See Also:


Attachments
Patch (636.64 KB, patch)
2017-08-08 15:57 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews122 for ios-simulator-wk2 (6.76 MB, application/zip)
2017-08-08 19:56 PDT, Build Bot
no flags Details
Patch (646.43 KB, patch)
2017-08-08 21:15 PDT, Andy Estes
no flags Details | Formatted Diff | Diff
Patch (646.43 KB, patch)
2017-08-08 21:31 PDT, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Estes 2017-08-08 15:45:01 PDT
[QuickLook] Use case-insensitive comparison of preview MIME types
Comment 1 Andy Estes 2017-08-08 15:46:10 PDT
rdar://problem/33761159
Comment 2 Andy Estes 2017-08-08 15:57:16 PDT
Created attachment 317636 [details]
Patch
Comment 3 Build Bot 2017-08-08 19:56:53 PDT
Comment on attachment 317636 [details]
Patch

Attachment 317636 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/4281452

New failing tests:
quicklook/excel-macro-enabled.html
Comment 4 Build Bot 2017-08-08 19:56:55 PDT
Created attachment 317667 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.5
Comment 5 Andy Estes 2017-08-08 21:15:22 PDT
Created attachment 317674 [details]
Patch
Comment 6 Andy Estes 2017-08-08 21:31:04 PDT
Created attachment 317676 [details]
Patch
Comment 7 WebKit Commit Bot 2017-08-09 08:52:26 PDT
Comment on attachment 317676 [details]
Patch

Clearing flags on attachment: 317676

Committed r220456: <http://trac.webkit.org/changeset/220456>
Comment 8 WebKit Commit Bot 2017-08-09 08:52:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Darin Adler 2017-09-03 23:33:22 PDT
Comment on attachment 317636 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=317636&action=review

> Source/WebCore/loader/ios/PreviewLoader.mm:211
> +    static std::once_flag onceFlag;
> +    static NeverDestroyed<HashSet<String, ASCIICaseInsensitiveHash>> supportedMIMETypes;
> +    std::call_once(onceFlag, [] {
> +        for (NSString *mimeType in QLPreviewGetSupportedMIMETypesSet())
> +            supportedMIMETypes.get().add(mimeType);
> +    });

The use of std::call_once here seems like overkill. It’s not safe to use a set of strings on multiple threads so we don’t need to be thread-safe, so we should just be able to use a lambda to initialize.