| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 cc::MainThreadScrollingReason::kNotScrollingOnMain, | 420 cc::MainThreadScrollingReason::kNotScrollingOnMain, |
| 421 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); | 421 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 for (uint32_t i = 0; | 425 for (uint32_t i = 0; |
| 426 i < cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount - 1; | 426 i < cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount - 1; |
| 427 ++i) { | 427 ++i) { |
| 428 unsigned val = 1 << i; | 428 unsigned val = 1 << i; |
| 429 if (reasons & val) { | 429 if (reasons & val) { |
| 430 if (val == cc::MainThreadScrollingReason::kAnimatingScrollOnMainThread) { |
| 431 // We only want to record "animating scroll on main thread" reason if |
| 432 // it's the only reason. Bail if that's not the case. |
| 433 if (reasons & ~val) |
| 434 continue; |
| 435 } |
| 430 if (device == blink::WebGestureDeviceTouchscreen) { | 436 if (device == blink::WebGestureDeviceTouchscreen) { |
| 431 UMA_HISTOGRAM_ENUMERATION( | 437 UMA_HISTOGRAM_ENUMERATION( |
| 432 kGestureHistogramName, i + 1, | 438 kGestureHistogramName, i + 1, |
| 433 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); | 439 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); |
| 434 } else { | 440 } else { |
| 435 UMA_HISTOGRAM_ENUMERATION( | 441 UMA_HISTOGRAM_ENUMERATION( |
| 436 kWheelHistogramName, i + 1, | 442 kWheelHistogramName, i + 1, |
| 437 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); | 443 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount); |
| 438 } | 444 } |
| 439 } | 445 } |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 // is made asynchronously, to minimize divergence between main thread and | 1335 // is made asynchronously, to minimize divergence between main thread and |
| 1330 // impl thread event handling paths. | 1336 // impl thread event handling paths. |
| 1331 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1337 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1332 FROM_HERE, | 1338 FROM_HERE, |
| 1333 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1339 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1334 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1340 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1335 scroll_result)); | 1341 scroll_result)); |
| 1336 } | 1342 } |
| 1337 | 1343 |
| 1338 } // namespace ui | 1344 } // namespace ui |
| OLD | NEW |