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

Unified Diff: content/renderer/render_widget.cc

Issue 9215005: Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 | « content/renderer/load_progress_tracker.cc ('k') | dbus/test_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
===================================================================
--- content/renderer/render_widget.cc (revision 117824)
+++ content/renderer/render_widget.cc (working copy)
@@ -677,13 +677,13 @@
return;
// Target 60FPS if vsync is on. Go as fast as we can if vsync is off.
- base::TimeDelta animationInterval = IsRenderingVSynced() ?
- base::TimeDelta::FromMilliseconds(16) : base::TimeDelta();
+ int animationInterval = IsRenderingVSynced() ? 16 : 0;
base::Time now = base::Time::Now();
if (now >= animation_floor_time_ || is_accelerated_compositing_active_) {
TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded")
- animation_floor_time_ = now + animationInterval;
+ animation_floor_time_ = now +
+ base::TimeDelta::FromMilliseconds(animationInterval);
// Set a timer to call us back after animationInterval before
// running animation callbacks so that if a callback requests another
// we'll be sure to run it at the proper time.
@@ -706,7 +706,7 @@
// base::Time::Now() has advanced past the animation_floor_time_. To
// avoid exposing this delay to javascript, we keep posting delayed
// tasks until base::Time::Now() has advanced far enough.
- base::TimeDelta delay = animation_floor_time_ - now;
+ int64 delay = (animation_floor_time_ - now).InMillisecondsRoundedUp();
animation_task_posted_ = true;
MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), delay);
« no previous file with comments | « content/renderer/load_progress_tracker.cc ('k') | dbus/test_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698