Chromium Code Reviews| Index: chrome/renderer/render_widget.cc |
| diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc |
| index 96f33c912435d9478d6f0b9b1b7b5e37adce4ff1..7342c2d05c299576acfbe430b12021a5395cf248 100644 |
| --- a/chrome/renderer/render_widget.cc |
| +++ b/chrome/renderer/render_widget.cc |
| @@ -483,8 +483,21 @@ void RenderWidget::PaintDebugBorder(const gfx::Rect& rect, |
| void RenderWidget::AnimationCallback() { |
| animation_task_posted_ = false; |
| - UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AnimationDelayTime", 0, 0, 16, 17); |
| - CallDoDeferredUpdate(); |
| + if (animation_update_pending_) { |
|
jar (doing other things)
2011/02/18 07:31:29
nit: Suggest an early return, rather than indentin
|
| + if (!animation_floor_time_.is_null()) { |
| + // Record when we fired (according to base::Time::Now()) relative to when |
| + // we posted the task to quantify how much the base::Time/base::TimeTicks |
| + // skew is affecting animations. |
| + base::TimeDelta animation_callback_delay = base::Time::Now() - |
| + (animation_floor_time_ - base::TimeDelta::FromMilliseconds(16)); |
| + UMA_HISTOGRAM_CUSTOM_TIMES("Renderer4.AnimationCallbackDelayTime", |
| + animation_callback_delay, |
| + base::TimeDelta::FromMilliseconds(0), |
| + base::TimeDelta::FromMilliseconds(30), |
| + 25); |
| + } |
| + CallDoDeferredUpdate(); |
| + } |
| } |
| void RenderWidget::AnimateIfNeeded() { |
| @@ -510,11 +523,9 @@ void RenderWidget::AnimateIfNeeded() { |
| // 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(); |
|
jar (doing other things)
2011/02/18 07:31:29
Comment: It is interesting that delay could be as
|
| - UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.AnimationDelayTime", |
| - static_cast<int>(delay), 0, 16, 17); |
| animation_task_posted_ = true; |
| - MessageLoop::current()->PostDelayedTask(FROM_HERE, NewRunnableMethod( |
| - this, &RenderWidget::AnimationCallback), delay); |
| + MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| + NewRunnableMethod(this, &RenderWidget::AnimationCallback), delay); |
| } |
| } |
| } |