[webkit-reviews] review granted: [Bug 209686] [iOS] Delay process suspension for a while after loading an app link : [Attachment 394765] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 27 15:49:42 PDT 2020


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 209686: [iOS] Delay process suspension for a while after loading an app
link
https://bugs.webkit.org/show_bug.cgi?id=209686

Attachment 394765: Patch

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




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

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

> Source/WebKit/ChangeLog:13
> +	   This patch adds a [WKWebView _willOpenAppLink] SPI that the client
needs to call before opening the
> +	   app link.

Why SPI instead of API?

> Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:1550
> +    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(25 *
NSEC_PER_SEC)), dispatch_get_main_queue(), [weakThis = makeWeakPtr(*this)] {

Seems like typecasting 25 seconds to int64_t *after* doing the multiplication
is too late to avoid overflow. I understand know why a typecast is needed at
all, but if one is needed, I’d think we’d need to cast before doing the math.

The comment should explain where the 25 second duration comes from, its
rationale, so someone doesn’t just change it randomly later without
understanding how we chose 25 seconds.


More information about the webkit-reviews mailing list