[webkit-reviews] review granted: [Bug 233841] [iOS] Web content process sometimes crashes under WebPage::positionInformation() : [Attachment 445911] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 3 16:21:05 PST 2021


Geoffrey Garen <ggaren at apple.com> has granted Wenson Hsieh
<wenson_hsieh at apple.com>'s request for review:
Bug 233841: [iOS] Web content process sometimes crashes under
WebPage::positionInformation()
https://bugs.webkit.org/show_bug.cgi?id=233841

Attachment 445911: Patch

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




--- Comment #2 from Geoffrey Garen <ggaren at apple.com> ---
Comment on attachment 445911
  --> https://bugs.webkit.org/attachment.cgi?id=445911
Patch

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

r=me

> Tools/TestWebKitAPI/Tests/WebKitCocoa/ImageAnalysisTests.mm:87
> +static CGPoint gSwizzledLocationInView = CGPoint { 100, 100 };
>  static CGPoint swizzledLocationInView(id, SEL, UIView *)
>  {
> -    return CGPointMake(100, 100);
> +    return gSwizzledLocationInView;
>  }

Nit:

The most efficient thing to do here is "return CGPoint { 100, 100 }". On all
modern hardware, that will just fill two registers with constants and return.
Maybe that's the best thing to do.

If we do have a specific motivation to use a constant, I'd suggest putting the
static inside the function and marking it const, to reduce its scope /
potential for incorrect usage.


More information about the webkit-reviews mailing list