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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2773593005: Move logic of recording main thread scrolling reasons from cc to blink::ScrollManager (Closed)
Patch Set: fix incorrect test for android devices Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/tests/data/two_scrollable_area.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
550 "Renderer4.MainThreadWheelScrollReason"; 550 "Renderer4.MainThreadWheelScrollReason";
551 551
552 DCHECK(device == blink::kWebGestureDeviceTouchpad || 552 DCHECK(device == blink::kWebGestureDeviceTouchpad ||
553 device == blink::kWebGestureDeviceTouchscreen); 553 device == blink::kWebGestureDeviceTouchscreen);
554 554
555 if (device != blink::kWebGestureDeviceTouchpad && 555 if (device != blink::kWebGestureDeviceTouchpad &&
556 device != blink::kWebGestureDeviceTouchscreen) { 556 device != blink::kWebGestureDeviceTouchscreen) {
557 return; 557 return;
558 } 558 }
559 559
560 // NonCompositedScrollReasons should only be set on the main thread.
561 DCHECK(
562 !cc::MainThreadScrollingReason::HasNonCompositedScrollReasons(reasons));
563
560 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly 564 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly
561 // greater than the sample value. kMainThreadScrollingReasonCount doesn't 565 // greater than the sample value. kMainThreadScrollingReasonCount doesn't
562 // include the NotScrollingOnMain enum but the histograms do so adding 566 // include the NotScrollingOnMain enum but the histograms do so adding
563 // the +1 is necessary. 567 // the +1 is necessary.
564 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. 568 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed.
565 constexpr uint32_t kMainThreadScrollingReasonEnumMax = 569 constexpr uint32_t kMainThreadScrollingReasonEnumMax =
566 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; 570 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1;
567 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { 571 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
568 if (device == blink::kWebGestureDeviceTouchscreen) { 572 if (device == blink::kWebGestureDeviceTouchscreen) {
569 UMA_HISTOGRAM_ENUMERATION( 573 UMA_HISTOGRAM_ENUMERATION(
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1645 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1642 scroll_result)); 1646 scroll_result));
1643 } 1647 }
1644 1648
1645 void InputHandlerProxy::SetTickClockForTesting( 1649 void InputHandlerProxy::SetTickClockForTesting(
1646 std::unique_ptr<base::TickClock> tick_clock) { 1650 std::unique_ptr<base::TickClock> tick_clock) {
1647 tick_clock_ = std::move(tick_clock); 1651 tick_clock_ = std::move(tick_clock);
1648 } 1652 }
1649 1653
1650 } // namespace ui 1654 } // namespace ui
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/data/two_scrollable_area.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698