Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 scroll_elasticity_controller_.reset(); | 288 scroll_elasticity_controller_.reset(); |
| 289 input_handler_ = NULL; | 289 input_handler_ = NULL; |
| 290 client_->WillShutdown(); | 290 client_->WillShutdown(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void InputHandlerProxy::HandleInputEventWithLatencyInfo( | 293 void InputHandlerProxy::HandleInputEventWithLatencyInfo( |
| 294 WebScopedInputEvent event, | 294 WebScopedInputEvent event, |
| 295 const LatencyInfo& latency_info, | 295 const LatencyInfo& latency_info, |
| 296 const EventDispositionCallback& callback) { | 296 const EventDispositionCallback& callback) { |
| 297 DCHECK(input_handler_); | 297 DCHECK(input_handler_); |
| 298 TRACE_EVENT0("input", "InputHandlerProxy::HandleInputEventWithLatencyInfo"); | |
| 298 | 299 |
| 299 if (uma_latency_reporting_enabled_) | 300 if (uma_latency_reporting_enabled_) |
| 300 ReportInputEventLatencyUma(*event, latency_info); | 301 ReportInputEventLatencyUma(*event, latency_info); |
| 301 | 302 |
| 302 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", | 303 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", |
| 303 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), | 304 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), |
| 304 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 305 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
| 305 "step", "HandleInputEventImpl"); | 306 "step", "HandleInputEventImpl"); |
| 306 | 307 |
| 307 std::unique_ptr<EventWithCallback> event_with_callback = | 308 std::unique_ptr<EventWithCallback> event_with_callback = |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 328 | 329 |
| 329 // We have to dispatch the event to know whether the gesture sequence will be | 330 // We have to dispatch the event to know whether the gesture sequence will be |
| 330 // handled by the compositor or not. | 331 // handled by the compositor or not. |
| 331 DispatchSingleInputEvent(std::move(event_with_callback), | 332 DispatchSingleInputEvent(std::move(event_with_callback), |
| 332 tick_clock_->NowTicks()); | 333 tick_clock_->NowTicks()); |
| 333 } | 334 } |
| 334 | 335 |
| 335 void InputHandlerProxy::DispatchSingleInputEvent( | 336 void InputHandlerProxy::DispatchSingleInputEvent( |
| 336 std::unique_ptr<EventWithCallback> event_with_callback, | 337 std::unique_ptr<EventWithCallback> event_with_callback, |
| 337 const base::TimeTicks now) { | 338 const base::TimeTicks now) { |
| 339 TRACE_EVENT0("input", "InputHandlerProxy::DispatchSingleInputEvent"); | |
| 338 if (compositor_event_queue_ && | 340 if (compositor_event_queue_ && |
| 339 IsGestureScollOrPinch(event_with_callback->event().type())) { | 341 IsGestureScollOrPinch(event_with_callback->event().type())) { |
| 340 // Report the coalesced count only for continuous events to avoid the noise | 342 // Report the coalesced count only for continuous events to avoid the noise |
| 341 // from non-continuous events. | 343 // from non-continuous events. |
| 342 if (IsContinuousGestureEvent(event_with_callback->event().type())) { | 344 if (IsContinuousGestureEvent(event_with_callback->event().type())) { |
| 345 TRACE_EVENT_INSTANT2( | |
| 346 "input", "InputHandlerProxy::CoalescedContinusGestureEvent", | |
|
tdresser
2017/02/14 16:31:54
Continuous
| |
| 347 TRACE_EVENT_SCOPE_THREAD, "type", event_with_callback->event().type(), | |
| 348 "coalesced_count", event_with_callback->coalesced_count()); | |
| 349 | |
| 343 UMA_HISTOGRAM_CUSTOM_COUNTS( | 350 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 344 "Event.CompositorThreadEventQueue.Continuous.HeadQueueingTime", | 351 "Event.CompositorThreadEventQueue.Continuous.HeadQueueingTime", |
| 345 (now - event_with_callback->creation_timestamp()).InMicroseconds(), 1, | 352 (now - event_with_callback->creation_timestamp()).InMicroseconds(), 1, |
| 346 kTenSeconds, 50); | 353 kTenSeconds, 50); |
| 347 | 354 |
| 348 UMA_HISTOGRAM_CUSTOM_COUNTS( | 355 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 349 "Event.CompositorThreadEventQueue.Continuous.TailQueueingTime", | 356 "Event.CompositorThreadEventQueue.Continuous.TailQueueingTime", |
| 350 (now - event_with_callback->last_coalesced_timestamp()) | 357 (now - event_with_callback->last_coalesced_timestamp()) |
| 351 .InMicroseconds(), | 358 .InMicroseconds(), |
| 352 1, kTenSeconds, 50); | 359 1, kTenSeconds, 50); |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1614 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1621 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1615 scroll_result)); | 1622 scroll_result)); |
| 1616 } | 1623 } |
| 1617 | 1624 |
| 1618 void InputHandlerProxy::SetTickClockForTesting( | 1625 void InputHandlerProxy::SetTickClockForTesting( |
| 1619 std::unique_ptr<base::TickClock> tick_clock) { | 1626 std::unique_ptr<base::TickClock> tick_clock) { |
| 1620 tick_clock_ = std::move(tick_clock); | 1627 tick_clock_ = std::move(tick_clock); |
| 1621 } | 1628 } |
| 1622 | 1629 |
| 1623 } // namespace ui | 1630 } // namespace ui |
| OLD | NEW |