Regression(r229831): ProcessSwap.Basic API test is crashing
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2018 01:49:27 +0000 (01:49 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2018 01:49:27 +0000 (01:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183884

Reviewed by Brady Eidson.

This code should only be called for navigation policy decisions.
It used to work without this check because of an early return, which
was dropped in r229831.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp

index 4ec4d6d..7d5eeea 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-21  Chris Dumez  <cdumez@apple.com>
+
+        Regression(r229831): ProcessSwap.Basic API test is crashing
+        https://bugs.webkit.org/show_bug.cgi?id=183884
+
+        Reviewed by Brady Eidson.
+
+        This code should only be called for navigation policy decisions.
+        It used to work without this check because of an early return, which
+        was dropped in r229831.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::receivedPolicyDecision):
+
 2018-03-21  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
index 4a06eff..272d639 100644 (file)
@@ -2369,7 +2369,7 @@ void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy& fr
     }
 
     auto* activePolicyListener = frame.activePolicyListenerProxy();
-    if (activePolicyListener) {
+    if (activePolicyListener && activePolicyListener->policyListenerType() == PolicyListenerType::NavigationAction) {
         ASSERT(activePolicyListener->listenerID() == listenerID);
 
         if (action == PolicyAction::Use && navigation) {