[GTK] Remove GDK dependency from SharedTimerGtk
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 12:49:38 +0000 (12:49 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 12:49:38 +0000 (12:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138092

Reviewed by Martin Robinson.

It depends on GDK just to use GDK_PRIORITY_REDRAW constant, we can
use its value directly instead.

* PlatformGTK.cmake:
* platform/gtk/SharedTimerGtk.cpp:
(WebCore::setSharedTimerFireInterval):

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

Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/gtk/SharedTimerGtk.cpp

index 8010602..ccb718d 100644 (file)
@@ -1,3 +1,17 @@
+2014-10-28  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Remove GDK dependency from SharedTimerGtk
+        https://bugs.webkit.org/show_bug.cgi?id=138092
+
+        Reviewed by Martin Robinson.
+
+        It depends on GDK just to use GDK_PRIORITY_REDRAW constant, we can
+        use its value directly instead.
+
+        * PlatformGTK.cmake:
+        * platform/gtk/SharedTimerGtk.cpp:
+        (WebCore::setSharedTimerFireInterval):
+
 2014-10-27  Andreas Kling  <akling@apple.com>
 
         Move RenderBlock::beingDestroyed() to RenderObject.
index 8a14cad..cf9531f 100644 (file)
@@ -132,6 +132,7 @@ list(APPEND WebCore_SOURCES
     platform/gtk/LoggingGtk.cpp
     platform/gtk/MIMETypeRegistryGtk.cpp
     platform/gtk/SharedBufferGtk.cpp
+    platform/gtk/SharedTimerGtk.cpp
     platform/gtk/TemporaryLinkStubs.cpp
     platform/gtk/UserAgentGtk.cpp
 
@@ -234,7 +235,6 @@ list(APPEND WebCorePlatformGTK_SOURCES
     platform/gtk/PlatformWheelEventGtk.cpp
     platform/gtk/RedirectedXCompositeWindow.cpp
     platform/gtk/ScrollbarThemeGtk.cpp
-    platform/gtk/SharedTimerGtk.cpp
     platform/gtk/SoundGtk.cpp
     platform/gtk/WidgetGtk.cpp
 
index bdc3c55..74c6f70 100644 (file)
@@ -28,7 +28,6 @@
 #include "config.h"
 #include "SharedTimer.h"
 
-#include <gdk/gdk.h>
 #include <wtf/gobject/GMainLoopSource.h>
 
 namespace WebCore {
@@ -47,8 +46,10 @@ void setSharedTimerFireInterval(double interval)
 {
     ASSERT(sharedTimerFiredFunction);
 
+    // This is GDK_PRIORITY_REDRAW, but we don't want to depend on GDK here just to use a constant.
+    static const int priority = G_PRIORITY_HIGH_IDLE + 20;
     gSharedTimer.scheduleAfterDelay("[WebKit] sharedTimerTimeoutCallback", std::function<void()>(sharedTimerFiredFunction),
-        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(interval)), GDK_PRIORITY_REDRAW);
+        std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::duration<double>(interval)), priority);
 }
 
 void stopSharedTimer()