Changeset 234276 in webkit


Ignore:
Timestamp:
Jul 26, 2018 2:44:05 PM (6 years ago)
Author:
achristensen@apple.com
Message:

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):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r234272 r234276  
     12018-07-26  Alex Christensen  <achristensen@webkit.org>
     2
     3        Fix assertions introduced in r234210
     4        https://bugs.webkit.org/show_bug.cgi?id=188074
     5
     6        Reviewed by Chris Dumez.
     7
     8        There is a client that uses WKFramePolicyListenerUseWithPolicies to send website policies as
     9        a response to the WKPageNavigationClient's decidePolicyForNavigationResponse.  That is wasting
     10        effort to generate policies that don't change anything. Once that client adopts WKWebView
     11        they won't be able to do this any more, so temporarily remove the assertion.
     12        Also, make the assertion about process swapping a release assert to prevent that client
     13        from adopting WKFramePolicyListenerUseInNewProcessWithPolicies for navigation responses.
     14        It should only be used for navigation actions.
     15
     16        * UIProcess/WebPageProxy.cpp:
     17        (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
     18        (WebKit::WebPageProxy::decidePolicyForResponse):
     19
    1202018-07-26  Commit Queue  <commit-queue@webkit.org>
    221
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r234268 r234276  
    40834083    MESSAGE_CHECK_URL(request.url());
    40844084
    4085     auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frame = makeRef(*frame)] (WebCore::PolicyAction policyAction, API::WebsitePolicies* policies, ShouldProcessSwapIfPossible swap) {
    4086         ASSERT_UNUSED(policies, !policies);
    4087         ASSERT_UNUSED(swap, swap == ShouldProcessSwapIfPossible::No);
     4085    auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frame = makeRef(*frame)] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ShouldProcessSwapIfPossible swap) {
     4086        // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
     4087        RELEASE_ASSERT(swap == ShouldProcessSwapIfPossible::No);
    40884088        receivedPolicyDecision(policyAction, frame.get(), listenerID, nullptr, std::nullopt);
    40894089    }));
     
    41164116
    41174117    RefPtr<API::Navigation> navigation = navigationID ? &m_navigationState->navigation(navigationID) : nullptr;
    4118     auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(*frame), listenerID, navigation = WTFMove(navigation)] (WebCore::PolicyAction policyAction, API::WebsitePolicies* policies, ShouldProcessSwapIfPossible swap) {
    4119         ASSERT_UNUSED(policies, !policies);
    4120         ASSERT_UNUSED(swap, swap == ShouldProcessSwapIfPossible::No);
     4118    auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(*frame), listenerID, navigation = WTFMove(navigation)] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ShouldProcessSwapIfPossible swap) {
     4119        // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
     4120        RELEASE_ASSERT(swap == ShouldProcessSwapIfPossible::No);
    41214121        receivedPolicyDecision(policyAction, frame.get(), listenerID, navigation.get(), std::nullopt);
    41224122    }));
Note: See TracChangeset for help on using the changeset viewer.