Bug 30833

Summary: Chromium builds should not use JavaScriptCore/wtf/CurrentTime.cpp
Product: WebKit Reporter: James Robinson <jamesr>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: fishd, mbelshe
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Patch that excludes wtf/CurrentTime.cpp from the Chromium build fishd: review+, fishd: commit-queue+

Description James Robinson 2009-10-27 13:55:55 PDT
Chromium uses a different method to calculate the current time than is used in JavaScriptCore/wtf/CurrentTime.cpp. This can lead to time skew when calls to currentTime() and Chromium's time function are mixed.  In particular, timers can get scheduled in the past which leads to 100% CPU use. See http://code.google.com/p/chromium/issues/detail?id=25892 for an example.

Chromium provides its own implementation of WTF::currentTime() which it should always use instead.
Comment 1 James Robinson 2009-10-27 14:15:03 PDT
Created attachment 41985 [details]
Patch that excludes wtf/CurrentTime.cpp from the Chromium build

Here's a fix - it adds an exclusion for wtf/CurrentTime.cpp in JavaScriptCore.gyp and adds a #error to ensure that the file isn't accidentally linked into a Chromium build.
Comment 2 Darin Fisher (:fishd, Google) 2009-10-27 14:52:26 PDT
Landed as http://trac.webkit.org/changeset/50173