| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 InputHandlerProxy::~InputHandlerProxy() {} | 256 InputHandlerProxy::~InputHandlerProxy() {} |
| 257 | 257 |
| 258 void InputHandlerProxy::WillShutdown() { | 258 void InputHandlerProxy::WillShutdown() { |
| 259 scroll_elasticity_controller_.reset(); | 259 scroll_elasticity_controller_.reset(); |
| 260 input_handler_ = NULL; | 260 input_handler_ = NULL; |
| 261 client_->WillShutdown(); | 261 client_->WillShutdown(); |
| 262 } | 262 } |
| 263 | 263 |
| 264 void InputHandlerProxy::HandleInputEventWithLatencyInfo( | 264 void InputHandlerProxy::HandleInputEventWithLatencyInfo( |
| 265 ScopedWebInputEvent event, | 265 blink::ScopedCoalescedWebInputEvent coalescedEvent, |
| 266 const LatencyInfo& latency_info, | 266 const LatencyInfo& latency_info, |
| 267 const EventDispositionCallback& callback) { | 267 const EventDispositionCallback& callback) { |
| 268 DCHECK(input_handler_); | 268 DCHECK(input_handler_); |
| 269 | 269 |
| 270 if (uma_latency_reporting_enabled_) | 270 if (uma_latency_reporting_enabled_) |
| 271 ReportInputEventLatencyUma(*event, latency_info); | 271 ReportInputEventLatencyUma(coalescedEvent->event(), latency_info); |
| 272 | 272 |
| 273 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", | 273 TRACE_EVENT_WITH_FLOW1("input,benchmark", "LatencyInfo.Flow", |
| 274 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), | 274 TRACE_ID_DONT_MANGLE(latency_info.trace_id()), |
| 275 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, | 275 TRACE_EVENT_FLAG_FLOW_IN | TRACE_EVENT_FLAG_FLOW_OUT, |
| 276 "step", "HandleInputEventImpl"); | 276 "step", "HandleInputEventImpl"); |
| 277 | 277 |
| 278 ui::LatencyInfo monitored_latency_info = latency_info; | 278 ui::LatencyInfo monitored_latency_info = latency_info; |
| 279 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = | 279 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor = |
| 280 input_handler_->CreateLatencyInfoSwapPromiseMonitor( | 280 input_handler_->CreateLatencyInfoSwapPromiseMonitor( |
| 281 &monitored_latency_info); | 281 &monitored_latency_info); |
| 282 | 282 |
| 283 current_overscroll_params_.reset(); | 283 current_overscroll_params_.reset(); |
| 284 InputHandlerProxy::EventDisposition disposition = HandleInputEvent(*event); | 284 InputHandlerProxy::EventDisposition disposition = |
| 285 HandleInputEvent(coalescedEvent->event()); |
| 285 callback.Run(disposition, std::move(event), monitored_latency_info, | 286 callback.Run(disposition, std::move(event), monitored_latency_info, |
| 286 std::move(current_overscroll_params_)); | 287 std::move(current_overscroll_params_)); |
| 287 } | 288 } |
| 288 | 289 |
| 289 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( | 290 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent( |
| 290 const WebInputEvent& event) { | 291 const WebInputEvent& event) { |
| 291 DCHECK(input_handler_); | 292 DCHECK(input_handler_); |
| 292 | 293 |
| 293 if (FilterInputEventForFlingBoosting(event)) | 294 if (FilterInputEventForFlingBoosting(event)) |
| 294 return DID_HANDLE; | 295 return DID_HANDLE; |
| (...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 // is made asynchronously, to minimize divergence between main thread and | 1417 // is made asynchronously, to minimize divergence between main thread and |
| 1417 // impl thread event handling paths. | 1418 // impl thread event handling paths. |
| 1418 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1419 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1419 FROM_HERE, | 1420 FROM_HERE, |
| 1420 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1421 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1421 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1422 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1422 scroll_result)); | 1423 scroll_result)); |
| 1423 } | 1424 } |
| 1424 | 1425 |
| 1425 } // namespace ui | 1426 } // namespace ui |
| OLD | NEW |