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

Unified Diff: chrome/renderer/render_widget.cc

Issue 6547001: Update the animation callback histogram to measure only the delay between post and invocation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698