Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2019 19:54:19 +0000 (19:54 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2019 19:54:19 +0000 (19:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194640
<rdar://problem/48064140>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241558 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/NavigationState.mm

index 008f9d6..b8c8e9b 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-14  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Handle _WKNavigationActionPolicyAllowWithoutTryingAppLink for LoadOptimizer
+        https://bugs.webkit.org/show_bug.cgi?id=194640
+        <rdar://problem/48064140>
+
+        Reviewed by Brent Fulgham.
+
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
+
 2019-02-14  Chris Dumez  <cdumez@apple.com>
 
         [PSON] Introduce a WebContent Process cache
index b050b6d..44032e8 100644 (file)
@@ -589,7 +589,14 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP
             localListener->download();
             break;
         case _WKNavigationActionPolicyAllowWithoutTryingAppLink:
-            localListener->use(apiWebsitePolicies.get());
+            tryOptimizingLoad(navigationAction->request(), webPageProxy, [localListener = WTFMove(localListener), websitePolicies = WTFMove(apiWebsitePolicies)] (bool optimizedLoad) {
+                if (optimizedLoad) {
+                    localListener->ignore();
+                    return;
+                }
+
+                localListener->use(websitePolicies.get());
+            });
             break;
         }
     };