Modified: trunk/Source/WebKit/ChangeLog (234275 => 234276)
--- trunk/Source/WebKit/ChangeLog 2018-07-26 21:34:27 UTC (rev 234275)
+++ trunk/Source/WebKit/ChangeLog 2018-07-26 21:44:05 UTC (rev 234276)
@@ -1,3 +1,22 @@
+2018-07-26 Alex Christensen <[email protected]>
+
+ Fix assertions introduced in r234210
+ https://bugs.webkit.org/show_bug.cgi?id=188074
+
+ Reviewed by Chris Dumez.
+
+ There is a client that uses WKFramePolicyListenerUseWithPolicies to send website policies as
+ a response to the WKPageNavigationClient's decidePolicyForNavigationResponse. That is wasting
+ effort to generate policies that don't change anything. Once that client adopts WKWebView
+ they won't be able to do this any more, so temporarily remove the assertion.
+ Also, make the assertion about process swapping a release assert to prevent that client
+ from adopting WKFramePolicyListenerUseInNewProcessWithPolicies for navigation responses.
+ It should only be used for navigation actions.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
+ (WebKit::WebPageProxy::decidePolicyForResponse):
+
2018-07-26 Commit Queue <[email protected]>
Unreviewed, rolling out r234181 and r234189.
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (234275 => 234276)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-07-26 21:34:27 UTC (rev 234275)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-07-26 21:44:05 UTC (rev 234276)
@@ -4082,9 +4082,9 @@
MESSAGE_CHECK(frame);
MESSAGE_CHECK_URL(request.url());
- auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frame = makeRef(*frame)] (WebCore::PolicyAction policyAction, API::WebsitePolicies* policies, ShouldProcessSwapIfPossible swap) {
- ASSERT_UNUSED(policies, !policies);
- ASSERT_UNUSED(swap, swap == ShouldProcessSwapIfPossible::No);
+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frame = makeRef(*frame)] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ShouldProcessSwapIfPossible swap) {
+ // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
+ RELEASE_ASSERT(swap == ShouldProcessSwapIfPossible::No);
receivedPolicyDecision(policyAction, frame.get(), listenerID, nullptr, std::nullopt);
}));
@@ -4115,9 +4115,9 @@
MESSAGE_CHECK_URL(response.url());
RefPtr<API::Navigation> navigation = navigationID ? &m_navigationState->navigation(navigationID) : nullptr;
- auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(*frame), listenerID, navigation = WTFMove(navigation)] (WebCore::PolicyAction policyAction, API::WebsitePolicies* policies, ShouldProcessSwapIfPossible swap) {
- ASSERT_UNUSED(policies, !policies);
- ASSERT_UNUSED(swap, swap == ShouldProcessSwapIfPossible::No);
+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(*frame), listenerID, navigation = WTFMove(navigation)] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ShouldProcessSwapIfPossible swap) {
+ // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
+ RELEASE_ASSERT(swap == ShouldProcessSwapIfPossible::No);
receivedPolicyDecision(policyAction, frame.get(), listenerID, navigation.get(), std::nullopt);
}));