Commit Graph

8 Commits

Author SHA1 Message Date
Brian Birtles
b15868c319 Bug 1207412 - Make SystemTimeConverter use TimeStamp::Now() when converting times; r=karlt 2015-10-26 09:29:54 +09:00
Brian Birtles
19812eb712 Bug 1212102 - Drop unnecessary assertion comparing timestamps in SystemTimeConverter; r=karlt 2015-10-21 15:26:46 +09:00
Brian Birtles
d869816d8e Bug 1026803 part 8b - Factor out an IsTimeNewerThanTimeStamp method; r=karlt 2015-08-12 13:19:14 +09:00
Brian Birtles
aa9ff80d0f Bug 1026803 part 6 - Make SystemTimeConverter detect clock skew; r=karlt
This patch revises the logic in SystemTimeConverter to detect backwards and
forwards skew between the two time sources: the native time source (represented
by the Time type) and the time source used to generate TimeStamp objects.
2015-08-11 17:11:41 +09:00
Brian Birtles
363121843f Bug 1026803 part 5 - Convert CurrentXXXTimeGetter classes from functors to helper classes; r=karlt
Previously the CurrentX11TimeGetter and CurrentWindowsTimeGetter classes acted
as functors with a single operator() method. In preparation for handling clock
skew, this patch refactors these two helper classes into regular classes with
two named methods:

  GetCurrentTime which matches the existing operator() method, and

  GetTimeAsyncForPossibleBackwardsSkew which will be used when possible
  backwards skew is detected to fetch the current time asynchronously.

Some renaming is also included to match the expanded role of these classes.
2015-02-19 14:10:00 +09:00
Brian Birtles
05d18edfcf Bug 1026803 part 3 - Make some simplifications to SystemTimeConverter; r=karlt
This patch exploits the fact that the underlying Time type is an unsigned
integer to simplify some of the overflow checks in SystemTimeConvert by relying
on unsigned integer overflow behavior, which, unlike signed integer overflow, is
well-defined.
2015-02-19 14:06:01 +09:00
Brian Birtles
1da7c1afd8 Bug 1026803 part 2 - Add an assertion that SystemTimeConverter's template parameter is unsigned; r=karlt
Various operations in the time conversion assume that the native event time is
an unsigned integer so this patch adds and assertion to check this precondition
is met.
2015-02-19 14:05:42 +09:00
Brian Birtles
d392cd6dca Bug 1026803 part 1 - Factor out a common utility class for converting wrapping native times to TimeStamps; r=karlt
This just moves the code from widget/windows/nsWindow.cpp to a template class in
widget/xpwidgets/WrappingTimeConverter.h so that we can reuse this code for
other platforms (GTK at least).
2015-08-11 13:38:18 +09:00