summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authortedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:45:33 +0000
committertedvessenes@gmail.com <tedvessenes@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-27 00:45:33 +0000
commit02798a98ff76ed7f21c446dfb76e9d46f561d5cf (patch)
tree8446dcbb05cf2630a715fe84e517f477f2f99546 /content/renderer
parent1d7382f2c7d71448dc1c2292ff104b814f1308ec (diff)
downloadchromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.zip
chromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.tar.gz
chromium_src-02798a98ff76ed7f21c446dfb76e9d46f561d5cf.tar.bz2
Convert use of int ms to TimeDelta in files owned by brettw.
BUG=108171 TEST= Review URL: http://codereview.chromium.org/9233018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/load_progress_tracker.cc10
-rw-r--r--content/renderer/render_widget.cc8
2 files changed, 10 insertions, 8 deletions
diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc
index cc153f6..b7a14ba 100644
--- a/content/renderer/load_progress_tracker.cc
+++ b/content/renderer/load_progress_tracker.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -51,9 +51,11 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
// last updates. Also, since the message loop may be pretty busy when a page
// is loaded, it might not execute a posted task in a timely manner so we make
// sure to immediately send progress report if enough time has passed.
+ base::TimeDelta min_delay =
+ base::TimeDelta::FromMilliseconds(kMinimumDelayBetweenUpdatesMS);
if (progress == 1.0 || last_time_progress_sent_.is_null() ||
- (base::TimeTicks::Now() - last_time_progress_sent_).InMilliseconds() >
- kMinimumDelayBetweenUpdatesMS) {
+ base::TimeTicks::Now() - last_time_progress_sent_ >
+ min_delay) {
// If there is a pending task to send progress, it is now obsolete.
weak_factory_.InvalidateWeakPtrs();
SendChangeLoadProgress();
@@ -69,7 +71,7 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
FROM_HERE,
base::Bind(&LoadProgressTracker::SendChangeLoadProgress,
weak_factory_.GetWeakPtr()),
- kMinimumDelayBetweenUpdatesMS);
+ min_delay);
}
void LoadProgressTracker::SendChangeLoadProgress() {
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index e60c793..dfdae16 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -676,13 +676,13 @@ void RenderWidget::AnimateIfNeeded() {
return;
// Target 60FPS if vsync is on. Go as fast as we can if vsync is off.
- int animationInterval = IsRenderingVSynced() ? 16 : 0;
+ base::TimeDelta animationInterval = IsRenderingVSynced() ?
+ base::TimeDelta::FromMilliseconds(16) : base::TimeDelta();
base::Time now = base::Time::Now();
if (now >= animation_floor_time_ || is_accelerated_compositing_active_) {
TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded")
- animation_floor_time_ = now +
- base::TimeDelta::FromMilliseconds(animationInterval);
+ animation_floor_time_ = now + 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.
@@ -705,7 +705,7 @@ void RenderWidget::AnimateIfNeeded() {
// 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.
- int64 delay = (animation_floor_time_ - now).InMillisecondsRoundedUp();
+ base::TimeDelta delay = animation_floor_time_ - now;
animation_task_posted_ = true;
MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), delay);