Diff
Modified: trunk/Source/WebKit2/ChangeLog (163505 => 163506)
--- trunk/Source/WebKit2/ChangeLog 2014-02-06 02:30:04 UTC (rev 163505)
+++ trunk/Source/WebKit2/ChangeLog 2014-02-06 03:07:17 UTC (rev 163506)
@@ -1,3 +1,18 @@
+2014-02-05 Anders Carlsson <ander...@apple.com>
+
+ Add -[WKNavigationAction request]
+ https://bugs.webkit.org/show_bug.cgi?id=128288
+
+ Reviewed by Andreas Kling.
+
+ * UIProcess/API/Cocoa/WKNavigationAction.h:
+ * UIProcess/API/Cocoa/WKNavigationAction.mm:
+ (-[WKNavigationAction request]):
+ (-[WKNavigationAction setRequest:]):
+ * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
+ * UIProcess/Cocoa/NavigationState.mm:
+ (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
+
2014-02-05 Sam Weinig <s...@webkit.org>
[WebKit2, FTL] Add user default to enable the FTL
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h (163505 => 163506)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h 2014-02-06 02:30:04 UTC (rev 163505)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h 2014-02-06 03:07:17 UTC (rev 163506)
@@ -45,6 +45,7 @@
@property (nonatomic, readonly) WKFrameInfo *sourceFrame;
@property (nonatomic, readonly) WKNavigationType navigationType;
+@property (nonatomic, readonly) NSURLRequest *request;
@end
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm (163505 => 163506)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm 2014-02-06 02:30:04 UTC (rev 163505)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm 2014-02-06 03:07:17 UTC (rev 163506)
@@ -32,6 +32,7 @@
@implementation WKNavigationAction {
RetainPtr<WKFrameInfo> _sourceFrame;
+ RetainPtr<NSURLRequest> _request;
}
- (WKFrameInfo *)sourceFrame
@@ -44,6 +45,16 @@
_sourceFrame = sourceFrame;
}
+- (NSURLRequest *)request
+{
+ return _request.get();
+}
+
+- (void)setRequest:(NSURLRequest *)request
+{
+ _request = adoptNS([request copy]);
+}
+
@end
#endif
Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h (163505 => 163506)
--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h 2014-02-06 02:30:04 UTC (rev 163505)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h 2014-02-06 03:07:17 UTC (rev 163506)
@@ -32,6 +32,7 @@
@property (nonatomic, readwrite, strong) WKFrameInfo *sourceFrame;
@property (nonatomic, readwrite) WKNavigationType navigationType;
+@property (nonatomic, readwrite, copy) NSURLRequest *request;
@end
Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (163505 => 163506)
--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm 2014-02-06 02:30:04 UTC (rev 163505)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm 2014-02-06 03:07:17 UTC (rev 163506)
@@ -136,7 +136,7 @@
return frameInfo;
}
-void NavigationState::PolicyClient::decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy* destinationFrame, const NavigationActionData& navigationActionData, WebFrameProxy* sourceFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest&, RefPtr<WebFramePolicyListenerProxy> listener, API::Object* userData)
+void NavigationState::PolicyClient::decidePolicyForNavigationAction(WebPageProxy*, WebFrameProxy* destinationFrame, const NavigationActionData& navigationActionData, WebFrameProxy* sourceFrame, const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceRequest& request, RefPtr<WebFramePolicyListenerProxy> listener, API::Object* userData)
{
if (!m_navigationState.m_navigationDelegateMethods.webViewDecidePolicyForNavigationActionDecisionHandler) {
// FIXME: <rdar://problem/15949822> Figure out what the "default delegate behavior" should be here.
@@ -158,6 +158,7 @@
}
[navigationAction setNavigationType:toWKNavigationType(navigationActionData.navigationType)];
+ [navigationAction setRequest:request.nsURLRequest(WebCore::DoNotUpdateHTTPBody)];
[navigationDelegate webView:m_navigationState.m_webView decidePolicyForNavigationAction:navigationAction.get() decisionHandler:[listener](WKNavigationPolicyDecision policyDecision) {
switch (policyDecision) {