Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: webkit/glue/webkitclient_impl.cc

Issue 222031: Roll back Markus's CL ( http://codereview.chromium.org/196053)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socket_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webkitclient_impl.cc
===================================================================
--- webkit/glue/webkitclient_impl.cc (revision 27159)
+++ webkit/glue/webkitclient_impl.cc (working copy)
@@ -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::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);
}
« no previous file with comments | « net/socket/socket_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698