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

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

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: Add comments 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 | « media/blink/resource_multibuffer_data_provider.cc ('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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 if (device != blink::WebGestureDeviceTouchpad && 550 if (device != blink::WebGestureDeviceTouchpad &&
551 device != blink::WebGestureDeviceTouchscreen) { 551 device != blink::WebGestureDeviceTouchscreen) {
552 return; 552 return;
553 } 553 }
554 554
555 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly 555 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly
556 // greater than the sample value. kMainThreadScrollingReasonCount doesn't 556 // greater than the sample value. kMainThreadScrollingReasonCount doesn't
557 // include the NotScrollingOnMain enum but the histograms do so adding 557 // include the NotScrollingOnMain enum but the histograms do so adding
558 // the +1 is necessary. 558 // the +1 is necessary.
559 uint32_t mainThreadScrollingReasonEnumMax = 559 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed.
560 constexpr uint32_t mainThreadScrollingReasonEnumMax =
sky 2017/03/30 03:22:11 kMainThread (or main_thread_sco...)
560 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; 561 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1;
561 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { 562 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
562 if (device == blink::WebGestureDeviceTouchscreen) { 563 if (device == blink::WebGestureDeviceTouchscreen) {
563 UMA_HISTOGRAM_ENUMERATION( 564 UMA_HISTOGRAM_ENUMERATION(
564 kGestureHistogramName, 565 kGestureHistogramName,
565 cc::MainThreadScrollingReason::kNotScrollingOnMain, 566 cc::MainThreadScrollingReason::kNotScrollingOnMain,
566 mainThreadScrollingReasonEnumMax); 567 mainThreadScrollingReasonEnumMax);
567 } else { 568 } else {
568 UMA_HISTOGRAM_ENUMERATION( 569 UMA_HISTOGRAM_ENUMERATION(
569 kWheelHistogramName, 570 kWheelHistogramName,
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1617 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1617 scroll_result)); 1618 scroll_result));
1618 } 1619 }
1619 1620
1620 void InputHandlerProxy::SetTickClockForTesting( 1621 void InputHandlerProxy::SetTickClockForTesting(
1621 std::unique_ptr<base::TickClock> tick_clock) { 1622 std::unique_ptr<base::TickClock> tick_clock) {
1622 tick_clock_ = std::move(tick_clock); 1623 tick_clock_ = std::move(tick_clock);
1623 } 1624 }
1624 1625
1625 } // namespace ui 1626 } // namespace ui
OLDNEW
« no previous file with comments | « media/blink/resource_multibuffer_data_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698