RESOLVED FIXED 123260
Replace 0 timeouts g_timeout_add() by g_idle_add()
https://bugs.webkit.org/show_bug.cgi?id=123260
Summary Replace 0 timeouts g_timeout_add() by g_idle_add()
Bastien Nocera
Reported 2013-10-24 03:19:57 PDT
.
Attachments
Replace 0 timeouts g_timeout_add() by g_idle_add() (9.82 KB, patch)
2013-10-24 03:20 PDT, Bastien Nocera
no flags
Replace 0 timeouts g_timeout_add() by g_idle_add() (9.78 KB, patch)
2013-10-24 03:27 PDT, Bastien Nocera
andersca: review-
Patch (13.88 KB, patch)
2013-10-25 00:08 PDT, Philippe Normand
cgarcia: review-
cgarcia: commit-queue-
patch for laundring (13.66 KB, patch)
2013-10-25 01:17 PDT, Philippe Normand
no flags
patch (12.97 KB, patch)
2013-10-28 01:16 PDT, Philippe Normand
no flags
Bastien Nocera
Comment 1 2013-10-24 03:20:25 PDT
Created attachment 215044 [details] Replace 0 timeouts g_timeout_add() by g_idle_add() A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ... without the nagging feeling that the wrong API was used.
WebKit Commit Bot
Comment 2 2013-10-24 03:22:58 PDT
Attachment 215044 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/wtf/gtk/MainThreadGtk.cpp', u'Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp', u'Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp', u'Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp', u'Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp', u'Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp', u'Source/WebKit/gtk/webkit/webkitwebview.cpp', u'Tools/DumpRenderTree/gtk/DumpRenderTree.cpp', u'Tools/DumpRenderTree/gtk/EventSender.cpp']" exit_code: 1 Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp:94: Use 0 instead of NULL. [readability/null] [5] Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp:94: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 2 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Bastien Nocera
Comment 3 2013-10-24 03:27:11 PDT
Created attachment 215047 [details] Replace 0 timeouts g_timeout_add() by g_idle_add() A zero timeout should be equivalent to using g_idle_add_full(G_PRIORITY_DEFAULT, ... without the nagging feeling that the wrong API was used.
Bastien Nocera
Comment 4 2013-10-24 03:29:15 PDT
Comment on attachment 215047 [details] Replace 0 timeouts g_timeout_add() by g_idle_add() The "weird number of spaces" review comment is due to me realigning the second line of a function (eg. trying to follow the existing style).
WebKit Commit Bot
Comment 5 2013-10-24 03:30:49 PDT
Attachment 215047 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WTF/wtf/gtk/MainThreadGtk.cpp', u'Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp', u'Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp', u'Source/WebCore/platform/gtk/GtkDragAndDropHelper.cpp', u'Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp', u'Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp', u'Source/WebKit/gtk/webkit/webkitwebview.cpp', u'Tools/DumpRenderTree/gtk/DumpRenderTree.cpp', u'Tools/DumpRenderTree/gtk/EventSender.cpp']" exit_code: 1 Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp:94: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Total errors found: 1 in 9 files If any of these errors are false positives, please file a bug against check-webkit-style.
Anders Carlsson
Comment 6 2013-10-24 06:28:37 PDT
Comment on attachment 215047 [details] Replace 0 timeouts g_timeout_add() by g_idle_add() View in context: https://bugs.webkit.org/attachment.cgi?id=215047&action=review Patch looks good but needs a ChangeLog with the rationale. >> Source/WebKit/gtk/WebCoreSupport/GtkAdjustmentWatcher.cpp:94 >> + const_cast<void*>(static_cast<const void*>(this)), 0); > > Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] I know you're just matching what was here before, but the entire function call should be on a single line.
Philippe Normand
Comment 7 2013-10-25 00:01:13 PDT
I'll update the patch.
Philippe Normand
Comment 8 2013-10-25 00:08:36 PDT
Carlos Garcia Campos
Comment 9 2013-10-25 00:42:03 PDT
Comment on attachment 215146 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > Source/WebCore/ChangeLog:11 > + Patch by Bastien Nocera <hadess@hadess.net> Why not adding the author to the changelog header so that commit-queue will credit him correctly? > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); This is not correct, I don't know why but this was not a 0 timeout.
Philippe Normand
Comment 10 2013-10-25 00:52:49 PDT
(In reply to comment #9) > (From update of attachment 215146 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > Source/WebCore/ChangeLog:11 > > + Patch by Bastien Nocera <hadess@hadess.net> > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > > > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); > > This is not correct, I don't know why but this was not a 0 timeout. I think this should be fixed in another patch.
Philippe Normand
Comment 11 2013-10-25 00:56:34 PDT
(In reply to comment #9) > (From update of attachment 215146 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > Source/WebCore/ChangeLog:11 > > + Patch by Bastien Nocera <hadess@hadess.net> > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > AFAIK the commit-queue does that only for commiters. Using Patch by is quite common and gives him credit already :)
Carlos Garcia Campos
Comment 12 2013-10-25 01:05:14 PDT
(In reply to comment #10) > (In reply to comment #9) > > (From update of attachment 215146 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > > > Source/WebCore/ChangeLog:11 > > > + Patch by Bastien Nocera <hadess@hadess.net> > > > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > > > > > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > > > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > > > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); > > > > This is not correct, I don't know why but this was not a 0 timeout. > > I think this should be fixed in another patch. Well, I'm not sure it's wrong, it seems it was added intentionally, I still don't understand it, though see: https://bugs.webkit.org/show_bug.cgi?id=108960#c24
Carlos Garcia Campos
Comment 13 2013-10-25 01:06:09 PDT
(In reply to comment #11) > (In reply to comment #9) > > (From update of attachment 215146 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > > > Source/WebCore/ChangeLog:11 > > > + Patch by Bastien Nocera <hadess@hadess.net> > > > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > > > > AFAIK the commit-queue does that only for commiters. I don't think so. > Using Patch by is quite common and gives him credit already :) Looks weird to me, but I'm fine.
Philippe Normand
Comment 14 2013-10-25 01:17:22 PDT
Created attachment 215148 [details] patch for laundring
Gustavo Noronha (kov)
Comment 15 2013-10-25 03:36:13 PDT
(In reply to comment #13) > > AFAIK the commit-queue does that only for commiters. > > I don't think so. Philn is right, it doesn't even credit me when I use an email address that is not the svn username for the changelog. (which is why I asked to get that modified from kov@webkit.org, which I never use in changelogs, to gns@gnome.org)
Carlos Garcia Campos
Comment 16 2013-10-25 04:03:47 PDT
Comment on attachment 215148 [details] patch for laundring View in context: https://bugs.webkit.org/attachment.cgi?id=215148&action=review > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); I set r- only because of this, if it's wrong, let's fix it in a follow up patch as you suggested, otherwise don't change it because this commit is about changing 0 timeouts.
Philippe Normand
Comment 17 2013-10-28 01:16:37 PDT
Carlos Garcia Campos
Comment 18 2013-10-28 02:04:00 PDT
Comment on attachment 215286 [details] patch Thanks
WebKit Commit Bot
Comment 19 2013-10-28 02:27:29 PDT
Comment on attachment 215286 [details] patch Clearing flags on attachment: 215286 Committed r158103: <http://trac.webkit.org/changeset/158103>
WebKit Commit Bot
Comment 20 2013-10-28 02:27:32 PDT
All reviewed patches have been landed. Closing bug.
Bastien Nocera
Comment 21 2013-10-28 05:04:00 PDT
(In reply to comment #12) > (In reply to comment #10) > > (In reply to comment #9) > > > (From update of attachment 215146 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > > > > > Source/WebCore/ChangeLog:11 > > > > + Patch by Bastien Nocera <hadess@hadess.net> > > > > > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > > > > > > > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > > > > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > > > > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); > > > > > > This is not correct, I don't know why but this was not a 0 timeout. > > > > I think this should be fixed in another patch. > > Well, I'm not sure it's wrong, it seems it was added intentionally, I still don't understand it, though see: > > https://bugs.webkit.org/show_bug.cgi?id=108960#c24 Did a separate bug get filed for that one?
Philippe Normand
Comment 22 2013-10-28 08:32:41 PDT
(In reply to comment #21) > (In reply to comment #12) > > (In reply to comment #10) > > > (In reply to comment #9) > > > > (From update of attachment 215146 [details] [details] [details] [details]) > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=215146&action=review > > > > > > > > > Source/WebCore/ChangeLog:11 > > > > > + Patch by Bastien Nocera <hadess@hadess.net> > > > > > > > > Why not adding the author to the changelog header so that commit-queue will credit him correctly? > > > > > > > > > Source/WebKit/gtk/webkit/webkitwebview.cpp:5276 > > > > > - g_timeout_add(1, cleanupTemporarilyCachedSubresources, g_list_copy(subResources)); > > > > > + g_idle_add_full(G_PRIORITY_DEFAULT, cleanupTemporarilyCachedSubresources, g_list_copy(subResources), 0); > > > > > > > > This is not correct, I don't know why but this was not a 0 timeout. > > > > > > I think this should be fixed in another patch. > > > > Well, I'm not sure it's wrong, it seems it was added intentionally, I still don't understand it, though see: > > > > https://bugs.webkit.org/show_bug.cgi?id=108960#c24 > > Did a separate bug get filed for that one? Yes, bug 123404
Bastien Nocera
Comment 23 2013-10-28 08:42:37 PDT
Thanks.
Note You need to log in before you can comment on or make changes to this bug.