WebKit Bugzilla
Attachment 357310 Details for
Bug 192696
: [GLib] RunLoop::dispatchAfter() GSource requires microsecond precision
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192696-20181214130329.patch (text/plain), 2.35 KB, created by
Zan Dobersek
on 2018-12-14 04:03:30 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2018-12-14 04:03:30 PST
Size:
2.35 KB
patch
obsolete
>Subversion Revision: 239198 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 7a995d79df1b7213484602e387a54b8969120cf1..1dd80d12a69c70431b3409fad3fda2695093f189 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,25 @@ >+2018-12-14 Zan Dobersek <zdobersek@igalia.com> >+ >+ [GLib] RunLoop::dispatchAfter() GSource requires microsecond precision >+ https://bugs.webkit.org/show_bug.cgi?id=192696 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The GSource we set up in GLib's RunLoop::dispatchAfter() implementation >+ should support microsecond-precision delays. Such delays are common in >+ JSC's Watchdog implementation and missing support for them has been >+ causing test failures in the `testapi` program as well as some JSC >+ tests that depend on the termination determination functionality of the >+ JSC::Watchdog class. >+ >+ RunLoop::dispatchAfter() is changed to spawn a raw GSource that uses the >+ existing GSourceFuncs implementation used elsewhere in GLib's RunLoop. >+ The GSource's ready time is set manually, now with the necessary >+ microsecond precision. >+ >+ * wtf/glib/RunLoopGLib.cpp: >+ (WTF::RunLoop::dispatchAfter): >+ > 2018-12-13 Saam Barati <sbarati@apple.com> > > The JSC shell should listen for memory pressure events and respond to them >diff --git a/Source/WTF/wtf/glib/RunLoopGLib.cpp b/Source/WTF/wtf/glib/RunLoopGLib.cpp >index b8ab44b9ab55c1e2cc5e4be61666fc69490523b2..720fc9a2394360a234127b2a374734084ccdafcb 100644 >--- a/Source/WTF/wtf/glib/RunLoopGLib.cpp >+++ b/Source/WTF/wtf/glib/RunLoopGLib.cpp >@@ -142,9 +142,10 @@ private: > > void RunLoop::dispatchAfter(Seconds duration, Function<void()>&& function) > { >- GRefPtr<GSource> source = adoptGRef(g_timeout_source_new(duration.millisecondsAs<guint>())); >+ GRefPtr<GSource> source = adoptGRef(g_source_new(&runLoopSourceFunctions, sizeof(GSource))); > g_source_set_priority(source.get(), RunLoopSourcePriority::RunLoopTimer); > g_source_set_name(source.get(), "[WebKit] RunLoop dispatchAfter"); >+ g_source_set_ready_time(source.get(), g_get_monotonic_time() + duration.microsecondsAs<gint64>()); > > std::unique_ptr<DispatchAfterContext> context = std::make_unique<DispatchAfterContext>(WTFMove(function)); > g_source_set_callback(source.get(), [](gpointer userData) -> gboolean {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192696
: 357310