DescriptionChange chrome from statically enabling high resolution timers on windows
to enabling them dynamically - only when the application really needs
them.
I am working on some test cases for this, and will add them. But wanted
to send out the concept for review.
In this implementation, I modify the message loop to detect when the
application has requested high resolution timers. Note that there are
multiple MessageLoops active in a single process. After a period of
time, we simply shut it off again. We could have set a timer or
kept a count of active timers, or any number of more complex algorithms.
But I think this algorithm is very simple and good enough. If an
application continues needing high resolution timers for more than 1s,
we'll turn the high-resolution timers back on again.
One last change - since we've implemented the clamp at 4ms, there isn't
a lot of point to our use of 1ms for timeBeginPeriod. I've modified
that to 2 (which is half of 4ms, our target minimal interval).
BUG=46531
TEST=MessageLoop.HighResolutionTimers
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=51102
Patch Set 1 #Patch Set 2 : '' #
Total comments: 12
Patch Set 3 : '' #
Total comments: 10
Patch Set 4 : '' #Patch Set 5 : '' #Patch Set 6 : '' #
Messages
Total messages: 7 (0 generated)
|