Combined implementations of currentTime() from several platform-dependent files in WebCore/platform and from JSC/runtime/DateMath.cpp into JSC/WTF/CurrentTime.(h,cpp) This brings all implementations close to each other, eliminates duplication and allows to sue currentTime() anywhere in the project, including WTF itself, in particulr to implement WTF::MessageQueue::WaitForMessageTimed and correct implementation of ThreadCondition::waitTimed() - those changes are following.
Created attachment 26560 [details] Proposed patch Although there are many files, most of the files in this patch only have a different header file included.
Comment on attachment 26560 [details] Proposed patch > +// Platform note: GTK should use gettimeofday everywhere except WIN, where Sentence fragment here. Also, I think it might be better to put this comment after the includes rather than in the middle of them. > +#if PLATFORM(MAC) > +double currentTime() > +{ > + return CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970; > +} > +#elif PLATFORM(WIN) I think some blank lines here would make it easier to read. The per-platform sections are large enough that a little more vertical whitespace will make it easier to spot the boundaries. r=me
Created attachment 26596 [details] Updated patch Fixed comment, whitespaces and resolved against current tree. Seems to be ready for landing.
Committed revision 39784.