Bug 46284 - [GTK] Replace instances of g_timeout_add() with g_idle_add() in testatk.c
Summary: [GTK] Replace instances of g_timeout_add() with g_idle_add() in testatk.c
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-22 11:50 PDT by Mario Sanchez Prada
Modified: 2010-09-22 18:48 PDT (History)
3 users (show)

See Also:


Attachments
Patch proposal (3.50 KB, patch)
2010-09-22 12:41 PDT, Mario Sanchez Prada
mrobinson: review-
mrobinson: commit-queue-
Details | Formatted Diff | Diff
Patch proposal (4.04 KB, patch)
2010-09-22 13:24 PDT, Mario Sanchez Prada
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2010-09-22 11:50:18 PDT
Inside WebKit/gtk/tests/testatk.c, there are still some places where the following kind of lines

   g_timeout_add(100, (GSourceFunc)bail_out, loop);

...should be replaced by a call to g_idle_add:

   g_idle_add((GSourceFunc)bail_out, loop);

This is a trivial-yet-needed bug that needs obvious fixing (and further care when adding new tests <- note to myself :-/)
Comment 1 Mario Sanchez Prada 2010-09-22 12:41:30 PDT
Created attachment 68419 [details]
Patch proposal

This should be straightforward I guess...
Comment 2 Martin Robinson 2010-09-22 12:45:10 PDT
Comment on attachment 68419 [details]
Patch proposal

View in context: https://bugs.webkit.org/attachment.cgi?id=68419&action=review

> WebKit/gtk/ChangeLog:8
> +        Use g_idle_add() whenever g_timeout_add() was being used

You should explain here why this conversion is a good thing. In the future, other programmers will see this commit and wonder what the explanation was. We should be able to concisely describe to people why we prefer this style.
Comment 3 Mario Sanchez Prada 2010-09-22 13:24:12 PDT
Created attachment 68430 [details]
Patch proposal

(In reply to comment #2)
> (From update of attachment 68419 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68419&action=review
> 
> > WebKit/gtk/ChangeLog:8
> > +        Use g_idle_add() whenever g_timeout_add() was being used
> 
> You should explain here why this conversion is a good thing. In the future, other programmers will see this commit and wonder what the explanation was. We should be able to concisely describe to people why we prefer this style.
Comment 4 Martin Robinson 2010-09-22 13:28:35 PDT
Comment on attachment 68430 [details]
Patch proposal

Great description! Thanks.
Comment 5 WebKit Commit Bot 2010-09-22 18:48:51 PDT
Comment on attachment 68430 [details]
Patch proposal

Clearing flags on attachment: 68430

Committed r68111: <http://trac.webkit.org/changeset/68111>
Comment 6 WebKit Commit Bot 2010-09-22 18:48:56 PDT
All reviewed patches have been landed.  Closing bug.