[webkit-reviews] review granted: [Bug 222060] Reduce explicit usage of [objC autorelease] in WebKit even further : [Attachment 420764] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 17 18:06:07 PST 2021


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 222060: Reduce explicit usage of [objC autorelease] in WebKit even further
https://bugs.webkit.org/show_bug.cgi?id=222060

Attachment 420764: Patch

https://bugs.webkit.org/attachment.cgi?id=420764&action=review




--- Comment #7 from Darin Adler <darin at apple.com> ---
Comment on attachment 420764
  --> https://bugs.webkit.org/attachment.cgi?id=420764
Patch

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

> Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm:298
> +	   _title = adoptNS([(NSString *)title.get() copy]);

I don’t think we need a copy here. I would write:

    _title = (NSString *)title.get();

> Source/WebKitLegacy/ios/WebView/WebPDFViewIOS.mm:299
> +	   core([self _frame])->loader().client().dispatchDidReceiveTitle({
title.bridgingAutorelease(), TextDirection::LTR });

Should just use _title.get() here instead of title.bridgingAutorelease().

> Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm:1953
> +		   return adoptRef(new
NetscapePluginWidget(pluginView.autorelease()));

get()

> Source/WebKitLegacy/mac/WebView/WebFrameView.mm:372
> +    [scrollView setContentView:adoptNS([[WebClipView alloc]
initWithFrame:[scrollView bounds]]).autorelease()];

get()

> Source/WebKitLegacy/mac/WebView/WebFrameView.mm:1232
> +    [scrollView setContentView:adoptNS([[WebClipView alloc]
initWithFrame:[scrollView bounds]]).autorelease()];

get()

> Tools/TestRunnerShared/cocoa/LayoutTestSpellChecker.mm:251
> +	       [resultsForWord addObject:adoptNS([[LayoutTestTextCheckingResult
alloc] initWithType:nsTextCheckingType(typeValue.get())
range:NSMakeRange(fromValue, toValue - fromValue) replacement:(__bridge
NSString *)replacementText.get() details:details.get()]).autorelease()];

get()

>
Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcessCrashNonPersistentDataStore
.mm:87
> +    checkRecoveryAfterCrash(adoptNS([[WKWebsiteDataStore alloc]
_initWithConfiguration:adoptNS([[_WKWebsiteDataStoreConfiguration alloc]
init]).autorelease()]).autorelease());

get(), get()


More information about the webkit-reviews mailing list