Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 input_event.type == WebInputEvent::TouchStart && | |
| 338 static_cast<const WebTouchEvent&>(input_event).dispatchType == | |
| 339 WebInputEvent::Blocking) { | |
| 340 base::TimeTicks now = base::TimeTicks::Now(); | |
| 341 if (static_cast<const WebTouchEvent&>(input_event) | |
|
tdresser
2016/05/12 12:11:32
Let's only perform the cast once, as soon as we kn
| |
| 342 .dispatchedDuringFling) { | |
| 343 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
| 344 "Event.Touch.TouchStartDuringFlingLatency", | |
| 345 GetEventLatencyMicros(input_event.timeStampSeconds, now), 1, | |
| 346 10000000, 100); | |
| 347 } else { | |
| 348 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
| 349 "Event.Touch.TouchStartNoFlingLatency", | |
|
tdresser
2016/05/12 12:11:32
TouchStartNoFlingLatency -> TouchStartOutsideFling
| |
| 350 GetEventLatencyMicros(input_event.timeStampSeconds, now), 1, | |
| 351 10000000, 100); | |
| 352 } | |
| 353 } | |
| 335 } else if (input_event.type == WebInputEvent::MouseWheel) { | 354 } else if (input_event.type == WebInputEvent::MouseWheel) { |
| 336 LogPassiveEventListenersUma( | 355 LogPassiveEventListenersUma( |
| 337 processed, | 356 processed, |
| 338 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType, | 357 static_cast<const WebMouseWheelEvent&>(input_event).dispatchType, |
| 339 input_event.timeStampSeconds, latency_info); | 358 input_event.timeStampSeconds, latency_info); |
| 340 } | 359 } |
| 341 | 360 |
| 342 // If this RawKeyDown event corresponds to a browser keyboard shortcut and | 361 // 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 | 362 // it's not processed by webkit, then we need to suppress the upcoming Char |
| 344 // events. | 363 // events. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 if (pending_input_event_ack_) { | 566 if (pending_input_event_ack_) { |
| 548 TRACE_EVENT_ASYNC_END0("input", | 567 TRACE_EVENT_ASYNC_END0("input", |
| 549 "RenderWidgetInputHandler::ThrottledInputEventAck", | 568 "RenderWidgetInputHandler::ThrottledInputEventAck", |
| 550 pending_input_event_ack_.get()); | 569 pending_input_event_ack_.get()); |
| 551 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); | 570 delegate_->OnInputEventAck(std::move(pending_input_event_ack_)); |
| 552 } | 571 } |
| 553 total_input_handling_time_this_frame_ = base::TimeDelta(); | 572 total_input_handling_time_this_frame_ = base::TimeDelta(); |
| 554 } | 573 } |
| 555 | 574 |
| 556 } // namespace content | 575 } // namespace content |
| OLD | NEW |