⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259695 in webkit


Ignore:
Timestamp:
Apr 7, 2020, 5:43:11 PM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r259615. rdar://problem/61360282

Create a way to signal if the WKAppBoundDomains list is empty
https://bugs.webkit.org/show_bug.cgi?id=210074
<rdar://problem/61359228>

Reviewed by Brent Fulgham.

Updates the WebFramePolicyListener to return an Optional<NavigatingToAppBoundDomain>
to signal if the WKAppBoundDomains list is empty. If so, we don't want to update
any app-bound domain parameters in WebPageProxy.

  • UIProcess/WebFramePolicyListenerProxy.cpp: (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult):
  • UIProcess/WebFramePolicyListenerProxy.h:
  • UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
  • UIProcess/WebFrameProxy.h:
  • UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponseShared):
  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: (WebKit::WebsiteDataStore::beginAppBoundDomainCheck): Changed the WebFramePolicyListener to take a NavigatingToAppBoundDomain type as opposed to a boolean to allow it to handle the empty value.

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

Location:
branches/safari-610.1.9-branch/Source/WebKit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610.1.9-branch/Source/WebKit/ChangeLog

    r259541 r259695  
     12020-04-07  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259615. rdar://problem/61360282
     4
     5    Create a way to signal if the WKAppBoundDomains list is empty
     6    https://bugs.webkit.org/show_bug.cgi?id=210074
     7    <rdar://problem/61359228>
     8   
     9    Reviewed by Brent Fulgham.
     10   
     11    Updates the WebFramePolicyListener to return an Optional<NavigatingToAppBoundDomain>
     12    to signal if the WKAppBoundDomains list is empty. If so, we don't want to update
     13    any app-bound domain parameters in WebPageProxy.
     14   
     15    * UIProcess/WebFramePolicyListenerProxy.cpp:
     16    (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult):
     17    * UIProcess/WebFramePolicyListenerProxy.h:
     18    * UIProcess/WebFrameProxy.cpp:
     19    (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
     20    * UIProcess/WebFrameProxy.h:
     21    * UIProcess/WebPageProxy.cpp:
     22    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     23    (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
     24    (WebKit::WebPageProxy::decidePolicyForResponseShared):
     25    * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     26    (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
     27    Changed the WebFramePolicyListener to take a NavigatingToAppBoundDomain
     28    type as opposed to a boolean to allow it to handle the empty value.
     29   
     30   
     31    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     32
     33    2020-04-06  Kate Cheney  <katherine_cheney@apple.com>
     34
     35            Create a way to signal if the WKAppBoundDomains list is empty
     36            https://bugs.webkit.org/show_bug.cgi?id=210074
     37            <rdar://problem/61359228>
     38
     39            Reviewed by Brent Fulgham.
     40
     41            Updates the WebFramePolicyListener to return an Optional<NavigatingToAppBoundDomain>
     42            to signal if the WKAppBoundDomains list is empty. If so, we don't want to update
     43            any app-bound domain parameters in WebPageProxy.
     44
     45            * UIProcess/WebFramePolicyListenerProxy.cpp:
     46            (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult):
     47            * UIProcess/WebFramePolicyListenerProxy.h:
     48            * UIProcess/WebFrameProxy.cpp:
     49            (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
     50            * UIProcess/WebFrameProxy.h:
     51            * UIProcess/WebPageProxy.cpp:
     52            (WebKit::WebPageProxy::decidePolicyForNavigationAction):
     53            (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
     54            (WebKit::WebPageProxy::decidePolicyForResponseShared):
     55            * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     56            (WebKit::WebsiteDataStore::beginAppBoundDomainCheck):
     57            Changed the WebFramePolicyListener to take a NavigatingToAppBoundDomain
     58            type as opposed to a boolean to allow it to handle the empty value.
     59
    1602020-04-04  Wenson Hsieh  <wenson_hsieh@apple.com>
    261
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp

    r258054 r259695  
    4747WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy() = default;
    4848
    49 void WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult(bool isNavigatingToAppBoundDomain)
     49void WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult(Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain)
    5050{
    5151    ASSERT(RunLoop::isMain());
    5252
    53     auto isAppBound = isNavigatingToAppBoundDomain ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No;
    5453    if (m_policyResult && m_safeBrowsingWarning) {
    5554        if (m_reply)
    56             m_reply(WebCore::PolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(*m_safeBrowsingWarning), isAppBound);
     55            m_reply(WebCore::PolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(*m_safeBrowsingWarning), isNavigatingToAppBoundDomain);
    5756    } else
    58         m_isNavigatingToAppBoundDomain = isAppBound;
     57        m_isNavigatingToAppBoundDomain = isNavigatingToAppBoundDomain;
    5958}
    6059
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h

    r258054 r259695  
    4747public:
    4848
    49     using Reply = CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, NavigatingToAppBoundDomain)>;
     49    using Reply = CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, Optional<NavigatingToAppBoundDomain>)>;
    5050    static Ref<WebFramePolicyListenerProxy> create(Reply&& reply, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult)
    5151    {
     
    5959   
    6060    void didReceiveSafeBrowsingResults(RefPtr<SafeBrowsingWarning>&&);
    61     void didReceiveAppBoundDomainResult(bool);
     61    void didReceiveAppBoundDomainResult(Optional<NavigatingToAppBoundDomain>);
    6262
    6363private:
     
    6666    Optional<std::pair<RefPtr<API::WebsitePolicies>, ProcessSwapRequestedByClient>> m_policyResult;
    6767    Optional<RefPtr<SafeBrowsingWarning>> m_safeBrowsingWarning;
    68     Optional<NavigatingToAppBoundDomain> m_isNavigatingToAppBoundDomain;
     68    Optional<Optional<NavigatingToAppBoundDomain>> m_isNavigatingToAppBoundDomain;
    6969    Reply m_reply;
    7070};
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFrameProxy.cpp

    r258054 r259695  
    194194}
    195195
    196 WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, NavigatingToAppBoundDomain)>&& completionHandler, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult)
     196WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, Optional<NavigatingToAppBoundDomain>)>&& completionHandler, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult)
    197197{
    198198    if (m_activeListener)
    199199        m_activeListener->ignore();
    200     m_activeListener = WebFramePolicyListenerProxy::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (PolicyAction action, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain) mutable {
     200    m_activeListener = WebFramePolicyListenerProxy::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (PolicyAction action, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) mutable {
    201201        completionHandler(action, policies, processSwapRequestedByClient, WTFMove(safeBrowsingWarning), isNavigatingToAppBoundDomain);
    202202        m_activeListener = nullptr;
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFrameProxy.h

    r258054 r259695  
    121121    void didChangeTitle(const String&);
    122122
    123     WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, NavigatingToAppBoundDomain)>&&, ShouldExpectSafeBrowsingResult, ShouldExpectAppBoundDomainResult);
     123    WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, Optional<NavigatingToAppBoundDomain>)>&&, ShouldExpectSafeBrowsingResult, ShouldExpectAppBoundDomainResult);
    124124
    125125#if ENABLE(CONTENT_FILTERING)
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r259523 r259695  
    51045104#endif
    51055105   
    5106     auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, NavigatingToAppBoundDomain isAppBoundDomain) mutable {
    5107 
    5108         if (policyAction != PolicyAction::Ignore)
    5109             setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), isAppBoundDomain);
     5106    auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isAppBoundDomain) mutable {
     5107
     5108        if (policyAction != PolicyAction::Ignore && isAppBoundDomain)
     5109            setIsNavigatingToAppBoundDomain(frame->isMainFrame(), navigation->currentRequest().url(), *isAppBoundDomain);
    51105110
    51115111        auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable {
     
    52915291    MESSAGE_CHECK_URL(m_process, request.url());
    52925292
    5293     auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), identifier, listenerID, frameID] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain) mutable {
     5293    auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), identifier, listenerID, frameID] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) mutable {
    52945294        // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
    52955295        RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No);
     
    53395339    RefPtr<API::Navigation> navigation = navigationID ? m_navigationState->navigation(navigationID) : nullptr;
    53405340    auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), webPageID, frameID, identifier, listenerID, navigation = WTFMove(navigation),
    5341         process = process.copyRef()] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain) mutable {
     5341        process = process.copyRef()] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) mutable {
    53425342        // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away.
    53435343        RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No);
  • branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r259520 r259695  
    458458
    459459    if (shouldTreatURLProtocolAsAppBound(requestURL)) {
    460         listener.didReceiveAppBoundDomainResult(true);
     460        listener.didReceiveAppBoundDomainResult(NavigatingToAppBoundDomain::Yes);
    461461        return;
    462462    }
    463463
    464464    ensureAppBoundDomains([domain = WebCore::RegistrableDomain(requestURL), listener = makeRef(listener)] (auto& domains) mutable {
    465         listener->didReceiveAppBoundDomainResult(domains.contains(domain));
     465        if (domains.isEmpty()) {
     466            listener->didReceiveAppBoundDomainResult(WTF::nullopt);
     467            return;
     468        }
     469        listener->didReceiveAppBoundDomainResult(domains.contains(domain) ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No);
    466470    });
    467471}
Note: See TracChangeset for help on using the changeset viewer.