Unreviewed, rolling out r222541.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 23:25:07 +0000 (23:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Sep 2017 23:25:07 +0000 (23:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177580

WebCore isn't ready for the asynchronousness this was going to
enable (Requested by alexchristensen on #webkit).

Reverted changeset:

"Pass a completion handler instead of a
WebFramePolicyListenerProxy during policy decisions"
https://bugs.webkit.org/show_bug.cgi?id=177509
http://trac.webkit.org/changeset/222541

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

27 files changed:
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/APINavigationClient.h
Source/WebKit/UIProcess/API/APIPolicyClient.h
Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
Source/WebKit/UIProcess/API/glib/WebKitPolicyClient.cpp
Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/Cocoa/NavigationState.h
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/RemoteWebInspectorProxy.cpp
Source/WebKit/UIProcess/WebFormSubmissionListenerProxy.h
Source/WebKit/UIProcess/WebFrameListenerProxy.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/WebFrameListenerProxy.h [new file with mode: 0644]
Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp
Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h
Source/WebKit/UIProcess/WebFrameProxy.cpp
Source/WebKit/UIProcess/WebFrameProxy.h
Source/WebKit/UIProcess/WebInspectorProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj

index 02c32be..0e36b13 100644 (file)
@@ -313,6 +313,7 @@ set(WebKit_SOURCES
     UIProcess/WebEditCommandProxy.cpp
     UIProcess/WebFormClient.cpp
     UIProcess/WebFormSubmissionListenerProxy.cpp
+    UIProcess/WebFrameListenerProxy.cpp
     UIProcess/WebFramePolicyListenerProxy.cpp
     UIProcess/WebFrameProxy.cpp
     UIProcess/WebFullScreenManagerProxy.cpp
index dd20396..c95725a 100644 (file)
@@ -1,3 +1,18 @@
+2017-09-27  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r222541.
+        https://bugs.webkit.org/show_bug.cgi?id=177580
+
+        WebCore isn't ready for the asynchronousness this was going to
+        enable (Requested by alexchristensen on #webkit).
+
+        Reverted changeset:
+
+        "Pass a completion handler instead of a
+        WebFramePolicyListenerProxy during policy decisions"
+        https://bugs.webkit.org/show_bug.cgi?id=177509
+        http://trac.webkit.org/changeset/222541
+
 2017-09-27  Tina Liu  <iting_liu@apple.com>
 
         Expose setShouldSuppressFirstResponderChanges() as WKView SPI
index a381c9d..61dc71d 100644 (file)
 #pragma once
 
 #include "APIData.h"
-#include "DownloadID.h"
 #include "PluginModuleInfo.h"
 #include "ProcessTerminationReason.h"
 #include "SameDocumentNavigationType.h"
 #include "WebEvent.h"
+#include "WebFramePolicyListenerProxy.h"
 #include "WebsitePolicies.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/LayoutMilestones.h>
@@ -40,15 +40,14 @@ namespace WebCore {
 class ResourceError;
 class ResourceRequest;
 class ResourceResponse;
-class URL;
 struct SecurityOriginData;
 }
 
 namespace WebKit {
 class AuthenticationChallengeProxy;
-class DownloadID;
 class QuickLookDocumentData;
 class WebBackForwardListItem;
+class WebFramePolicyListenerProxy;
 class WebFrameProxy;
 class WebPageProxy;
 class WebProtectionSpace;
@@ -97,14 +96,14 @@ public:
     virtual void didFinishLoadForQuickLookDocumentInMainFrame(const WebKit::QuickLookDocumentData&) { }
 #endif
 
-    virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, Ref<NavigationAction>&&, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, Object*)
+    virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, Ref<NavigationAction>&&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, Object*)
     {
-        completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+        listener->use({ });
     }
 
-    virtual void decidePolicyForNavigationResponse(WebKit::WebPageProxy&, NavigationResponse&, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, Object*)
+    virtual void decidePolicyForNavigationResponse(WebKit::WebPageProxy&, NavigationResponse&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, Object*)
     {
-        completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+        listener->use({ });
     }
     
 #if ENABLE(NETSCAPE_PLUGIN_API)
index 77b4894..a12e797 100644 (file)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "WebEvent.h"
+#include "WebFramePolicyListenerProxy.h"
 #include "WebsitePolicies.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <wtf/Forward.h>
@@ -37,10 +38,10 @@ class ResourceResponse;
 }
 
 namespace WebKit {
-class DownloadID;
 struct NavigationActionData;
 class WebPageProxy;
 class WebFrameProxy;
+class WebFramePolicyListenerProxy;
 }
 
 namespace API {
@@ -50,17 +51,17 @@ class PolicyClient {
 public:
     virtual ~PolicyClient() { }
 
-    virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, WebKit::WebFrameProxy*, const WebKit::NavigationActionData&, WebKit::WebFrameProxy*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object*)
+    virtual void decidePolicyForNavigationAction(WebKit::WebPageProxy&, WebKit::WebFrameProxy*, const WebKit::NavigationActionData&, WebKit::WebFrameProxy*, const WebCore::ResourceRequest&, const WebCore::ResourceRequest&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
     {
-        completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+        listener->use({ });
     }
-    virtual void decidePolicyForNewWindowAction(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebKit::NavigationActionData&, const WebCore::ResourceRequest&, const WTF::String&, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object*)
+    virtual void decidePolicyForNewWindowAction(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebKit::NavigationActionData&, const WebCore::ResourceRequest&, const WTF::String&, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
     {
-        completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+        listener->use({ });
     }
-    virtual void decidePolicyForResponse(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object*)
+    virtual void decidePolicyForResponse(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object*)
     {
-        completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+        listener->use({ });
     }
     virtual void unableToImplementPolicy(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, const WebCore::ResourceError&, API::Object*) { }
 };
index b4eddff..b654beb 100644 (file)
@@ -44,10 +44,9 @@ void WKFramePolicyListenerUse(WKFramePolicyListenerRef policyListenerRef)
     toImpl(policyListenerRef)->use({ });
 }
 
-void WKFramePolicyListenerUseWithPolicies(WKFramePolicyListenerRef policyListenerRef, WKWebsitePoliciesRef websitePoliciesRef)
+void WKFramePolicyListenerUseWithPolicies(WKFramePolicyListenerRef policyListenerRef, WKWebsitePoliciesRef websitePolicies)
 {
-    auto websitePolicies = toImpl(websitePoliciesRef)->websitePolicies();
-    toImpl(policyListenerRef)->use(WTFMove(websitePolicies));
+    toImpl(policyListenerRef)->use(toImpl(websitePolicies)->websitePolicies());
 }
 
 void WKFramePolicyListenerDownload(WKFramePolicyListenerRef policyListenerRef)
index fd6637f..1088612 100644 (file)
@@ -38,7 +38,6 @@
 #include "APIGeometry.h"
 #include "APIHitTestResult.h"
 #include "APILoaderClient.h"
-#include "APINavigation.h"
 #include "APINavigationAction.h"
 #include "APINavigationClient.h"
 #include "APINavigationResponse.h"
@@ -63,7 +62,6 @@
 #include "WKPluginInformation.h"
 #include "WebBackForwardList.h"
 #include "WebFormClient.h"
-#include "WebFramePolicyListenerProxy.h"
 #include "WebImage.h"
 #include "WebInspectorProxy.h"
 #include "WebOpenPanelResultListenerProxy.h"
@@ -1350,14 +1348,13 @@ void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClientBase*
         }
 
     private:
-        void decidePolicyForNavigationAction(WebPageProxy& page, WebFrameProxy* frame, const NavigationActionData& navigationActionData, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalResourceRequest, const WebCore::ResourceRequest& resourceRequest, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* userData) override
+        void decidePolicyForNavigationAction(WebPageProxy& page, WebFrameProxy* frame, const NavigationActionData& navigationActionData, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalResourceRequest, const WebCore::ResourceRequest& resourceRequest, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
         {
             if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1 && !m_client.decidePolicyForNavigationAction) {
-                completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+                listener->use({ });
                 return;
             }
 
-            auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
             Ref<API::URLRequest> originalRequest = API::URLRequest::create(originalResourceRequest);
             Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
 
@@ -1369,27 +1366,25 @@ void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClientBase*
                 m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(originatingFrame), toAPI(originalRequest.ptr()), toAPI(request.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
         }
 
-        void decidePolicyForNewWindowAction(WebPageProxy& page, WebFrameProxy& frame, const NavigationActionData& navigationActionData, const ResourceRequest& resourceRequest, const String& frameName, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* userData) override
+        void decidePolicyForNewWindowAction(WebPageProxy& page, WebFrameProxy& frame, const NavigationActionData& navigationActionData, const ResourceRequest& resourceRequest, const String& frameName, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
         {
             if (!m_client.decidePolicyForNewWindowAction) {
-                completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+                listener->use({ });
                 return;
             }
 
-            auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
             Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
 
             m_client.decidePolicyForNewWindowAction(toAPI(&page), toAPI(&frame), toAPI(navigationActionData.navigationType), toAPI(navigationActionData.modifiers), toAPI(navigationActionData.mouseButton), toAPI(request.ptr()), toAPI(frameName.impl()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
         }
 
-        void decidePolicyForResponse(WebPageProxy& page, WebFrameProxy& frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* userData) override
+        void decidePolicyForResponse(WebPageProxy& page, WebFrameProxy& frame, const ResourceResponse& resourceResponse, const ResourceRequest& resourceRequest, bool canShowMIMEType, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
         {
             if (!m_client.decidePolicyForResponse_deprecatedForUseWithV0 && !m_client.decidePolicyForResponse) {
-                completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+                listener->use({ });
                 return;
             }
 
-            auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
             Ref<API::URLResponse> response = API::URLResponse::create(resourceResponse);
             Ref<API::URLRequest> request = API::URLRequest::create(resourceRequest);
 
@@ -2145,23 +2140,21 @@ void WKPageSetPageNavigationClient(WKPageRef pageRef, const WKPageNavigationClie
         }
 
     private:
-        void decidePolicyForNavigationAction(WebPageProxy& page, Ref<API::NavigationAction>&& navigationAction, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* userData) final
+        void decidePolicyForNavigationAction(WebPageProxy& page, Ref<API::NavigationAction>&& navigationAction, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) final
         {
             if (!m_client.decidePolicyForNavigationAction) {
-                completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+                listener->use({ });
                 return;
             }
-            auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
             m_client.decidePolicyForNavigationAction(toAPI(&page), toAPI(navigationAction.ptr()), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
         }
 
-        void decidePolicyForNavigationResponse(WebPageProxy& page, API::NavigationResponse& navigationResponse, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* userData) override
+        void decidePolicyForNavigationResponse(WebPageProxy& page, API::NavigationResponse& navigationResponse, Ref<WebKit::WebFramePolicyListenerProxy>&& listener, API::Object* userData) override
         {
             if (!m_client.decidePolicyForNavigationResponse) {
-                completionHandler(WebCore::PolicyAction::Use, std::nullopt);
+                listener->use({ });
                 return;
             }
-            auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
             m_client.decidePolicyForNavigationResponse(toAPI(&page), toAPI(&navigationResponse), toAPI(listener.ptr()), toAPI(userData), m_client.base.clientInfo);
         }
 
index 106fac3..b7e5e69 100644 (file)
@@ -29,7 +29,6 @@
 #if WK_API_ENABLED
 
 #import "APIData.h"
-#import "APINavigation.h"
 #import "ObjCObjectGraph.h"
 #import "PageLoadStateObserver.h"
 #import "RemoteObjectRegistry.h"
index 38986a4..78c0d5e 100644 (file)
@@ -38,23 +38,20 @@ public:
     }
 
 private:
-    void decidePolicyForNavigationAction(WebPageProxy&, WebFrameProxy*, const NavigationActionData& navigationActionData, WebFrameProxy* /*originatingFrame*/, const WebCore::ResourceRequest& /*originalRequest*/, const WebCore::ResourceRequest& request, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* /*userData*/) override
+    void decidePolicyForNavigationAction(WebPageProxy&, WebFrameProxy*, const NavigationActionData& navigationActionData, WebFrameProxy* /*originatingFrame*/, const WebCore::ResourceRequest& /*originalRequest*/, const WebCore::ResourceRequest& request, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* /*userData*/) override
     {
-        auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
         GRefPtr<WebKitPolicyDecision> decision = adoptGRef(webkitNavigationPolicyDecisionCreate(navigationActionData, request, listener.ptr()));
         webkitWebViewMakePolicyDecision(m_webView, WEBKIT_POLICY_DECISION_TYPE_NAVIGATION_ACTION, decision.get());
     }
 
-    void decidePolicyForNewWindowAction(WebPageProxy&, WebFrameProxy&, const NavigationActionData& navigationActionData, const WebCore::ResourceRequest& request, const String& frameName, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* /*userData*/) override
+    void decidePolicyForNewWindowAction(WebPageProxy&, WebFrameProxy&, const NavigationActionData& navigationActionData, const WebCore::ResourceRequest& request, const String& frameName, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* /*userData*/) override
     {
-        auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
         GRefPtr<WebKitPolicyDecision> decision = adoptGRef(webkitNewWindowPolicyDecisionCreate(navigationActionData, request, frameName, listener.ptr()));
         webkitWebViewMakePolicyDecision(m_webView, WEBKIT_POLICY_DECISION_TYPE_NEW_WINDOW_ACTION, decision.get());
     }
 
-    void decidePolicyForResponse(WebPageProxy&, WebFrameProxy&, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, bool canShowMIMEType, Function<void(WebCore::PolicyAction, std::optional<WebKit::WebsitePolicies>&&)>&& completionHandler, API::Object* /*userData*/) override
+    void decidePolicyForResponse(WebPageProxy&, WebFrameProxy&, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& request, bool canShowMIMEType, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* /*userData*/) override
     {
-        auto listener = WebFramePolicyListenerProxy::create(WTFMove(completionHandler));
         GRefPtr<WebKitPolicyDecision> decision = adoptGRef(webkitResponsePolicyDecisionCreate(request, response, canShowMIMEType, listener.ptr()));
         webkitWebViewMakePolicyDecision(m_webView, WEBKIT_POLICY_DECISION_TYPE_RESPONSE, decision.get());
     }
index bf6acfe..0c17983 100644 (file)
@@ -23,7 +23,6 @@
 #include "WebKitWebView.h"
 
 #include "APIData.h"
-#include "APINavigation.h"
 #include "APISerializedScriptValue.h"
 #include "ImageOptions.h"
 #include "WebCertificateInfo.h"
index 3c7674e..8494d88 100644 (file)
@@ -28,7 +28,6 @@
 
 #include "APIArray.h"
 #include "APIAutomationSessionClient.h"
-#include "APINavigation.h"
 #include "APIOpenPanelParameters.h"
 #include "AutomationProtocolObjects.h"
 #include "WebAutomationSessionMacros.h"
index 0d1ef87..807860b 100644 (file)
@@ -121,8 +121,8 @@ private:
         void resolveWebGLLoadPolicy(WebPageProxy&, const WebCore::URL&, WTF::Function<void(WebCore::WebGLLoadPolicy)>&& completionHandler) const final;
 #endif
 
-        void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationAction>&&, Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&&, API::Object* userData) override;
-        void decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse&, Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&&, API::Object* userData) override;
+        void decidePolicyForNavigationAction(WebPageProxy&, Ref<API::NavigationAction>&&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
+        void decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse&, Ref<WebFramePolicyListenerProxy>&&, API::Object* userData) override;
 
         NavigationState& m_navigationState;
     };
index 32a32c1..a91afb4 100644 (file)
@@ -360,31 +360,32 @@ static void tryAppLink(RefPtr<API::NavigationAction>&& navigationAction, const S
 #endif
 }
 
-void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy& webPageProxy, Ref<API::NavigationAction>&& navigationAction, Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&& completionHandler, API::Object* userData)
+void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageProxy& webPageProxy, Ref<API::NavigationAction>&& navigationAction, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
 {
     String mainFrameURLString = webPageProxy.mainFrame()->url();
 
     if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler
         && !m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies) {
         Ref<API::NavigationAction> localNavigationAction = navigationAction.copyRef();
+        RefPtr<WebFramePolicyListenerProxy> localListener = WTFMove(listener);
 
-        tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [webPage = RefPtr<WebPageProxy>(&webPageProxy), completionHandler = WTFMove(completionHandler), localNavigationAction = navigationAction.copyRef()] (bool followedLinkToApp) {
+        tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [webPage = RefPtr<WebPageProxy>(&webPageProxy), localListener, localNavigationAction = navigationAction.copyRef()] (bool followedLinkToApp) {
             if (followedLinkToApp) {
-                completionHandler(PolicyAction::Ignore, std::nullopt);
+                localListener->ignore();
                 return;
             }
 
             if (!localNavigationAction->targetFrame()) {
-                completionHandler(PolicyAction::Use, std::nullopt);
+                localListener->use({ });
                 return;
             }
 
             RetainPtr<NSURLRequest> nsURLRequest = adoptNS(wrapper(API::URLRequest::create(localNavigationAction->request()).leakRef()));
             if ([NSURLConnection canHandleRequest:nsURLRequest.get()] || webPage->urlSchemeHandlerForScheme([nsURLRequest URL].scheme)) {
                 if (localNavigationAction->shouldPerformDownload())
-                    completionHandler(PolicyAction::Download, std::nullopt);
+                    localListener->download();
                 else
-                    completionHandler(PolicyAction::Use, std::nullopt);
+                    localListener->use({ });
                 return;
             }
 
@@ -394,7 +395,7 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP
             if (![[nsURLRequest URL] isFileURL])
                 [[NSWorkspace sharedWorkspace] openURL:[nsURLRequest URL]];
 #endif
-            completionHandler(PolicyAction::Ignore, std::nullopt);
+            localListener->ignore();
         });
 
         return;
@@ -406,43 +407,43 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP
 
     bool delegateHasWebsitePolicies = m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandlerWebsitePolicies;
     
-    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), delegateHasWebsitePolicies ? @selector(_webView:decidePolicyForNavigationAction:decisionHandler:) : @selector(webView:decidePolicyForNavigationAction:decisionHandler:));
+    RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), delegateHasWebsitePolicies ? @selector(_webView:decidePolicyForNavigationAction:decisionHandler:) : @selector(webView:decidePolicyForNavigationAction:decisionHandler:));
     
-    auto decisionHandlerWithPolicies = [completionHandler = WTFMove(completionHandler), localNavigationAction = navigationAction.copyRef(), checker = WTFMove(checker), mainFrameURLString](WKNavigationActionPolicy actionPolicy, _WKWebsitePolicies *websitePolicies) mutable {
+    auto decisionHandlerWithPolicies = [localListener = RefPtr<WebFramePolicyListenerProxy>(WTFMove(listener)), localNavigationAction = navigationAction.copyRef(), checker = WTFMove(checker), mainFrameURLString](WKNavigationActionPolicy actionPolicy, _WKWebsitePolicies *websitePolicies) mutable {
         if (checker->completionHandlerHasBeenCalled())
             return;
         checker->didCallCompletionHandler();
 
-        std::optional<WebsitePolicies> policies;
+        WebsitePolicies policies;
         if (websitePolicies)
             policies = websitePolicies->_websitePolicies->websitePolicies();
 
         switch (actionPolicy) {
         case WKNavigationActionPolicyAllow:
-            tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [completionHandler = WTFMove(completionHandler), policies = WTFMove(policies)](bool followedLinkToApp) mutable {
+            tryAppLink(WTFMove(localNavigationAction), mainFrameURLString, [localListener = WTFMove(localListener), policies = WTFMove(policies)](bool followedLinkToApp) mutable {
                 if (followedLinkToApp) {
-                    completionHandler(PolicyAction::Ignore, std::nullopt);
+                    localListener->ignore();
                     return;
                 }
 
-                completionHandler(PolicyAction::Use, WTFMove(policies));
+                localListener->use(policies);
             });
         
             break;
 
         case WKNavigationActionPolicyCancel:
-            completionHandler(PolicyAction::Ignore, std::nullopt);
+            localListener->ignore();
             break;
 
 // FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wswitch"
         case _WKNavigationActionPolicyDownload:
-            completionHandler(PolicyAction::Download, std::nullopt);
+            localListener->download();
             break;
         case _WKNavigationActionPolicyAllowWithoutTryingAppLink:
 #pragma clang diagnostic pop
-            completionHandler(PolicyAction::Use, WTFMove(policies));
+            localListener->use(policies);
             break;
         }
     };
@@ -457,7 +458,7 @@ void NavigationState::NavigationClient::decidePolicyForNavigationAction(WebPageP
     }
 }
 
-void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse& navigationResponse, Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&& completionHandler, API::Object* userData)
+void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPageProxy&, API::NavigationResponse& navigationResponse, Ref<WebFramePolicyListenerProxy>&& listener, API::Object* userData)
 {
     if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationResponseDecisionHandler) {
         NSURL *url = navigationResponse.response().nsURLResponse().URL;
@@ -466,16 +467,16 @@ void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPag
             BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:url.path isDirectory:&isDirectory];
 
             if (exists && !isDirectory && navigationResponse.canShowMIMEType())
-                completionHandler(PolicyAction::Use, std::nullopt);
+                listener->use({ });
             else
-                completionHandler(PolicyAction::Ignore, std::nullopt);
+                listener->ignore();
             return;
         }
 
         if (navigationResponse.canShowMIMEType())
