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

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

Issue 1955643002: Add UMA metric to track the time saved on making events passive during fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 4 years, 7 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 if (processed == WebInputEventResult::NotHandled && widget_->webwidget()) 322 if (processed == WebInputEventResult::NotHandled && widget_->webwidget())
323 processed = widget_->webwidget()->handleInputEvent(input_event); 323 processed = widget_->webwidget()->handleInputEvent(input_event);
324 } 324 }
325 325
326 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start 326 // TODO(dtapuska): Use the input_event.timeStampSeconds as the start
327 // ideally this should be when the event was sent by the compositor to the 327 // ideally this should be when the event was sent by the compositor to the
328 // renderer. crbug.com/565348 328 // renderer. crbug.com/565348
329 if (input_event.type == WebInputEvent::TouchStart || 329 if (input_event.type == WebInputEvent::TouchStart ||
330 input_event.type == WebInputEvent::TouchMove || 330 input_event.type == WebInputEvent::TouchMove ||
331 input_event.type == WebInputEvent::TouchEnd) { 331 input_event.type == WebInputEvent::TouchEnd) {
332 LogPassiveEventListenersUma( 332 WebTouchEvent touch = static_cast<const WebTouchEvent&>(input_event);
tdresser 2016/05/13 13:32:59 Make this a const ref.
lanwei 2016/05/17 22:51:37 Done.
333 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType, 333
334 input_event.timeStampSeconds, latency_info); 334 LogPassiveEventListenersUma(processed, touch.dispatchType,
335 input_event.timeStampSeconds, latency_info);
336
337 if (input_event.type == WebInputEvent::TouchStart &&
338 touch.dispatchType == WebInputEvent::Blocking &&
339 base::TimeTicks::IsHighResolution()) {
340 base::TimeTicks now = base::TimeTicks::Now();
341 if (touch.dispatchedDuringFling) {
342 UMA_HISTOGRAM_CUSTOM_COUNTS(
343 "Event.Touch.TouchStartDuringFlingLatency",
344 GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
345 10000000, 100);
Ilya Sherman 2016/05/17 01:27:29 Would 50 buckets suffice here?
lanwei 2016/05/17 22:51:37 Yes.
346 } else {
347 UMA_HISTOGRAM_CUSTOM_COUNTS(
348 "Event.Touch.TouchStartOutsideFlingLatency",
349 GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
350 10000000, 100);
Ilya Sherman 2016/05/17 01:27:29 Ditto
351 }
352 }
335 } else if (input_event.type == WebInputEvent::MouseWheel) { 353 } else if (input_event.type == WebInputEvent::MouseWheel) {
336 LogPassiveEventListenersUma( 354 LogPassiveEventListenersUma(
337 processed, 355 processed,
338 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType, 356 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType,
339 input_event.timeStampSeconds, latency_info); 357 input_event.timeStampSeconds, latency_info);
340 } 358 }
341 359
342 // If this RawKeyDown event corresponds to a browser keyboard shortcut and 360 // If this RawKeyDown event corresponds to a browser keyboard shortcut and
343 // it's not processed by webkit, then we need to suppress the upcoming Char 361 // it's not processed by webkit, then we need to suppress the upcoming Char
344 // events. 362 // events.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 if (pending_input_event_ack_) { 565 if (pending_input_event_ack_) {
548 TRACE_EVENT_ASYNC_END0("input", 566 TRACE_EVENT_ASYNC_END0("input",
549 "RenderWidgetInputHandler::ThrottledInputEventAck", 567 "RenderWidgetInputHandler::ThrottledInputEventAck",
550 pending_input_event_ack_.get()); 568 pending_input_event_ack_.get());
551 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); 569 delegate_->OnInputEventAck(std::move(pending_input_event_ack_));
552 } 570 }
553 total_input_handling_time_this_frame_ = base::TimeDelta(); 571 total_input_handling_time_this_frame_ = base::TimeDelta();
554 } 572 }
555 573
556 } // namespace content 574 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_widget_unittest.cc » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698