Bug 27848 - [WINCE] allow using old GetTickCount implementation of currentTime
Summary: [WINCE] allow using old GetTickCount implementation of currentTime
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Other
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks: 23154
  Show dependency treegraph
 
Reported: 2009-07-30 12:04 PDT by Joe Mason
Modified: 2009-07-31 22:26 PDT (History)
3 users (show)

See Also:


Attachments
patch to CurrentTime.cpp (3.99 KB, patch)
2009-07-30 12:10 PDT, Joe Mason
staikos: review+
Details | Formatted Diff | Diff
same patch, updated changelog (4.25 KB, patch)
2009-07-30 12:42 PDT, Joe Mason
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Mason 2009-07-30 12:04:33 PDT
The QueryPerformanceCounter implementation of currentTime has a few problems: despite the workarounds, the clock still occasionally goes backwards (I suspect the 2 sec threshold is too small), and using timeBeginPeriod/timeEndPeriod can affect system performance by changing the frequency of the scheduler.  This patch lets you choose the older implementation, despite the lower resolution, by setting WTF_USE_QUERY_PERFORMANCE_COUNTER to 0.
Comment 1 Joe Mason 2009-07-30 12:10:06 PDT
Created attachment 33802 [details]
patch to CurrentTime.cpp
Comment 2 George Staikos 2009-07-30 12:22:13 PDT
Comment on attachment 33802 [details]
patch to CurrentTime.cpp

Looks good to me.  Needed for WinCE, could also be useful elsewhere.
Comment 3 Joe Mason 2009-07-30 12:29:15 PDT
The changelog on this patch is wrong - missed giving author credit to Yong.
Comment 4 Yong Li 2009-07-30 12:31:05 PDT
#if PLATFORM(WIN_OS)
 343 #define WTF_USE_QUERY_PERFORMANCE_COUNTER 1
 344 #endif 

how about adding

#ifndef WTF_USE_QUERY_PERFORMANCE_COUNTER

here? so that it won't overwrite the one in project settings if any
Comment 5 Joe Mason 2009-07-30 12:42:59 PDT
Created attachment 33805 [details]
same patch, updated changelog
Comment 6 Joe Mason 2009-07-30 12:45:28 PDT
I just have it redefined later in our local copy of Platform.h.

I prefer having all symbols like this in Platform.h anyway instead of hidden in project files.
Comment 7 Adam Barth 2009-07-31 21:44:22 PDT
Will land.
Comment 8 Adam Barth 2009-07-31 22:26:19 PDT
Comment on attachment 33805 [details]
same patch, updated changelog

Clearing review flag on attachment: 33805

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/wtf/CurrentTime.cpp
	M	JavaScriptCore/wtf/Platform.h
Committed r46660
	M	JavaScriptCore/wtf/Platform.h
	M	JavaScriptCore/wtf/CurrentTime.cpp
	M	JavaScriptCore/ChangeLog
r46660 = f50ff91bb2c8f9f99fb86c09814c0551acd967b3 (trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
http://trac.webkit.org/changeset/46660
Comment 9 Adam Barth 2009-07-31 22:26:23 PDT
All reviewed patches have been landed.  Closing bug.