-            completionHandler(PolicyAction::Use, std::nullopt);
+            listener->use({ });
         else
-            completionHandler(PolicyAction::Ignore, std::nullopt);
+            listener->ignore();
         return;
     }
 
@@ -483,19 +484,20 @@ void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPag
     if (!navigationDelegate)
         return;
 
-    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
-    [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:BlockPtr<void(WKNavigationResponsePolicy)>::fromCallable([completionHandler = WTFMove(completionHandler), checker = WTFMove(checker)](WKNavigationResponsePolicy responsePolicy) {
+    RefPtr<WebFramePolicyListenerProxy> localListener = WTFMove(listener);
+    RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:decidePolicyForNavigationResponse:decisionHandler:));
+    [navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationResponse:wrapper(navigationResponse) decisionHandler:[localListener, checker](WKNavigationResponsePolicy responsePolicy) {
         if (checker->completionHandlerHasBeenCalled())
             return;
         checker->didCallCompletionHandler();
 
         switch (responsePolicy) {
         case WKNavigationResponsePolicyAllow:
-            completionHandler(PolicyAction::Use, std::nullopt);
+            localListener->use({ });
             break;
 
         case WKNavigationResponsePolicyCancel:
-            completionHandler(PolicyAction::Ignore, std::nullopt);
+            localListener->ignore();
             break;
 
 // FIXME: Once we have a new enough compiler everywhere we don't need to ignore -Wswitch.
@@ -503,10 +505,10 @@ void NavigationState::NavigationClient::decidePolicyForNavigationResponse(WebPag
 #pragma clang diagnostic ignored "-Wswitch"
         case _WKNavigationResponsePolicyBecomeDownload:
 #pragma clang diagnostic pop
-            completionHandler(PolicyAction::Download, std::nullopt);
+            localListener->download();
             break;
         }
-    }).get()];
+    }];
 }
 
 void NavigationState::NavigationClient::didStartProvisionalNavigation(WebPageProxy& page, API::Navigation* navigation, API::Object*)
