Source/WebKit2: [EFL][GTK][WK2] Remove unnecessary reinterpret_casts when setting...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Dec 2013 22:42:46 +0000 (22:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Dec 2013 22:42:46 +0000 (22:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125231

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-04
Reviewed by Anders Carlsson.

After r159988, WKClients have to be instantiated with a specific
version of that client and its Base field has to used when setting it.
Eg:

    WKFullScreenClientV0 wkClient = {
        {
            0, // version
            this, // clientInfo
        },
            willEnterFullScreen,
            willExitFullScreen
    };
    WKViewSetFullScreenClientGtk(this, &wkClient.base);

So we don't need the reinterpret_casts introduced in r160075.

* UIProcess/API/gtk/WebKitFullscreenClient.cpp:
(attachFullScreenClientToView): reinterpret_cast<WKFooClientBase*>(&client) -> &client.base
* UIProcess/API/gtk/WebKitRequestManagerClient.cpp:
(attachRequestManagerClientToContext): Ditto.
* UIProcess/API/gtk/WebKitTextChecker.cpp:
(WebKitTextChecker::WebKitTextChecker): Ditto.
* UIProcess/API/gtk/WebKitWebInspector.cpp:
(webkitWebInspectorCreate): Ditto.
* UIProcess/efl/BatteryProvider.cpp:
(BatteryProvider::BatteryProvider): Ditto.
* UIProcess/efl/NetworkInfoProvider.cpp:
(NetworkInfoProvider::NetworkInfoProvider): Ditto.
* UIProcess/efl/PageUIClientEfl.cpp:
(WebKit::PageUIClientEfl::PageUIClientEfl): Ditto.
* UIProcess/efl/RequestManagerClientEfl.cpp:
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl): Ditto.
* UIProcess/efl/TextCheckerClientEfl.cpp:
(TextCheckerClientEfl::TextCheckerClientEfl): Ditto.
* UIProcess/efl/VibrationClientEfl.cpp:
(VibrationClientEfl::VibrationClientEfl): Ditto.
* UIProcess/efl/ViewClientEfl.cpp:
(WebKit::ViewClientEfl::ViewClientEfl): Ditto.

Tools: [EFL][WK2] Buildfix after r160104
https://bugs.webkit.org/show_bug.cgi?id=125231

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-04
Reviewed by Anders Carlsson.

* TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive.cpp:
(TestWebKitAPI::TEST): reinterpret_cast<WKFooClientBase*>(&client) -> &client.base
* TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
(TestWebKitAPI::setViewClient): Ditto.

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

14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitFullscreenClient.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitTextChecker.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitWebInspector.cpp
Source/WebKit2/UIProcess/efl/BatteryProvider.cpp
Source/WebKit2/UIProcess/efl/NetworkInfoProvider.cpp
Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp
Source/WebKit2/UIProcess/efl/TextCheckerClientEfl.cpp
Source/WebKit2/UIProcess/efl/VibrationClientEfl.cpp
Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive.cpp
Tools/TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp

index 07d5ab94a6719a50517c3eea5247bb4e75e1144f..fc75fac881a8bda123e88d5ac977ab9636e116ab 100644 (file)
@@ -1,3 +1,49 @@
+2013-12-04  Nick Diego Yamane  <nick.yamane@openbossa.org>
+
+        [EFL][GTK][WK2] Remove unnecessary reinterpret_casts when setting API clients
+        https://bugs.webkit.org/show_bug.cgi?id=125231
+
+        Reviewed by Anders Carlsson.
+
+        After r159988, WKClients have to be instantiated with a specific
+        version of that client and its Base field has to used when setting it.
+        Eg:
+
+            WKFullScreenClientV0 wkClient = {
+                {
+                    0, // version
+                    this, // clientInfo
+                },
+                    willEnterFullScreen,
+                    willExitFullScreen
+            };
+            WKViewSetFullScreenClientGtk(this, &wkClient.base);
+
+        So we don't need the reinterpret_casts introduced in r160075.
+
+        * UIProcess/API/gtk/WebKitFullscreenClient.cpp:
+        (attachFullScreenClientToView): reinterpret_cast<WKFooClientBase*>(&client) -> &client.base
+        * UIProcess/API/gtk/WebKitRequestManagerClient.cpp:
+        (attachRequestManagerClientToContext): Ditto.
+        * UIProcess/API/gtk/WebKitTextChecker.cpp:
+        (WebKitTextChecker::WebKitTextChecker): Ditto.
+        * UIProcess/API/gtk/WebKitWebInspector.cpp:
+        (webkitWebInspectorCreate): Ditto.
+        * UIProcess/efl/BatteryProvider.cpp:
+        (BatteryProvider::BatteryProvider): Ditto.
+        * UIProcess/efl/NetworkInfoProvider.cpp:
+        (NetworkInfoProvider::NetworkInfoProvider): Ditto.
+        * UIProcess/efl/PageUIClientEfl.cpp:
+        (WebKit::PageUIClientEfl::PageUIClientEfl): Ditto.
+        * UIProcess/efl/RequestManagerClientEfl.cpp:
+        (WebKit::RequestManagerClientEfl::RequestManagerClientEfl): Ditto.
+        * UIProcess/efl/TextCheckerClientEfl.cpp:
+        (TextCheckerClientEfl::TextCheckerClientEfl): Ditto.
+        * UIProcess/efl/VibrationClientEfl.cpp:
+        (VibrationClientEfl::VibrationClientEfl): Ditto.
+        * UIProcess/efl/ViewClientEfl.cpp:
+        (WebKit::ViewClientEfl::ViewClientEfl): Ditto.
+
 2013-12-04  Nick Diego Yamane  <nick.yamane@openbossa.org>
 
         [GTK][WK2] Fix build after r160104
index e0db98ef5050dec553eeb661730bf3efcb1966af..6273d833cf53d5c892ab271583d6a8f3e129d857 100644 (file)
@@ -45,6 +45,6 @@ void attachFullScreenClientToView(WebKitWebView* webView)
         willEnterFullScreen,
         willExitFullScreen
     };
