summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webkitclient_impl.cc
diff options
context:
space:
mode:
authorjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 01:13:20 +0000
committerjshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 01:13:20 +0000
commit26f34dd42f1af46a4c68e9082290c359706685db (patch)
tree63891e5d7594b26a0b5b599618b560e154633e18 /webkit/glue/webkitclient_impl.cc
parenteb6d7019c477673c57f1fbde224d5b8ae8919019 (diff)
downloadchromium_src-26f34dd42f1af46a4c68e9082290c359706685db.zip
chromium_src-26f34dd42f1af46a4c68e9082290c359706685db.tar.gz
chromium_src-26f34dd42f1af46a4c68e9082290c359706685db.tar.bz2
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
Diffstat (limited to 'webkit/glue/webkitclient_impl.cc')
-rw-r--r--webkit/glue/webkitclient_impl.cc16
1 files changed, 2 insertions, 14 deletions
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 <math.h>
#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<int64>(
- ceil((fire_time - currentTime()) * base::Time::kMicrosecondsPerSecond));
+ int interval = static_cast<int>((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);
}