index 05df1c7..93846a8 100644 (file)
@@ -29,7 +29,6 @@
 #if PLATFORM(MAC)
 
 #import "APILegacyContextHistoryClient.h"
-#import "APINavigation.h"
 #import "AttributedString.h"
 #import "ColorSpaceData.h"
 #import "FullscreenClient.h"
index b5c461b..8e83895 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "RemoteWebInspectorProxy.h"
 
-#include "APINavigation.h"
 #include "RemoteWebInspectorProxyMessages.h"
 #include "RemoteWebInspectorUIMessages.h"
 #include "WebInspectorProxy.h"
index c54ff34..2a7fa4b 100644 (file)
@@ -25,8 +25,7 @@
 
 #pragma once
 
-#include "APIObject.h"
-#include <wtf/Function.h>
+#include "WebFrameListenerProxy.h"
 
 namespace WebKit {
 
diff --git a/Source/WebKit/UIProcess/WebFrameListenerProxy.cpp b/Source/WebKit/UIProcess/WebFrameListenerProxy.cpp
new file mode 100644 (file)
index 0000000..5add279
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#include "config.h"
+#include "WebFrameListenerProxy.h"
+
+#include "WebFrameProxy.h"
+
+namespace WebKit {
+
+WebFrameListenerProxy::WebFrameListenerProxy(WebFrameProxy* frame, uint64_t listenerID)
+    : m_frame(frame)
+    , m_listenerID(listenerID)
+{
+}
+
+WebFrameListenerProxy::~WebFrameListenerProxy()
+{
+}
+
+void WebFrameListenerProxy::invalidate()
+{
+    m_frame = nullptr;
+}
+
+void WebFrameListenerProxy::receivedPolicyDecision(WebCore::PolicyAction action, const WebsitePolicies& websitePolicies)
+{
+    if (!m_frame)
+        return;
+
+    m_frame->receivedPolicyDecision(action, m_listenerID, m_navigation.get(), websitePolicies);
+    m_frame = nullptr;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit/UIProcess/WebFrameListenerProxy.h b/Source/WebKit/UIProcess/WebFrameListenerProxy.h
new file mode 100644 (file)
index 0000000..c3dfa05
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2010 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 "APINavigation.h"
+#include "APIObject.h"
+#include <WebCore/FrameLoaderTypes.h>
+#include <wtf/Ref.h>
+#include <wtf/RefPtr.h>
+
+namespace WebKit {
+
+class WebFrameProxy;
+struct WebsitePolicies;
+
+class WebFrameListenerProxy : public API::Object {
+public:
+    virtual ~WebFrameListenerProxy();
+
+    void invalidate();
+    uint64_t listenerID() const { return m_listenerID; }
+
+    void setNavigation(Ref<API::Navigation>&& navigation) { m_navigation = WTFMove(navigation); }
+
+protected:
+    WebFrameListenerProxy(WebFrameProxy*, uint64_t listenerID);
+
+    void receivedPolicyDecision(WebCore::PolicyAction, const WebsitePolicies&);
+
+private:
+    RefPtr<WebFrameProxy> m_frame;
+    uint64_t m_listenerID;
+    RefPtr<API::Navigation> m_navigation;
+};
+
+} // namespace WebKit
index 15b7005..4a74901 100644 (file)
 #include "config.h"
 #include "WebFramePolicyListenerProxy.h"
 
+#include "WebFrameProxy.h"
 #include "WebsitePolicies.h"
-#include <WebCore/FrameLoaderTypes.h>
-#include <wtf/Function.h>
 
 namespace WebKit {
 
-Ref<WebFramePolicyListenerProxy> WebFramePolicyListenerProxy::create(Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&& completionHandler)
+WebFramePolicyListenerProxy::WebFramePolicyListenerProxy(WebFrameProxy* frame, uint64_t listenerID)
+    : WebFrameListenerProxy(frame, listenerID)
 {
-    return adoptRef(*new WebFramePolicyListenerProxy(WTFMove(completionHandler)));
 }
 
-WebFramePolicyListenerProxy::WebFramePolicyListenerProxy(Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&& completionHandler)
-    : m_completionHandler(WTFMove(completionHandler))
+void WebFramePolicyListenerProxy::use(const WebsitePolicies& websitePolicies)
 {
-}
-
-void WebFramePolicyListenerProxy::use(std::optional<WebsitePolicies>&& websitePolicies)
-{
-    if (auto completionHandler = std::exchange(m_completionHandler, nullptr))
-        completionHandler(WebCore::PolicyAction::Use, WTFMove(websitePolicies));
+    receivedPolicyDecision(WebCore::PolicyAction::Use, websitePolicies);
 }
 
 void WebFramePolicyListenerProxy::download()
 {
-    if (auto completionHandler = std::exchange(m_completionHandler, nullptr))
-        completionHandler(WebCore::PolicyAction::Download, std::nullopt);
+    receivedPolicyDecision(WebCore::PolicyAction::Download, { });
 }
 
 void WebFramePolicyListenerProxy::ignore()
 {
-    if (auto completionHandler = std::exchange(m_completionHandler, nullptr))
-        completionHandler(WebCore::PolicyAction::Ignore, std::nullopt);
+    receivedPolicyDecision(WebCore::PolicyAction::Ignore, { });
 }
 
 } // namespace WebKit
index 2a04346..379efd2 100644 (file)
 
 #pragma once
 
-#include "APIObject.h"
-#include <wtf/Function.h>
-#include <wtf/Optional.h>
+#include "WebFrameListenerProxy.h"
 
-namespace WebCore {
-enum class PolicyAction;
-}
+#if PLATFORM(COCOA)
+#include "WKFoundation.h"
+#endif
 
-namespace WebKit {
+#define DELEGATE_REF_COUNTING_TO_COCOA (PLATFORM(COCOA) && WK_API_ENABLED)
 
-struct WebsitePolicies;
+namespace WebKit {
 
-class WebFramePolicyListenerProxy : public API::ObjectImpl<API::Object::Type::FramePolicyListener> {
+class WebFramePolicyListenerProxy : public WebFrameListenerProxy {
 public:
-    static Ref<WebFramePolicyListenerProxy> create(Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&&);
+    static const Type APIType = Type::FramePolicyListener;
+
+    static Ref<WebFramePolicyListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID)
+    {
+        return adoptRef(*new WebFramePolicyListenerProxy(frame, listenerID));
+    }
 
-    void use(std::optional<WebsitePolicies>&&);
+    void use(const WebsitePolicies&);
     void download();
     void ignore();
 
 private:
-    WebFramePolicyListenerProxy(Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)>&&);
+    WebFramePolicyListenerProxy(WebFrameProxy*, uint64_t listenerID);
 
-    Function<void(WebCore::PolicyAction, std::optional<WebsitePolicies>&&)> m_completionHandler;
+    Type type() const override { return APIType; }
+
+#if DELEGATE_REF_COUNTING_TO_COCOA
+    void* operator new(size_t size) { return newObject(size, APIType); }
+#endif
 };
 
 } // namespace WebKit
+
+#undef DELEGATE_REF_COUNTING_TO_COCOA
index b556f81..855d5d1 100644 (file)
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "WebFrameProxy.h"
 
-#include "APINavigation.h"
 #include "WebCertificateInfo.h"
+#include "WebFramePolicyListenerProxy.h"
 #include "WebPageMessages.h"
 #include "WebPageProxy.h"
 #include "WebPasteboardProxy.h"
@@ -60,6 +60,11 @@ WebFrameProxy::~WebFrameProxy()
 void WebFrameProxy::webProcessWillShutDown()
 {
     m_page = nullptr;
+
+    if (m_activeListener) {
+        m_activeListener->invalidate();
+        m_activeListener = nullptr;
+    }
 }
 
 bool WebFrameProxy::isMainFrame() const
@@ -170,6 +175,24 @@ void WebFrameProxy::didChangeTitle(const String& title)
     m_title = title;
 }
 
+void WebFrameProxy::receivedPolicyDecision(PolicyAction action, uint64_t listenerID, API::Navigation* navigation, const WebsitePolicies& websitePolicies)
+{
+    if (!m_page)
+        return;
+
+    ASSERT(m_activeListener);
+    ASSERT(m_activeListener->listenerID() == listenerID);
+    m_page->receivedPolicyDecision(action, *this, listenerID, navigation, websitePolicies);
+}
+
+WebFramePolicyListenerProxy& WebFrameProxy::setUpPolicyListenerProxy(uint64_t listenerID)
+{
+    if (m_activeListener)
+        m_activeListener->invalidate();
+    m_activeListener = WebFramePolicyListenerProxy::create(this, listenerID);
+    return *static_cast<WebFramePolicyListenerProxy*>(m_activeListener.get());
+}
+
 void WebFrameProxy::getWebArchive(Function<void (API::Data*, CallbackBase::Error)>&& callbackFunction)
 {
     if (!m_page) {
index 99e3ccc..b834197 100644 (file)
@@ -28,6 +28,7 @@
 #include "APIObject.h"
 #include "FrameLoadState.h"
 #include "GenericCallback.h"
+#include "WebFrameListenerProxy.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
@@ -48,6 +49,7 @@ class Decoder;
 
 namespace WebKit {
 class WebCertificateInfo;
+class WebFramePolicyListenerProxy;
 class WebPageProxy;
 struct WebsitePolicies;
 
@@ -111,6 +113,10 @@ public:
     void didSameDocumentNavigation(const WebCore::URL&); // eg. anchor navigation, session state change.
     void didChangeTitle(const String&);
 
+    // Policy operations.
+    void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID, API::Navigation*, const WebsitePolicies&);
+    WebFramePolicyListenerProxy& setUpPolicyListenerProxy(uint64_t listenerID);
+
 #if ENABLE(CONTENT_FILTERING)
     void contentFilterDidBlockLoad(WebCore::ContentFilterUnblockHandler contentFilterUnblockHandler) { m_contentFilterUnblockHandler = WTFMove(contentFilterUnblockHandler); }
     bool didHandleContentFilterUnblockNavigation(const WebCore::ResourceRequest&);
@@ -132,6 +138,7 @@ private:
     bool m_isFrameSet;
     bool m_containsPluginDocument { false };
     RefPtr<WebCertificateInfo> m_certificateInfo;
+    RefPtr<WebFrameListenerProxy> m_activeListener;
     uint64_t m_frameID;
 #if ENABLE(CONTENT_FILTERING)
     WebCore::ContentFilterUnblockHandler m_contentFilterUnblockHandler;
index aa28ad1..5f11d8d 100644 (file)
@@ -27,7 +27,6 @@
 #include "config.h"
 #include "WebInspectorProxy.h"
 
-#include "APINavigation.h"
 #include "APINavigationAction.h"
 #include "APIProcessPoolConfiguration.h"
 #include "WKArray.h"
index c121dbe..a5628da 100644 (file)
@@ -50,7 +50,6 @@
 #include "APISecurityOrigin.h"
 #include "APIUIClient.h"
 #include "APIURLRequest.h"
-#include "APIWebsitePolicies.h"
 #include "AuthenticationChallengeProxy.h"
 #include "AuthenticationDecisionListener.h"
 #include "DataReference.h"
@@ -89,6 +88,7 @@
 #include "WebEditCommandProxy.h"
 #include "WebEvent.h"
 #include "WebEventConversion.h"
+#include "WebFramePolicyListenerProxy.h"
 #include "WebFullScreenManagerProxy.h"
 #include "WebFullScreenManagerProxyMessages.h"
 #include "WebImage.h"
@@ -2257,6 +2257,56 @@ void WebPageProxy::centerSelectionInVisibleArea()
     m_process->send(Messages::WebPage::CenterSelectionInVisibleArea(), m_pageID);
 }
 
+void WebPageProxy::receivedPolicyDecision(PolicyAction action, WebFrameProxy& frame, uint64_t listenerID, API::Navigation* navigation, const WebsitePolicies& websitePolicies)
+{
+    if (!isValid())
+        return;
+
+    auto transaction = m_pageLoadState.transaction();
+
+    if (action == PolicyAction::Ignore)
+        m_pageLoadState.clearPendingAPIRequestURL(transaction);
+
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    if (m_syncNavigationActionHasDownloadAttribute && action == PolicyAction::Use)
+        action = PolicyAction::Download;
+#endif
+
+    DownloadID downloadID = { };
+    if (action == PolicyAction::Download) {
+        // Create a download proxy.
+        auto* download = m_process->processPool().createDownloadProxy(m_decidePolicyForResponseRequest, this);
+        if (navigation) {
+            download->setWasUserInitiated(navigation->wasUserInitiated());
+            download->setRedirectChain(navigation->takeRedirectChain());
+        }
+
+        downloadID = download->downloadID();
+        handleDownloadRequest(download);
+        m_decidePolicyForResponseRequest = { };
+    }
+
+    // If we received a policy decision while in decidePolicyForResponse the decision will
+    // be sent back to the web process by decidePolicyForResponse.
+    if (m_responsePolicyReply) {
+        m_responsePolicyReply->send(action, downloadID);
+        ASSERT(!m_newNavigationID);
+        m_responsePolicyReply = nullptr;
+        return;
+    }
+
+    // If we received a policy decision while in decidePolicyForNavigationAction the decision will 
+    // be sent back to the web process by decidePolicyForNavigationAction. 
+    if (m_navigationActionPolicyReply) {
+        m_navigationActionPolicyReply->send(m_newNavigationID, action, downloadID, websitePolicies);
+        m_newNavigationID = 0;
+        m_navigationActionPolicyReply = nullptr;
+        return;
+    }
+    
+    m_process->send(Messages::WebPage::DidReceivePolicyDecision(frame.frameID(), listenerID, action, navigation ? navigation->navigationID() : 0, downloadID), m_pageID);
+}
+
 void WebPageProxy::setUserAgent(const String& userAgent)
 {
     if (m_userAgent == userAgent)
@@ -3606,21 +3656,6 @@ void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
         m_frameSetLargestFrame = value ? m_mainFrame : 0;
 }
 
-DownloadID WebPageProxy::makeDownloadProxy(ResourceRequest&& request, uint64_t navigationID)
-{
-    auto* download = m_process->processPool().createDownloadProxy(request, this);
-
-    RefPtr<API::Navigation> navigation;
-    if (navigationID)
-        navigation = &m_navigationState->navigation(navigationID);
-    else
-        navigation = m_navigationState->createLoadRequestNavigation(WTFMove(request));
-    download->setWasUserInitiated(navigation->wasUserInitiated());
-    download->setRedirectChain(navigation->takeRedirectChain());
-    handleDownloadRequest(download);
-    return download->downloadID();
-}
-
 void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&& navigationActionData, const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, ResourceRequest&& request, uint64_t listenerID, const UserData& userData, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&& reply)
 {
     PageClientProtector protector(m_pageClient);
@@ -3636,53 +3671,32 @@ void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, const Secur
     MESSAGE_CHECK_URL(request.url());
     MESSAGE_CHECK_URL(originalRequest.url());
     
-#if ENABLE(DOWNLOAD_ATTRIBUTE)
-    bool forceDownload = !navigationActionData.downloadAttribute.isNull();
-#else
-    bool forceDownload = false;
-#endif
-
-    uint64_t newNavigationID = 0;
-    RefPtr<API::Navigation> navigation;
+    m_newNavigationID = 0;
+    Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
     if (!navigationID) {
-        navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request));
-        newNavigationID = navigation->navigationID();
-        navigationID = newNavigationID;
-    } else
-        navigation = &m_navigationState->navigation(navigationID);
-    ASSERT(navigation);
-    navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdentifier);
-
-    auto completionHandler = [this, protectedThis = makeRef(*this), reply = WTFMove(reply), request = request, navigationID, newNavigationID, forceDownload](WebCore::PolicyAction policyAction, std::optional<WebsitePolicies>&& optional) mutable {
-
-        if (policyAction == PolicyAction::Use && forceDownload)
-            policyAction = PolicyAction::Download;
-
-        WebsitePolicies websitePolicies; // FIXME: Just send the optional instead
-        if (optional)
-            websitePolicies = WTFMove(*optional);
-
-        DownloadID downloadID;
-        switch (policyAction) {
-        case PolicyAction::Ignore: {
-            auto transaction = m_pageLoadState.transaction();
-            m_pageLoadState.clearPendingAPIRequestURL(transaction);
-            break;
-        }
-        case PolicyAction::Download:
-            downloadID = makeDownloadProxy(WTFMove(request), navigationID);
-            break;
-        case PolicyAction::Use:
-            break;
-        }
-        reply->send(newNavigationID, policyAction, downloadID, websitePolicies);
-    };
+        auto navigation = m_navigationState->createLoadRequestNavigation(ResourceRequest(request));
+        m_newNavigationID = navigation->navigationID();
+        navigation->setWasUserInitiated(!!navigationActionData.userGestureTokenIdentifier);
+        listener->setNavigation(WTFMove(navigation));
+    } else {
+        auto& navigation = m_navigationState->navigation(navigationID);
+        navigation.setWasUserInitiated(!!navigationActionData.userGestureTokenIdentifier);
+        listener->setNavigation(navigation);
+    }
 
 #if ENABLE(CONTENT_FILTERING)
