Bug 193340

Summary: Cleanup possible WK*Copy/Create leaks in WebKitTestRunner
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Tools / TestsAssignee: Joseph Pecoraro <joepeck>
Severity: Normal CC: commit-queue, darin, ddkilzer, joepeck, lforschler, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2019-01-10 14:44:59 PST
Cleanup possible WK*Copy/Create leaks in WebKitTestRunner

Searching for lines with WK.*?Create / WK.*?Copy that don't use WKRetainPtr or improperly use it.
Comment 1 Joseph Pecoraro 2019-01-10 14:46:43 PST
Created attachment 358838 [details]
[PATCH] Proposed Fix
Comment 2 David Kilzer (:ddkilzer) 2019-01-11 12:54:06 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

Comment 3 WebKit Commit Bot 2019-01-11 13:04:15 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 358838

Committed r239871: <https://trac.webkit.org/changeset/239871>
Comment 4 WebKit Commit Bot 2019-01-11 13:04:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2019-01-11 13:05:28 PST
Comment 6 Darin Adler 2019-01-14 06:51:08 PST
Comment on attachment 358838 [details]
[PATCH] Proposed Fix

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

> Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:434
> +        WKRetainPtr<WKStringRef> totalPrevalentResourcesKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResources"));
> +        WKRetainPtr<WKStringRef> totalPrevalentResourcesWithUserInteractionKey(AdoptWK, WKStringCreateWithUTF8CString("TotalPrevalentResourcesWithUserInteraction"));
> +        WKRetainPtr<WKStringRef> top3SubframeUnderTopFrameOriginsKey(AdoptWK, WKStringCreateWithUTF8CString("Top3SubframeUnderTopFrameOrigins"));

Please use the adoptWK function, not the special AdoptWK constructor, in new code. We want to get rid of those special constructors some day.