Chromium Code Reviews| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 "Renderer4.MainThreadWheelScrollReason"; | 550 "Renderer4.MainThreadWheelScrollReason"; |
| 551 | 551 |
| 552 DCHECK(device == blink::WebGestureDeviceTouchpad || | 552 DCHECK(device == blink::WebGestureDeviceTouchpad || |
| 553 device == blink::WebGestureDeviceTouchscreen); | 553 device == blink::WebGestureDeviceTouchscreen); |
| 554 | 554 |
| 555 if (device != blink::WebGestureDeviceTouchpad && | 555 if (device != blink::WebGestureDeviceTouchpad && |
| 556 device != blink::WebGestureDeviceTouchscreen) { | 556 device != blink::WebGestureDeviceTouchscreen) { |
| 557 return; | 557 return; |
| 558 } | 558 } |
| 559 | 559 |
| 560 // NonCompositedScrollReasons should only be set on the main thread. | |
| 561 DCHECK(!cc::MainThreadScrollingReason::NonCompositedScrollReasons(reasons)); | |
|
bokan
2017/04/07 17:39:03
I think this check isn't what you want. The functi
yigu
2017/04/07 19:26:27
Done.
| |
| 562 | |
| 560 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly | 563 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly |
| 561 // greater than the sample value. kMainThreadScrollingReasonCount doesn't | 564 // greater than the sample value. kMainThreadScrollingReasonCount doesn't |
| 562 // include the NotScrollingOnMain enum but the histograms do so adding | 565 // include the NotScrollingOnMain enum but the histograms do so adding |
| 563 // the +1 is necessary. | 566 // the +1 is necessary. |
| 564 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. | 567 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. |
| 565 constexpr uint32_t kMainThreadScrollingReasonEnumMax = | 568 constexpr uint32_t kMainThreadScrollingReasonEnumMax = |
| 566 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; | 569 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; |
| 567 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { | 570 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { |
| 568 if (device == blink::WebGestureDeviceTouchscreen) { | 571 if (device == blink::WebGestureDeviceTouchscreen) { |
| 569 UMA_HISTOGRAM_ENUMERATION( | 572 UMA_HISTOGRAM_ENUMERATION( |
| (...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1645 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1643 scroll_result)); | 1646 scroll_result)); |
| 1644 } | 1647 } |
| 1645 | 1648 |
| 1646 void InputHandlerProxy::SetTickClockForTesting( | 1649 void InputHandlerProxy::SetTickClockForTesting( |
| 1647 std::unique_ptr<base::TickClock> tick_clock) { | 1650 std::unique_ptr<base::TickClock> tick_clock) { |
| 1648 tick_clock_ = std::move(tick_clock); | 1651 tick_clock_ = std::move(tick_clock); |
| 1649 } | 1652 } |
| 1650 | 1653 |
| 1651 } // namespace ui | 1654 } // namespace ui |
| OLD | NEW |