-    if (frame->didHandleContentFilterUnblockNavigation(request))
-        return completionHandler(PolicyAction::Ignore, std::nullopt);
+    if (frame->didHandleContentFilterUnblockNavigation(request)) {
+        reply->send(m_newNavigationID, PolicyAction::Ignore, { }, { });
+        m_newNavigationID = 0;
+        return;
+    }
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    m_syncNavigationActionHasDownloadAttribute = !navigationActionData.downloadAttribute.isNull();
+#endif
+    m_navigationActionPolicyReply = WTFMove(reply);
+
     WebFrameProxy* originatingFrame = m_process->webFrame(originatingFrameInfoData.frameID);
 
     if (m_navigationClient) {
@@ -3698,9 +3712,9 @@ void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, const Secur
 
         auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), destinationFrameInfo.ptr(), WTFMove(request), originalRequest.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
 
-        m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
+        m_navigationClient->decidePolicyForNavigationAction(*this, WTFMove(navigationAction), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
     } else
-        m_policyClient->decidePolicyForNavigationAction(*this, frame, WTFMove(navigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
+        m_policyClient->decidePolicyForNavigationAction(*this, frame, WTFMove(navigationActionData), originatingFrame, originalRequest, WTFMove(request), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
 
     m_shouldSuppressAppLinksInNextNavigationPolicyDecision = false;
 }
@@ -3713,32 +3727,24 @@ void WebPageProxy::decidePolicyForNewWindowAction(uint64_t frameID, const Securi
     MESSAGE_CHECK(frame);
     MESSAGE_CHECK_URL(request.url());
 
+    Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
+
     if (m_navigationClient) {
         RefPtr<API::FrameInfo> sourceFrameInfo;
         if (frame)
             sourceFrameInfo = API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin());
-        
-        auto completionHandler = [this, protectedThis = makeRef(*this), listenerID, frameID](WebCore::PolicyAction policyAction, std::optional<WebsitePolicies>&& optional) {
-            ASSERT_UNUSED(optional, !optional);
-            m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, policyAction, 0, DownloadID()), m_pageID);
-        };
 
         auto userInitiatedActivity = m_process->userInitiatedActivity(navigationActionData.userGestureTokenIdentifier);
         bool shouldOpenAppLinks = !hostsAreEqual(URL(ParsedURLString, m_mainFrame->url()), request.url());
         auto navigationAction = API::NavigationAction::create(WTFMove(navigationActionData), sourceFrameInfo.get(), nullptr, WTFMove(request), request.url(), shouldOpenAppLinks, WTFMove(userInitiatedActivity));
 
-        m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
+        m_navigationClient->decidePolicyForNavigationAction(*this, navigationAction.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
 
-    } else {
-        auto completionHandler = [this, protectedThis = makeRef(*this), frameID, listenerID](WebCore::PolicyAction policyAction, std::optional<WebsitePolicies>&& optional) {
-            ASSERT_UNUSED(optional, !optional);
-            m_process->send(Messages::WebPage::DidReceivePolicyDecision(frameID, listenerID, policyAction, 0, DownloadID()), m_pageID);
-        };
-        m_policyClient->decidePolicyForNewWindowAction(*this, *frame, navigationActionData, request, frameName, WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
-    }
+    } else
+        m_policyClient->decidePolicyForNewWindowAction(*this, *frame, navigationActionData, request, frameName, WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
 }
 
-void WebPageProxy::decidePolicyForResponseSync(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, const UserData& userData, Ref<Messages::WebPageProxy::DecidePolicyForResponseSync::DelayedReply>&& reply)
+void WebPageProxy::decidePolicyForResponse(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -3747,29 +3753,25 @@ void WebPageProxy::decidePolicyForResponseSync(uint64_t frameID, const SecurityO
     MESSAGE_CHECK_URL(request.url());
     MESSAGE_CHECK_URL(response.url());
 
-    auto completionHandler = [this, protectedThis = makeRef(*this), reply = WTFMove(reply), request = request, navigationID](WebCore::PolicyAction policyAction, std::optional<WebsitePolicies>&& optional) mutable {
-        ASSERT_UNUSED(optional, !optional);
-        DownloadID downloadID;
-        switch (policyAction) {
-        case PolicyAction::Ignore: {
-            auto transaction = m_pageLoadState.transaction();
-            m_pageLoadState.clearPendingAPIRequestURL(transaction);
-            break;
-        }
-        case PolicyAction::Download:
-            downloadID = makeDownloadProxy(WTFMove(request), navigationID);
-            break;
-        case PolicyAction::Use:
-            break;
-        }
-        reply->send(policyAction, downloadID);
-    };
+    Ref<WebFramePolicyListenerProxy> listener = frame->setUpPolicyListenerProxy(listenerID);
+    if (navigationID)
+        listener->setNavigation(m_navigationState->navigation(navigationID));
 
     if (m_navigationClient) {
         auto navigationResponse = API::NavigationResponse::create(API::FrameInfo::create(*frame, frameSecurityOrigin.securityOrigin()).get(), request, response, canShowMIMEType);
-        m_navigationClient->decidePolicyForNavigationResponse(*this, navigationResponse.get(), WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
+        m_navigationClient->decidePolicyForNavigationResponse(*this, navigationResponse.get(), WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
     } else
-        m_policyClient->decidePolicyForResponse(*this, *frame, response, request, canShowMIMEType, WTFMove(completionHandler), m_process->transformHandlesToObjects(userData.object()).get());
+        m_policyClient->decidePolicyForResponse(*this, *frame, response, request, canShowMIMEType, WTFMove(listener), m_process->transformHandlesToObjects(userData.object()).get());
+}
+
+void WebPageProxy::decidePolicyForResponseSync(uint64_t frameID, const SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const ResourceResponse& response, const ResourceRequest& request, bool canShowMIMEType, uint64_t listenerID, const UserData& userData, Ref<Messages::WebPageProxy::DecidePolicyForResponseSync::DelayedReply>&& reply)
+{
+    PageClientProtector protector(m_pageClient);
+
+    m_decidePolicyForResponseRequest = request;
+    m_responsePolicyReply = WTFMove(reply);
+
+    decidePolicyForResponse(frameID, frameSecurityOrigin, navigationID, response, request, canShowMIMEType, listenerID, userData);
 }
 
 void WebPageProxy::unableToImplementPolicy(uint64_t frameID, const ResourceError& error, const UserData& userData)
index 078bc4e..18932cb 100644 (file)
@@ -824,6 +824,8 @@ public:
     void performDictionaryLookupOfCurrentSelection();
 #endif
 
+    void receivedPolicyDecision(WebCore::PolicyAction, WebFrameProxy&, uint64_t listenerID, API::Navigation* navigationID, const WebsitePolicies&);
+
     void backForwardRemovedItem(uint64_t itemID);
 
 #if ENABLE(DRAG_SUPPORT)    
@@ -1263,7 +1265,6 @@ private:
     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
     void didSameDocumentNavigationForFrame(uint64_t frameID, uint64_t navigationID, uint32_t sameDocumentNavigationType, WebCore::URL&&, const UserData&);
     void didChangeMainDocument(uint64_t frameID);
-    DownloadID makeDownloadProxy(WebCore::ResourceRequest&&, uint64_t navigationID);
 
     void didReceiveTitleForFrame(uint64_t frameID, const String&, const UserData&);
     void didFirstLayoutForFrame(uint64_t frameID, const UserData&);
@@ -1284,6 +1285,7 @@ private:
 
     void decidePolicyForNavigationAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, NavigationActionData&&, const FrameInfoData&, uint64_t originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply>&&);
     void decidePolicyForNewWindowAction(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, NavigationActionData&&, WebCore::ResourceRequest&&, const String& frameName, uint64_t listenerID, const UserData&);
+    void decidePolicyForResponse(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&);
     void decidePolicyForResponseSync(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, const UserData&, Ref<Messages::WebPageProxy::DecidePolicyForResponseSync::DelayedReply>&&);
     void unableToImplementPolicy(uint64_t frameID, const WebCore::ResourceError&, const UserData&);
 
@@ -1796,6 +1798,11 @@ private:
     bool m_isInPrintingMode { false };
     bool m_isPerformingDOMPrintOperation { false };
 
+    RefPtr<Messages::WebPageProxy::DecidePolicyForNavigationAction::DelayedReply> m_navigationActionPolicyReply;
+    uint64_t m_newNavigationID { 0 };
+    RefPtr<Messages::WebPageProxy::DecidePolicyForResponseSync::DelayedReply> m_responsePolicyReply;
+    WebCore::ResourceRequest m_decidePolicyForResponseRequest;
+
     bool m_shouldSuppressAppLinksInNextNavigationPolicyDecision { false };
 
     Deque<NativeWebKeyboardEvent> m_keyEventQueue;
@@ -1994,6 +2001,10 @@ private:
     bool m_isPointerLocked { false };
 #endif
 
+#if ENABLE(DOWNLOAD_ATTRIBUTE)
+    bool m_syncNavigationActionHasDownloadAttribute { false };
+#endif
+
     bool m_isUsingHighPerformanceWebGL { false };
 
     WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
index 37cea85..a08f21d 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(IOS)
 
-#import "APINavigation.h"
 #import "DrawingAreaProxy.h"
 #import "UIKitSPI.h"
 #import "ViewGestureControllerMessages.h"
index 10c5cd0..54ad762 100644 (file)
@@ -28,7 +28,6 @@
 
 #if PLATFORM(MAC)
 
-#import "APINavigation.h"
 #import "DrawingAreaProxy.h"
 #import "FrameLoadState.h"
 #import "Logging.h"
index 62a4b72..6807e93 100644 (file)
                BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */; };
                BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */; };
                BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */; };
