From 26f34dd42f1af46a4c68e9082290c359706685db Mon Sep 17 00:00:00 2001 From: "jshin@chromium.org" Date: Fri, 25 Sep 2009 01:13:20 +0000 Subject: Roll back Markus's CL ( http://codereview.chromium.org/196053) BUG=none TEST=UI test and valgrind test pass TBR=markus Review URL: http://codereview.chromium.org/222031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27160 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webkitclient_impl.cc | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'webkit/glue/webkitclient_impl.cc') diff --git a/webkit/glue/webkitclient_impl.cc b/webkit/glue/webkitclient_impl.cc index 79ddffd6..4315db7 100644 --- a/webkit/glue/webkitclient_impl.cc +++ b/webkit/glue/webkitclient_impl.cc @@ -2,7 +2,6 @@ // source code is governed by a BSD-style license that can be found in the // LICENSE file. -#include #include "config.h" #include "FrameView.h" @@ -266,23 +265,12 @@ void WebKitClientImpl::setSharedTimerFiredFunction(void (*func)()) { } void WebKitClientImpl::setSharedTimerFireTime(double fire_time) { - // By converting between double and int64 representation, we run the risk - // of losing precision due to rounding errors. Performing computations in - // microseconds reduces this risk somewhat. But there still is the potential - // of us computing a fire time for the timer that is shorter than what we - // need. - // As the event loop will check event deadlines prior to actually firing - // them, there is a risk of needlessly rescheduling events and of - // needlessly looping if sleep times are too short even by small amounts. - // This results in measurable performance degradation unless we use ceil() to - // always round up the sleep times. - int64 interval = static_cast( - ceil((fire_time - currentTime()) * base::Time::kMicrosecondsPerSecond)); + int interval = static_cast((fire_time - currentTime()) * 1000); if (interval < 0) interval = 0; shared_timer_.Stop(); - shared_timer_.Start(base::TimeDelta::FromMicroseconds(interval), this, + shared_timer_.Start(base::TimeDelta::FromMilliseconds(interval), this, &WebKitClientImpl::DoTimeout); } -- cgit v1.1