[Webkit-unassigned] [Bug 150590] [GTK] Use a persistent main loop source in RunLoop glib implementation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 29 04:47:27 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=150590
--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com> ---
(In reply to comment #2)
> Comment on attachment 264130 [details]
> Patch
>
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=264130&action=review
>
> > Source/WTF/wtf/glib/RunLoopGLib.cpp:146
> > stop();
> > + g_source_destroy(m_source.get());
>
> Is stop() still bringing anything here, given that the source is destroyed
> afterwards?
Nope, it can be just removed.
> > Source/WTF/wtf/glib/RunLoopGLib.cpp:152
> > + gint64 current = g_get_monotonic_time();
> > + g_source_set_ready_time(m_source.get(), m_fireInterval.count() ? current + m_fireInterval.count() : current);
>
> I'd advise special-casing the 0-microsecond delay here, which is the most
> common.
Ok.
> > gint64 delay = 0;
> > if (m_fireInterval.count())
> > delay = g_get_monotonic_time() + m_fireInterval.count()
> > g_source_set_ready_time(m_source.get(), delay);
>
> That way you avoid querying the monotonic time for most cases, and 0 delay
> still means 'dispatch ASAP' in GLib.
Ah, right, I guess we can do this too
g_source_set_ready_time(m_source.get(), m_fireInterval.count() ? g_get_monotonic_time() + m_fireInterval.count() : 0);
> > Source/WTF/wtf/glib/RunLoopGLib.cpp:157
> > + stop();
>
> Is stop() useful here? The source's ready time is updated afterwards anyway.
Nope, it's also useless
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151029/affe2ceb/attachment.html>
More information about the webkit-unassigned
mailing list