WebKit Bugzilla
Attachment 357319 Details for
Bug 192701
: [PSON] Stop exposing PolicyAction::Suspend to WebCore
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192701-20181214093057.patch (text/plain), 45.00 KB, created by
Chris Dumez
on 2018-12-14 09:30:58 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-12-14 09:30:58 PST
Size:
45.00 KB
patch
obsolete
>Subversion Revision: 239205 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3bb109f401b9b40f6cda88cd4db692e94d808488..884d8eda6c6b14e638e9d16d9bf8ecbec13bb2e9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-12-14 Chris Dumez <cdumez@apple.com> >+ >+ [PSON] Stop exposing PolicyAction::Suspend to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=192701 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore. >+ >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::continueAfterContentPolicy): >+ * loader/FrameLoaderTypes.h: >+ * loader/PolicyChecker.cpp: >+ (WebCore::PolicyChecker::checkNavigationPolicy): >+ (WebCore::PolicyChecker::checkNewWindowPolicy): >+ > 2018-12-14 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d4a1b4123922aaccffd0cefee0bb4918497afad7..c2d32f99d806b743ea16deefc603b8e6d5d25b9c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,49 @@ >+2018-12-14 Chris Dumez <cdumez@apple.com> >+ >+ [PSON] Stop exposing PolicyAction::Suspend to WebCore >+ https://bugs.webkit.org/show_bug.cgi?id=192701 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Introduce a new WebPolicyAction enum that is used at WebKit2 layer and augments >+ WebCore::PolicyAction with a "Suspend" value. >+ >+ * NetworkProcess/NetworkDataTaskBlob.cpp: >+ (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: >+ (toNSURLSessionResponseDisposition): >+ * Shared/WebPolicyAction.h: Added. >+ * UIProcess/WebFramePolicyListenerProxy.cpp: >+ (WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults): >+ (WebKit::WebFramePolicyListenerProxy::use): >+ (WebKit::WebFramePolicyListenerProxy::download): >+ (WebKit::WebFramePolicyListenerProxy::ignore): >+ * UIProcess/WebFramePolicyListenerProxy.h: >+ * UIProcess/WebFrameProxy.cpp: >+ (WebKit::WebFrameProxy::setUpPolicyListenerProxy): >+ * UIProcess/WebFrameProxy.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::receivedNavigationPolicyDecision): >+ (WebKit::WebPageProxy::receivedPolicyDecision): >+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): >+ (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): >+ (WebKit::WebPageProxy::decidePolicyForNewWindowAction): >+ (WebKit::WebPageProxy::decidePolicyForResponse): >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/WebPageProxy.messages.in: >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::toPolicyAction): >+ (WebKit::WebFrame::didReceivePolicyDecision): >+ * WebProcess/WebPage/WebFrame.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::didReceivePolicyDecision): >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ > 2018-12-14 Patrick Griffis <pgriffis@igalia.com> > > [GTK][WPE] Fix forwarding webkit socket to flatpak sandbox >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 1ea7f352a7b152f43cc5239df5396a056f42d82b..2f508ebc63b71718b81e3627ff28cc46712cfbdb 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -918,9 +918,6 @@ void DocumentLoader::continueAfterContentPolicy(PolicyAction policy) > static_cast<ResourceLoader*>(mainResourceLoader())->didFail(interruptedForPolicyChangeError()); > return; > } >- case PolicyAction::Suspend: >- // It is invalid to get a Suspend policy based on navigation response. >- RELEASE_ASSERT_NOT_REACHED(); > case PolicyAction::Ignore: > if (ResourceLoader* mainResourceLoader = this->mainResourceLoader()) > InspectorInstrumentation::continueWithPolicyIgnore(*m_frame, mainResourceLoader->identifier(), *this, m_response); >diff --git a/Source/WebCore/loader/FrameLoaderTypes.h b/Source/WebCore/loader/FrameLoaderTypes.h >index a3d0f242caf0dd748897fdee1c463b1feea1d3b8..1250239ca6145ac5df7bb5ba41c556799d6b969f 100644 >--- a/Source/WebCore/loader/FrameLoaderTypes.h >+++ b/Source/WebCore/loader/FrameLoaderTypes.h >@@ -44,7 +44,6 @@ enum class PolicyAction : uint8_t { > Use, > Download, > Ignore, >- Suspend, // FIXME: This is only used by WebKit2 so we shouldn't need this in the WebCore enum. > }; > > enum class ReloadOption : uint8_t { >@@ -153,8 +152,7 @@ template<> struct EnumTraits<WebCore::PolicyAction> { > WebCore::PolicyAction, > WebCore::PolicyAction::Use, > WebCore::PolicyAction::Download, >- WebCore::PolicyAction::Ignore, >- WebCore::PolicyAction::Suspend >+ WebCore::PolicyAction::Ignore > >; > }; > >diff --git a/Source/WebCore/loader/PolicyChecker.cpp b/Source/WebCore/loader/PolicyChecker.cpp >index 3b6d10a3f8d35e7c138d4a3821cfc88aa898e286..1f4bd250a00c99c012764c300d5dc2562688dd3e 100644 >--- a/Source/WebCore/loader/PolicyChecker.cpp >+++ b/Source/WebCore/loader/PolicyChecker.cpp >@@ -182,8 +182,6 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou > FALLTHROUGH; > case PolicyAction::Ignore: > return function({ }, nullptr, ShouldContinue::No); >- case PolicyAction::Suspend: >- RELEASE_ASSERT_NOT_REACHED(); > case PolicyAction::Use: > if (!m_frame.loader().client().canHandleRequest(request)) { > handleUnimplementablePolicy(m_frame.loader().client().cannotShowURLError(request)); >@@ -213,9 +211,6 @@ void PolicyChecker::checkNewWindowPolicy(NavigationAction&& navigationAction, Re > case PolicyAction::Ignore: > function({ }, nullptr, { }, { }, ShouldContinue::No); > return; >- case PolicyAction::Suspend: >- // It is invalid to get a "Suspend" policy for new windows, as the old document is not going away. >- RELEASE_ASSERT_NOT_REACHED(); > case PolicyAction::Use: > function(request, makeWeakPtr(formState.get()), frameName, navigationAction, ShouldContinue::Yes); > return; >diff --git a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >index 036ec8efe85ae34f1cc298b47fa5f830d35e6910..ead9d87ae05c4c26c476739b5db0b765399b76a7 100644 >--- a/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp >@@ -311,9 +311,6 @@ void NetworkDataTaskBlob::dispatchDidReceiveResponse(Error errorCode) > m_buffer.resize(bufferSize); > read(); > break; >- case PolicyAction::Suspend: >- LOG_ERROR("PolicyAction::Suspend encountered - Treating as PolicyAction::Ignore for now"); >- FALLTHROUGH; > case PolicyAction::Ignore: > break; > case PolicyAction::Download: >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index 2d4a7fdb0b9c0b02921cc81ff6a73faa88bf4f61..65ff7611f08a09a89bc59edf14beaf2b0a22b0d0 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -58,9 +58,6 @@ using namespace WebKit; > static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition) > { > switch (disposition) { >- case WebCore::PolicyAction::Suspend: >- LOG_ERROR("PolicyAction::Suspend encountered - Treating as PolicyAction::Ignore for now"); >- FALLTHROUGH; > case WebCore::PolicyAction::Ignore: > return NSURLSessionResponseCancel; > case WebCore::PolicyAction::Use: >diff --git a/Source/WebKit/Shared/WebPolicyAction.h b/Source/WebKit/Shared/WebPolicyAction.h >new file mode 100644 >index 0000000000000000000000000000000000000000..142a518df097e5ef2fa180484e09d0333c105b81 >--- /dev/null >+++ b/Source/WebKit/Shared/WebPolicyAction.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <wtf/Forward.h> >+ >+namespace WebKit { >+ >+enum class WebPolicyAction : uint8_t { >+ Use, >+ Download, >+ Ignore, >+ Suspend >+}; >+ >+} >+ >+namespace WTF { >+ >+template<> struct EnumTraits<WebKit::WebPolicyAction> { >+ using values = EnumValues< >+ WebKit::WebPolicyAction, >+ WebKit::WebPolicyAction::Use, >+ WebKit::WebPolicyAction::Download, >+ WebKit::WebPolicyAction::Ignore, >+ WebKit::WebPolicyAction::Suspend >+ >; >+}; >+ >+} // namespace WTF >+ >diff --git a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp >index 8e31f070153fb6eacd4b0fd2ac3cdd0dfb49e9c0..d7fccd695c97d32d1c79ce7fda005994828743fb 100644 >--- a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp >+++ b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp >@@ -50,7 +50,7 @@ void WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults(RefPtr<SafeBrows > ASSERT(!m_safeBrowsingWarning); > if (m_policyResult) { > if (m_reply) >- m_reply(WebCore::PolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(safeBrowsingWarning)); >+ m_reply(WebPolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(safeBrowsingWarning)); > } else > m_safeBrowsingWarning = WTFMove(safeBrowsingWarning); > } >@@ -59,7 +59,7 @@ void WebFramePolicyListenerProxy::use(API::WebsitePolicies* policies, ProcessSwa > { > if (m_safeBrowsingWarning) { > if (m_reply) >- m_reply(WebCore::PolicyAction::Use, policies, processSwapRequestedByClient, WTFMove(*m_safeBrowsingWarning)); >+ m_reply(WebPolicyAction::Use, policies, processSwapRequestedByClient, WTFMove(*m_safeBrowsingWarning)); > } else if (!m_policyResult) > m_policyResult = {{ policies, processSwapRequestedByClient }}; > } >@@ -67,13 +67,13 @@ void WebFramePolicyListenerProxy::use(API::WebsitePolicies* policies, ProcessSwa > void WebFramePolicyListenerProxy::download() > { > if (m_reply) >- m_reply(WebCore::PolicyAction::Download, nullptr, ProcessSwapRequestedByClient::No, { }); >+ m_reply(WebPolicyAction::Download, nullptr, ProcessSwapRequestedByClient::No, { }); > } > > void WebFramePolicyListenerProxy::ignore() > { > if (m_reply) >- m_reply(WebCore::PolicyAction::Ignore, nullptr, ProcessSwapRequestedByClient::No, { }); >+ m_reply(WebPolicyAction::Ignore, nullptr, ProcessSwapRequestedByClient::No, { }); > } > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >index 9598da7bd352a6a240d3bed757b26947da3c4a98..2ad99f6592d9b470021ad6e87191ed3aaa9c450f 100644 >--- a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >+++ b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >@@ -26,6 +26,7 @@ > #pragma once > > #include "APIObject.h" >+#include "WebPolicyAction.h" > #include <wtf/CompletionHandler.h> > #include <wtf/Vector.h> > >@@ -33,10 +34,6 @@ namespace API { > class WebsitePolicies; > } > >-namespace WebCore { >-enum class PolicyAction : uint8_t; >-} >- > namespace WebKit { > > class SafeBrowsingWarning; >@@ -47,7 +44,7 @@ enum class ShouldExpectSafeBrowsingResult { No, Yes }; > class WebFramePolicyListenerProxy : public API::ObjectImpl<API::Object::Type::FramePolicyListener> { > public: > >- using Reply = CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>; >+ using Reply = CompletionHandler<void(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>; > static Ref<WebFramePolicyListenerProxy> create(Reply&& reply, ShouldExpectSafeBrowsingResult expect) > { > return adoptRef(*new WebFramePolicyListenerProxy(WTFMove(reply), expect)); >diff --git a/Source/WebKit/UIProcess/WebFrameProxy.cpp b/Source/WebKit/UIProcess/WebFrameProxy.cpp >index 69288494c6b619267aa2cc0e55f9df7d65261a27..c77a26b7427c31c828e2eaa221f8070b77add262 100644 >--- a/Source/WebKit/UIProcess/WebFrameProxy.cpp >+++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp >@@ -177,11 +177,11 @@ void WebFrameProxy::didChangeTitle(const String& title) > m_title = title; > } > >-WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&& completionHandler, ShouldExpectSafeBrowsingResult expect) >+WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&& completionHandler, ShouldExpectSafeBrowsingResult expect) > { > if (m_activeListener) > m_activeListener->ignore(); >- m_activeListener = WebFramePolicyListenerProxy::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (WebCore::PolicyAction action, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ m_activeListener = WebFramePolicyListenerProxy::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (WebPolicyAction action, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { > completionHandler(action, policies, processSwapRequestedByClient, WTFMove(safeBrowsingWarning)); > m_activeListener = nullptr; > }, expect); >diff --git a/Source/WebKit/UIProcess/WebFrameProxy.h b/Source/WebKit/UIProcess/WebFrameProxy.h >index 66238d11bc791fedd8eecfeb7ec45c7cb2368330..8cea71366e754d4807b042a3bfc86e42909dbbf1 100644 >--- a/Source/WebKit/UIProcess/WebFrameProxy.h >+++ b/Source/WebKit/UIProcess/WebFrameProxy.h >@@ -117,7 +117,7 @@ public: > void didSameDocumentNavigation(const URL&); // eg. anchor navigation, session state change. > void didChangeTitle(const String&); > >- WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&&, ShouldExpectSafeBrowsingResult); >+ WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&&, ShouldExpectSafeBrowsingResult); > > #if ENABLE(CONTENT_FILTERING) > void contentFilterDidBlockLoad(WebCore::ContentFilterUnblockHandler contentFilterUnblockHandler) { m_contentFilterUnblockHandler = WTFMove(contentFilterUnblockHandler); } >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index 04b038ee2cf9ebf801604394bcbcaad7ef2a8f64..dac15297a9242ddb088222da3a4eedc5f3d90050 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -2592,7 +2592,7 @@ void WebPageProxy::centerSelectionInVisibleArea() > > class WebPageProxy::PolicyDecisionSender : public RefCounted<PolicyDecisionSender> { > public: >- using SendFunction = CompletionHandler<void(WebCore::PolicyAction, uint64_t newNavigationID, DownloadID, std::optional<WebsitePoliciesData>)>; >+ using SendFunction = CompletionHandler<void(WebPolicyAction, uint64_t newNavigationID, DownloadID, std::optional<WebsitePoliciesData>)>; > static Ref<PolicyDecisionSender> create(SendFunction&& sendFunction) > { > return adoptRef(*new PolicyDecisionSender(WTFMove(sendFunction))); >@@ -2610,7 +2610,7 @@ private: > SendFunction m_sendFunction; > }; > >-void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, API::Navigation* navigation, ProcessSwapRequestedByClient processSwapRequestedByClient, WebFrameProxy& frame, API::WebsitePolicies* policies, Ref<PolicyDecisionSender>&& sender) >+void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction, API::Navigation* navigation, ProcessSwapRequestedByClient processSwapRequestedByClient, WebFrameProxy& frame, API::WebsitePolicies* policies, Ref<PolicyDecisionSender>&& sender) > { > std::optional<WebsitePoliciesData> data; > if (policies) { >@@ -2619,7 +2619,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A > changeWebsiteDataStore(policies->websiteDataStore()->websiteDataStore()); > } > >- if (policyAction != PolicyAction::Use || !frame.isMainFrame() || !navigation) { >+ if (policyAction != WebPolicyAction::Use || !frame.isMainFrame() || !navigation) { > receivedPolicyDecision(policyAction, navigation, WTFMove(data), WTFMove(sender)); > return; > } >@@ -2632,7 +2632,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A > } > > if (processForNavigation.ptr() != &process()) { >- policyAction = isPageOpenedByDOMShowingInitialEmptyDocument() ? PolicyAction::Ignore : PolicyAction::Suspend; >+ policyAction = isPageOpenedByDOMShowingInitialEmptyDocument() ? WebPolicyAction::Ignore : WebPolicyAction::Suspend; > RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "%p - WebPageProxy::decidePolicyForNavigationAction, swapping process %i with process %i for navigation, reason: %{public}s", this, processIdentifier(), processForNavigation->processIdentifier(), reason.utf8().data()); > LOG(ProcessSwapping, "(ProcessSwapping) Switching from process %i to new process (%i) for navigation %" PRIu64 " '%s'", processIdentifier(), processForNavigation->processIdentifier(), navigation->navigationID(), navigation->loggingString()); > } else >@@ -2645,23 +2645,23 @@ void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, A > }); > } > >-void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) >+void WebPageProxy::receivedPolicyDecision(WebPolicyAction action, API::Navigation* navigation, std::optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) > { > if (!isValid()) { >- sender->send(PolicyAction::Ignore, 0, DownloadID(), std::nullopt); >+ sender->send(WebPolicyAction::Ignore, 0, DownloadID(), std::nullopt); > return; > } > > auto transaction = m_pageLoadState.transaction(); > >- if (action == PolicyAction::Ignore) >+ if (action == WebPolicyAction::Ignore) > m_pageLoadState.clearPendingAPIRequestURL(transaction); > >- if (navigation && navigation->shouldForceDownload() && action == PolicyAction::Use) >- action = PolicyAction::Download; >+ if (navigation && navigation->shouldForceDownload() && action == WebPolicyAction::Use) >+ action = WebPolicyAction::Download; > > DownloadID downloadID = { }; >- if (action == PolicyAction::Download) { >+ if (action == WebPolicyAction::Download) { > // Create a download proxy. > auto* download = m_process->processPool().createDownloadProxy(m_decidePolicyForResponseRequest, this); > if (navigation) { >@@ -4311,7 +4311,7 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > > #if ENABLE(CONTENT_FILTERING) > if (frame.didHandleContentFilterUnblockNavigation(request)) >- return receivedPolicyDecision(PolicyAction::Ignore, m_navigationState->navigation(newNavigationID), std::nullopt, WTFMove(sender)); >+ return receivedPolicyDecision(WebPolicyAction::Ignore, m_navigationState->navigation(newNavigationID), std::nullopt, WTFMove(sender)); > #else > UNUSED_PARAM(newNavigationID); > #endif >@@ -4320,9 +4320,9 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > if (!m_preferences->safeBrowsingEnabled()) > shouldExpectSafeBrowsingResult = ShouldExpectSafeBrowsingResult::No; > >- auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (WebCore::PolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ auto listener = makeRef(frame.setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frame = makeRef(frame), sender = WTFMove(sender), navigation] (WebPolicyAction policyAction, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { > >- auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation = WTFMove(navigation), processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable { >+ auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation = WTFMove(navigation), processSwapRequestedByClient, policies = makeRefPtr(policies)] (WebPolicyAction policyAction) mutable { > receivedNavigationPolicyDecision(policyAction, navigation.get(), processSwapRequestedByClient, frame, policies.get(), WTFMove(sender)); > }; > >@@ -4334,12 +4334,12 @@ void WebPageProxy::decidePolicyForNavigationAction(WebFrameProxy& frame, WebCore > if (safeBrowsingWarning) { > m_pageClient->showSafeBrowsingWarning(*safeBrowsingWarning, [protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler), policyAction] (auto&& result) mutable { > switchOn(result, [&] (const URL& url) { >- completionHandler(PolicyAction::Ignore); >+ completionHandler(WebPolicyAction::Ignore); > protectedThis->loadRequest({ url }); > }, [&] (ContinueUnsafeLoad continueUnsafeLoad) { > switch (continueUnsafeLoad) { > case ContinueUnsafeLoad::No: >- completionHandler(PolicyAction::Ignore); >+ completionHandler(WebPolicyAction::Ignore); > break; > case ContinueUnsafeLoad::Yes: > completionHandler(policyAction); >@@ -4402,7 +4402,7 @@ void WebPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, bool is > decidePolicyForNavigationAction(*frame, WTFMove(frameSecurityOrigin), navigationID, WTFMove(navigationActionData), WTFMove(frameInfoData), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(redirectResponse), userData, sender.copyRef()); > > // If the client did not respond synchronously, proceed with the load. >- sender->send(PolicyAction::Use, navigationID, DownloadID(), std::nullopt); >+ sender->send(WebPolicyAction::Use, navigationID, DownloadID(), std::nullopt); > } > > void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData, ResourceRequest&& request, const String& frameName, uint64_t listenerID, const UserData& userData) >@@ -4413,7 +4413,7 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi > MESSAGE_CHECK(frame); > MESSAGE_CHECK_URL(request.url()); > >- auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frameID] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frameID] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { > // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. > RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); > ASSERT_UNUSED(safeBrowsingWarning, !safeBrowsingWarning); >@@ -4451,7 +4451,7 @@ void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const SecurityOrigi > MESSAGE_CHECK_URL(response.url()); > > RefPtr<API::Navigation> navigation = navigationID ? m_navigationState->navigation(navigationID) : nullptr; >- auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frameID, listenerID, navigation = WTFMove(navigation)] (WebCore::PolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frameID, listenerID, navigation = WTFMove(navigation)] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { > // FIXME: Assert the API::WebsitePolicies* is nullptr here once clients of WKFramePolicyListenerUseWithPolicies go away. > RELEASE_ASSERT(processSwapRequestedByClient == ProcessSwapRequestedByClient::No); > ASSERT_UNUSED(safeBrowsingWarning, !safeBrowsingWarning); >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index d96473e8932f7f43ec3eba8b626cdaa97fab1b18..9334ef225a5a504c5e1741b75fe9346c2cd125a3 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -962,8 +962,8 @@ public: > #endif > > class PolicyDecisionSender; >- void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, std::optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); >- void receivedNavigationPolicyDecision(WebCore::PolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&); >+ void receivedPolicyDecision(WebPolicyAction, API::Navigation*, std::optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); >+ void receivedNavigationPolicyDecision(WebPolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&); > > void backForwardRemovedItem(const WebCore::BackForwardItemIdentifier&); > >diff --git a/Source/WebKit/UIProcess/WebPageProxy.messages.in b/Source/WebKit/UIProcess/WebPageProxy.messages.in >index e6e94fe9a38bb04ba3b2e5ca57ed1e66c715ce64..128e6e95073a1119fd91f779d9f97ae82e80cffc 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebPageProxy.messages.in >@@ -107,7 +107,7 @@ messages -> WebPageProxy { > # Policy messages > DecidePolicyForResponse(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, uint64_t listenerID, WebKit::UserData userData) > DecidePolicyForNavigationActionAsync(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData, uint64_t listenerID) >- DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData) -> (enum:uint8_t WebCore::PolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed >+ DecidePolicyForNavigationActionSync(uint64_t frameID, bool isMainFrame, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, struct WebKit::NavigationActionData navigationActionData, struct WebKit::FrameInfoData originatingFrameInfoData, uint64_t originatingPageID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, IPC::FormDataReference requestBody, WebCore::ResourceResponse redirectResponse, WebKit::UserData userData) -> (enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) Delayed > DecidePolicyForNewWindowAction(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, struct WebKit::NavigationActionData navigationActionData, WebCore::ResourceRequest request, String frameName, uint64_t listenerID, WebKit::UserData userData) > UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::UserData userData) > >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 6b189008453095b4c4db7e50ee32936a1b6cf93c..adb6dbab6d6bc1a09524bdcc79dcb76c56fe04e1 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -893,6 +893,7 @@ > 466BC03C1FA266DA002FA9C1 /* WebSWContextManagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */; }; > 46A2B6091E5676A600C3DEDA /* BackgroundProcessResponsivenessTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */; }; > 46DF063C1F3905F8001980BB /* NetworkCORSPreflightChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 46DF063A1F3905E5001980BB /* NetworkCORSPreflightChecker.h */; }; >+ 46F636D021C41A1D00413010 /* WebPolicyAction.h in Headers */ = {isa = PBXBuildFile; fileRef = 46F636CF21C41A1D00413010 /* WebPolicyAction.h */; }; > 4A3CC18B19B0640F00D14AEF /* UserMediaPermissionRequestManagerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3A19AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.h */; }; > 4A3CC18D19B0641900D14AEF /* UserMediaPermissionRequestProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3C19AF7B04002EBAB5 /* UserMediaPermissionRequestProxy.h */; }; > 4A3CC18F19B07B8A00D14AEF /* WKUserMediaPermissionRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 4A410F3619AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -3095,6 +3096,7 @@ > 46A2B6071E5675A200C3DEDA /* BackgroundProcessResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackgroundProcessResponsivenessTimer.h; sourceTree = "<group>"; }; > 46DF06391F3905E5001980BB /* NetworkCORSPreflightChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCORSPreflightChecker.cpp; sourceTree = "<group>"; }; > 46DF063A1F3905E5001980BB /* NetworkCORSPreflightChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCORSPreflightChecker.h; sourceTree = "<group>"; }; >+ 46F636CF21C41A1D00413010 /* WebPolicyAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebPolicyAction.h; sourceTree = "<group>"; }; > 4A410F3519AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserMediaPermissionRequest.cpp; sourceTree = "<group>"; }; > 4A410F3619AF7AC3002EBAB5 /* WKUserMediaPermissionRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKUserMediaPermissionRequest.h; sourceTree = "<group>"; }; > 4A410F3919AF7B04002EBAB5 /* UserMediaPermissionRequestManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMediaPermissionRequestManagerProxy.cpp; sourceTree = "<group>"; }; >@@ -5126,6 +5128,7 @@ > BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */, > BC7B625012A43C9600D174A4 /* WebPageGroupData.h */, > C0337DDC127A521C008FF4F4 /* WebPlatformTouchPoint.cpp */, >+ 46F636CF21C41A1D00413010 /* WebPolicyAction.h */, > BC5744ED12638FB3006F0F12 /* WebPopupItem.cpp */, > BC5744EE12638FB3006F0F12 /* WebPopupItem.h */, > 7CDE739F1F9DA37A00390312 /* WebPreferences.yaml */, >@@ -9454,6 +9457,7 @@ > 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */, > 1A3E736111CC2659007BD539 /* WebPlatformStrategies.h in Headers */, > 31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */, >+ 46F636D021C41A1D00413010 /* WebPolicyAction.h in Headers */, > BC5744F012638FB3006F0F12 /* WebPopupItem.h in Headers */, > D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */, > BC574E631267D080006F0F12 /* WebPopupMenuProxy.h in Headers */, >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index 3fdf1e4f5b06d2bccdaab40e992b71e2ddd486e7..527ea191477410b27be4d3b0286bb0aef537af10 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -753,7 +753,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForResponse(const ResourceRespons > Ref<WebFrame> protector(*m_frame); > uint64_t listenerID = m_frame->setUpPolicyListener(WTFMove(function), WebFrame::ForNavigationAction::No); > if (!webPage->send(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), navigationID, response, request, canShowResponse, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())))) >- m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, WebPolicyAction::Ignore, 0, { }, { }); > } > > void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const NavigationAction& navigationAction, const ResourceRequest& request, FormState* formState, const String& frameName, FramePolicyFunction&& function) >@@ -890,12 +890,12 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const Navigat > > if (policyDecisionMode == PolicyDecisionMode::Synchronous) { > uint64_t newNavigationID; >- PolicyAction policyAction; >+ WebPolicyAction policyAction; > DownloadID downloadID; > std::optional<WebsitePoliciesData> websitePolicies; > > if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationActionSync(m_frame->frameID(), m_frame->isMainFrame(), SecurityOriginData::fromFrame(coreFrame), documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForNavigationActionSync::Reply(policyAction, newNavigationID, downloadID, websitePolicies))) { >- m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, WebPolicyAction::Ignore, 0, { }, { }); > return; > } > >@@ -905,7 +905,7 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const Navigat > > ASSERT(policyDecisionMode == PolicyDecisionMode::Asynchronous); > if (!webPage->send(Messages::WebPageProxy::DecidePolicyForNavigationActionAsync(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()), listenerID))) >- m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, WebPolicyAction::Ignore, 0, { }, { }); > } > > void WebFrameLoaderClient::cancelPolicyCheck() >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index 395753510567a95a111aa4b07fa10e63138d4108..189d1a188b24b6446d0527df8650f0a1a386810b 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -43,6 +43,7 @@ > #include "WebDocumentLoader.h" > #include "WebPage.h" > #include "WebPageProxyMessages.h" >+#include "WebPolicyAction.h" > #include "WebProcess.h" > #include "WebsitePoliciesData.h" > #include <JavaScriptCore/APICast.h> >@@ -253,10 +254,26 @@ void WebFrame::invalidatePolicyListener() > completionHandler(); > } > >-void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action, uint64_t navigationID, DownloadID downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) >+static WebCore::PolicyAction toPolicyAction(WebPolicyAction policyAction) >+{ >+ switch (policyAction) { >+ case WebPolicyAction::Use: >+ return WebCore::PolicyAction::Use; >+ case WebPolicyAction::Ignore: >+ return WebCore::PolicyAction::Ignore; >+ case WebPolicyAction::Download: >+ return WebCore::PolicyAction::Download; >+ case WebPolicyAction::Suspend: >+ break; >+ } >+ ASSERT_NOT_REACHED(); >+ return WebCore::PolicyAction::Ignore; >+} >+ >+void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction action, uint64_t navigationID, DownloadID downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) > { > if (!m_coreFrame || !m_policyListenerID || listenerID != m_policyListenerID || !m_policyFunction) { >- if (action == PolicyAction::Suspend) >+ if (action == WebPolicyAction::Suspend) > page()->send(Messages::WebPageProxy::DidFailToSuspendAfterProcessSwap()); > return; > } >@@ -276,12 +293,12 @@ void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action > } > > bool shouldSuspend = false; >- if (action == PolicyAction::Suspend) { >+ if (action == WebPolicyAction::Suspend) { > shouldSuspend = true; >- action = PolicyAction::Ignore; >+ action = WebPolicyAction::Ignore; > } > >- function(action); >+ function(toPolicyAction(action)); > > if (shouldSuspend) > page()->suspendForProcessSwap(); >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.h b/Source/WebKit/WebProcess/WebPage/WebFrame.h >index 617b18f27333e3b20b68ca437c2e2d0528131013..82bcb6d879dd24e9faa52fa3566b7d5b66a2fff1 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.h >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.h >@@ -65,6 +65,8 @@ class WebPage; > struct FrameInfoData; > struct WebsitePoliciesData; > >+enum class WebPolicyAction : uint8_t; >+ > class WebFrame : public API::ObjectImpl<API::Object::Type::BundleFrame> { > public: > static Ref<WebFrame> createWithCoreMainFrame(WebPage*, WebCore::Frame*); >@@ -85,7 +87,7 @@ public: > enum class ForNavigationAction { No, Yes }; > uint64_t setUpPolicyListener(WebCore::FramePolicyFunction&&, ForNavigationAction); > void invalidatePolicyListener(); >- void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, DownloadID, std::optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction, uint64_t navigationID, DownloadID, std::optional<WebsitePoliciesData>&&); > > uint64_t setUpWillSubmitFormListener(CompletionHandler<void()>&&); > void continueWillSubmitForm(uint64_t); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index b28f040e1b25c3813ae5a0ad6aec5ade85eb37be..bfcea82a00c8f75e0684587fa3f8f81122aac273 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -112,6 +112,7 @@ > #include "WebPerformanceLoggingClient.h" > #include "WebPlugInClient.h" > #include "WebPluginInfoProvider.h" >+#include "WebPolicyAction.h" > #include "WebPopupMenu.h" > #include "WebPreferencesDefinitions.h" > #include "WebPreferencesKeys.h" >@@ -3022,12 +3023,12 @@ void WebPage::setSessionID(PAL::SessionID sessionID) > m_page->setSessionID(sessionID); > } > >-void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, PolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) >+void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, std::optional<WebsitePoliciesData>&& websitePolicies) > { > WebFrame* frame = WebProcess::singleton().webFrame(frameID); > if (!frame) > return; >- if (policyAction == PolicyAction::Suspend) { >+ if (policyAction == WebPolicyAction::Suspend) { > ASSERT(frame == m_mainFrame); > setIsSuspended(true); > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 099b2c5fa09d642ed4ae4c5201fc47a1a1da912f..5ffc8e300962ee2b19961261b9e5fadd06767f36 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -237,6 +237,7 @@ class RemoteLayerTreeTransaction; > > enum FindOptions : uint16_t; > enum class DragControllerAction : uint8_t; >+enum class WebPolicyAction : uint8_t; > > struct AssistedNodeInformation; > struct AttributedString; >@@ -1292,7 +1293,7 @@ private: > bool parentProcessHasServiceWorkerEntitlement() const { return true; } > #endif > >- void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, const DownloadID&, std::optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction, uint64_t navigationID, const DownloadID&, std::optional<WebsitePoliciesData>&&); > void continueWillSubmitForm(uint64_t frameID, uint64_t listenerID); > void setUserAgent(const String&); > void setCustomTextEncodingName(const String&); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index 6f917bc8b2ce67686358eb9f2d5ca705ba62b166..e9fbe164ec09c85c906d9e3b8e5a9b502497bb37 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -167,7 +167,7 @@ messages -> WebPage LegacyReceiver { > DidRemoveBackForwardItem(struct WebCore::BackForwardItemIdentifier backForwardItemID) > > UpdateWebsitePolicies(struct WebKit::WebsitePoliciesData websitePolicies) >- DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebCore::PolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) >+ DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebKit::WebPolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, std::optional<WebKit::WebsitePoliciesData> websitePolicies) > ContinueWillSubmitForm(uint64_t frameID, uint64_t listenerID) > > ClearSelection()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192701
: 357319