<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[160495] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/160495">160495</a></dd>
<dt>Author</dt> <dd>mitz@apple.com</dd>
<dt>Date</dt> <dd>2013-12-12 10:41:55 -0800 (Thu, 12 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Cocoa] Navigation action information for policy decisions is missing the original request
https://bugs.webkit.org/show_bug.cgi?id=125612
Reviewed by Anders Carlsson.
* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::callMemberFunction): Added template with additional message parameter.
* UIProcess/API/C/WKPagePolicyClientInternal.h: Added. Defines a new version of the client
interface with a new version of the policy decision callback.
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(setUpPagePolicyClient): Use the new internal version of the client. Pass the original
request in the action information dictionary under a new key.
* UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h: Declared new action information
key.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Added originalRequest parameter,
which is passed to the policy client.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Added originalRequest parameter in
DecidePolicyForNavigationAction.
* UIProcess/WebPolicyClient.cpp:
(WebKit::WebPolicyClient::decidePolicyForNavigationAction): Pass the original request to
the client.
* UIProcess/WebPolicyClient.h:
* WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the original
request from the navigation action to the UI process.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformCoreIPCHandleMessageh">trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextControllermm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextPolicyDelegateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPolicyClientcpp">trunk/Source/WebKit2/UIProcess/WebPolicyClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPolicyClienth">trunk/Source/WebKit2/UIProcess/WebPolicyClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKPagePolicyClientInternalh">trunk/Source/WebKit2/UIProcess/API/C/WKPagePolicyClientInternal.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/ChangeLog        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2013-12-12 Dan Bernstein <mitz@apple.com>
+
+ [Cocoa] Navigation action information for policy decisions is missing the original request
+ https://bugs.webkit.org/show_bug.cgi?id=125612
+
+ Reviewed by Anders Carlsson.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC::callMemberFunction): Added template with additional message parameter.
+ * UIProcess/API/C/WKPagePolicyClientInternal.h: Added. Defines a new version of the client
+ interface with a new version of the policy decision callback.
+ * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
+ (setUpPagePolicyClient): Use the new internal version of the client. Pass the original
+ request in the action information dictionary under a new key.
+ * UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h: Declared new action information
+ key.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added originalRequest parameter,
+ which is passed to the policy client.
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in: Added originalRequest parameter in
+ DecidePolicyForNavigationAction.
+ * UIProcess/WebPolicyClient.cpp:
+ (WebKit::WebPolicyClient::decidePolicyForNavigationAction): Pass the original request to
+ the client.
+ * UIProcess/WebPolicyClient.h:
+ * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the original
+ request from the navigation action to the UI process.
+
</ins><span class="cx"> 2013-12-12 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> [Autotools] Prepend the WebCore layer archives' names with 'lib'
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformCoreIPCHandleMessageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/Platform/CoreIPC/HandleMessage.h        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -364,6 +364,12 @@
</span><span class="cx"> (object->*function)(std::get<0>(args), std::get<1>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args), std::get<5>(args), std::get<6>(args), decoder, std::get<0>(replyArgs), std::get<1>(replyArgs), std::get<2>(replyArgs));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template<typename C, typename MF, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename R1, typename R2, typename R3>
+void callMemberFunction(std::tuple<P1, P2, P3, P4, P5, P6, P7, P8>&& args, MessageDecoder& decoder, std::tuple<R1, R2, R3>& replyArgs, C* object, MF function)
+{
+ (object->*function)(std::get<0>(args), std::get<1>(args), std::get<2>(args), std::get<3>(args), std::get<4>(args), std::get<5>(args), std::get<6>(args), std::get<7>(args), decoder, std::get<0>(replyArgs), std::get<1>(replyArgs), std::get<2>(replyArgs));
+}
+
</ins><span class="cx"> // Main dispatch functions
</span><span class="cx"> template<typename T, typename C, typename MF>
</span><span class="cx"> void handleMessage(MessageDecoder& decoder, C* object, MF function)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKPagePolicyClientInternalh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/C/WKPagePolicyClientInternal.h (0 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKPagePolicyClientInternal.h         (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPagePolicyClientInternal.h        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2013 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.
+ */
+
+#ifndef WKPagePolicyClientInternal_h
+#define WKPagePolicyClientInternal_h
+
+#include "WKPagePolicyClient.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*WKPageDecidePolicyForNavigationActionCallback_internal)(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef originalRequest, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo);
+
+typedef struct WKPagePolicyClientInternal {
+ WKPagePolicyClientBase base;
+
+ // Version 0.
+ WKPageDecidePolicyForNavigationActionCallback_deprecatedForUseWithV0 decidePolicyForNavigationAction_deprecatedForUseWithV0;
+ WKPageDecidePolicyForNewWindowActionCallback decidePolicyForNewWindowAction;
+ WKPageDecidePolicyForResponseCallback_deprecatedForUseWithV0 decidePolicyForResponse_deprecatedForUseWithV0;
+ WKPageUnableToImplementPolicyCallback unableToImplementPolicy;
+
+ // Version 1.
+ WKPageDecidePolicyForNavigationActionCallback decidePolicyForNavigationAction_deprecatedForUseWithV1;
+ WKPageDecidePolicyForResponseCallback decidePolicyForResponse;
+
+ // Internal.
+ WKPageDecidePolicyForNavigationActionCallback_internal decidePolicyForNavigationAction;
+} WKPagePolicyClientInternal;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKPagePolicyClientInternal_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx"> NSString * const WKActionNavigationTypeKey = @"WKActionNavigationTypeKey";
</span><span class="cx"> NSString * const WKActionMouseButtonKey = @"WKActionMouseButtonKey";
</span><span class="cx"> NSString * const WKActionModifierFlagsKey = @"WKActionModifierFlagsKey";
</span><ins>+NSString * const WKActionOriginalURLRequestKey = @"WKActionOriginalURLRequestKey";
</ins><span class="cx"> NSString * const WKActionURLRequestKey = @"WKActionURLRequestKey";
</span><span class="cx"> NSString * const WKActionURLResponseKey = @"WKActionURLResponseKey";
</span><span class="cx"> NSString * const WKActionFrameNameKey = @"WKActionFrameNameKey";
</span><span class="lines">@@ -561,13 +562,13 @@
</span><span class="cx">
</span><span class="cx"> static void setUpPagePolicyClient(WKBrowsingContextController *browsingContext, WebPageProxy& page)
</span><span class="cx"> {
</span><del>- WKPagePolicyClientV1 policyClient;
</del><ins>+ WKPagePolicyClientInternal policyClient;
</ins><span class="cx"> memset(&policyClient, 0, sizeof(policyClient));
</span><span class="cx">
</span><del>- policyClient.base.version = 1;
</del><ins>+ policyClient.base.version = 2;
</ins><span class="cx"> policyClient.base.clientInfo = browsingContext;
</span><span class="cx">
</span><del>- policyClient.decidePolicyForNavigationAction = [](WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
</del><ins>+ policyClient.decidePolicyForNavigationAction = [](WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef originalRequest, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
</ins><span class="cx"> {
</span><span class="cx"> WKBrowsingContextController *browsingContext = (WKBrowsingContextController *)clientInfo;
</span><span class="cx"> auto policyDelegate = browsingContext->_policyDelegate.get();
</span><span class="lines">@@ -578,6 +579,7 @@
</span><span class="cx"> WKActionNavigationTypeKey: @(navigationType),
</span><span class="cx"> WKActionModifierFlagsKey: @(modifiers),
</span><span class="cx"> WKActionMouseButtonKey: @(mouseButton),
</span><ins>+ WKActionOriginalURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(originalRequest)).get(),
</ins><span class="cx"> WKActionURLRequestKey: adoptNS(WKURLRequestCopyNSURLRequest(request)).get()
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKBrowsingContextPolicyDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextPolicyDelegate.h        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> WK_EXPORT extern NSString * const WKActionNavigationTypeKey; // NSNumber (WKNavigationType)
</span><span class="cx"> WK_EXPORT extern NSString * const WKActionMouseButtonKey; // NSNumber (0 for left button, 1 for middle button, 2 for right button)
</span><span class="cx"> WK_EXPORT extern NSString * const WKActionModifierFlagsKey; // NSNumber (unsigned)
</span><ins>+WK_EXPORT extern NSString * const WKActionOriginalURLRequestKey; // NSURLRequest
</ins><span class="cx"> WK_EXPORT extern NSString * const WKActionURLRequestKey; // NSURLRequest
</span><span class="cx"> WK_EXPORT extern NSString * const WKActionURLResponseKey; // NSURLResponse
</span><span class="cx"> WK_EXPORT extern NSString * const WKActionFrameNameKey; // NSString
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -2424,7 +2424,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // PolicyClient
</span><del>-void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t originatingFrameID, const ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder& decoder, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
</del><ins>+void WebPageProxy::decidePolicyForNavigationAction(uint64_t frameID, uint32_t opaqueNavigationType, uint32_t opaqueModifiers, int32_t opaqueMouseButton, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder& decoder, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<API::Object> userData;
</span><span class="cx"> WebContextUserMessageDecoder messageDecoder(userData, process());
</span><span class="lines">@@ -2439,6 +2439,7 @@
</span><span class="cx"> WebFrameProxy* frame = m_process->webFrame(frameID);
</span><span class="cx"> MESSAGE_CHECK(frame);
</span><span class="cx"> MESSAGE_CHECK_URL(request.url());
</span><ins>+ MESSAGE_CHECK_URL(originalRequest.url());
</ins><span class="cx">
</span><span class="cx"> NavigationType navigationType = static_cast<NavigationType>(opaqueNavigationType);
</span><span class="cx"> WebEvent::Modifiers modifiers = static_cast<WebEvent::Modifiers>(opaqueModifiers);
</span><span class="lines">@@ -2452,7 +2453,7 @@
</span><span class="cx"> m_inDecidePolicyForNavigationAction = true;
</span><span class="cx"> m_syncNavigationActionPolicyActionIsValid = false;
</span><span class="cx">
</span><del>- if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, originatingFrame, request, listener.get(), userData.get()))
</del><ins>+ if (!m_policyClient.decidePolicyForNavigationAction(this, frame, navigationType, modifiers, mouseButton, originatingFrame, originalRequest, request, listener.get(), userData.get()))
</ins><span class="cx"> listener->use();
</span><span class="cx">
</span><span class="cx"> m_inDecidePolicyForNavigationAction = false;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -898,7 +898,7 @@
</span><span class="cx"> void didChangeProgress(double);
</span><span class="cx"> void didFinishProgress();
</span><span class="cx">
</span><del>- void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, uint64_t originatingFrameID, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
</del><ins>+ void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, uint64_t originatingFrameID, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest& request, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
</ins><span class="cx"> void decidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, const String& frameName, uint64_t listenerID, CoreIPC::MessageDecoder&);
</span><span class="cx"> void decidePolicyForResponse(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, CoreIPC::MessageDecoder&);
</span><span class="cx"> void decidePolicyForResponseSync(uint64_t frameID, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, uint64_t listenerID, CoreIPC::MessageDecoder&, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">
</span><span class="cx"> # Policy messages
</span><span class="cx"> DecidePolicyForResponseSync(uint64_t frameID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, bool canShowMIMEType, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID) Variadic
</span><del>- DecidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, uint64_t originatingFrameID, WebCore::ResourceRequest request, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID) Variadic
</del><ins>+ DecidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, uint64_t originatingFrameID, WebCore::ResourceRequest originalRequest, WebCore::ResourceRequest request, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID) Variadic
</ins><span class="cx"> DecidePolicyForNewWindowAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, WebCore::ResourceRequest request, String frameName, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
</span><span class="cx"> UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData) Variadic
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPolicyClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPolicyClient.cpp (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPolicyClient.cpp        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/WebPolicyClient.cpp        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -34,17 +34,20 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, WebFrameProxy* originatingFrame, const ResourceRequest& resourceRequest, WebFramePolicyListenerProxy* listener, API::Object* userData)
</del><ins>+bool WebPolicyClient::decidePolicyForNavigationAction(WebPageProxy* page, WebFrameProxy* frame, NavigationType type, WebEvent::Modifiers modifiers, WebMouseEvent::Button mouseButton, WebFrameProxy* originatingFrame, const ResourceRequest& originalResourceRequest, const ResourceRequest& resourceRequest, WebFramePolicyListenerProxy* listener, API::Object* userData)
</ins><span class="cx"> {
</span><del>- if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction)
</del><ins>+ if (!m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0 && !m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1 && !m_client.decidePolicyForNavigationAction)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><ins>+ RefPtr<WebURLRequest> originalRequest = WebURLRequest::create(originalResourceRequest);
</ins><span class="cx"> RefPtr<WebURLRequest> request = WebURLRequest::create(resourceRequest);
</span><span class="cx">
</span><span class="cx"> if (m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0)
</span><span class="cx"> m_client.decidePolicyForNavigationAction_deprecatedForUseWithV0(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
</span><ins>+ else if (m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1)
+ m_client.decidePolicyForNavigationAction_deprecatedForUseWithV1(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(originatingFrame), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
</ins><span class="cx"> else
</span><del>- m_client.decidePolicyForNavigationAction(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(originatingFrame), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
</del><ins>+ m_client.decidePolicyForNavigationAction(toAPI(page), toAPI(frame), toAPI(type), toAPI(modifiers), toAPI(mouseButton), toAPI(originatingFrame), toAPI(originalRequest.get()), toAPI(request.get()), toAPI(listener), toAPI(userData), m_client.base.clientInfo);
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPolicyClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPolicyClient.h (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPolicyClient.h        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/UIProcess/WebPolicyClient.h        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "APIClient.h"
</span><span class="cx"> #include "WKPage.h"
</span><ins>+#include "WKPagePolicyClientInternal.h"
</ins><span class="cx"> #include "WebEvent.h"
</span><span class="cx"> #include <WebCore/FrameLoaderTypes.h>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="lines">@@ -36,7 +37,7 @@
</span><span class="cx"> class Object;
</span><span class="cx">
</span><span class="cx"> template<> struct ClientTraits<WKPagePolicyClientBase> {
</span><del>- typedef std::tuple<WKPagePolicyClientV0, WKPagePolicyClientV1> Versions;
</del><ins>+ typedef std::tuple<WKPagePolicyClientV0, WKPagePolicyClientV1, WKPagePolicyClientInternal> Versions;
</ins><span class="cx"> };
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -54,7 +55,7 @@
</span><span class="cx">
</span><span class="cx"> class WebPolicyClient : public API::Client<WKPagePolicyClientBase> {
</span><span class="cx"> public:
</span><del>- bool decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest&, WebFramePolicyListenerProxy*, API::Object* userData);
</del><ins>+ bool decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, WebFrameProxy* originatingFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, WebFramePolicyListenerProxy*, API::Object* userData);
</ins><span class="cx"> bool decidePolicyForNewWindowAction(WebPageProxy*, WebFrameProxy*, WebCore::NavigationType, WebEvent::Modifiers, WebMouseEvent::Button, const WebCore::ResourceRequest&, const String& frameName, WebFramePolicyListenerProxy*, API::Object* userData);
</span><span class="cx"> bool decidePolicyForResponse(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceResponse&, const WebCore::ResourceRequest&, bool canShowMIMEType, WebFramePolicyListenerProxy*, API::Object* userData);
</span><span class="cx"> void unableToImplementPolicy(WebPageProxy*, WebFrameProxy*, const WebCore::ResourceError&, API::Object* userData);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -450,6 +450,7 @@
</span><span class="cx">                 372CAF0C1833FD910040AC27 /* WKNSError.mm in Sources */ = {isa = PBXBuildFile; fileRef = 372CAF0A1833FD910040AC27 /* WKNSError.mm */; };
</span><span class="cx">                 373CEAD5185417AE008C363D /* WKNSData.mm in Sources */ = {isa = PBXBuildFile; fileRef = 373CEAD3185417AE008C363D /* WKNSData.mm */; };
</span><span class="cx">                 373CEAD6185417AE008C363D /* WKNSData.h in Headers */ = {isa = PBXBuildFile; fileRef = 373CEAD4185417AE008C363D /* WKNSData.h */; };
</span><ins>+                373CEAD81859553F008C363D /* WKPagePolicyClientInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 373CEAD71859553F008C363D /* WKPagePolicyClientInternal.h */; };
</ins><span class="cx">                 374436881820E7240049579F /* WKObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 374436871820E7240049579F /* WKObject.mm */; };
</span><span class="cx">                 3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3760881C150413E900FC82C7 /* WebRenderObject.cpp */; };
</span><span class="cx">                 3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 3760881D150413E900FC82C7 /* WebRenderObject.h */; };
</span><span class="lines">@@ -2002,6 +2003,7 @@
</span><span class="cx">                 372CAF0A1833FD910040AC27 /* WKNSError.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSError.mm; sourceTree = "<group>"; };
</span><span class="cx">                 373CEAD3185417AE008C363D /* WKNSData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSData.mm; sourceTree = "<group>"; };
</span><span class="cx">                 373CEAD4185417AE008C363D /* WKNSData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNSData.h; sourceTree = "<group>"; };
</span><ins>+                373CEAD71859553F008C363D /* WKPagePolicyClientInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPagePolicyClientInternal.h; sourceTree = "<group>"; };
</ins><span class="cx">                 374436871820E7240049579F /* WKObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKObject.mm; sourceTree = "<group>"; };
</span><span class="cx">                 3760881C150413E900FC82C7 /* WebRenderObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebRenderObject.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 3760881D150413E900FC82C7 /* WebRenderObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderObject.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4661,6 +4663,7 @@
</span><span class="cx">                                 BC7B633512A45ABA00D174A4 /* WKPageGroup.h */,
</span><span class="cx">                                 1AB8A1EB1840080900E9AE69 /* WKPageLoaderClient.h */,
</span><span class="cx">                                 1AB8A1ED18400ACB00E9AE69 /* WKPagePolicyClient.h */,
</span><ins>+                                373CEAD71859553F008C363D /* WKPagePolicyClientInternal.h */,
</ins><span class="cx">                                 BC177464118B9FF4007D9E9A /* WKPagePrivate.h */,
</span><span class="cx">                                 1AB8A1F118400B6200E9AE69 /* WKPageUIClient.h */,
</span><span class="cx">                                 1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */,
</span><span class="lines">@@ -6184,6 +6187,7 @@
</span><span class="cx">                                 BCDDB32B124EC2AB0048D13C /* WKSharedAPICast.h in Headers */,
</span><span class="cx">                                 BC407606124FF0270068F20A /* WKString.h in Headers */,
</span><span class="cx">                                 7C9D1537184584DA009D3918 /* WKBrowsingContextGroupInternal.h in Headers */,
</span><ins>+                                373CEAD81859553F008C363D /* WKPagePolicyClientInternal.h in Headers */,
</ins><span class="cx">                                 BC40761A124FF0370068F20A /* WKStringCF.h in Headers */,
</span><span class="cx">                                 759CCD591808F1690078E8A8 /* WebOriginDataManagerProxyChangeClient.h in Headers */,
</span><span class="cx">                                 BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (160494 => 160495)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-12-12 18:41:35 UTC (rev 160494)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-12-12 18:41:55 UTC (rev 160495)
</span><span class="lines">@@ -728,7 +728,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Notify the UIProcess.
</span><del>- if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationAction(m_frame->frameID(), action->navigationType(), action->modifiers(), action->mouseButton(), originatingFrame ? originatingFrame->frameID() : 0, request, listenerID, InjectedBundleUserMessageEncoder(userData.get())), Messages::WebPageProxy::DecidePolicyForNavigationAction::Reply(receivedPolicyAction, policyAction, downloadID)))
</del><ins>+ if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationAction(m_frame->frameID(), action->navigationType(), action->modifiers(), action->mouseButton(), originatingFrame ? originatingFrame->frameID() : 0, navigationAction.resourceRequest(), request, listenerID, InjectedBundleUserMessageEncoder(userData.get())), Messages::WebPageProxy::DecidePolicyForNavigationAction::Reply(receivedPolicyAction, policyAction, downloadID)))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // We call this synchronously because WebCore cannot gracefully handle a frame load without a synchronous navigation policy reply.
</span></span></pre>
</div>
</div>
</body>
</html>