WebKit Bugzilla
Attachment 360119 Details for
Bug 193827
: Drop WebKit::WebKitPolicyAction type as it is no longer needed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193827-20190125094637.patch (text/plain), 39.11 KB, created by
Chris Dumez
on 2019-01-25 09:46:38 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-01-25 09:46:38 PST
Size:
39.11 KB
patch
obsolete
>Subversion Revision: 240475 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 566f4bcf21ed146c9e4726e4e75fee708f9def59..f410d516275cd85d3e5bce2e3cd63b317d620026 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,43 @@ >+2019-01-25 Chris Dumez <cdumez@apple.com> >+ >+ Drop WebKit::WebKitPolicyAction type as it is no longer needed >+ https://bugs.webkit.org/show_bug.cgi?id=193827 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Drop WebKit::WebKitPolicyAction type as it is no longer needed. It is now identical to >+ WebCore::PolicyAction. >+ >+ * Shared/WebPolicyAction.h: Removed. >+ * 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::decidePolicyForResponseShared): >+ * UIProcess/WebPageProxy.h: >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): >+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): >+ * WebProcess/WebPage/WebFrame.cpp: >+ (WebKit::WebFrame::didReceivePolicyDecision): >+ (WebKit::toPolicyAction): Deleted. >+ * WebProcess/WebPage/WebFrame.h: >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::didReceivePolicyDecision): >+ * WebProcess/WebPage/WebPage.h: >+ > 2019-01-25 Patrick Griffis <pgriffis@igalia.com> > > [GTK][WPE] Add API to add paths to sandbox >diff --git a/Source/WebKit/Shared/WebPolicyAction.h b/Source/WebKit/Shared/WebPolicyAction.h >deleted file mode 100644 >index 3971795c46a51b38818c55b76d653a34b5289e9c..0000000000000000000000000000000000000000 >--- a/Source/WebKit/Shared/WebPolicyAction.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * 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 { >- >-// FIXME: Remove this type and use WebCore::PolicyAction instead. >-enum class WebPolicyAction : uint8_t { >- Use, >- Download, >- Ignore >-}; >- >-} >- >-namespace WTF { >- >-template<> struct EnumTraits<WebKit::WebPolicyAction> { >- using values = EnumValues< >- WebKit::WebPolicyAction, >- WebKit::WebPolicyAction::Use, >- WebKit::WebPolicyAction::Download, >- WebKit::WebPolicyAction::Ignore >- >; >-}; >- >-} // namespace WTF >- >diff --git a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp >index d7fccd695c97d32d1c79ce7fda005994828743fb..8e31f070153fb6eacd4b0fd2ac3cdd0dfb49e9c0 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(WebPolicyAction::Use, m_policyResult->first.get(), m_policyResult->second, WTFMove(safeBrowsingWarning)); >+ m_reply(WebCore::PolicyAction::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(WebPolicyAction::Use, policies, processSwapRequestedByClient, WTFMove(*m_safeBrowsingWarning)); >+ m_reply(WebCore::PolicyAction::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(WebPolicyAction::Download, nullptr, ProcessSwapRequestedByClient::No, { }); >+ m_reply(WebCore::PolicyAction::Download, nullptr, ProcessSwapRequestedByClient::No, { }); > } > > void WebFramePolicyListenerProxy::ignore() > { > if (m_reply) >- m_reply(WebPolicyAction::Ignore, nullptr, ProcessSwapRequestedByClient::No, { }); >+ m_reply(WebCore::PolicyAction::Ignore, nullptr, ProcessSwapRequestedByClient::No, { }); > } > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >index e98a0fd4b52f444c7e187c638bbe697e10892b96..9a6be99d4073ee108b4cb20f721c108f7c0188e9 100644 >--- a/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >+++ b/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h >@@ -26,7 +26,7 @@ > #pragma once > > #include "APIObject.h" >-#include "WebPolicyAction.h" >+#include <WebCore/FrameLoaderTypes.h> > #include <wtf/CompletionHandler.h> > #include <wtf/Vector.h> > >@@ -44,7 +44,7 @@ enum class ShouldExpectSafeBrowsingResult { No, Yes }; > class WebFramePolicyListenerProxy : public API::ObjectImpl<API::Object::Type::FramePolicyListener> { > public: > >- using Reply = CompletionHandler<void(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>; >+ using Reply = CompletionHandler<void(WebCore::PolicyAction, 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 53c7196c2aa0a33d220758190cd4bd95a5cd025f..9f4684651e3cce8ec00a4691e58e0b15e2f69d60 100644 >--- a/Source/WebKit/UIProcess/WebFrameProxy.cpp >+++ b/Source/WebKit/UIProcess/WebFrameProxy.cpp >@@ -178,11 +178,11 @@ void WebFrameProxy::didChangeTitle(const String& title) > m_title = title; > } > >-WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&& completionHandler, ShouldExpectSafeBrowsingResult expect) >+WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(CompletionHandler<void(PolicyAction, 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)] (WebPolicyAction action, API::WebsitePolicies* policies, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ m_activeListener = WebFramePolicyListenerProxy::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] (PolicyAction 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 8cea71366e754d4807b042a3bfc86e42909dbbf1..66238d11bc791fedd8eecfeb7ec45c7cb2368330 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(WebPolicyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&&)>&&, ShouldExpectSafeBrowsingResult); >+ WebFramePolicyListenerProxy& setUpPolicyListenerProxy(CompletionHandler<void(WebCore::PolicyAction, 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 e398cf7b73cb66b730dd232c74841a55160921c6..54e4d3e2f701db11842f7925f720ac5cac4a1d22 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -2660,7 +2660,7 @@ void WebPageProxy::centerSelectionInVisibleArea() > > class WebPageProxy::PolicyDecisionSender : public RefCounted<PolicyDecisionSender> { > public: >- using SendFunction = CompletionHandler<void(WebPolicyAction, uint64_t newNavigationID, DownloadID, Optional<WebsitePoliciesData>)>; >+ using SendFunction = CompletionHandler<void(PolicyAction, uint64_t newNavigationID, DownloadID, Optional<WebsitePoliciesData>)>; > static Ref<PolicyDecisionSender> create(SendFunction&& sendFunction) > { > return adoptRef(*new PolicyDecisionSender(WTFMove(sendFunction))); >@@ -2678,7 +2678,7 @@ private: > SendFunction m_sendFunction; > }; > >-void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction, API::Navigation* navigation, ProcessSwapRequestedByClient processSwapRequestedByClient, WebFrameProxy& frame, API::WebsitePolicies* policies, Ref<PolicyDecisionSender>&& sender) >+void WebPageProxy::receivedNavigationPolicyDecision(PolicyAction policyAction, API::Navigation* navigation, ProcessSwapRequestedByClient processSwapRequestedByClient, WebFrameProxy& frame, API::WebsitePolicies* policies, Ref<PolicyDecisionSender>&& sender) > { > Optional<WebsitePoliciesData> data; > if (policies) { >@@ -2687,7 +2687,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction > changeWebsiteDataStore(policies->websiteDataStore()->websiteDataStore()); > } > >- if (policyAction != WebPolicyAction::Use || !frame.isMainFrame() || !navigation) { >+ if (policyAction != PolicyAction::Use || !frame.isMainFrame() || !navigation) { > receivedPolicyDecision(policyAction, navigation, WTFMove(data), WTFMove(sender)); > return; > } >@@ -2700,7 +2700,7 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction > } > > if (processForNavigation.ptr() != &process()) { >- policyAction = WebPolicyAction::Ignore; >+ policyAction = PolicyAction::Ignore; > RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "decidePolicyForNavigationAction, swapping process %i with process %i for navigation, reason: %{public}s", 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 >@@ -2720,23 +2720,23 @@ void WebPageProxy::receivedNavigationPolicyDecision(WebPolicyAction policyAction > }); > } > >-void WebPageProxy::receivedPolicyDecision(WebPolicyAction action, API::Navigation* navigation, Optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) >+void WebPageProxy::receivedPolicyDecision(PolicyAction action, API::Navigation* navigation, Optional<WebsitePoliciesData>&& websitePolicies, Ref<PolicyDecisionSender>&& sender) > { > if (!isValid()) { >- sender->send(WebPolicyAction::Ignore, 0, DownloadID(), WTF::nullopt); >+ sender->send(PolicyAction::Ignore, 0, DownloadID(), WTF::nullopt); > return; > } > > auto transaction = m_pageLoadState.transaction(); > >- if (action == WebPolicyAction::Ignore) >+ if (action == PolicyAction::Ignore) > m_pageLoadState.clearPendingAPIRequestURL(transaction); > >- if (navigation && navigation->shouldForceDownload() && action == WebPolicyAction::Use) >- action = WebPolicyAction::Download; >+ if (navigation && navigation->shouldForceDownload() && action == PolicyAction::Use) >+ action = PolicyAction::Download; > > DownloadID downloadID = { }; >- if (action == WebPolicyAction::Download) { >+ if (action == PolicyAction::Download) { > // Create a download proxy. > auto* download = m_process->processPool().createDownloadProxy(m_decidePolicyForResponseRequest, this); > if (navigation) { >@@ -4399,7 +4399,7 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces > > #if ENABLE(CONTENT_FILTERING) > if (frame.didHandleContentFilterUnblockNavigation(request)) >- return receivedPolicyDecision(WebPolicyAction::Ignore, m_navigationState->navigation(newNavigationID), WTF::nullopt, WTFMove(sender)); >+ return receivedPolicyDecision(PolicyAction::Ignore, m_navigationState->navigation(newNavigationID), WTF::nullopt, WTFMove(sender)); > #else > UNUSED_PARAM(newNavigationID); > #endif >@@ -4408,9 +4408,9 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces > if (!m_preferences->safeBrowsingEnabled()) > shouldExpectSafeBrowsingResult = ShouldExpectSafeBrowsingResult::No; > >- 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 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) mutable { > >- auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation = WTFMove(navigation), processSwapRequestedByClient, policies = makeRefPtr(policies)] (WebPolicyAction policyAction) mutable { >+ auto completionHandler = [this, protectedThis = protectedThis.copyRef(), frame = frame.copyRef(), sender = WTFMove(sender), navigation = WTFMove(navigation), processSwapRequestedByClient, policies = makeRefPtr(policies)] (PolicyAction policyAction) mutable { > receivedNavigationPolicyDecision(policyAction, navigation.get(), processSwapRequestedByClient, frame, policies.get(), WTFMove(sender)); > }; > >@@ -4428,12 +4428,12 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces > > m_pageClient->showSafeBrowsingWarning(*safeBrowsingWarning, [protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler), policyAction] (auto&& result) mutable { > switchOn(result, [&] (const URL& url) { >- completionHandler(WebPolicyAction::Ignore); >+ completionHandler(PolicyAction::Ignore); > protectedThis->loadRequest({ url }); > }, [&] (ContinueUnsafeLoad continueUnsafeLoad) { > switch (continueUnsafeLoad) { > case ContinueUnsafeLoad::No: >- completionHandler(WebPolicyAction::Ignore); >+ completionHandler(PolicyAction::Ignore); > break; > case ContinueUnsafeLoad::Yes: > completionHandler(policyAction); >@@ -4551,7 +4551,7 @@ void WebPageProxy::decidePolicyForNavigationActionSync(uint64_t frameID, bool is > decidePolicyForNavigationAction(m_process.copyRef(), *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(WebPolicyAction::Use, navigationID, DownloadID(), WTF::nullopt); >+ sender->send(PolicyAction::Use, navigationID, DownloadID(), WTF::nullopt); > } > > void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, NavigationActionData&& navigationActionData, ResourceRequest&& request, const String& frameName, uint64_t listenerID, const UserData& userData) >@@ -4562,7 +4562,7 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi > MESSAGE_CHECK(m_process, frame); > MESSAGE_CHECK_URL(m_process, request.url()); > >- auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frameID] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), listenerID, frameID] (PolicyAction 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); >@@ -4605,7 +4605,7 @@ void WebPageProxy::decidePolicyForResponseShared(Ref<WebProcessProxy>&& process, > MESSAGE_CHECK_URL(process, 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), process = process.copyRef()] (WebPolicyAction policyAction, API::WebsitePolicies*, ProcessSwapRequestedByClient processSwapRequestedByClient, RefPtr<SafeBrowsingWarning>&& safeBrowsingWarning) mutable { >+ auto listener = makeRef(frame->setUpPolicyListenerProxy([this, protectedThis = makeRef(*this), frameID, listenerID, navigation = WTFMove(navigation), process = process.copyRef()] (PolicyAction 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 ad7d7dc9282e357f30ef24e289a113da63201d92..283fde654a3ec5d8b4e550302c32bcdd96f01bcd 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -970,8 +970,8 @@ public: > #endif > > class PolicyDecisionSender; >- void receivedPolicyDecision(WebPolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); >- void receivedNavigationPolicyDecision(WebPolicyAction, API::Navigation*, ProcessSwapRequestedByClient, WebFrameProxy&, API::WebsitePolicies*, Ref<PolicyDecisionSender>&&); >+ void receivedPolicyDecision(WebCore::PolicyAction, API::Navigation*, Optional<WebsitePoliciesData>&&, Ref<PolicyDecisionSender>&&); >+ void receivedNavigationPolicyDecision(WebCore::PolicyAction, 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 6c35cb411236a138a5c6071707f3c40165050b5e..90f7c97319ba3041e7883ceeecf702278a216c2f 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 WebKit::WebPolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, 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 WebCore::PolicyAction policyAction, uint64_t newNavigationID, WebKit::DownloadID downloadID, 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 a0b70ca478d5e3341a38359cbf24d98de4409186..14d56089f586a3a07a4cb90f26fb8f2ce9c4e5d4 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -891,7 +891,6 @@ > 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, ); }; }; >@@ -3087,7 +3086,6 @@ > 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>"; }; >@@ -5127,7 +5125,6 @@ > BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */, > BC7B625012A43C9600D174A4 /* WebPageGroupData.h */, > C0337DDC127A521C008FF4F4 /* WebPlatformTouchPoint.cpp */, >- 46F636CF21C41A1D00413010 /* WebPolicyAction.h */, > BC5744ED12638FB3006F0F12 /* WebPopupItem.cpp */, > BC5744EE12638FB3006F0F12 /* WebPopupItem.h */, > 7CDE739F1F9DA37A00390312 /* WebPreferences.yaml */, >@@ -9504,7 +9501,6 @@ > 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 */, >@@ -10707,7 +10703,6 @@ > buildActionMask = 2147483647; > files = ( > 2D92A784212B6AB100F493FD /* ActivityAssertion.cpp in Sources */, >- 5CE43B7221F7CC020093BCC5 /* APIHTTPCookieStoreCocoa.mm in Sources */, > 2D92A77B212B6A7100F493FD /* ArgumentCoders.cpp in Sources */, > 2DEB1D2E2127473600933906 /* ArgumentCodersCF.cpp in Sources */, > 2D92A77C212B6A7100F493FD /* Attachment.cpp in Sources */, >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >index df272f15a3edba0048950d842dd19c8791fe2d49..e8613d2393f0cbee80d95ff882325d8c53e571ed 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp >@@ -55,7 +55,6 @@ > #include "WebPage.h" > #include "WebPageGroupProxy.h" > #include "WebPageProxyMessages.h" >-#include "WebPolicyAction.h" > #include "WebProcess.h" > #include "WebProcessPoolMessages.h" > #include "WebsitePoliciesData.h" >@@ -70,6 +69,7 @@ > #include <WebCore/Frame.h> > #include <WebCore/FrameLoadRequest.h> > #include <WebCore/FrameLoader.h> >+#include <WebCore/FrameLoaderTypes.h> > #include <WebCore/FrameView.h> > #include <WebCore/HTMLAppletElement.h> > #include <WebCore/HTMLFormElement.h> >@@ -758,7 +758,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, WebPolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); > } > > void WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const NavigationAction& navigationAction, const ResourceRequest& request, FormState* formState, const String& frameName, FramePolicyFunction&& function) >@@ -895,12 +895,12 @@ void WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(const Navigat > > if (policyDecisionMode == PolicyDecisionMode::Synchronous) { > uint64_t newNavigationID; >- WebPolicyAction policyAction; >+ PolicyAction policyAction; > DownloadID downloadID; > 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, WebPolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); > return; > } > >@@ -910,7 +910,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, WebPolicyAction::Ignore, 0, { }, { }); >+ m_frame->didReceivePolicyDecision(listenerID, PolicyAction::Ignore, 0, { }, { }); > } > > void WebFrameLoaderClient::cancelPolicyCheck() >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >index ffed00c8206a94f0e4ffc7ff3a8a9dff8613fac8..da3e65da8c327b8c417a71b3ee8328debab4e6a8 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.cpp >@@ -43,7 +43,6 @@ > #include "WebDocumentLoader.h" > #include "WebPage.h" > #include "WebPageProxyMessages.h" >-#include "WebPolicyAction.h" > #include "WebProcess.h" > #include "WebsitePoliciesData.h" > #include <JavaScriptCore/APICast.h> >@@ -254,21 +253,7 @@ void WebFrame::invalidatePolicyListener() > completionHandler(); > } > >-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; >- } >- ASSERT_NOT_REACHED(); >- return WebCore::PolicyAction::Ignore; >-} >- >-void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction action, uint64_t navigationID, DownloadID downloadID, Optional<WebsitePoliciesData>&& websitePolicies) >+void WebFrame::didReceivePolicyDecision(uint64_t listenerID, PolicyAction action, uint64_t navigationID, DownloadID downloadID, Optional<WebsitePoliciesData>&& websitePolicies) > { > if (!m_coreFrame || !m_policyListenerID || listenerID != m_policyListenerID || !m_policyFunction) > return; >@@ -287,7 +272,7 @@ void WebFrame::didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction act > documentLoader->setNavigationID(navigationID); > } > >- function(toPolicyAction(action)); >+ function(action); > } > > void WebFrame::startDownload(const WebCore::ResourceRequest& request, const String& suggestedName) >diff --git a/Source/WebKit/WebProcess/WebPage/WebFrame.h b/Source/WebKit/WebProcess/WebPage/WebFrame.h >index 6199e0ba4a3fc88c8e6af1fc708ea5f2d37012ff..0aadbdbf42cae006cf00de0c3b6362cb111999bd 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebFrame.h >+++ b/Source/WebKit/WebProcess/WebPage/WebFrame.h >@@ -65,8 +65,6 @@ 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*); >@@ -87,7 +85,7 @@ public: > enum class ForNavigationAction { No, Yes }; > uint64_t setUpPolicyListener(WebCore::FramePolicyFunction&&, ForNavigationAction); > void invalidatePolicyListener(); >- void didReceivePolicyDecision(uint64_t listenerID, WebPolicyAction, uint64_t navigationID, DownloadID, Optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, DownloadID, 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 3b0b5098823515d5a45bcff4632ec7a06cc95d5a..64547149cf77f392a6efdad76b7cddbb81e2d7b6 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -111,7 +111,6 @@ > #include "WebPerformanceLoggingClient.h" > #include "WebPlugInClient.h" > #include "WebPluginInfoProvider.h" >-#include "WebPolicyAction.h" > #include "WebPopupMenu.h" > #include "WebPreferencesDefinitions.h" > #include "WebPreferencesKeys.h" >@@ -3050,7 +3049,7 @@ void WebPage::setSessionID(PAL::SessionID sessionID) > m_page->setSessionID(sessionID); > } > >-void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, Optional<WebsitePoliciesData>&& websitePolicies) >+void WebPage::didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, PolicyAction policyAction, uint64_t navigationID, const DownloadID& downloadID, Optional<WebsitePoliciesData>&& websitePolicies) > { > WebFrame* frame = WebProcess::singleton().webFrame(frameID); > if (!frame) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 4a40ae0bd35eaf3be04dbaa57ca13db79517ca6b..a7ff384dfe86e61ea3be9d24ca1df3674b1837e9 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -240,7 +240,6 @@ class RemoteLayerTreeTransaction; > > enum FindOptions : uint16_t; > enum class DragControllerAction : uint8_t; >-enum class WebPolicyAction : uint8_t; > > struct AttributedString; > struct DataDetectionResult; >@@ -1301,7 +1300,7 @@ private: > bool parentProcessHasServiceWorkerEntitlement() const { return true; } > #endif > >- void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebPolicyAction, uint64_t navigationID, const DownloadID&, Optional<WebsitePoliciesData>&&); >+ void didReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, WebCore::PolicyAction, uint64_t navigationID, const DownloadID&, 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 54abbaf8934ccdcf8e4f20f783fcb6b9f03040eb..5cfe804f9c2502a2d0e67e1e629c6c3b0b654514 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 WebKit::WebPolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, Optional<WebKit::WebsitePoliciesData> websitePolicies) >+ DidReceivePolicyDecision(uint64_t frameID, uint64_t listenerID, enum:uint8_t WebCore::PolicyAction policyAction, uint64_t navigationID, WebKit::DownloadID downloadID, 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 193827
: 360119