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

Side by Side Diff: content/renderer/input/render_widget_input_handler.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/renderer/input/render_widget_input_handler.h" 5 #include "content/renderer/input/render_widget_input_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 break; 113 break;
114 } 114 }
115 115
116 #undef CASE_TYPE 116 #undef CASE_TYPE
117 } 117 }
118 118
119 void LogPassiveEventListenersUma(WebInputEventResult result, 119 void LogPassiveEventListenersUma(WebInputEventResult result,
120 WebInputEvent::DispatchType dispatch_type, 120 WebInputEvent::DispatchType dispatch_type,
121 double event_timestamp, 121 double event_timestamp,
122 const ui::LatencyInfo& latency_info) { 122 const ui::LatencyInfo& latency_info) {
123 enum { 123 enum ListenerEnum {
124 PASSIVE_LISTENER_UMA_ENUM_PASSIVE, 124 PASSIVE_LISTENER_UMA_ENUM_PASSIVE,
125 PASSIVE_LISTENER_UMA_ENUM_UNCANCELABLE, 125 PASSIVE_LISTENER_UMA_ENUM_UNCANCELABLE,
126 PASSIVE_LISTENER_UMA_ENUM_SUPPRESSED, 126 PASSIVE_LISTENER_UMA_ENUM_SUPPRESSED,
127 PASSIVE_LISTENER_UMA_ENUM_CANCELABLE, 127 PASSIVE_LISTENER_UMA_ENUM_CANCELABLE,
128 PASSIVE_LISTENER_UMA_ENUM_CANCELABLE_AND_CANCELED, 128 PASSIVE_LISTENER_UMA_ENUM_CANCELABLE_AND_CANCELED,
129 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING, 129 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING,
130 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_MAIN_THREAD_RESPONSIVEN ESS, 130 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_MAIN_THREAD_RESPONSIVEN ESS,
131 PASSIVE_LISTENER_UMA_ENUM_COUNT 131 PASSIVE_LISTENER_UMA_ENUM_COUNT
132 }; 132 };
133 133
134 int enum_value; 134 ListenerEnum enum_value;
135 switch (dispatch_type) { 135 switch (dispatch_type) {
136 case WebInputEvent::kListenersForcedNonBlockingDueToFling: 136 case WebInputEvent::kListenersForcedNonBlockingDueToFling:
137 enum_value = PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING; 137 enum_value = PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_FLING;
138 break; 138 break;
139 case WebInputEvent:: 139 case WebInputEvent::
140 kListenersForcedNonBlockingDueToMainThreadResponsiveness: 140 kListenersForcedNonBlockingDueToMainThreadResponsiveness:
141 enum_value = 141 enum_value =
142 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_MAIN_THREAD_RESPO NSIVENESS; 142 PASSIVE_LISTENER_UMA_ENUM_FORCED_NON_BLOCKING_DUE_TO_MAIN_THREAD_RESPO NSIVENESS;
143 break; 143 break;
144 case WebInputEvent::kListenersNonBlockingPassive: 144 case WebInputEvent::kListenersNonBlockingPassive:
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 // it can be bundled in the event ack. 436 // it can be bundled in the event ack.
437 if (handling_event_overscroll_) { 437 if (handling_event_overscroll_) {
438 *handling_event_overscroll_ = std::move(params); 438 *handling_event_overscroll_ = std::move(params);
439 return; 439 return;
440 } 440 }
441 441
442 delegate_->OnDidOverscroll(*params); 442 delegate_->OnDidOverscroll(*params);
443 } 443 }
444 444
445 } // namespace content 445 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | ios/chrome/browser/physical_web/physical_web_initial_state_recorder.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698