Bug 210894 - Soft link QuickLookThumbnailing framework
Summary: Soft link QuickLookThumbnailing framework
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: Nikos Mouchtaris
URL:
Keywords: InRadar
Depends on:
Blocks: 210814
  Show dependency treegraph
 
Reported: 2020-04-22 19:48 PDT by Nikos Mouchtaris
Modified: 2020-04-23 13:47 PDT (History)
3 users (show)

See Also:


Attachments
Patch (20.62 KB, patch)
2020-04-22 19:52 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (16.63 KB, patch)
2020-04-22 20:11 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (16.59 KB, patch)
2020-04-22 20:19 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff
Patch (16.68 KB, patch)
2020-04-23 10:21 PDT, Nikos Mouchtaris
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Mouchtaris 2020-04-22 19:48:50 PDT
Soft link QuickLookThumbnailing framework
Comment 1 Nikos Mouchtaris 2020-04-22 19:52:13 PDT
Created attachment 397306 [details]
Patch
Comment 2 Tim Horton 2020-04-22 19:59:05 PDT
Comment on attachment 397306 [details]
Patch

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

> Source/WebKit/Configurations/WebKit.xcconfig:130
> +//WK_QUICKLOOK_THUMBNAILING_LDFLAGS_macosx = $(WK_QUICKLOOK_THUMBNAILING_LDFLAGS$(WK_MACOS_1015));
> +//WK_QUICKLOOK_THUMBNAILING_LDFLAGS_MACOS_SINCE_1015 = -framework QuickLookThumbnailing;
> +//WK_QUICKLOOK_THUMBNAILING_LDFLAGS_iphoneos = -framework QuickLookThumbnailing;

You'll want to actually delete this, not just comment it out

> Source/WebKit/UIProcess/QuickLookThumbnailLoader.mm:79
> +        _filePath = adoptNS([[NSURL fileURLWithPath:fileURL] copy]);

No need for the adopt OR the copy: you can just assign an autoreleased NSURL (as returned by -fileURLWithPath) to a RetainPtr. It will retain it, and all will be well. The previous code was OK

> Source/WebKit/UIProcess/QuickLookThumbnailLoader.mm:95
> -        auto fileURLPath = adoptNS([NSURL fileURLWithPath:filePath]);
> +        auto fileURLPath = adoptNS([[NSURL fileURLWithPath:filePath] copy]);

THIS one was wrong, and will crash. Remove the adoptNS(), and don't add a copy (you only need adopt if you have a +1 object, returned by a -new or -alloc or -create -- NOT for an autoreleased object like here).

> Source/WebKit/UIProcess/QuickLookThumbnailLoader.mm:104
> +    req.get().iconMode = YES;

we generally prefer [req setIconMode:YES]; (normally we'd rather dot notation, but the .get(). is SO UGLY)

> Source/WebKit/UIProcess/QuickLookThumbnailingSPI.h:26
> +#if HAVE(QUICKLOOK_THUMBNAILING)

You don't actually need this SPI header! QuickLookThumbnailing is API, you can include the real header in QuickLookThumbnailingSoftLink, no problem. Soft linking is only about linking, it has no impact on whether or not you can include headers from the framework.
Comment 3 Nikos Mouchtaris 2020-04-22 20:11:38 PDT
Created attachment 397309 [details]
Patch
Comment 4 Nikos Mouchtaris 2020-04-22 20:19:53 PDT
Created attachment 397310 [details]
Patch
Comment 5 EWS 2020-04-22 21:05:31 PDT
Committed r260553: <https://trac.webkit.org/changeset/260553>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397310 [details].
Comment 6 Radar WebKit Bug Importer 2020-04-22 21:06:14 PDT
<rdar://problem/62229893>
Comment 7 Ryan Haddad 2020-04-22 23:12:48 PDT
This change broke iOS and Catalina builds:
/Volumes/Data/worker/iOS-13-Build-EWS/build/Source/WebKit/UIProcess/QuickLookThumbnailLoader.mm:97:46: error: property 'get' not found on object of type 'NSURL *'

https://build.webkit.org/builders/Apple-Catalina-Release-Build/builds/5902/steps/compile-webkit/logs/stdio

https://build.webkit.org/builders/Apple%20iOS%2013%20Simulator%20Release%20%28Build%29/builds/6353/steps/compile-webkit/logs/stdio
Comment 8 Ryan Haddad 2020-04-22 23:15:36 PDT
Reverted r260553 for reason:

Broke iOS and Catalina builds.

Committed r260558: <https://trac.webkit.org/changeset/260558>
Comment 9 Nikos Mouchtaris 2020-04-23 10:21:47 PDT
Created attachment 397356 [details]
Patch
Comment 10 EWS 2020-04-23 10:49:04 PDT
Committed r260581: <https://trac.webkit.org/changeset/260581>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397356 [details].