[GTK] Do not use deprecated callbacks in WebKitPolicyClient
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Nov 2013 10:35:04 +0000 (10:35 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Nov 2013 10:35:04 +0000 (10:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=124648

Reviewed by Philippe Normand.

Fixes compile warnings for uninitialized callbacks.

* UIProcess/API/gtk/WebKitPolicyClient.cpp:
(decidePolicyForNavigationAction): Add originatingFrame parameter.
(decidePolicyForNewWindowAction): Renamed for consistency.
(decidePolicyForResponse): Add canShowMIMEType parameter.
(attachPolicyClientToView): Add new callbacks.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitPolicyClient.cpp

index 1011902..44282d7 100644 (file)
@@ -1,3 +1,18 @@
+2013-11-20  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Do not use deprecated callbacks in WebKitPolicyClient
+        https://bugs.webkit.org/show_bug.cgi?id=124648
+
+        Reviewed by Philippe Normand.
+
+        Fixes compile warnings for uninitialized callbacks.
+
+        * UIProcess/API/gtk/WebKitPolicyClient.cpp:
+        (decidePolicyForNavigationAction): Add originatingFrame parameter.
+        (decidePolicyForNewWindowAction): Renamed for consistency.
+        (decidePolicyForResponse): Add canShowMIMEType parameter.
+        (attachPolicyClientToView): Add new callbacks.
+
 2013-11-19  Ryosuke Niwa  <rniwa@webkit.org>
 
         Enable HTMLTemplateElement on Mac port
index 72a5266..0eaa9be 100644 (file)
@@ -29,7 +29,7 @@
 
 using namespace WebKit;
 
-static void decidePolicyForNavigationActionCallback(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKFrameRef originatingFrame, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
 {
     GRefPtr<WebKitNavigationPolicyDecision> decision =
         adoptGRef(webkitNavigationPolicyDecisionCreate(static_cast<WebKitNavigationType>(navigationType),
@@ -43,7 +43,7 @@ static void decidePolicyForNavigationActionCallback(WKPageRef page, WKFrameRef f
                                     WEBKIT_POLICY_DECISION(decision.get()));
 }
 
-static void decidePolicyForNewWindowActionCallback(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
 {
     GRefPtr<WebKitNavigationPolicyDecision> decision =
         adoptGRef(webkitNavigationPolicyDecisionCreate(static_cast<WebKitNavigationType>(navigationType),
@@ -57,7 +57,7 @@ static void decidePolicyForNewWindowActionCallback(WKPageRef page, WKFrameRef fr
                                     WEBKIT_POLICY_DECISION(decision.get()));
 }
 
-static void decidePolicyForResponseCallback(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+static void decidePolicyForResponse(WKPageRef page, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef request, bool canShowMIMEType, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
 {
     GRefPtr<WebKitResponsePolicyDecision> decision =
         adoptGRef(webkitResponsePolicyDecisionCreate(toImpl(request), toImpl(response), toImpl(listener)));
@@ -71,10 +71,12 @@ void attachPolicyClientToView(WebKitWebView* webView)
     WKPagePolicyClient policyClient = {
         kWKPagePolicyClientCurrentVersion,
         webView, // clientInfo
-        decidePolicyForNavigationActionCallback,
-        decidePolicyForNewWindowActionCallback,
-        decidePolicyForResponseCallback,
+        0, // decidePolicyForNavigationAction_deprecatedForUseWithV0
+        decidePolicyForNewWindowAction,
+        0, // decidePolicyForResponse_deprecatedForUseWithV0
         0, // unableToImplementPolicy
+        decidePolicyForNavigationAction,
+        decidePolicyForResponse
     };
     WKPageSetPagePolicyClient(toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView))), &policyClient);
 }