Bug 211197 - REGRESSION (r246395): Leak of ARQuickLookPreviewItem and ARQuickLookWebKitItem in -[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]
Summary: REGRESSION (r246395): Leak of ARQuickLookPreviewItem and ARQuickLookWebKitIte...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on: 198812
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-29 12:20 PDT by David Kilzer (:ddkilzer)
Modified: 2020-04-29 16:28 PDT (History)
3 users (show)

See Also:


Attachments
Patch v1 (2.28 KB, patch)
2020-04-29 12:24 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (2.34 KB, patch)
2020-04-29 12:36 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch for landing (2.33 KB, patch)
2020-04-29 15:10 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2020-04-29 12:20:08 PDT
Leak of ARQuickLookPreviewItem and ARQuickLookWebKitItem in -[_WKPreviewControllerDataSource previewController:previewItemAtIndex:].

Regressed in r246395 for Bug 198812.
Comment 1 Radar WebKit Bug Importer 2020-04-29 12:20:23 PDT
<rdar://problem/62612483>
Comment 2 David Kilzer (:ddkilzer) 2020-04-29 12:24:28 PDT
Created attachment 397985 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2020-04-29 12:36:53 PDT
Created attachment 397988 [details]
Patch v2
Comment 4 David Kilzer (:ddkilzer) 2020-04-29 12:37:22 PDT
(In reply to David Kilzer (:ddkilzer) from comment #3)
> Created attachment 397988 [details]
> Patch v2

Fixed build error:

-    previewItem.canonicalWebPageURL = _originatingPageURL;
+    previewItem.get().canonicalWebPageURL = _originatingPageURL;
Comment 5 Darin Adler 2020-04-29 13:49:05 PDT
Comment on attachment 397988 [details]
Patch v2

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

> Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:113
> +    previewItem.get().canonicalWebPageURL = _originatingPageURL;

Some WebKit contributors prefer this style to sidestep the get():

    [previewItem setCanonicalWebPageURL:_originatingPageURL];
Comment 6 David Kilzer (:ddkilzer) 2020-04-29 13:50:33 PDT
Comment on attachment 397988 [details]
Patch v2

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

>> Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:113
>> +    previewItem.get().canonicalWebPageURL = _originatingPageURL;
> 
> Some WebKit contributors prefer this style to sidestep the get():
> 
>     [previewItem setCanonicalWebPageURL:_originatingPageURL];

Wasn't sure if new-style Objective-C setters (with .get()) were preferred over old-style setter syntax (but no .get()).
Comment 7 Darin Adler 2020-04-29 14:06:49 PDT
Comment on attachment 397988 [details]
Patch v2

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

>>> Source/WebKit/UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:113
>>> +    previewItem.get().canonicalWebPageURL = _originatingPageURL;
>> 
>> Some WebKit contributors prefer this style to sidestep the get():
>> 
>>     [previewItem setCanonicalWebPageURL:_originatingPageURL];
> 
> Wasn't sure if new-style Objective-C setters (with .get()) were preferred over old-style setter syntax (but no .get()).

Tim Horton was the one who explained the lack of Objective-C setters in another patch, by citing this.
Comment 8 David Kilzer (:ddkilzer) 2020-04-29 15:10:05 PDT
Created attachment 397999 [details]
Patch for landing
Comment 9 David Kilzer (:ddkilzer) 2020-04-29 16:04:41 PDT
Comment on attachment 397999 [details]
Patch for landing

Marking cq+ because "Patch v2" has passed all tests except one ios-wk2 test (fast/text/text-indent-inside-float.html) which this patch is not likely to have affected.
Comment 10 EWS 2020-04-29 16:08:06 PDT
Committed r260922: <https://trac.webkit.org/changeset/260922>

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