[GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=1159

System Internals / WebKit - carlosgc@webkit.org [268f45cc-cd09-0410-ab3c-d52691b4dbfc] - 10 May 2013 11:11 UTC

[GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=115904

Reviewed by Martin Robinson.

Source/WebCore:

- bindings/gobject/WebKitDOMEventTarget.cpp:
- platform/gtk/GtkVersioning.c:
- platform/gtk/GtkVersioning.h:

Source/WebKit2:

- UIProcess/API/gtk/tests/TestInspectorServer.cpp: (startTestServerMonitor):
- UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp: (startTestServerMonitor):

Source/WTF:

- wtf/gobject/GRefPtr.cpp:

Tools:

- ImageDiff/gtk/ImageDiff.cpp: (main):

###

diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 1ffaa47..3c0bd25 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,12 @@
+2013-05-10 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115904
+
+ Reviewed by Martin Robinson.
+
+ * wtf/gobject/GRefPtr.cpp:
+
2013-05-09 Darin Adler

RenderQuote has giant function for language to quotes map
diff --git a/Source/WTF/wtf/gobject/GRefPtr.cpp b/Source/WTF/wtf/gobject/GRefPtr.cpp
index 317139d..92554ab 100644
--- a/Source/WTF/wtf/gobject/GRefPtr.cpp
+++ b/Source/WTF/wtf/gobject/GRefPtr.cpp
@@ -63,7 +63,6 @@ template <> void derefGPtr(GMainLoop* ptr)
g_main_loop_unref(ptr);
}

-#if GLIB_CHECK_VERSION(2, 32, 0)
template <> GBytes* refGPtr(GBytes* ptr)
{
if (ptr)
@@ -77,24 +76,6 @@ template <> void derefGPtr(GBytes* ptr)
g_bytes_unref(ptr);
}

-# else
-
-typedef struct _GBytes {
- bool fake;
-} GBytes;
-
-template <> GBytes* refGPtr(GBytes* ptr)
-{
- return ptr;
-}
-
-template <> void derefGPtr(GBytes* ptr)
-{
-}
-
-#endif
-
-#if GLIB_CHECK_VERSION(2, 24, 0)
template <> GVariant* refGPtr(GVariant* ptr)
{
if (ptr)
@@ -107,24 +88,6 @@ template <> void derefGPtr(GVariant* ptr)
g_variant_unref(ptr);
}

-#else
-
-// We do this so that we can avoid including the glib.h header in GRefPtr.h.
-typedef struct _GVariant {
- bool fake;
-} GVariant;
-
-template <> GVariant* refGPtr(GVariant* ptr)
-{
- return ptr;
-}
-
-template <> void derefGPtr(GVariant* ptr)
-{
-}
-
-#endif
-
template <> GSource* refGPtr(GSource* ptr)
{
if (ptr)
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 68122e8..d4c1d9e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2013-05-10 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115904
+
+ Reviewed by Martin Robinson.
+
+ * bindings/gobject/WebKitDOMEventTarget.cpp:
+ * platform/gtk/GtkVersioning.c:
+ * platform/gtk/GtkVersioning.h:
+
2013-05-10 Zoltan Arvai

Unreviewed. Fix the ENABLE(SHARED_WORKERS) build after r149864.
diff --git a/Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp b/Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp
index e21ab46..d885b2c 100644
--- a/Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp
+++ b/Source/WebCore/bindings/gobject/WebKitDOMEventTarget.cpp
@@ -38,30 +38,8 @@
#include "WebKitDOMPrivate.h"

typedef WebKitDOMEventTargetIface WebKitDOMEventTargetInterface;
-#if GLIB_CHECK_VERSION(2, 24, 0)
-G_DEFINE_INTERFACE(WebKitDOMEventTarget, webkit_dom_event_target, G_TYPE_OBJECT)
-#else
-static void webkit_dom_event_target_default_init(WebKitDOMEventTargetIface*);

-GType webkit_dom_event_target_get_type(void)
-{
- static volatile gsize typeIdVolatile = 0;
-
- if (g_once_init_enter(&typeIdVolatile)) {
- GType typeId = g_type_register_static_simple(G_TYPE_INTERFACE,
- g_intern_static_string("WebKitDOMEventTarget"),
- sizeof(WebKitDOMEventTargetInterface),
- (GClassInitFunc)webkit_dom_event_target_default_init,
- 0,
- static_cast(0),
- static_cast(0));
- g_type_interface_add_prerequisite(typeId, G_TYPE_OBJECT);
- g_once_init_leave(&typeIdVolatile, typeId);
- }
-
- return typeIdVolatile;
-}
-#endif
+G_DEFINE_INTERFACE(WebKitDOMEventTarget, webkit_dom_event_target, G_TYPE_OBJECT)

static void webkit_dom_event_target_default_init(WebKitDOMEventTargetIface*)
{
diff --git a/Source/WebCore/platform/gtk/GtkVersioning.c b/Source/WebCore/platform/gtk/GtkVersioning.c
index ac2f84c..2c8f5d8 100644
--- a/Source/WebCore/platform/gtk/GtkVersioning.c
+++ b/Source/WebCore/platform/gtk/GtkVersioning.c
@@ -289,14 +289,6 @@ void getGdkDrawableSize(GdkDrawable *drawable, int *width, int *height)

#endif // GTK_API_VERSION_2

-#if !GLIB_CHECK_VERSION(2, 27, 1)
-gboolean g_signal_accumulator_first_wins(GSignalInvocationHint *invocationHint, GValue *returnAccumulator, const GValue *handlerReturn, gpointer data)
-{
- g_value_copy(handlerReturn, returnAccumulator);
- return FALSE;
-}
-#endif
-
#if !GTK_CHECK_VERSION(2, 22, 0)
cairo_surface_t *gdk_window_create_similar_surface(GdkWindow *window, cairo_content_t content, int width, int height)
{
diff --git a/Source/WebCore/platform/gtk/GtkVersioning.h b/Source/WebCore/platform/gtk/GtkVersioning.h
index e3cac63..251ade2 100644
--- a/Source/WebCore/platform/gtk/GtkVersioning.h
+++ b/Source/WebCore/platform/gtk/GtkVersioning.h
@@ -114,10 +114,6 @@ void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
GdkCursor* blankCursor();

-#if !GLIB_CHECK_VERSION(2, 27, 1)
-gboolean g_signal_accumulator_first_wins(GSignalInvocationHint* invocationHint, GValue* returnAccumulator, const GValue* handlerReturn, gpointer data);
-#endif
-
#if !GTK_CHECK_VERSION(3, 3, 6)
void gdk_screen_get_monitor_workarea(GdkScreen *, int monitor, GdkRectangle *area);
#endif
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 3357cc1..4542b4a 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,15 @@
+2013-05-10 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115904
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/tests/TestInspectorServer.cpp:
+ (startTestServerMonitor):
+ * UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp:
+ (startTestServerMonitor):
+
2013-05-09 Anders Carlsson

Fix build.
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp
index 48b4e2b..92b7f00b 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestInspectorServer.cpp
@@ -73,12 +73,7 @@ static gpointer testServerMonitorThreadFunc(gpointer)
static void startTestServerMonitor()
{
gChildIsReady = false;
-
-#if (!GLIB_CHECK_VERSION(2, 31, 0))
- g_thread_create(testServerMonitorThreadFunc, 0, FALSE, 0);
-#else
g_thread_new("TestServerMonitor", testServerMonitorThreadFunc, 0);
-#endif
}

static void startTestServer()
diff --git a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp
index 3db9094..d3750c0 100644
--- a/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp
+++ b/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitAccessibility.cpp
@@ -81,12 +81,7 @@ static gpointer testServerMonitorThreadFunc(gpointer)
static void startTestServerMonitor()
{
kChildIsReady = false;
-
-#if (!GLIB_CHECK_VERSION(2, 31, 0))
- g_thread_create(testServerMonitorThreadFunc, 0, FALSE, 0);
-#else
g_thread_new("TestServerMonitor", testServerMonitorThreadFunc, 0);
-#endif
}

static void startTestServer()
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index aa2f7b9..c4555e2 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,13 @@
+2013-05-10 Carlos Garcia Campos
+
+ [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=115904
+
+ Reviewed by Martin Robinson.
+
+ * ImageDiff/gtk/ImageDiff.cpp:
+ (main):
+
2013-05-10 Balazs Kelemen

Add my new address to contributors.json. (Unreviewed)
diff --git a/Tools/ImageDiff/gtk/ImageDiff.cpp b/Tools/ImageDiff/gtk/ImageDiff.cpp
index 7baa25e..84c4003 100644
--- a/Tools/ImageDiff/gtk/ImageDiff.cpp
+++ b/Tools/ImageDiff/gtk/ImageDiff.cpp
@@ -177,10 +177,6 @@ void printImageDifferences(GdkPixbuf* baselineImage, GdkPixbuf* actualImage)

int main(int argc, char* argv[])
{
-#if !GLIB_CHECK_VERSION(2, 35, 0)
- g_type_init();
-#endif
-
GError* error = 0;
GOptionContext* context = g_option_context_new("- compare two image files, printing their percentage difference and the difference image to stdout");
g_option_context_add_main_entries(context, commandLineOptionEntries, 0);

8e51566 [GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs https://bugs.webkit.org/show_bug.cgi?id=115904
Source/WTF/ChangeLog | 9 +++++
Source/WTF/wtf/gobject/GRefPtr.cpp | 37 --------------------
Source/WebCore/ChangeLog | 11 ++++++
.../bindings/gobject/WebKitDOMEventTarget.cpp | 24 +------------
Source/WebCore/platform/gtk/GtkVersioning.c | 8 -----
Source/WebCore/platform/gtk/GtkVersioning.h | 4 ---
Source/WebKit2/ChangeLog | 12 +++++++
.../API/gtk/tests/TestInspectorServer.cpp | 5 ---
.../API/gtk/tests/TestWebKitAccessibility.cpp | 5 ---
Tools/ChangeLog | 10 ++++++
Tools/ImageDiff/gtk/ImageDiff.cpp | 4 ---
11 files changed, 43 insertions(+), 86 deletions(-)

Upstream: github.com


  • Share