Bug 23207 - Move currentTime() from WebCore into WTF (to use in WTF::MessageQueue::WaitForMessageTimed)
Summary: Move currentTime() from WebCore into WTF (to use in WTF::MessageQueue::WaitFo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 22718
  Show dependency treegraph
 
Reported: 2009-01-08 22:25 PST by Dmitry Titov
Modified: 2009-01-11 00:15 PST (History)
2 users (show)

See Also:


Attachments
Proposed patch (57.33 KB, patch)
2009-01-08 23:24 PST, Dmitry Titov
darin: review+
Details | Formatted Diff | Diff
Updated patch (57.26 KB, patch)
2009-01-10 18:34 PST, Dmitry Titov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Titov 2009-01-08 22:25:37 PST
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.
Comment 1 Dmitry Titov 2009-01-08 23:24:32 PST
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 2 Darin Adler 2009-01-10 14:34:23 PST
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
Comment 3 Dmitry Titov 2009-01-10 18:34:19 PST
Created attachment 26596 [details]
Updated patch

Fixed comment, whitespaces and resolved against current tree.
Seems to be ready for landing.
Comment 4 Alexey Proskuryakov 2009-01-11 00:15:57 PST
Committed revision 39784.