+               BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */; };
                BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE81D8A1319F7EF00241910 /* FontInfo.cpp */; };
                BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE81D8B1319F7EF00241910 /* FontInfo.h */; };
                BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE7ACC12817988009827DA /* WebProcessProxyMessageReceiver.cpp */; };
                BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFormSubmissionListenerProxy.h; sourceTree = "<group>"; };
                BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKFormSubmissionListener.cpp; sourceTree = "<group>"; };
                BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFormSubmissionListener.h; sourceTree = "<group>"; };
+               BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameListenerProxy.h; sourceTree = "<group>"; };
+               BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFrameListenerProxy.cpp; sourceTree = "<group>"; };
                BCE81D8A1319F7EF00241910 /* FontInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontInfo.cpp; sourceTree = "<group>"; };
                BCE81D8B1319F7EF00241910 /* FontInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontInfo.h; sourceTree = "<group>"; };
                BCE9C0CF1485965D00E33D61 /* WebConnectionToUIProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConnectionToUIProcess.cpp; sourceTree = "<group>"; };
                                BCE469501214E6CB000B98EB /* WebFormClient.h */,
                                BCE469511214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp */,
                                BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */,
+                               BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */,
+                               BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */,
                                BCB9F69F1123A84B00A137E0 /* WebFramePolicyListenerProxy.cpp */,
                                BCB9F69E1123A84B00A137E0 /* WebFramePolicyListenerProxy.h */,
                                BC111B0A112F5E4F00337BAB /* WebFrameProxy.cpp */,
                                BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */,
                                BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */,
                                BC032D8D10F437A00058C15A /* WebFrame.h in Headers */,
+                               BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
                                BC032D7F10F4378D0058C15A /* WebFrameLoaderClient.h in Headers */,
                                9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
                                BCB9F6A01123A84B00A137E0 /* WebFramePolicyListenerProxy.h in Headers */,
                                BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
                                BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
                                BC111ADD112F5B9300337BAB /* WebFrame.cpp in Sources */,
+                               BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
                                BC111A5F112F4FBB00337BAB /* WebFrameLoaderClient.cpp in Sources */,
                                2D28F3E71885CCC1004B9EAE /* WebFrameLoaderClientIOS.mm in Sources */,
                                9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,