Bug 62159

Summary: Implement montonicallyIncreasingClock() on Qt
Product: WebKit Reporter: James Simonsen <simonjam>
Component: JavaScriptCoreAssignee: Pierre Rossi <pierre.rossi>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, gustavo.noronha, gustavo, igor.oliveira, jamesr, jasonliuwebkit, kling, mark, menard, ossy, pierre.rossi, tonikitoo, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 37743, 75087    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
patch
none
patch
webkit-ews: commit-queue-
Patch
none
patch
none
Patch
hausmann: review-
Patch
none
Patch none

James Simonsen
Reported 2011-06-06 15:49:47 PDT
Attachments
Patch (1.68 KB, patch)
2011-06-06 18:15 PDT, Jason Liu
no flags
patch (1.71 KB, patch)
2011-06-06 18:44 PDT, Jason Liu
no flags
patch (1.73 KB, patch)
2011-06-12 22:47 PDT, Jason Liu
webkit-ews: commit-queue-
Patch (1.81 KB, patch)
2011-06-12 23:59 PDT, Jason Liu
no flags
patch (1.72 KB, patch)
2011-06-13 19:31 PDT, Jason Liu
no flags
Patch (1.72 KB, patch)
2011-06-14 19:23 PDT, Jason Liu
hausmann: review-
Patch (2.61 KB, patch)
2011-12-20 14:11 PST, Mark Dyer
no flags
Patch (1.59 KB, patch)
2011-12-21 14:36 PST, Pierre Rossi
no flags
James Robinson
Comment 1 2011-06-06 16:02:08 PDT
You should clarify whether you mean GTK or QT here, since they both run on 'linux' and will likely have different implementations. I'd recommend filing bugs on ports (GTK/QT/etc) rather than OSes
James Simonsen
Comment 2 2011-06-06 16:08:12 PDT
(In reply to comment #1) > You should clarify whether you mean GTK or QT here, since they both run on 'linux' and will likely have different implementations. I'd recommend filing bugs on ports (GTK/QT/etc) rather than OSes The other patch on bug 33743 was #if OS(LINUX). I'm not sure which one that's for or if it's intend it to work for both. Maybe Jason can follow up with which one he intended and we can update/create new bugs as needed.
Jason Liu
Comment 3 2011-06-06 18:15:45 PDT
Created attachment 96168 [details] Patch patch
Jason Liu
Comment 4 2011-06-06 18:44:23 PDT
Created attachment 96172 [details] patch patch on Qt/linux
Collabora GTK+ EWS bot
Comment 5 2011-06-06 18:51:23 PDT
James Simonsen
Comment 6 2011-06-06 18:53:51 PDT
Sounds like this is a QT only patch. I've updated the summary and I'll file a new bug for GTK.
Jason Liu
Comment 7 2011-06-12 22:47:06 PDT
Created attachment 96920 [details] patch patch
Jason Liu
Comment 8 2011-06-12 23:59:20 PDT
Created attachment 96928 [details] Patch patch
Gyuyoung Kim
Comment 9 2011-06-13 09:43:35 PDT
Jason Liu
Comment 10 2011-06-13 19:31:06 PDT
Created attachment 97056 [details] patch patch
Andreas Kling
Comment 11 2011-06-14 04:16:50 PDT
@Jason: Please mark only the relevant patch(es) for review.
Jason Liu
Comment 12 2011-06-14 19:23:59 PDT
Created attachment 97221 [details] Patch Patch
Antonio Gomes
Comment 13 2011-06-14 20:51:01 PDT
Comment on attachment 97221 [details] Patch Is this Qt-specific really?
Jason Liu
Comment 14 2011-06-14 21:15:22 PDT
(In reply to comment #13) > (From update of attachment 97221 [details]) > Is this Qt-specific really? Yes.Would you pls help me to review it ? Thanks a lot!
Igor Trindade Oliveira
Comment 15 2011-06-15 06:50:26 PDT
Great patch. I have just few comments. clock_gettime works on all Unix systems since Linux until AIX, so it is not Qt specific. About clock_gettime with CLOCK_MONOTONIC clock it is not completely monotonic (Linux case), because if the system is using NTP(Network Time Protocol) and the time changes the clock_gettime returns a wrong time. The solution for Linux using kernel 2.6.28 is the option CLOCK_MONOTONIC_RAW. But for now i think CLOCK_MONOTONIC is enough. (In reply to comment #12) > Created an attachment (id=97221) [details] > Patch > > Patch
Pierre Rossi
Comment 16 2011-07-04 07:57:27 PDT
If you want to make this specific to the Qt port, I guess you could simply use QElapsedTimer directly. See: http://doc.qt.nokia.com/4.8-snapshot/qelapsedtimer.html
Alexis Menard (darktears)
Comment 17 2011-08-26 07:54:12 PDT
(In reply to comment #16) > If you want to make this specific to the Qt port, I guess you could simply use QElapsedTimer directly. > See: > http://doc.qt.nokia.com/4.8-snapshot/qelapsedtimer.html Yep no need to use a low level API no?
Simon Hausmann
Comment 18 2011-11-01 14:45:41 PDT
Comment on attachment 97221 [details] Patch I agree with the two gentlemen :). Could you implement this using QElapsedTimer? Plus there's something wrong in the function declaration. From what I can tell from the CurrentTime.cpp the patch should look something like this: +#elif PLATFORM(QT) + +double monotonicallyIncreasingClock() +{ ... +} + #else
WebKit Review Bot
Comment 19 2011-11-01 22:39:06 PDT
Attachment 96920 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Early Warning System Bot
Comment 20 2011-11-01 23:54:39 PDT
Mark Dyer
Comment 21 2011-12-20 14:11:17 PST
WebKit Review Bot
Comment 22 2011-12-20 14:17:18 PST
Attachment 120081 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1 Source/JavaScriptCore/wtf/CurrentTime.cpp:63: "sys/time.h" already included at Source/JavaScriptCore/wtf/CurrentTime.cpp:38 [build/include] [4] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Mark Dyer
Comment 23 2011-12-21 12:22:17 PST
I've implemented monotonicallyIncreasingTime() using QElapsedTimer, but it is failing to pass check-webkit-style because when that script checks for multiple includes of the same file, it does not take into account platform specific includes (ie includes inside #if PLATFORM(MAC)...#elif PLATFORM(QT)... being required by more than one platform) Using #if HAVE(SYS_TIME_H) like is done in DateMath.cpp, I can get rid of the ""sys/time.h" already included", but there will still be an "Alphabetical sorting problem". I can't see a way to get rid of that without making that part of the file completely unreadable.
Pierre Rossi
Comment 24 2011-12-21 13:11:30 PST
(In reply to comment #23) > I've implemented monotonicallyIncreasingTime() using QElapsedTimer, but it is failing to pass check-webkit-style because when that script checks for multiple includes of the same file, it does not take into account platform specific includes (ie includes inside #if PLATFORM(MAC)...#elif PLATFORM(QT)... being required by more than one platform) > > Using #if HAVE(SYS_TIME_H) like is done in DateMath.cpp, I can get rid of the ""sys/time.h" already included", but there will still be an "Alphabetical sorting problem". I can't see a way to get rid of that without making that part of the file completely unreadable. I actually fail to see why you would want to manually include "sys/time.h" at all. This would most likely be a problem on platforms like Windows for instance. The platform-specific implementations of QElapsedTimer will take care of using what's right on the various platform Qt runs on for you.
Pierre Rossi
Comment 25 2011-12-21 13:11:52 PST
(In reply to comment #23) > I've implemented monotonicallyIncreasingTime() using QElapsedTimer, but it is failing to pass check-webkit-style because when that script checks for multiple includes of the same file, it does not take into account platform specific includes (ie includes inside #if PLATFORM(MAC)...#elif PLATFORM(QT)... being required by more than one platform) > > Using #if HAVE(SYS_TIME_H) like is done in DateMath.cpp, I can get rid of the ""sys/time.h" already included", but there will still be an "Alphabetical sorting problem". I can't see a way to get rid of that without making that part of the file completely unreadable. I actually fail to see why you would want to manually include "sys/time.h" at all. This would most likely be a problem on platforms like Windows for instance. The platform-specific implementations of QElapsedTimer will take care of using what's right on the various platform Qt runs on for you.
Pierre Rossi
Comment 26 2011-12-21 14:36:02 PST
WebKit Review Bot
Comment 27 2011-12-21 14:38:05 PST
Attachment 120219 [details] did not pass style-queue: Failed to run "['Tools/Scripts/update-webkit']" exit_code: 9 Updating OpenSource From git://git.webkit.org/WebKit 4428c79..c4e9134 master -> origin/master Partial-rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc ... Currently at 103445 = 4428c79e3922c44a4537acf0b21a4e4540a3eecb r103450 = 66364db0ef636bce41f0699b135aa8278cf5cdf8 r103452 = c4e9134aef89c0b495d95a6923bb9491218b33e4 Done rebuilding .git/svn/refs/remotes/origin/master/.rev_map.268f45cc-cd09-0410-ab3c-d52691b4dbfc First, rewinding head to replay your work on top of it... Applying: Inform the scrolling coordinator when scrollbar layers come and go Using index info to reconstruct a base tree... <stdin>:474806: trailing whitespace. [Chromium] DatabaseTrackerChromium: iterating DatabaseSet races with Database disposal on worker thread <stdin>:474827: trailing whitespace. Nothing to test, just removing redundant code. Correct behavior tested by <stdin>:475346: trailing whitespace. warning: 3 lines add whitespace errors. Falling back to patching base and 3-way merge... warning: too many files (created: 167249 deleted: 3), skipping inexact rename detection Auto-merging LayoutTests/ChangeLog CONFLICT (content): Merge conflict in LayoutTests/ChangeLog Auto-merging LayoutTests/platform/chromium/test_expectations.txt Auto-merging Source/WebCore/ChangeLog CONFLICT (content): Merge conflict in Source/WebCore/ChangeLog Auto-merging Source/WebKit2/ChangeLog CONFLICT (content): Merge conflict in Source/WebKit2/ChangeLog Failed to merge in the changes. Patch failed at 0001 Inform the scrolling coordinator when scrollbar layers come and go When you have resolved this problem run "git rebase --continue". If you would prefer to skip this patch, instead run "git rebase --skip". To restore the original branch and stop rebasing run "git rebase --abort". rebase refs/remotes/origin/master: command returned error: 1 Died at Tools/Scripts/update-webkit line 158. If any of these errors are false positives, please file a bug against check-webkit-style.
Pierre Rossi
Comment 28 2011-12-21 15:40:34 PST
Csaba Osztrogonác
Comment 29 2011-12-22 02:44:28 PST
(In reply to comment #28) > Committed r103467: <http://trac.webkit.org/changeset/103467> Reopen, because it broke fast/images/animated-gif-restored-from-bfcache.html on Qt: --- /ramdisk/qt-linux-64-release/build/layout-test-results/fast/images/animated-gif-restored-from-bfcache-expected.txt +++ /ramdisk/qt-linux-64-release/build/layout-test-results/fast/images/animated-gif-restored-from-bfcache-actual.txt @@ -1,5 +1,5 @@ Test that animated GIFs resume animating after restoring a page from the back forward cache. To test manually, click here to visit about:blank, then press the browser's back button. On success, you should see a square that continuously animates through various shades of green followed by the word 'PASS'. -PASS +FAIL
Csaba Osztrogonác
Comment 30 2011-12-22 02:45:12 PST
Comment on attachment 120219 [details] Patch remove r+ from landed patch
Csaba Osztrogonác
Comment 31 2011-12-22 07:25:24 PST
I filed a new bug report to fix the regression: https://bugs.webkit.org/show_bug.cgi?id=75087
Pierre Rossi
Comment 32 2011-12-23 05:36:34 PST
Forgot to close that one as well.
Eric Seidel (no email)
Comment 33 2012-01-09 13:28:19 PST
Comment on attachment 120081 [details] Patch Cleared review? from attachment 120081 [details] so that this bug does not appear in http://webkit.org/pending-review. If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).
Note You need to log in before you can comment on or make changes to this bug.