[webkit-reviews] review granted: [Bug 222634] Use adoptNS() right away after calling [obj copy] / [obj mutableCopy] : [Attachment 422020] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 3 13:02:18 PST 2021


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 222634: Use adoptNS() right away after calling [obj copy] / [obj
mutableCopy]
https://bugs.webkit.org/show_bug.cgi?id=222634

Attachment 422020: Patch

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




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

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

> Source/WebCore/platform/cocoa/SystemVersion.mm:40
> -    return [[systemVersionInfo objectForKey:@"ProductVersion"] copy];
> +    return [systemVersionInfo objectForKey:@"ProductVersion"];

What’s the rationale for moving from copy to retain here?

I’m not saying it’s wrong, but we are removing the copy. That means if it
happens to be a mutable dictionary we will keep a pointer to it rather than
making an immutable copy. I could imagine making the copy in an effort to avoid
things being mutated under us or perhaps to optimize memory use since the
immutable copy could be smaller.

> Source/WebKit/Shared/ApplePay/ApplePayPaymentSetupFeatures.mm:74
> +	   allowedClasses.get() = WTFMove(allowed);

What’s the rationale for moving from copy to retain here?

> Source/WebKit/Shared/ApplePay/PaymentSetupConfiguration.mm:93
> +	   allowedClasses.get() = WTFMove(allowed);

What’s the rationale for moving from copy to retain here?

> Source/WebKit/Shared/ApplePay/cocoa/PaymentSetupConfiguration.mm:70
> +	   allowedClasses.get() = WTFMove(allowed);

What’s the rationale for moving from copy to retain here?

> Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm:110
> -    }() copy];
> +    }());

What’s the rationale for moving from copy to retain here?


More information about the webkit-reviews mailing list