Changeset 259695 in webkit
- Timestamp:
- Apr 7, 2020, 5:43:11 PM (6 years ago)
- Location:
- branches/safari-610.1.9-branch/Source/WebKit
- Files:
-
- 7 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebFramePolicyListenerProxy.cpp (modified) (1 diff)
-
UIProcess/WebFramePolicyListenerProxy.h (modified) (3 diffs)
-
UIProcess/WebFrameProxy.cpp (modified) (1 diff)
-
UIProcess/WebFrameProxy.h (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (3 diffs)
-
UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-610.1.9-branch/Source/WebKit/ChangeLog
r259541 r259695 1 2020-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 1 60 2020-04-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 61 -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp
r258054 r259695 47 47 WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy() = default; 48 48 49 void WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult( boolisNavigatingToAppBoundDomain)49 void WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult(Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) 50 50 { 51 51 ASSERT(RunLoop::isMain()); 52 52 53 auto isAppBound = isNavigatingToAppBoundDomain ? NavigatingToAppBoundDomain::Yes : NavigatingToAppBoundDomain::No;54 53 if (m_policyResult && m_safeBrowsingWarning) { 55 54 if (m_reply) 56 m_reply(WebCore::PolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(*m_safeBrowsingWarning), is AppBound);55 m_reply(WebCore::PolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(*m_safeBrowsingWarning), isNavigatingToAppBoundDomain); 57 56 } else 58 m_isNavigatingToAppBoundDomain = is AppBound;57 m_isNavigatingToAppBoundDomain = isNavigatingToAppBoundDomain; 59 58 } 60 59 -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h
r258054 r259695 47 47 public: 48 48 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>)>; 50 50 static Ref<WebFramePolicyListenerProxy> create(Reply&& reply, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult) 51 51 { … … 59 59 60 60 void didReceiveSafeBrowsingResults(RefPtr<SafeBrowsingWarning>&&); 61 void didReceiveAppBoundDomainResult( bool);61 void didReceiveAppBoundDomainResult(Optional<NavigatingToAppBoundDomain>); 62 62 63 63 private: … … 66 66 Optional<std::pair<RefPtr<API::WebsitePolicies>, ProcessSwapRequestedByClient>> m_policyResult; 67 67 Optional<RefPtr<SafeBrowsingWarning>> m_safeBrowsingWarning; 68 Optional< NavigatingToAppBoundDomain> m_isNavigatingToAppBoundDomain;68 Optional<Optional<NavigatingToAppBoundDomain>> m_isNavigatingToAppBoundDomain; 69 69 Reply m_reply; 70 70 }; -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFrameProxy.cpp
r258054 r259695 194 194 } 195 195 196 WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, NavigatingToAppBoundDomain)>&& completionHandler, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult)196 WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&, Optional<NavigatingToAppBoundDomain>)>&& completionHandler, ShouldExpectSafeBrowsingResult expectSafeBrowsingResult, ShouldExpectAppBoundDomainResult expectAppBoundDomainResult) 197 197 { 198 198 if (m_activeListener) 199 199 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, NavigatingToAppBoundDomainisNavigatingToAppBoundDomain) 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 { 201 201 completionHandler(action, policies, processSwapRequestedByClient, WTFMove(safeBrowsingWarning), isNavigatingToAppBoundDomain); 202 202 m_activeListener = nullptr; -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebFrameProxy.h
r258054 r259695 121 121 void didChangeTitle(const String&); 122 122 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); 124 124 125 125 #if ENABLE(CONTENT_FILTERING) -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebPageProxy.cpp
r259523 r259695 5104 5104 #endif 5105 5105 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, NavigatingToAppBoundDomainisAppBoundDomain) 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); 5110 5110 5111 5111 auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation, processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable { … … 5291 5291 MESSAGE_CHECK_URL(m_process, request.url()); 5292 5292 5293 auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), identifier, listenerID, frameID] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, NavigatingToAppBoundDomainisNavigatingToAppBoundDomain) 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 { 5294 5294 // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. 5295 5295 RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); … … 5339 5339 RefPtr<API::Navigation> navigation = navigationID ? m_navigationState->navigation(navigationID) : nullptr; 5340 5340 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, NavigatingToAppBoundDomainisNavigatingToAppBoundDomain) mutable {5341 process = process.copyRef()] (PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain) mutable { 5342 5342 // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. 5343 5343 RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); -
branches/safari-610.1.9-branch/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r259520 r259695 458 458 459 459 if (shouldTreatURLProtocolAsAppBound(requestURL)) { 460 listener.didReceiveAppBoundDomainResult( true);460 listener.didReceiveAppBoundDomainResult(NavigatingToAppBoundDomain::Yes); 461 461 return; 462 462 } 463 463 464 464 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); 466 470 }); 467 471 }
Note:
See TracChangeset
for help on using the changeset viewer.