-    WKViewSetFullScreenClientGtk(toAPI(WEBKIT_WEB_VIEW_BASE(webView)), reinterpret_cast<WKFullScreenClientGtkBase*>(&wkFullScreenClient));
+    WKViewSetFullScreenClientGtk(toAPI(WEBKIT_WEB_VIEW_BASE(webView)), &wkFullScreenClient.base);
 }
 
index 81a07771b18dd528e129b6cc20e79a0c7968f79a..acc190154f00320014315431a96749977ff36831 100644 (file)
@@ -48,6 +48,6 @@ void attachRequestManagerClientToContext(WebKitWebContext* webContext)
         didReceiveURIRequest,
         didFailToLoadURIRequest
     };
-    WKSoupRequestManagerSetClient(toAPI(webkitWebContextGetRequestManager(webContext)), reinterpret_cast<WKSoupRequestManagerClientBase*>(&wkRequestManagerClient));
+    WKSoupRequestManagerSetClient(toAPI(webkitWebContextGetRequestManager(webContext)), &wkRequestManagerClient.base);
 }
 
index 267bfdeb53bc346d353fbf92d42dc03f735ef8fa..69b4b091bfb7fa10941f816918be660799e60bd4 100644 (file)
@@ -107,7 +107,7 @@ WebKitTextChecker::WebKitTextChecker()
         learnWordCallback,
         ignoreWordCallback,
     };
-    WKTextCheckerSetClient(reinterpret_cast<WKTextCheckerClientBase*>(&wkTextCheckerClient));
+    WKTextCheckerSetClient(&wkTextCheckerClient.base);
 }
 
 void WebKitTextChecker::checkSpellingOfString(const String& string, int& misspellingLocation, int& misspellingLength)
index bbabacaee1d892b3ec6ead94119bffecf2340245..b401c5bc6ac9e8903672d83d62bbbd445100e477 100644 (file)
@@ -329,7 +329,7 @@ WebKitWebInspector* webkitWebInspectorCreate(WebInspectorProxy* webInspector)
         detach,
         didChangeAttachedHeight
     };
-    WKInspectorSetInspectorClientGtk(toAPI(webInspector), reinterpret_cast<WKInspectorClientGtkBase*>(&wkInspectorClientGtk));
+    WKInspectorSetInspectorClientGtk(toAPI(webInspector), &wkInspectorClientGtk.base);
 
     return inspector;
 }
index ca6f133dbd0d774cf75a119278ae3430499b5d48..e0c4f70503b2c629b383fa31bb628089d1632e68 100644 (file)
@@ -78,7 +78,7 @@ BatteryProvider::BatteryProvider(WKContextRef context)
         stopUpdatingCallback
     };
 
-    WKBatteryManagerSetProvider(m_batteryManager.get(), reinterpret_cast<WKBatteryProviderBase*>(&wkBatteryProvider));
+    WKBatteryManagerSetProvider(m_batteryManager.get(), &wkBatteryProvider.base);
 }
 
 void BatteryProvider::startUpdating()
index efa7516dff51d597ea8aee3fc8b9311b2a23cec3..54db8e004da2d9f36d0567f9249cf6b6f0c9e00b 100644 (file)
@@ -82,7 +82,7 @@ NetworkInfoProvider::NetworkInfoProvider(WKContextRef context)
         isMeteredCallback
     };
 
-    WKNetworkInfoManagerSetProvider(wkNetworkInfoManager, reinterpret_cast<WKNetworkInfoProviderBase*>(&wkNetworkInfoProvider));
+    WKNetworkInfoManagerSetProvider(wkNetworkInfoManager, &wkNetworkInfoProvider.base);
 }
 
 NetworkInfoProvider::~NetworkInfoProvider()
