Changeset 50608 in webkit for trunk/JavaScriptCore/wtf/DateMath.h
- Timestamp:
- Nov 6, 2009, 3:33:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/DateMath.h
r50591 r50608 45 45 #include <time.h> 46 46 #include <string.h> 47 #include <wtf/CurrentTime.h> 47 48 #include <wtf/Noncopyable.h> 49 #include <wtf/UnusedParam.h> 48 50 49 namespace WTF{51 namespace JSC { 50 52 53 class ExecState; 51 54 struct GregorianDateTime; 52 55 53 56 void initializeDates(); 54 void msToGregorianDateTime( double, bool outputIsUTC, GregorianDateTime&);55 double gregorianDateTimeToMS( const GregorianDateTime&, double, bool inputIsUTC);56 double getUTCOffset( );57 void msToGregorianDateTime(ExecState*, double, bool outputIsUTC, GregorianDateTime&); 58 double gregorianDateTimeToMS(ExecState*, const GregorianDateTime&, double, bool inputIsUTC); 59 double getUTCOffset(ExecState*); 57 60 int equivalentYearForDST(int year); 58 double getCurrentUTCTime();59 double getCurrentUTCTimeWithMicroseconds();60 void getLocalTime(const time_t*, tm*);61 61 62 62 // Not really math related, but this is currently the only shared place to put these. 63 double parseDateFromNullTerminatedCharacters(const char* );63 double parseDateFromNullTerminatedCharacters(const char* dateString, ExecState* exec); // exec may be 0 64 64 double timeClip(double); 65 66 inline double jsCurrentTime() 67 { 68 // JavaScript doesn't recognize fractions of a millisecond. 69 return floor(WTF::currentTimeMS()); 70 } 65 71 66 72 const char * const weekdayName[7] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" }; … … 99 105 } 100 106 101 GregorianDateTime( const tm& inTm)107 GregorianDateTime(ExecState* exec, const tm& inTm) 102 108 : second(inTm.tm_sec) 103 109 , minute(inTm.tm_min) … … 110 116 , isDST(inTm.tm_isdst) 111 117 { 118 UNUSED_PARAM(exec); 112 119 #if HAVE(TM_GMTOFF) 113 120 utcOffset = static_cast<int>(inTm.tm_gmtoff); 114 121 #else 115 utcOffset = static_cast<int>(getUTCOffset( ) / msPerSecond + (isDST ? secondsPerHour : 0));122 utcOffset = static_cast<int>(getUTCOffset(exec) / msPerSecond + (isDST ? secondsPerHour : 0)); 116 123 #endif 117 124 … … 188 195 } 189 196 190 } // namespace WTF197 } // namespace JSC 191 198 192 199 #endif // DateMath_h
Note:
See TracChangeset
for help on using the changeset viewer.