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

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: 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 LogPassiveEventListenersUma(
333 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType, 333 processed, static_cast<const WebTouchEvent&>(input_event).dispatchType,
334 input_event.timeStampSeconds, latency_info); 334 input_event.timeStampSeconds, latency_info);
335
336 if (base::TimeTicks::IsHighResolution()) {
337 if (input_event.type == WebInputEvent::TouchStart &&
338 static_cast<const WebTouchEvent&>(input_event).dispatchType ==
339 WebInputEvent::Blocking &&
340 static_cast<const WebTouchEvent&>(input_event).shouldForceBePassive) {
341 base::TimeTicks now = base::TimeTicks::Now();
342 UMA_HISTOGRAM_CUSTOM_COUNTS(
343 "Event.Touch.ExperiencedForcedPassiveLatency",
tdresser 2016/05/06 18:49:19 We'll want to record during fling and outside of f
lanwei 2016/05/12 11:52:06 Done.
344 GetEventLatencyMicros(input_event.timeStampSeconds, now), 1,
345 10000000, 100);
346 }
347 }
335 } else if (input_event.type == WebInputEvent::MouseWheel) { 348 } else if (input_event.type == WebInputEvent::MouseWheel) {
336 LogPassiveEventListenersUma( 349 LogPassiveEventListenersUma(
337 processed, 350 processed,
338 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType, 351 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType,
339 input_event.timeStampSeconds, latency_info); 352 input_event.timeStampSeconds, latency_info);
340 } 353 }
341 354
342 // If this RawKeyDown event corresponds to a browser keyboard shortcut and 355 // 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 356 // it's not processed by webkit, then we need to suppress the upcoming Char
344 // events. 357 // events.
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 if (pending_input_event_ack_) { 560 if (pending_input_event_ack_) {
548 TRACE_EVENT_ASYNC_END0("input", 561 TRACE_EVENT_ASYNC_END0("input",
549 "RenderWidgetInputHandler::ThrottledInputEventAck", 562 "RenderWidgetInputHandler::ThrottledInputEventAck",
550 pending_input_event_ack_.get()); 563 pending_input_event_ack_.get());
551 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); 564 delegate_->OnInputEventAck(std::move(pending_input_event_ack_));
552 } 565 }
553 total_input_handling_time_this_frame_ = base::TimeDelta(); 566 total_input_handling_time_this_frame_ = base::TimeDelta();
554 } 567 }
555 568
556 } // namespace content 569 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698