0

Fix recording of kAnimatingScrollOnMain

We only want to record this reason if it's the only scroll reason (as it
obscures others).

BUG=None

Review-Url: https://codereview.chromium.org/2289593006
Cr-Commit-Position: refs/heads/master@{#415382}
This commit is contained in:
vollick
2016-08-30 12:02:30 -07:00
committed by Commit bot
parent 1ba33d9e4e
commit e23a88c56d
2 changed files with 22 additions and 0 deletions

@ -427,6 +427,14 @@ void InputHandlerProxy::RecordMainThreadScrollingReasons(
++i) {
unsigned val = 1 << i;
if (reasons & val) {
if (val == cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread) {
// We only want to record "animating scroll on main thread" reason if
// it's the only reason. If it's not the only reason, the "real" reason
// for scrolling on main is something else, and we only want to pay
// attention to that reason.
if (reasons & ~val)
continue;
}
if (device == blink::WebGestureDeviceTouchscreen) {
UMA_HISTOGRAM_ENUMERATION(
kGestureHistogramName, i + 1,

@ -2782,6 +2782,20 @@ TEST_P(InputHandlerProxyTest, MainThreadScrollingMouseWheelHistograms) {
cc::MainThreadScrollingReason::kPageOverlay |
cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
EXPECT_THAT(
histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),
base::Bucket(5, 1)));
// We only want to record "animating scroll on main thread" reason if it's the
// only reason. If it's not the only reason, the "real" reason for scrolling
// on main is something else, and we only want to pay attention to that
// reason. So we should only include this reason in the histogram when its on
// its own.
input_handler_->RecordMainThreadScrollingReasonsForTest(
blink::WebGestureDeviceTouchpad,
cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread);
EXPECT_THAT(
histogram_tester().GetAllSamples("Renderer4.MainThreadWheelScrollReason"),
testing::ElementsAre(base::Bucket(1, 1), base::Bucket(3, 1),