Title: [254804] trunk/Source
Revision
254804
Author
[email protected]
Date
2020-01-19 07:19:00 -0800 (Sun, 19 Jan 2020)

Log Message

[GTK] Remove usage of deprecated GTimeVal
https://bugs.webkit.org/show_bug.cgi?id=206358

Reviewed by Žan Doberšek.

Source/WebKit:

Use g_get_monotonic_time() for counting clicks instead of
deprecated and unsafe API.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent):

Source/WTF:

Use g_get_real_time() directly instead of deprecated and unsafe API.

* wtf/CurrentTime.cpp:
(WTF::currentTime):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (254803 => 254804)


--- trunk/Source/WTF/ChangeLog	2020-01-19 13:52:24 UTC (rev 254803)
+++ trunk/Source/WTF/ChangeLog	2020-01-19 15:19:00 UTC (rev 254804)
@@ -1,3 +1,15 @@
+2020-01-19  Claudio Saavedra  <[email protected]>
+
+        [GTK] Remove usage of deprecated GTimeVal
+        https://bugs.webkit.org/show_bug.cgi?id=206358
+
+        Reviewed by Žan Doberšek.
+
+        Use g_get_real_time() directly instead of deprecated and unsafe API.
+
+        * wtf/CurrentTime.cpp:
+        (WTF::currentTime):
+
 2020-01-16  Keith Miller  <[email protected]>
 
         Reland bytecode checkpoints since bugs have been fixed

Modified: trunk/Source/WTF/wtf/CurrentTime.cpp (254803 => 254804)


--- trunk/Source/WTF/wtf/CurrentTime.cpp	2020-01-19 13:52:24 UTC (rev 254803)
+++ trunk/Source/WTF/wtf/CurrentTime.cpp	2020-01-19 15:19:00 UTC (rev 254804)
@@ -230,9 +230,7 @@
 // Non-Windows GTK builds could use gettimeofday() directly but for the sake of consistency lets use GTK function.
 static inline double currentTime()
 {
-    GTimeVal now;
-    g_get_current_time(&now);
-    return static_cast<double>(now.tv_sec) + static_cast<double>(now.tv_usec / 1000000.0);
+    return static_cast<double>(g_get_real_time() / 1000000.0);
 }
 
 #else

Modified: trunk/Source/WebKit/ChangeLog (254803 => 254804)


--- trunk/Source/WebKit/ChangeLog	2020-01-19 13:52:24 UTC (rev 254803)
+++ trunk/Source/WebKit/ChangeLog	2020-01-19 15:19:00 UTC (rev 254804)
@@ -1,3 +1,16 @@
+2020-01-19  Claudio Saavedra  <[email protected]>
+
+        [GTK] Remove usage of deprecated GTimeVal
+        https://bugs.webkit.org/show_bug.cgi?id=206358
+
+        Reviewed by Žan Doberšek.
+
+        Use g_get_monotonic_time() for counting clicks instead of
+        deprecated and unsafe API.
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (ClickCounter::currentClickCountForGdkButtonEvent):
+
 2020-01-17  Cathie Chen  <[email protected]>
 
         Add support for scroll behavior parsing

Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp (254803 => 254804)


--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2020-01-19 13:52:24 UTC (rev 254803)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp	2020-01-19 15:19:00 UTC (rev 254804)
@@ -110,9 +110,7 @@
             // by the WTR do not and we must calculate a time manually. This time
             // is not calculated in the WTR, because GTK+ does not work well with
             // anything other than GDK_CURRENT_TIME on synthesized events.
-            GTimeVal timeValue;
-            g_get_current_time(&timeValue);
-            eventTime = (timeValue.tv_sec * 1000) + (timeValue.tv_usec / 1000);
+            eventTime = g_get_monotonic_time() / 1000;
         }
 
         GdkEventType type;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to