[iOS] Delay process suspension for a while after loading an app link
https://bugs.webkit.org/show_bug.cgi?id=209686
<rdar://problem/60888891>

Reviewed by Darin Adler.

Client apps that rely on WebKit to open app links cannot call the [WKWebView _willOpenAppLink] SPI
that was added in r259146. Instead, we need to call WebPageProxy::willOpenAppLink() in
tryInterceptNavigation() when WebKit opens the AppLink itself.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::tryInterceptNavigation):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 7dde26d..735d9df 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2020-03-28  Chris Dumez  <cdumez@apple.com>
+
+        [iOS] Delay process suspension for a while after loading an app link
+        https://bugs.webkit.org/show_bug.cgi?id=209686
+        <rdar://problem/60888891>
+
+        Reviewed by Darin Adler.
+
+        Client apps that rely on WebKit to open app links cannot call the [WKWebView _willOpenAppLink] SPI
+        that was added in r259146. Instead, we need to call WebPageProxy::willOpenAppLink() in
+        tryInterceptNavigation() when WebKit opens the AppLink itself.
+
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::tryInterceptNavigation):
+
 2020-03-28  Alex Christensen  <achristensen@webkit.org>
 
         Deprecate injected bundle page group SPI
diff --git a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
index 70ab430..18726556 100644
--- a/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
+++ b/Source/WebKit/UIProcess/Cocoa/NavigationState.mm
@@ -507,6 +507,8 @@
                 trySOAuthorization(WTFMove(navigationAction), *weakPage, WTFMove(completionHandler));
                 return;
             }
+            if (success && weakPage)
+                weakPage->willOpenAppLink();
             completionHandler(success);
         });
         [LSAppLink openWithURL:url completionHandler:[localCompletionHandler](BOOL success, NSError *) {