Give the policy client the originating frame of a navigation action
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Nov 2013 22:22:30 +0000 (22:22 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Nov 2013 22:22:30 +0000 (22:22 +0000)
commit3bd48484b99416664af5e719cc7f4dee24d72116
treedacb7daf60a47e87c5d46d27a15bf2e7ecb73b21
parent326c4086cbcb393a8be4283c00d1fa30f601b144
Give the policy client the originating frame of a navigation action
https://bugs.webkit.org/show_bug.cgi?id=124431

Reviewed by Anders Carlsson.

Source/WebKit2:

* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::callMemberFunction): Added a seventh message parameter to this template.

* Shared/APIClientTraits.cpp: Defined API traits for WKPagePolicyClient, which now has two
versions.
* Shared/APIClientTraits.h: Declared APIClientTraits<WKPagePolicyClient>.

* UIProcess/API/C/WKPage.h: Added an originatingFrame parameter to
WKPageDecidePolicyForNavigationActionCallback and deprecated the old version. Bumped the
policy client version to 1.

* UIProcess/API/mac/WKBrowsingContextController.mm:
(setUpPagePolicyClient): Include the originating frame‚Äôs URL under the a new key in the
action information dictionary.
* UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h: Declared
WKActionOriginatingFrameURLKey.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::decidePolicyForNavigationAction): Added originatingFrame parameter.
(WebKit::WebInspectorProxy::createInspectorPage): Updated to the new version of the policy
client interface.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Added originatingFrameID parameter
and passing the originating frame to the policy client.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Added originatingFrameID paremeter to
DecidePolicyForNavigationAction.

* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::decidePolicyForNavigationAction): Added originatingFrame
parameter, which is passed to the client callback.
* UIProcess/WebPolicyClient.h:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Determine the
originating frame for link activation and form submission actions and send its ID in the
DecidePolicyForNavigationAction message.

Tools:

* MiniBrowser/mac/WK2BrowserWindowController.m:
(decidePolicyForNavigationAction): Added originatingFrame parameter.
(-[WK2BrowserWindowController awakeFromNib]): Updated for the new version of the policy
client.

* TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp:
(TestWebKitAPI::decidePolicyForNavigationAction): Added originatingFrame parameter.
(TestWebKitAPI::setPagePolicyClient): Updated for the new version of the policy client.

* TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
(TestWebKitAPI::decidePolicyForNavigationAction): Added originatingFrame parameter.
(TestWebKitAPI::TEST): Updated for the new version of the policy client.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions): Updated for the new version of the policy
client.
(WTR::TestController::decidePolicyForNavigationAction): Added originatingFrame parameter.
* WebKitTestRunner/TestController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/CoreIPC/HandleMessage.h
Source/WebKit2/Shared/APIClientTraits.cpp
Source/WebKit2/Shared/APIClientTraits.h
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextPolicyDelegate.h
Source/WebKit2/UIProcess/WebInspectorProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/WebPolicyClient.cpp
Source/WebKit2/UIProcess/WebPolicyClient.h
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Tools/ChangeLog
Tools/MiniBrowser/mac/WK2BrowserWindowController.m
Tools/TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp
Tools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h