Changeset 50608 in webkit for trunk/JavaScriptCore/wtf/DateMath.h


Ignore:
Timestamp:
Nov 6, 2009, 3:33:17 PM (16 years ago)
Author:
[email protected]
Message:

Rolled back in r50590 with Windows build hopefully fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/DateMath.h

    r50591 r50608  
    4545#include <time.h>
    4646#include <string.h>
     47#include <wtf/CurrentTime.h>
    4748#include <wtf/Noncopyable.h>
     49#include <wtf/UnusedParam.h>
    4850
    49 namespace WTF {
     51namespace JSC {
    5052
     53class ExecState;
    5154struct GregorianDateTime;
    5255
    5356void initializeDates();
    54 void msToGregorianDateTime(double, bool outputIsUTC, GregorianDateTime&);
    55 double gregorianDateTimeToMS(const GregorianDateTime&, double, bool inputIsUTC);
    56 double getUTCOffset();
     57void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&);
     58double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC);
     59double getUTCOffset(ExecState*);
    5760int equivalentYearForDST(int year);
    58 double getCurrentUTCTime();
    59 double getCurrentUTCTimeWithMicroseconds();
    60 void getLocalTime(const time_t*, tm*);
    6161
    6262// Not really math related, but this is currently the only shared place to put these. 
    63 double parseDateFromNullTerminatedCharacters(const char*);
     63double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec); // exec may be 0
    6464double timeClip(double);
     65
     66inline double jsCurrentTime()
     67{
     68    // JavaScript doesn't recognize fractions of a millisecond.
     69    return floor(WTF::currentTimeMS());
     70}
    6571
    6672const char * const weekdayName[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
     
    99105    }
    100106
    101     GregorianDateTime(const tm& inTm)
     107    GregorianDateTime(ExecState* exec, const tm& inTm)
    102108        : second(inTm.tm_sec)
    103109        , minute(inTm.tm_min)
     
    110116        , isDST(inTm.tm_isdst)
    111117    {
     118        UNUSED_PARAM(exec);
    112119#if HAVE(TM_GMTOFF)
    113120        utcOffset = static_cast<int>(inTm.tm_gmtoff);
    114121#else
    115         utcOffset = static_cast<int>(getUTCOffset() / msPerSecond + (isDST ? secondsPerHour : 0));
     122        utcOffset = static_cast<int>(getUTCOffset(exec) / msPerSecond + (isDST ? secondsPerHour : 0));
    116123#endif
    117124
     
    188195}
    189196
    190 } // namespace WTF
     197} // namespace JSC
    191198
    192199#endif // DateMath_h
Note: See TracChangeset for help on using the changeset viewer.