index df5163222dd778efa7d59c6e5e391e2b54948b79..06e1a9f6986d7c3b8c5d79f6589877a7b1c083f0 100644 (file)
@@ -77,7 +77,7 @@ RequestManagerClientEfl::RequestManagerClientEfl(WKContextRef context)
     wkRequestManagerClient.base.clientInfo = this;
     wkRequestManagerClient.didReceiveURIRequest = didReceiveURIRequest;
 
-    WKSoupRequestManagerSetClient(m_soupRequestManager.get(), reinterpret_cast<WKSoupRequestManagerClientBase*>(&wkRequestManagerClient));
+    WKSoupRequestManagerSetClient(m_soupRequestManager.get(), &wkRequestManagerClient.base);
 }
 
 RequestManagerClientEfl::~RequestManagerClientEfl()
index 7216a60f82e059227224bfa8398d7cdc623e89f0..9c7caa77dfd11c20a96e30b6c2be059303c58023 100644 (file)
@@ -77,7 +77,7 @@ TextCheckerClientEfl::TextCheckerClientEfl()
         learnWordCallback,
         ignoreWordCallback
     };
-    WKTextCheckerSetClient(reinterpret_cast<WKTextCheckerClientBase*>(&wkTextCheckerClient));
+    WKTextCheckerSetClient(&wkTextCheckerClient.base);
 }
 
 TextCheckerClientEfl& TextCheckerClientEfl::instance()
index 92a9ad7d52bac1b5333437a5a1a959cc669eaf8b..2deaae021d1ce16b521dfa9d42bbcdee83ec14a3 100644 (file)
@@ -69,7 +69,7 @@ VibrationClientEfl::VibrationClientEfl(EwkView* view)
         vibrateCallback,
         cancelVibrationCallback
     };
-    WKVibrationSetProvider(wkVibration, reinterpret_cast<WKVibrationProviderBase*>(&wkVibrationProvider));
+    WKVibrationSetProvider(wkVibration, &wkVibrationProvider.base);
 }
 
 VibrationClientEfl::~VibrationClientEfl()
index f442d79ff3fed63b2a14d4248119b6e0be6b3d51..f47585b112bc62af922dd7afbef56e7eaddd1cb1 100644 (file)
@@ -200,7 +200,7 @@ ViewClientEfl::ViewClientEfl(EwkView* view)
     viewClient.doneWithTouchEvent = doneWithTouchEvent;
 #endif
 
-    WKViewSetViewClient(m_view->wkView(), reinterpret_cast<WKViewClientBase*>(&viewClient));
+    WKViewSetViewClient(m_view->wkView(), &viewClient.base);
 }
 
 ViewClientEfl::~ViewClientEfl()
index 2a017f7c1662206614f91f8ca9f93106e974f881..cb3198ec4ee198d645f5e2a9b0f6083a2e1bd945 100644 (file)
@@ -1,3 +1,15 @@
+2013-12-04  Nick Diego Yamane  <nick.yamane@openbossa.org>
+
+        [EFL][WK2] Buildfix after r160104
+        https://bugs.webkit.org/show_bug.cgi?id=125231
+
+        Reviewed by Anders Carlsson.
+
+        * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive.cpp:
+        (TestWebKitAPI::TEST): reinterpret_cast<WKFooClientBase*>(&client) -> &client.base
+        * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp:
+        (TestWebKitAPI::setViewClient): Ditto.
+
 2013-12-04  Myles C. Maxfield  <mmaxfield@apple.com>
 
         check-webkit-style detected some ternary statements as initialization lists
index f3ed440977b965898b9ad3f202b0fb3d547890a7..889bb72203337b861819877336f0d60c9acc209c 100644 (file)
@@ -92,7 +92,7 @@ TEST(WebKit2, WKViewIsActive)
     viewClient.base.version = 0;
     viewClient.webProcessCrashed = webProcessCrashed;
     viewClient.webProcessDidRelaunch = webProcessRelaunched;
-    WKViewSetViewClient(view.get(), reinterpret_cast<WKViewClientBase*>(&viewClient));
+    WKViewSetViewClient(view.get(), &viewClient.base);
 
     WKViewInitialize(view.get());
 
index 1a31c2bdd5eba307b7ce0bdc87446129ba08a878..6741e9f34aae45e87b4a51ee7711d9faf7d6af94 100644 (file)
@@ -97,7 +97,7 @@ static void setViewClient(WKViewRef view, const void* clientInfo)
     viewClient.webProcessCrashed = webProcessCrashed;
     viewClient.webProcessDidRelaunch = webProcessDidRelaunch;
 
-    WKViewSetViewClient(view, reinterpret_cast<WKViewClientBase*>(&viewClient));
+    WKViewSetViewClient(view, &viewClient.base);
 }
 
 TEST(WebKit2, WKViewClientWebProcessCallbacks)