Changeset 259615 in webkit
- Timestamp:
- Apr 6, 2020, 5:11:43 PM (6 years ago)
- Location:
- trunk/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
-
trunk/Source/WebKit/ChangeLog
r259610 r259615 1 2020-04-06 Kate Cheney <katherine_cheney@apple.com> 2 3 Create a way to signal if the WKAppBoundDomains list is empty 4 https://bugs.webkit.org/show_bug.cgi?id=210074 5 <rdar://problem/61359228> 6 7 Reviewed by Brent Fulgham. 8 9 Updates the WebFramePolicyListener to return an Optional<NavigatingToAppBoundDomain> 10 to signal if the WKAppBoundDomains list is empty. If so, we don't want to update 11 any app-bound domain parameters in WebPageProxy. 12 13 * UIProcess/WebFramePolicyListenerProxy.cpp: 14 (WebKit::WebFramePolicyListenerProxy::didReceiveAppBoundDomainResult): 15 * UIProcess/WebFramePolicyListenerProxy.h: 16 * UIProcess/WebFrameProxy.cpp: 17 (WebKit::WebFrameProxy::setUpPolicyListenerProxy): 18 * UIProcess/WebFrameProxy.h: 19 * UIProcess/WebPageProxy.cpp: 20 (WebKit::WebPageProxy::decidePolicyForNavigationAction): 21 (WebKit::WebPageProxy::decidePolicyForNewWindowAction): 22 (WebKit::WebPageProxy::decidePolicyForResponseShared): 23 * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm: 24 (WebKit::WebsiteDataStore::beginAppBoundDomainCheck): 25 Changed the WebFramePolicyListener to take a NavigatingToAppBoundDomain 26 type as opposed to a boolean to allow it to handle the empty value. 27 1 28 2020-04-06 Chris Dumez <cdumez@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp
r258054 r259615 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 -
trunk/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h
r258054 r259615 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 }; -
trunk/Source/WebKit/UIProcess/WebFrameProxy.cpp
r258054 r259615 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; -
trunk/Source/WebKit/UIProcess/WebFrameProxy.h
r258054 r259615 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) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r259523 r259615 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); -
trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm
r259520 r259615 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.