Bug 137782

Summary: [GLIB] Add API to GMainLoopSource to schedule sources after a delay in microseconds
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, gustavo, pnormand, zan
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Re-submitted for EWS svillar: review+

Description Carlos Garcia Campos 2014-10-16 10:56:31 PDT
In some cases when we have a double with the time in seconds, the conversion to milliseconds ends up truncating the value to 0, and the source scheduled immediately.
Comment 1 Carlos Garcia Campos 2014-10-16 11:04:16 PDT
Created attachment 239953 [details]
Patch
Comment 2 Carlos Garcia Campos 2014-10-16 11:20:18 PDT
Created attachment 239954 [details]
Re-submitted for EWS
Comment 3 WebKit Commit Bot 2014-10-16 11:22:43 PDT
Attachment 239954 [details] did not pass style-queue:


ERROR: Source/WTF/wtf/gobject/GMainLoopSource.cpp:265:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WTF/wtf/gobject/GMainLoopSource.cpp:282:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Sergio Villar Senin 2014-10-17 01:15:58 PDT
Comment on attachment 239954 [details]
Re-submitted for EWS

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

> Source/WTF/wtf/gobject/GMainLoopSource.cpp:295
> +    };

Either one of these two is wrong, check the position of WTF::move and the one of the callback.

> Source/WTF/wtf/gobject/GMainLoopSource.cpp:338
> +

Since the only difference is the callback function, couldn't we use a template and avoid repetitions?
Comment 5 Carlos Garcia Campos 2014-10-17 01:38:42 PDT
Comment on attachment 239954 [details]
Re-submitted for EWS

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

>> Source/WTF/wtf/gobject/GMainLoopSource.cpp:295
>> +    };
> 
> Either one of these two is wrong, check the position of WTF::move and the one of the callback.

I don't understand what you mean. There are two WTF::move here one is for the destroy func and the other is for the bool callback. There's nothing wrong there.

>> Source/WTF/wtf/gobject/GMainLoopSource.cpp:338
>> +
> 
> Since the only difference is the callback function, couldn't we use a template and avoid repetitions?

I guess, I find this more convenient to use, but in any case, that would be a different issue.
Comment 6 Sergio Villar Senin 2014-10-17 02:39:18 PDT
Comment on attachment 239954 [details]
Re-submitted for EWS

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

>>> Source/WTF/wtf/gobject/GMainLoopSource.cpp:295
>>> +    };
>> 
>> Either one of these two is wrong, check the position of WTF::move and the one of the callback.
> 
> I don't understand what you mean. There are two WTF::move here one is for the destroy func and the other is for the bool callback. There's nothing wrong there.

I was talking about the voidCallback and the boolCallback, but they're correctly placed anyway, just checked the Context struct.
Comment 7 Carlos Garcia Campos 2014-10-17 03:10:54 PDT
Committed r174818: <http://trac.webkit.org/changeset/174818>